Skip to content

Geval redundancy

GEval Redundancy Metric.

This metric is used to evaluate the redundancy of the generated output using GEval.

GEvalRedundancyMetric(*args, threshold=0.5, **kwargs)

Bases: DeepEvalGEvalMetric

GEval Redundancy Metric.

This metric is used to evaluate the redundancy of the generated output.

Available Fields
  • query (str): The query to evaluate the redundancy of the model's output.
  • generated_response (str): The generated response to evaluate the redundancy of the model's output.
Scoring
  • [0, 1] (Continuous): Normalized score range. Stored native 1-3 rubric value in rubric_score field. Lower score is better (higher_is_better=False).
Cookbook Example

Please refer to example_geval_redundancy.py in the gen-ai-sdk-cookbook repository.

Initializes GEvalRedundancyMetric.

Parameters:

Name Type Description Default
*args

Positional arguments passed to :class:DeepEvalGEvalMetric.

()
threshold float

The threshold to use for the metric. Defaults to 0.5.

0.5
**kwargs

Keyword arguments passed to :class:DeepEvalGEvalMetric. name (str | None, optional): The name of the metric. Defaults to None. Required if not provided via _defaults. evaluation_params (list[LLMTestCaseParams] | None, optional): The evaluation parameters. Defaults to None. Required if not provided via _defaults. model (str | ModelId | BaseLMInvoker, optional): The model to use for the metric. Defaults to DefaultValues.MODEL. criteria (str | None, optional): The criteria to use for the metric. Defaults to None. evaluation_steps (list[str] | None, optional): The evaluation steps to use for the metric. Defaults to None. rubric (list[Rubric] | None, optional): The rubric to use for the metric. Defaults to None. model_credentials (str | None, optional): The model credentials to use for the metric. Defaults to None. Required when model is a string. model_config (dict[str, Any] | None, optional): The model config to use for the metric. Defaults to None. additional_context (str | None, optional): Additional context like few-shot examples. Defaults to None. batch_status_check_interval (float, optional): Time between batch status checks in seconds. Defaults to 30.0. batch_max_iterations (int, optional): Maximum number of status check iterations before timeout. Defaults to 120. strict_mode (bool, optional): If True, binarizes score to 1.0 or 0.0. Defaults to False.

{}