This evaluation of Winogrande uses partial evaluation as described by
Trinh & Le in Simple Method for Commonsense Reasoning (2018).
Reference: https://arxiv.org/abs/1806.02847
"""
classWinogrande(HFTask):
DATASET_PATH="winogrande"
...
...
@@ -17,35 +22,31 @@ class Winogrande(HFTask):
defhas_test_docs(self):
returnTrue
deftraining_docs(self):
ifself.has_training_docs():
returnself.data["train"]
defvalidation_docs(self):
ifself.has_validation_docs():
returnself.data["validation"]
deftest_docs(self):
ifself.has_test_docs():
returnself.data["test"]
deffewshot_description(self):
# TODO: redo description
return"Winograd schema sentence including a either a ___ blank with a missing word, making the pronoun ambiguous, or the same with the word filled in."
@classmethod
defpartial_context(cls,doc):
# Substitute the pronoun in the sentence with each candidate choice