MrLight commited on
Commit
56c6e24
1 Parent(s): 56fe4cb

Update wikipedia-nq-corpus.py

Browse files
Files changed (1) hide show
  1. wikipedia-nq-corpus.py +1 -10
wikipedia-nq-corpus.py CHANGED
@@ -87,13 +87,4 @@ class WikipediaNqCorpus(datasets.GeneratorBasedBuilder):
87
  with open(filepath, encoding="utf-8") as f:
88
  for line in f:
89
  data = json.loads(line)
90
- if self.config.name == 'corpus':
91
- yield data['docid'], data
92
- else:
93
- if data.get('negative_passages') is None:
94
- data['negative_passages'] = []
95
- if data.get('positive_passages') is None:
96
- data['positive_passages'] = []
97
- if data.get('answers') is None:
98
- data['answers'] = []
99
- yield data['query_id'], data
 
87
  with open(filepath, encoding="utf-8") as f:
88
  for line in f:
89
  data = json.loads(line)
90
+ yield data['docid'], data