πŸ“„ Mt Bench Multi Turn With ReferenceΒΆ

templates.response_assessment.rating.mt_bench_multi_turn_with_reference

DialogTemplate(
    dialog_fields=[
        DialogFieldsData(
            dialog_field="reference_dialog",
            assistant_role_label="### Reference answer:",
            user_role_label="### User:",
            system_role_label="### System:",
        ),
        DialogFieldsData(
            dialog_field="dialog",
            assistant_role_label="### Assistant A:",
            user_role_label="### User:",
            system_role_label="### System:",
        ),
    ],
    turns_separator="

",
    label_separator="
",
    instruction="Please act as an impartial judge and evaluate the quality of the response provided by an AI assistant to the user question. Your evaluation should consider correctness and helpfulness. You will be given a reference answer and the assistant's answer. You evaluation should focus on the assistant's answer to the second question. Begin your evaluation by comparing the assistant's answer with the reference answer. Identify and correct any mistakes. Be as objective as possible. After providing your explanation, you must rate the response on a scale of 1 to 10 by strictly following this format: "[[rating]]", for example: "Rating: [[5]]".

",
    input_format="<|The Start of Reference Answer|>

{reference_dialog}

<|The End of Reference Answer|>


<|The Start of Assistant A's Conversation with User|>

{dialog}

<|The End of Assistant A's Conversation with User|>",
    output_format="[[{rating}]]",
    postprocessors=[
        "processors.extract_mt_bench_rating_judgment",
    ],
)
[source]

from unitxt.templates import DialogFieldsData

References: processors.extract_mt_bench_rating_judgment

Read more about catalog usage here.