updated syntax error
Browse files- nomiracl.py +4 -4
nomiracl.py
CHANGED
@@ -62,10 +62,10 @@ def load_corpus(filepath: str):
|
|
62 |
with open(filepath, encoding='utf8') as fIn:
|
63 |
for line in fIn:
|
64 |
line = json.loads(line)
|
65 |
-
corpus[line.get("docid")] =
|
66 |
"text": line.get("text", "").strip(),
|
67 |
"title": line.get("title", "").strip(),
|
68 |
-
|
69 |
return corpus
|
70 |
|
71 |
|
@@ -211,10 +211,10 @@ class NoMIRACL(datasets.GeneratorBasedBuilder):
|
|
211 |
neg_docids = [docid for docid, rel in qrels[qid].items() if rel == 0] if qrels is not None else []
|
212 |
data['positive_passages'] = [{
|
213 |
'docid': docid,
|
214 |
-
**
|
215 |
} for docid in pos_docids if docid in corpus]
|
216 |
data['negative_passages'] = [{
|
217 |
'docid': docid,
|
218 |
-
**
|
219 |
} for docid in neg_docids if docid in corpus]
|
220 |
yield qid, data
|
|
|
62 |
with open(filepath, encoding='utf8') as fIn:
|
63 |
for line in fIn:
|
64 |
line = json.loads(line)
|
65 |
+
corpus[line.get("docid")] = {
|
66 |
"text": line.get("text", "").strip(),
|
67 |
"title": line.get("title", "").strip(),
|
68 |
+
}
|
69 |
return corpus
|
70 |
|
71 |
|
|
|
211 |
neg_docids = [docid for docid, rel in qrels[qid].items() if rel == 0] if qrels is not None else []
|
212 |
data['positive_passages'] = [{
|
213 |
'docid': docid,
|
214 |
+
**corpus[docid]
|
215 |
} for docid in pos_docids if docid in corpus]
|
216 |
data['negative_passages'] = [{
|
217 |
'docid': docid,
|
218 |
+
**corpus[docid]
|
219 |
} for docid in neg_docids if docid in corpus]
|
220 |
yield qid, data
|