Commit 62714855 authored by Leo Gao's avatar Leo Gao
Browse files

Update RACE format

parent 9b14235d
......@@ -82,9 +82,12 @@ class RACE(HFTask):
def doc_to_text(self, doc):
text = 'Article: ' + doc['article'] + '\n\n'
for problem in doc['problems'][:-1]:
assert problem['question'][-6:] == ' _ .'
text += problem['question'][-5:] + self.get_answer_option(problem) + '\n'
if problem['question'][-6:] == ' _ .':
text += problem['question'][-5:] + self.get_answer_option(problem) + '\n'
else:
question = 'Question: ' + problem['question'] + '\n'
answer = 'Answer: ' + self.get_answer_option(problem) + '\n'
text += question + answer
text += self.last_problem(doc)['question']
return text
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment