NaturalQuestionsQA / naturalquestionqa.py
thinkall's picture
Upload 2 files
2859c76
raw
history blame contribute delete
No virus
394 Bytes
import os
import json
here = os.path.dirname(os.path.abspath(__file__))
def prepare_json_dataset():
with open(os.path.join(here, "corpus.txt"), "w") as fout:
with open(os.path.join(here, "corpus.jsonl"), "r") as fin:
for line in fin:
line = json.loads(line)
fout.write(line["title"] + " " + line["text"] + "\n")
prepare_json_dataset()