File size: 225 Bytes
6afe180 |
1 2 3 4 5 6 7 8 |
def doc_to_text(doc) -> str:
choices = ""
for idx, choice in enumerate(doc["choices"]["text"]):
letter = "ABCDE"[idx]
choices+= f"{letter}. {choice}\n"
return f"Question: {doc['question']}\n{choices}\nAnswer:"
|