Commit
•
90a60be
1
Parent(s):
c6eaa32
Update librispeech_asr_clean.py
Browse files- librispeech_asr_clean.py +5 -15
librispeech_asr_clean.py
CHANGED
@@ -41,10 +41,9 @@ audiobooks from the LibriVox project, and has been carefully segmented and align
|
|
41 |
_URL = "http://www.openslr.org/12"
|
42 |
_DL_URL = "http://www.openslr.org/resources/12/"
|
43 |
|
44 |
-
_DL_URLS = {"
|
45 |
-
"test": _DL_URL + "test-clean.tar.gz",
|
46 |
"train.100": _DL_URL + "train-clean-100.tar.gz",
|
47 |
-
|
48 |
|
49 |
|
50 |
class LibrispeechASRConfig(datasets.BuilderConfig):
|
@@ -93,7 +92,7 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
93 |
# (Optional) In non-streaming mode, we can extract the archive locally to have actual local audio files:
|
94 |
local_extracted_archive = dl_manager.extract(archive_path) if not dl_manager.is_streaming else {}
|
95 |
|
96 |
-
|
97 |
datasets.SplitGenerator(
|
98 |
name="train.100",
|
99 |
gen_kwargs={
|
@@ -102,16 +101,7 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
102 |
},
|
103 |
),
|
104 |
]
|
105 |
-
|
106 |
-
datasets.SplitGenerator(
|
107 |
-
name=datasets.Split.VALIDATION,
|
108 |
-
gen_kwargs={
|
109 |
-
"local_extracted_archive": local_extracted_archive.get("dev"),
|
110 |
-
"files": dl_manager.iter_archive(archive_path["dev"]),
|
111 |
-
},
|
112 |
-
)
|
113 |
-
]
|
114 |
-
test_splits = [
|
115 |
datasets.SplitGenerator(
|
116 |
name=datasets.Split.TEST,
|
117 |
gen_kwargs={
|
@@ -120,7 +110,7 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
120 |
},
|
121 |
)
|
122 |
]
|
123 |
-
return
|
124 |
|
125 |
def _generate_examples(self, files, local_extracted_archive):
|
126 |
"""Generate examples from a LibriSpeech archive_path."""
|
|
|
41 |
_URL = "http://www.openslr.org/12"
|
42 |
_DL_URL = "http://www.openslr.org/resources/12/"
|
43 |
|
44 |
+
_DL_URLS = {"test": _DL_URL + "test-clean.tar.gz",
|
|
|
45 |
"train.100": _DL_URL + "train-clean-100.tar.gz",
|
46 |
+
}
|
47 |
|
48 |
|
49 |
class LibrispeechASRConfig(datasets.BuilderConfig):
|
|
|
92 |
# (Optional) In non-streaming mode, we can extract the archive locally to have actual local audio files:
|
93 |
local_extracted_archive = dl_manager.extract(archive_path) if not dl_manager.is_streaming else {}
|
94 |
|
95 |
+
train_split = [
|
96 |
datasets.SplitGenerator(
|
97 |
name="train.100",
|
98 |
gen_kwargs={
|
|
|
101 |
},
|
102 |
),
|
103 |
]
|
104 |
+
test_split = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
datasets.SplitGenerator(
|
106 |
name=datasets.Split.TEST,
|
107 |
gen_kwargs={
|
|
|
110 |
},
|
111 |
)
|
112 |
]
|
113 |
+
return train_split + test_split
|
114 |
|
115 |
def _generate_examples(self, files, local_extracted_archive):
|
116 |
"""Generate examples from a LibriSpeech archive_path."""
|