Update NQ_squad_format.py
Browse files- NQ_squad_format.py +9 -9
NQ_squad_format.py
CHANGED
@@ -116,12 +116,12 @@ class Squad(datasets.GeneratorBasedBuilder):
|
|
116 |
logger.info("generating examples from = %s", filepath)
|
117 |
key = 0
|
118 |
with open(filepath, encoding="utf-8") as f:
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
116 |
logger.info("generating examples from = %s", filepath)
|
117 |
key = 0
|
118 |
with open(filepath, encoding="utf-8") as f:
|
119 |
+
data = json.load(f)
|
120 |
+
for line in data:
|
121 |
+
yield key, {
|
122 |
+
"context": line['context'],
|
123 |
+
"question": line["question"],
|
124 |
+
"id": line["id"],
|
125 |
+
"answers": line['answers']
|
126 |
+
}
|
127 |
+
key += 1
|