Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
question-generation
License:
init
Browse files- qg_squad.py +4 -2
qg_squad.py
CHANGED
@@ -60,12 +60,14 @@ class SquadQG(datasets.GeneratorBasedBuilder):
|
|
60 |
]
|
61 |
|
62 |
def _generate_examples(self, filepaths):
|
|
|
63 |
for filepath in filepaths:
|
64 |
logger.info("generating examples from = %s", filepath)
|
65 |
with open(filepath, encoding="utf-8") as f:
|
66 |
_list = f.read().split('\n')
|
67 |
if _list[-1] == '':
|
68 |
_list = _list[:-1]
|
69 |
-
for
|
70 |
data = json.loads(i)
|
71 |
-
yield
|
|
|
|
60 |
]
|
61 |
|
62 |
def _generate_examples(self, filepaths):
|
63 |
+
_key = 0
|
64 |
for filepath in filepaths:
|
65 |
logger.info("generating examples from = %s", filepath)
|
66 |
with open(filepath, encoding="utf-8") as f:
|
67 |
_list = f.read().split('\n')
|
68 |
if _list[-1] == '':
|
69 |
_list = _list[:-1]
|
70 |
+
for i in _list:
|
71 |
data = json.loads(i)
|
72 |
+
yield _key, data
|
73 |
+
_key += 1
|