πŸ“„ Judge No Question Simplified ExplainΒΆ

templates.rag_eval.faithfulness.judge_no_question_simplified_explain

InputOutputTemplateWithCustomTarget(
    input_format="Evidence: {contexts}

Prediction: {answer}
",
    output_format="{is_faithful}",
    postprocessors=[
        "processors.take_first_word",
        "processors.lower_case",
        "processors.predictions_yes_1_else_0",
        "processors.cast_to_float_return_zero_if_failed",
    ],
    reference="{number_val}",
    target_prefix="Answer: ",
    instruction="You are given an "Evidence" and a "Prediction" from a model. Compare the "Prediction" and the "Evidence" texts to determine whether all the information of the "Prediction" is present in the "Evidence" or can be inferred from the "Evidence". You must answer "No" if there are any specific details in the "Prediction" that are not mentioned in the "Evidence" or cannot be inferred from the "Evidence". Answer only "Yes" or "No". Then, provide an explanation to your answer.
",
)
[source]

References: processors.cast_to_float_return_zero_if_failed, processors.predictions_yes_1_else_0, processors.take_first_word, processors.lower_case

Read more about catalog usage here.