Update librispeech_asr_test.py
Browse files- librispeech_asr_test.py +7 -10
librispeech_asr_test.py
CHANGED
@@ -24,7 +24,6 @@ import os
|
|
24 |
import datasets
|
25 |
|
26 |
|
27 |
-
|
28 |
_CITATION = """\
|
29 |
@inproceedings{panayotov2015librispeech,
|
30 |
title={Librispeech: an ASR corpus based on public domain audio books},
|
@@ -39,7 +38,7 @@ _CITATION = """\
|
|
39 |
_DESCRIPTION = """\
|
40 |
LibriSpeech is a corpus of approximately 1000 hours of read English speech with sampling rate of 16 kHz,
|
41 |
prepared by Vassil Panayotov with the assistance of Daniel Povey. The data is derived from read
|
42 |
-
audiobooks from the LibriVox project, and has been carefully segmented and aligned.
|
43 |
Note that in order to limit the required storage for preparing this dataset, the audio
|
44 |
is stored in the .flac format and is not converted to a float32 array. To convert, the audio
|
45 |
file to a float32 array, please make use of the `.map()` function as follows:
|
@@ -54,15 +53,13 @@ dataset = dataset.map(map_to_array, remove_columns=["file"])
|
|
54 |
"""
|
55 |
|
56 |
_URL = "http://www.openslr.org/12"
|
57 |
-
_DL_URL = "
|
|
|
58 |
|
59 |
_DL_URLS = {
|
60 |
"clean": {
|
61 |
-
"test": _DL_URL + "
|
62 |
-
}
|
63 |
-
"other": {
|
64 |
-
"test": _DL_URL + "test-other.tar.gz",
|
65 |
-
},
|
66 |
}
|
67 |
|
68 |
|
@@ -95,7 +92,7 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
95 |
features=datasets.Features(
|
96 |
{
|
97 |
"file": datasets.Value("string"),
|
98 |
-
"audio": datasets.Audio(sampling_rate=16_000),
|
99 |
"text": datasets.Value("string"),
|
100 |
"speaker_id": datasets.Value("int64"),
|
101 |
"chapter_id": datasets.Value("int64"),
|
@@ -110,7 +107,7 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
110 |
def _split_generators(self, dl_manager):
|
111 |
archive_path = dl_manager.download_and_extract(_DL_URLS[self.config.name])
|
112 |
return [
|
113 |
-
datasets.SplitGenerator(name=datasets.Split.
|
114 |
]
|
115 |
|
116 |
def _generate_examples(self, archive_path, split_name):
|
|
|
24 |
import datasets
|
25 |
|
26 |
|
|
|
27 |
_CITATION = """\
|
28 |
@inproceedings{panayotov2015librispeech,
|
29 |
title={Librispeech: an ASR corpus based on public domain audio books},
|
|
|
38 |
_DESCRIPTION = """\
|
39 |
LibriSpeech is a corpus of approximately 1000 hours of read English speech with sampling rate of 16 kHz,
|
40 |
prepared by Vassil Panayotov with the assistance of Daniel Povey. The data is derived from read
|
41 |
+
audiobooks from the LibriVox project, and has been carefully segmented and aligned.
|
42 |
Note that in order to limit the required storage for preparing this dataset, the audio
|
43 |
is stored in the .flac format and is not converted to a float32 array. To convert, the audio
|
44 |
file to a float32 array, please make use of the `.map()` function as follows:
|
|
|
53 |
"""
|
54 |
|
55 |
_URL = "http://www.openslr.org/12"
|
56 |
+
_DL_URL = "https://s3.amazonaws.com/datasets.huggingface.co/librispeech_asr/2.1.0/"
|
57 |
+
_DL_URL = "https://s3.amazonaws.com/datasets.huggingface.co/librispeech_asr/2.1.0/"
|
58 |
|
59 |
_DL_URLS = {
|
60 |
"clean": {
|
61 |
+
"test": _DL_URL + "test_clean.tar.gz",
|
62 |
+
}
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
|
|
|
92 |
features=datasets.Features(
|
93 |
{
|
94 |
"file": datasets.Value("string"),
|
95 |
+
"audio": datasets.features.Audio(sampling_rate=16_000),
|
96 |
"text": datasets.Value("string"),
|
97 |
"speaker_id": datasets.Value("int64"),
|
98 |
"chapter_id": datasets.Value("int64"),
|
|
|
107 |
def _split_generators(self, dl_manager):
|
108 |
archive_path = dl_manager.download_and_extract(_DL_URLS[self.config.name])
|
109 |
return [
|
110 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"archive_path": archive_path["test"], "split_name": f"test_{self.config.name}"}),
|
111 |
]
|
112 |
|
113 |
def _generate_examples(self, archive_path, split_name):
|