Datasets:
Commit
•
8ac1acc
1
Parent(s):
3f69367
fix years
Browse files- voxpopuli.py +10 -5
voxpopuli.py
CHANGED
@@ -31,8 +31,12 @@ _CONFIG_TO_YEARS = {
|
|
31 |
# "asr": _YEARS
|
32 |
}
|
33 |
for lang in _LANGUAGES:
|
34 |
-
|
35 |
-
_CONFIG_TO_YEARS[lang] = [2020]
|
|
|
|
|
|
|
|
|
36 |
|
37 |
_BASE_URL = "https://dl.fbaipublicfiles.com/voxpopuli/"
|
38 |
|
@@ -51,7 +55,9 @@ class VoxpopuliConfig(datasets.BuilderConfig):
|
|
51 |
**kwargs: keyword arguments forwarded to super.
|
52 |
"""
|
53 |
super().__init__(name=name, **kwargs)
|
|
|
54 |
self.languages = [name] if name in _LANGUAGES else _LANGUAGES
|
|
|
55 |
|
56 |
|
57 |
class Voxpopuli(datasets.GeneratorBasedBuilder):
|
@@ -64,7 +70,7 @@ class Voxpopuli(datasets.GeneratorBasedBuilder):
|
|
64 |
# version=VERSION,
|
65 |
description="", # TODO
|
66 |
)
|
67 |
-
for name in _LANGUAGES + ["10k", "100k", "400k"]
|
68 |
]
|
69 |
# DEFAULT_CONFIG_NAME = "400k"
|
70 |
DEFAULT_WRITER_BATCH_SIZE = 256
|
@@ -129,8 +135,7 @@ class Voxpopuli(datasets.GeneratorBasedBuilder):
|
|
129 |
def _split_generators(self, dl_manager):
|
130 |
metadata_path = dl_manager.download_and_extract(_META_URL)
|
131 |
|
132 |
-
|
133 |
-
urls = [_DATA_URL.format(lang=language, year=year) for language in self.config.languages for year in years]
|
134 |
dl_manager.download_config.num_proc = len(urls)
|
135 |
data_dirs = dl_manager.download_and_extract(urls)
|
136 |
|
|
|
31 |
# "asr": _YEARS
|
32 |
}
|
33 |
for lang in _LANGUAGES:
|
34 |
+
_CONFIG_TO_YEARS[lang] = _YEARS
|
35 |
+
# _CONFIG_TO_YEARS[lang] = [2020]
|
36 |
+
|
37 |
+
for lang in _LANGUAGES_V2:
|
38 |
+
_CONFIG_TO_YEARS[lang] = _YEARS + [f"{y}_2" for y in _YEARS]
|
39 |
+
|
40 |
|
41 |
_BASE_URL = "https://dl.fbaipublicfiles.com/voxpopuli/"
|
42 |
|
|
|
55 |
**kwargs: keyword arguments forwarded to super.
|
56 |
"""
|
57 |
super().__init__(name=name, **kwargs)
|
58 |
+
name = name.split("_")[0]
|
59 |
self.languages = [name] if name in _LANGUAGES else _LANGUAGES
|
60 |
+
self.years = _CONFIG_TO_YEARS[name]
|
61 |
|
62 |
|
63 |
class Voxpopuli(datasets.GeneratorBasedBuilder):
|
|
|
70 |
# version=VERSION,
|
71 |
description="", # TODO
|
72 |
)
|
73 |
+
for name in _LANGUAGES + _LANGUAGES_V2 + ["10k", "100k", "400k"]
|
74 |
]
|
75 |
# DEFAULT_CONFIG_NAME = "400k"
|
76 |
DEFAULT_WRITER_BATCH_SIZE = 256
|
|
|
135 |
def _split_generators(self, dl_manager):
|
136 |
metadata_path = dl_manager.download_and_extract(_META_URL)
|
137 |
|
138 |
+
urls = [_DATA_URL.format(lang=language, year=year) for language in self.config.languages for year in self.config.years]
|
|
|
139 |
dl_manager.download_config.num_proc = len(urls)
|
140 |
data_dirs = dl_manager.download_and_extract(urls)
|
141 |
|