BayesTensor's picture
Upload folder using huggingface_hub
9d5b280 verified
raw
history blame contribute delete
400 Bytes
def doc_to_target(doc):
labels = [c["label"] for c in doc["question"]["choices"]]
try:
i = labels.index(doc["answerKey"].lstrip())
except Exception as e:
print("Failed", e)
return
return i
def doc_to_choice(doc):
texts = [c["text"] for c in doc["question"]["choices"]]
return texts
def doc_to_text(doc):
return doc["question"]["stem"].strip()