Lexi commited on
Commit
14aeca8
1 Parent(s): a4ffed4

Update NQ_squad_format.py

Browse files
Files changed (1) hide show
  1. 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
- squad = json.load(f)
120
- for line in squad:
121
- yield key, {
122
- "context": line['context'],
123
- "question": line["question"],
124
- "id": line["id"],
125
- "answers": line['answers']
126
- }
127
- key += 1
 
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