Class FaithfulnessMetric
java.lang.Object
com.google.genkit.plugins.evaluators.metrics.FaithfulnessMetric
Faithfulness metric evaluator.
Measures the factual consistency of the generated answer against the given context. Uses a two-step process: 1. Extract statements from the answer 2. Check each statement against the context using NLI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(EvalDataPoint dataPoint) Evaluates faithfulness of the output against the context.
-
Constructor Details
-
FaithfulnessMetric
-
-
Method Details
-
evaluate
Evaluates faithfulness of the output against the context.- Parameters:
dataPoint- the evaluation data point- Returns:
- the evaluation response
- Throws:
Exception- if evaluation fails
-