Update aishell1.py
Browse files- aishell1.py +83 -71
aishell1.py
CHANGED
@@ -137,77 +137,89 @@ class Aishell(datasets.GeneratorBasedBuilder):
|
|
137 |
|
138 |
# meta_paths = dl_manager.download_and_extract(meta_urls)
|
139 |
meta_paths = dl_manager.download(meta_urls)
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
],
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
|
212 |
def _generate_examples(self, audio_archives_iterators, local_audio_archives_paths, meta_paths):
|
213 |
|
|
|
137 |
|
138 |
# meta_paths = dl_manager.download_and_extract(meta_urls)
|
139 |
meta_paths = dl_manager.download(meta_urls)
|
140 |
+
return [
|
141 |
+
datasets.SplitGenerator(
|
142 |
+
name=datasets.Split.TEST,
|
143 |
+
gen_kwargs={
|
144 |
+
"audio_archives_iterators": [
|
145 |
+
dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths[self.config.name]
|
146 |
+
],
|
147 |
+
"local_audio_archives_paths": local_audio_archives_paths[
|
148 |
+
self.config.name] if local_audio_archives_paths else None,
|
149 |
+
"meta_paths": meta_paths[self.config.name]
|
150 |
+
},
|
151 |
+
),
|
152 |
+
]
|
153 |
+
# if self.config.name not in {"dev", "test"}:
|
154 |
+
# result = [
|
155 |
+
# datasets.SplitGenerator(
|
156 |
+
# name=datasets.Split.TRAIN,
|
157 |
+
# gen_kwargs={
|
158 |
+
# "audio_archives_iterators": [
|
159 |
+
# dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["train"]
|
160 |
+
# ],
|
161 |
+
# "local_audio_archives_paths": local_audio_archives_paths[
|
162 |
+
# "train"] if local_audio_archives_paths else None,
|
163 |
+
# "meta_paths": meta_paths["train"]
|
164 |
+
# },
|
165 |
+
# )
|
166 |
+
# ]
|
167 |
+
# if 'dev' in audio_archives_paths:
|
168 |
+
# result.append(datasets.SplitGenerator(
|
169 |
+
# name=datasets.Split.VALIDATION,
|
170 |
+
# gen_kwargs={
|
171 |
+
# "audio_archives_iterators": [
|
172 |
+
# dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["dev"]
|
173 |
+
# ],
|
174 |
+
# "local_audio_archives_paths": local_audio_archives_paths[
|
175 |
+
# "dev"] if local_audio_archives_paths else None,
|
176 |
+
# "meta_paths": meta_paths["dev"]
|
177 |
+
# },
|
178 |
+
# ))
|
179 |
+
# if 'test' in audio_archives_paths:
|
180 |
+
# result.append(datasets.SplitGenerator(
|
181 |
+
# name=datasets.Split.TEST,
|
182 |
+
# gen_kwargs={
|
183 |
+
# "audio_archives_iterators": [
|
184 |
+
# dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["test"]
|
185 |
+
# ],
|
186 |
+
# "local_audio_archives_paths": local_audio_archives_paths[
|
187 |
+
# "test"] if local_audio_archives_paths else None,
|
188 |
+
# "meta_paths": meta_paths["test"]
|
189 |
+
# },
|
190 |
+
# ))
|
191 |
+
# return result
|
192 |
+
|
193 |
+
# if self.config.name == "dev":
|
194 |
+
# return [
|
195 |
+
# datasets.SplitGenerator(
|
196 |
+
# name=datasets.Split.VALIDATION,
|
197 |
+
# gen_kwargs={
|
198 |
+
# "audio_archives_iterators": [
|
199 |
+
# dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["dev"]
|
200 |
+
# ],
|
201 |
+
# "local_audio_archives_paths": local_audio_archives_paths[
|
202 |
+
# "dev"] if local_audio_archives_paths else None,
|
203 |
+
# "meta_paths": meta_paths["dev"]
|
204 |
+
# },
|
205 |
+
# ),
|
206 |
+
# ]
|
207 |
+
|
208 |
+
# if self.config.name == "test":
|
209 |
+
|
210 |
+
# return [
|
211 |
+
# datasets.SplitGenerator(
|
212 |
+
# name=datasets.Split.TEST,
|
213 |
+
# gen_kwargs={
|
214 |
+
# "audio_archives_iterators": [
|
215 |
+
# dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["test"]
|
216 |
+
# ],
|
217 |
+
# "local_audio_archives_paths": local_audio_archives_paths[
|
218 |
+
# "test"] if local_audio_archives_paths else None,
|
219 |
+
# "meta_paths": meta_paths["test"]
|
220 |
+
# },
|
221 |
+
# ),
|
222 |
+
# ]
|
223 |
|
224 |
def _generate_examples(self, audio_archives_iterators, local_audio_archives_paths, meta_paths):
|
225 |
|