return"Label for the relevant action: Sentences describing the context, with an incomplete sentence trailing\nanswer that plausibly completes the situation."
return"Label for the relevant action: Sentences describing the context, with an incomplete sentence trailing\nanswer that plausibly completes the situation."
defdoc_to_text(self,doc,include_target=True):
defdoc_to_text(self,doc):
text=doc['activity_label']+': '+doc['ctx']+'\n'
returndoc['activity_label']+': '+doc['ctx']+'\n'
ifinclude_target:
defdoc_to_target(self,doc):
letter_answer=doc['label']
letter_answer=doc['label']
ifletter_answer=='0':
ifletter_answer=='0':
index=0
index=0
...
@@ -48,8 +49,7 @@ class HellaSwag(HFTask):
...
@@ -48,8 +49,7 @@ class HellaSwag(HFTask):
index=3
index=3
else:
else:
raiseValueError("HellaSwag from HF datasets contained an invalid answer key")
raiseValueError("HellaSwag from HF datasets contained an invalid answer key")
return"Title: The_Title_of_It\n\nBackground: A text passage as background to answer the question with.\n\nQ: Question about the passage.\n\nA: Answer."
return"Title: The_Title_of_It\n\nBackground: A text passage as background to answer the question with.\n\nQ: Question about the passage.\n\nA: Answer."
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."
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."
defdoc_to_text(self,doc,include_target=True):
defdoc_to_text(self,doc):
returndoc['sentence']
defdoc_to_target(self,doc):
text=doc['sentence']
text=doc['sentence']
ifinclude_target:
answer_n=doc['answer']
answer_n=doc['answer']
ifanswer_n=='1':
ifanswer_n=='1':
answer=doc['option1']
answer=doc['option1']
...
@@ -44,8 +46,7 @@ class Winogrande(HFTask):
...
@@ -44,8 +46,7 @@ class Winogrande(HFTask):
answer=doc['option2']
answer=doc['option2']
else:
else:
raiseValueError("Winogrande from HF datasets contained an invalid answer key")
raiseValueError("Winogrande from HF datasets contained an invalid answer key")