πŸ“„ Judge With Question Simplified VerbalΒΆ

templates.rag_eval.faithfulness.judge_with_question_simplified_verbal

InputOutputTemplateWithCustomTarget(
    input_format="Question: {question}

Evidence: {contexts}

Prediction: {answer}
",
    output_format="{is_faithful}",
    postprocessors=[
        "processors.take_first_word",
        "processors.lower_case",
        "processors.extract_verbal_judgement",
    ],
    reference="{number_val}",
    target_prefix="Answer: ",
    instruction="You are given a question, the corresponding evidence and a prediction from a model. Compare the "Prediction" and the "Evidence" to determine to what extent the prediction is grounded in the evidence.
To be grounded in the evidence, all the information of the prediction must either be present in the evidence or deducible from the evidence.

Base your answer only on the information in the evidence. If the prediction is correct but not present in the evidence - it is not grounded.
The question is only given for context, and is irrelevant for determining the groundedness of the prediction.
Reply with one of the 4 options, without any further explanations:
"Completely Grounded" - if the prediction is grounded in the evidence.
"Mostly grounded" - if the vast majority of the information in the prediction is grounded in the evidence, but there is a small or negligible part of the prediction which is not present in the evidence.
"Somewhat grounded" - If some of the information in the prediction is grounded in the evidence.
"Not grounded" - If most or all of the information in the prediction is not grounded in the evidence
",
)
[source]

References: processors.extract_verbal_judgement, processors.take_first_word, processors.lower_case

Read more about catalog usage here.