πŸ“„ Answer RelevanceΒΆ

metrics.llm_as_judge.direct.criteria.answer_relevance

CriteriaWithOptions(
    name="answer_relevance",
    description="Does the response directly answer the question?",
    prediction_field="response",
    context_fields=[
        "question",
    ],
    options=[
        CriteriaOption(
            name="Excellent",
            description="The response directly answers the question.",
        ),
        CriteriaOption(
            name="Acceptable",
            description="The response is adequate but could be better.",
        ),
        CriteriaOption(
            name="Could be Improved",
            description="The response relates to the question but does not directly answer it.",
        ),
        CriteriaOption(
            name="Bad",
            description="The response does not answer the question at all.",
        ),
    ],
    option_map={
        "Excellent": 1.0,
        "Acceptable": 0.75,
        "Could be Improved": 0.5,
        "Bad": 0.0,
    },
)
[source]

from unitxt.llm_as_judge_constants import CriteriaOption

Explanation about CriteriaWithOptionsΒΆ

Criteria used by DirectLLMJudge to run evaluations.

Explanation about CriteriaOptionΒΆ

A criteria option.

Read more about catalog usage here.