bugfixes for MIRACL
Browse files- mmteb-miracl.py +11 -5
mmteb-miracl.py
CHANGED
@@ -64,17 +64,17 @@ languages2filesize = {
|
|
64 |
_DESCRIPTION = 'dataset load script for MIRACL'
|
65 |
|
66 |
_DATASET_URLS = {
|
67 |
-
|
68 |
'dev': [
|
69 |
-
f'https://huggingface.co/datasets/miracl/miracl/resolve/main/miracl-v1.0-{
|
70 |
],
|
71 |
'corpus': [
|
72 |
-
f'https://huggingface.co/datasets/miracl/miracl-corpus/resolve/main/miracl-corpus-v1.0-{
|
73 |
],
|
74 |
'queries': [
|
75 |
-
f'https://huggingface.co/datasets/miracl/miracl/resolve/main/miracl-v1.0-{
|
76 |
],
|
77 |
-
} for
|
78 |
}
|
79 |
|
80 |
def load_topic(fn: str) -> Dict[str, str]:
|
@@ -169,6 +169,8 @@ class MMTEBMIRACL(datasets.GeneratorBasedBuilder):
|
|
169 |
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS[name])
|
170 |
|
171 |
if name.startswith('corpus-'):
|
|
|
|
|
172 |
splits = [
|
173 |
datasets.SplitGenerator(
|
174 |
name='corpus',
|
@@ -179,6 +181,8 @@ class MMTEBMIRACL(datasets.GeneratorBasedBuilder):
|
|
179 |
]
|
180 |
|
181 |
elif name.startswith('queries-'):
|
|
|
|
|
182 |
splits = [
|
183 |
datasets.SplitGenerator(
|
184 |
name='queries',
|
@@ -188,6 +192,8 @@ class MMTEBMIRACL(datasets.GeneratorBasedBuilder):
|
|
188 |
),
|
189 |
]
|
190 |
else:
|
|
|
|
|
191 |
splits = [
|
192 |
datasets.SplitGenerator(
|
193 |
name='dev',
|
|
|
64 |
_DESCRIPTION = 'dataset load script for MIRACL'
|
65 |
|
66 |
_DATASET_URLS = {
|
67 |
+
language: {
|
68 |
'dev': [
|
69 |
+
f'https://huggingface.co/datasets/miracl/miracl/resolve/main/miracl-v1.0-{language}/qrels/qrels.miracl-v1.0-{language}-dev.tsv',
|
70 |
],
|
71 |
'corpus': [
|
72 |
+
f'https://huggingface.co/datasets/miracl/miracl-corpus/resolve/main/miracl-corpus-v1.0-{language}/docs-{i}.jsonl.gz' for i in range(n)
|
73 |
],
|
74 |
'queries': [
|
75 |
+
f'https://huggingface.co/datasets/miracl/miracl/resolve/main/miracl-v1.0-{language}/topics/topics.miracl-v1.0-{language}-dev.tsv',
|
76 |
],
|
77 |
+
} for language, n in languages2filesize.items()
|
78 |
}
|
79 |
|
80 |
def load_topic(fn: str) -> Dict[str, str]:
|
|
|
169 |
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS[name])
|
170 |
|
171 |
if name.startswith('corpus-'):
|
172 |
+
language = name.strip('corpus-', '')
|
173 |
+
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS[language]['corpus'])
|
174 |
splits = [
|
175 |
datasets.SplitGenerator(
|
176 |
name='corpus',
|
|
|
181 |
]
|
182 |
|
183 |
elif name.startswith('queries-'):
|
184 |
+
language = name.strip('queries-', '')
|
185 |
+
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS[language]['queries'])
|
186 |
splits = [
|
187 |
datasets.SplitGenerator(
|
188 |
name='queries',
|
|
|
192 |
),
|
193 |
]
|
194 |
else:
|
195 |
+
language = name
|
196 |
+
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS[language]['dev'])
|
197 |
splits = [
|
198 |
datasets.SplitGenerator(
|
199 |
name='dev',
|