Datasets:
lmqg
/

Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:
asahi417 commited on
Commit
24a4e2e
1 Parent(s): b2ca82a
Files changed (1) hide show
  1. 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 _id, i in enumerate(_list):
70
  data = json.loads(i)
71
- yield _id, data
 
 
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