πŸ“„ Judge Context Relevance AresΒΆ

templates.rag_eval.context_relevance.judge_context_relevance_ares

InputOutputTemplateWithCustomTarget(
    input_format="Question: {question}

Document: {contexts}
",
    output_format="{is_context_relevant}",
    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="Given the following question and document, you must analyze the provided document and determine whether it is sufficient for answering the question. In your evaluation, you should consider the content of the document and how it relates to the provided question. Answer with only yes/no.
",
)
[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.