π Judge Context Relevance Ares NumericΒΆ
templates.rag_eval.context_relevance.judge_context_relevance_ares_numeric
InputOutputTemplateWithCustomTarget(
input_format="Question: {question}
Document: {contexts}
",
output_format="{is_context_relevant}",
postprocessors=[
"processors.take_first_word",
"processors.lower_case",
"processors.cast_to_float_return_zero_if_failed",
"processors.scale_0_10_to_0_1",
],
reference="{number_val}",
target_prefix="Answer: ",
instruction="Given the following question and document, you must analyze the provided document and determine to what extent 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.
On a scale of 0 to 10, to what extent is the document sufficient for answering the question? Reply with your rating score without any preceding explanation.
",
)
[source]References: processors.cast_to_float_return_zero_if_failed, processors.scale_0_10_to_0_1, processors.take_first_word, processors.lower_case
Read more about catalog usage here.