Upload 2 files
Browse files- corpus.txt +0 -0
- naturalquestionqa.py +14 -0
corpus.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
naturalquestionqa.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import json
|
3 |
+
|
4 |
+
here = os.path.dirname(os.path.abspath(__file__))
|
5 |
+
|
6 |
+
|
7 |
+
def prepare_json_dataset():
|
8 |
+
with open(os.path.join(here, "corpus.txt"), "w") as fout:
|
9 |
+
with open(os.path.join(here, "corpus.jsonl"), "r") as fin:
|
10 |
+
for line in fin:
|
11 |
+
line = json.loads(line)
|
12 |
+
fout.write(line["title"] + " " + line["text"] + "\n")
|
13 |
+
|
14 |
+
prepare_json_dataset()
|