crystina-z
commited on
Commit
•
91fe4d9
1
Parent(s):
3db9fcc
Update miracl_bm25_negative.py
Browse files- miracl_bm25_negative.py +2 -2
miracl_bm25_negative.py
CHANGED
@@ -99,7 +99,7 @@ class MsMarcoPassage(datasets.GeneratorBasedBuilder):
|
|
99 |
|
100 |
def _generate_examples(self, files):
|
101 |
"""Yields examples."""
|
102 |
-
for filepath in files:
|
103 |
with open(filepath, encoding="utf-8") as f:
|
104 |
for line in f:
|
105 |
data = json.loads(line)
|
@@ -107,4 +107,4 @@ class MsMarcoPassage(datasets.GeneratorBasedBuilder):
|
|
107 |
data['negative_passages'] = []
|
108 |
if data.get('positive_passages') is None:
|
109 |
data['positive_passages'] = []
|
110 |
-
yield data['query_id'], data
|
|
|
99 |
|
100 |
def _generate_examples(self, files):
|
101 |
"""Yields examples."""
|
102 |
+
for i, filepath in enumerate(files):
|
103 |
with open(filepath, encoding="utf-8") as f:
|
104 |
for line in f:
|
105 |
data = json.loads(line)
|
|
|
107 |
data['negative_passages'] = []
|
108 |
if data.get('positive_passages') is None:
|
109 |
data['positive_passages'] = []
|
110 |
+
yield f"{i}_" + data['query_id'], data
|