in 4_evaluation/project/evaluation_task.py [0:0]
def prompt_fn(line, task_name: str = None):
"""Converts a dataset line to a Doc object for evaluation."""
instruction = "Choose the correct answer for the following exam question:"
return Doc(
task_name=task_name,
query=f"{instruction} {line['question']}",
choices=[
f" {line['answer_a']}",
f" {line['answer_b']}",
f" {line['answer_c']}",
f" {line['answer_d']}",
],
gold_index=["answer_a", "answer_b", "answer_c", "answer_d"].index(
line["correct_answer"]
),
instruction=instruction,
)