Commit 9291edaa authored by Charles Foster's avatar Charles Foster
Browse files

Updates to natural questions to deal with memory issues.

parent 0dda9f63
...@@ -17,6 +17,13 @@ class NaturalQs(HFTask): ...@@ -17,6 +17,13 @@ class NaturalQs(HFTask):
# TODO: figure out description # TODO: figure out description
return "" return ""
def training_docs(self):
# Cache training for faster few-shot.
# Data is too large to fit in memory.
self.data["train"])
return self.data["train"])
def doc_to_text(self, doc, include_target=True): def doc_to_text(self, doc, include_target=True):
question = doc['question']['text'] question = doc['question']['text']
short_answer = doc['annotations']['short_answers'][0]['text'] short_answer = doc['annotations']['short_answers'][0]['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