Update ciral.py
Browse files
ciral.py
CHANGED
@@ -43,7 +43,7 @@ _URLS = {
|
|
43 |
#f'/store/scratch/moadeyem/CIRAL/ciral-qrels-queries/ciral/ciral-{lang}/topics/topics.ciral-{lang}-train.tsv',
|
44 |
#f'/store/scratch/moadeyem/CIRAL/ciral-qrels-queries/ciral/ciral-{lang}/qrels/qrels.ciral-{lang}-train.tsv'
|
45 |
],
|
46 |
-
|
47 |
} for lang in languages
|
48 |
}
|
49 |
|
@@ -119,12 +119,12 @@ class CIRAL(datasets.GeneratorBasedBuilder):
|
|
119 |
'filepaths': downloaded_files['train'],
|
120 |
},
|
121 |
),
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
]
|
129 |
|
130 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
@@ -133,7 +133,7 @@ class CIRAL(datasets.GeneratorBasedBuilder):
|
|
133 |
corpus = datasets.load_dataset('ciral/ciral-corpus', lang)['train']
|
134 |
docid2doc = {doc['docid']: doc['text'] for doc in corpus}
|
135 |
|
136 |
-
query_file, qrel_file = (filepaths) if len(filepaths) == 2 else (
|
137 |
queries = load_queries(query_file)
|
138 |
qrels = load_qrels(qrel_file)
|
139 |
for query_id in queries:
|
|
|
43 |
#f'/store/scratch/moadeyem/CIRAL/ciral-qrels-queries/ciral/ciral-{lang}/topics/topics.ciral-{lang}-train.tsv',
|
44 |
#f'/store/scratch/moadeyem/CIRAL/ciral-qrels-queries/ciral/ciral-{lang}/qrels/qrels.ciral-{lang}-train.tsv'
|
45 |
],
|
46 |
+
'test':[]
|
47 |
} for lang in languages
|
48 |
}
|
49 |
|
|
|
119 |
'filepaths': downloaded_files['train'],
|
120 |
},
|
121 |
),
|
122 |
+
datasets.SplitGenerator(
|
123 |
+
name='test',
|
124 |
+
gen_kwargs={
|
125 |
+
'filepaths': downloaded_files['test'],
|
126 |
+
},
|
127 |
+
),
|
128 |
]
|
129 |
|
130 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
|
|
133 |
corpus = datasets.load_dataset('ciral/ciral-corpus', lang)['train']
|
134 |
docid2doc = {doc['docid']: doc['text'] for doc in corpus}
|
135 |
|
136 |
+
query_file, qrel_file = (filepaths) if len(filepaths) == 2 else (None, None)
|
137 |
queries = load_queries(query_file)
|
138 |
qrels = load_qrels(qrel_file)
|
139 |
for query_id in queries:
|