Preset Evals
Grounded Evals
❊ Info
Grounded evaluators are designed to assess the relevance of a response or context based on specific similarity algorithm.
How does it work
Grounded evaluators compare a given response to a reference or context, using various similarity measures to determine the degree of relevance or similarity.
Required Args
Your dataset must contain these fields:
response
: The LLM generated response.expected_response
: The reference content to compare the response against in case of AnswerSimilarity.context
: The reference content to compare the response against in case of ContextSimilarity.
Metrics
SimilarityScore
: A numeric value representing the degree of similarity or relevance.
▷ Run the AnswerSimilarity evaluator on a single datapoint
▷ Run the function eval on a dataset
- Load your data with the
Loader
- Run the evaluator on your dataset
Following are examples of the various Grounded evaluators we support
AnswerSimilarity
Description: Evaluates the similarity between the generated response and a given expected response.
Arguments:
comparator
:Comparator
The similarity measurement function (e.g., CosineSimilarity).failure_threshold
:float
The threshold value for determining pass/fail.
Sample Code:
ContextSimilarity
Description: Evaluates the similarity between the generated response and the context.
Arguments:
comparator
:Comparator
The similarity measurement function (e.g., CosineSimilarity).failure_threshold
:float
The threshold value for determining pass/fail.
Sample Code: