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):
defdoc_to_text(self,doc):
returndoc['activity_label']+': '+doc['ctx']+'\n'
returndoc['activity_label']+': '+doc['ctx']+'\n'
...
@@ -46,7 +47,8 @@ class HellaSwag(HFTask):
...
@@ -46,7 +47,8 @@ class HellaSwag(HFTask):
elifletter_answer=='3':
elifletter_answer=='3':
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")
returndoc['endings'][index]
returndoc['endings'][index]
defconstruct_requests(self,doc,ctx):
defconstruct_requests(self,doc,ctx):
...
@@ -60,8 +62,10 @@ class HellaSwag(HFTask):
...
@@ -60,8 +62,10 @@ class HellaSwag(HFTask):
language description, as well as the few shot examples, and the question
language description, as well as the few shot examples, and the question
part of the document for `doc`.
part of the document for `doc`.
"""
"""
# TODO: implement evaluation.
ll_answers=[
raiseNotImplementedError('Evaluation not implemented')