Datasets:
Tasks:
Audio Classification
Sub-tasks:
keyword-spotting
Languages:
English
Size:
100K<n<1M
ArXiv:
License:
Commit
•
c68e203
0
Parent(s):
Update files from the datasets library (from 1.17.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.17.0
- .gitattributes +27 -0
- README.md +282 -0
- dataset_infos.json +1 -0
- dummy/v0.01/0.1.0/dummy_data.zip +3 -0
- dummy/v0.02/0.2.0/dummy_data.zip +3 -0
- speech_commands.py +229 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- other
|
4 |
+
language_creators:
|
5 |
+
- crowdsourced
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- cc-by-4-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
pretty_name: SpeechCommands
|
13 |
+
size_categories:
|
14 |
+
v0-01:
|
15 |
+
- 10K<n<100K
|
16 |
+
v0-02:
|
17 |
+
- 100K<n<1M
|
18 |
+
source_datasets:
|
19 |
+
- original
|
20 |
+
task_categories:
|
21 |
+
- speech-processing
|
22 |
+
task_ids:
|
23 |
+
- other-other-keyword-spotting
|
24 |
+
---
|
25 |
+
|
26 |
+
# Dataset Card for SpeechCommands
|
27 |
+
|
28 |
+
## Table of Contents
|
29 |
+
- [Table of Contents](#table-of-contents)
|
30 |
+
- [Dataset Description](#dataset-description)
|
31 |
+
- [Dataset Summary](#dataset-summary)
|
32 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
33 |
+
- [Languages](#languages)
|
34 |
+
- [Dataset Structure](#dataset-structure)
|
35 |
+
- [Data Instances](#data-instances)
|
36 |
+
- [Data Fields](#data-fields)
|
37 |
+
- [Data Splits](#data-splits)
|
38 |
+
- [Dataset Creation](#dataset-creation)
|
39 |
+
- [Curation Rationale](#curation-rationale)
|
40 |
+
- [Source Data](#source-data)
|
41 |
+
- [Annotations](#annotations)
|
42 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
43 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
44 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
45 |
+
- [Discussion of Biases](#discussion-of-biases)
|
46 |
+
- [Other Known Limitations](#other-known-limitations)
|
47 |
+
- [Additional Information](#additional-information)
|
48 |
+
- [Dataset Curators](#dataset-curators)
|
49 |
+
- [Licensing Information](#licensing-information)
|
50 |
+
- [Citation Information](#citation-information)
|
51 |
+
- [Contributions](#contributions)
|
52 |
+
|
53 |
+
## Dataset Description
|
54 |
+
|
55 |
+
- **Homepage:** https://www.tensorflow.org/datasets/catalog/speech_commands
|
56 |
+
- **Repository:** [More Information Needed]
|
57 |
+
- **Paper:** [Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition](https://arxiv.org/pdf/1804.03209.pdf)
|
58 |
+
- **Leaderboard:** [More Information Needed]
|
59 |
+
- **Point of Contact:** Pete Warden, petewarden@google.com
|
60 |
+
|
61 |
+
### Dataset Summary
|
62 |
+
|
63 |
+
This is a set of one-second .wav audio files, each containing a single spoken
|
64 |
+
English word or background noise. These words are from a small set of commands, and are spoken by a
|
65 |
+
variety of different speakers. This data set is designed to help train simple
|
66 |
+
machine learning models. It is covered in more detail at [https://arxiv.org/abs/1804.03209](https://arxiv.org/abs/1804.03209).
|
67 |
+
|
68 |
+
Version 0.01 of the data set (configuration `"v0.01"`) was released on August 3rd 2017 and contains
|
69 |
+
64,727 audio files.
|
70 |
+
|
71 |
+
Version 0.02 of the data set (configuration `"v0.02"`) was released on April 11th 2018 and
|
72 |
+
contains 105,829 audio files.
|
73 |
+
|
74 |
+
|
75 |
+
### Supported Tasks and Leaderboards
|
76 |
+
|
77 |
+
* `keyword-spotting`: the dataset can be used to train and evaluate keyword
|
78 |
+
spotting systems. The task is to detect preregistered keywords by classifying utterances
|
79 |
+
into a predefined set of words. The task is usually performed on-device for the
|
80 |
+
fast response time. Thus, accuracy, model size, and inference time are all crucial.
|
81 |
+
|
82 |
+
### Languages
|
83 |
+
|
84 |
+
The language data in SpeechCommands is in English (BCP-47 `en`).
|
85 |
+
|
86 |
+
## Dataset Structure
|
87 |
+
|
88 |
+
### Data Instances
|
89 |
+
|
90 |
+
Example of a core word (`"label"` is a word, `"is_unknown"` is `False`):
|
91 |
+
```python
|
92 |
+
{
|
93 |
+
"file": "no/7846fd85_nohash_0.wav",
|
94 |
+
"audio": {
|
95 |
+
"path": "no/7846fd85_nohash_0.wav",
|
96 |
+
"array": array([ -0.00021362, -0.00027466, -0.00036621, ..., 0.00079346,
|
97 |
+
0.00091553, 0.00079346]),
|
98 |
+
"sampling_rate": 16000
|
99 |
+
},
|
100 |
+
"label": 1, # "no"
|
101 |
+
"is_unknown": False,
|
102 |
+
"speaker_id": "7846fd85",
|
103 |
+
"utterance_id": 0
|
104 |
+
}
|
105 |
+
```
|
106 |
+
|
107 |
+
Example of an auxiliary word (`"label"` is a word, `"is_unknown"` is `True`)
|
108 |
+
```python
|
109 |
+
{
|
110 |
+
"file": "tree/8b775397_nohash_0.wav",
|
111 |
+
"audio": {
|
112 |
+
"path": "tree/8b775397_nohash_0.wav",
|
113 |
+
"array": array([ -0.00854492, -0.01339722, -0.02026367, ..., 0.00274658,
|
114 |
+
0.00335693, 0.0005188]),
|
115 |
+
"sampling_rate": 16000
|
116 |
+
},
|
117 |
+
"label": 28, # "tree"
|
118 |
+
"is_unknown": True,
|
119 |
+
"speaker_id": "1b88bf70",
|
120 |
+
"utterance_id": 0
|
121 |
+
}
|
122 |
+
```
|
123 |
+
|
124 |
+
Example of background noise (`_silence_`) class:
|
125 |
+
|
126 |
+
```python
|
127 |
+
{
|
128 |
+
"file": "_silence_/doing_the_dishes.wav",
|
129 |
+
"audio": {
|
130 |
+
"path": "_silence_/doing_the_dishes.wav",
|
131 |
+
"array": array([ 0. , 0. , 0. , ..., -0.00592041,
|
132 |
+
-0.00405884, -0.00253296]),
|
133 |
+
"sampling_rate": 16000
|
134 |
+
},
|
135 |
+
"label": 30, # "_silence_"
|
136 |
+
"is_unknown": False,
|
137 |
+
"speaker_id": "None",
|
138 |
+
"utterance_id": 0 # doesn't make sense here
|
139 |
+
}
|
140 |
+
```
|
141 |
+
|
142 |
+
### Data Fields
|
143 |
+
|
144 |
+
* `file`: relative audio filename inside the original archive.
|
145 |
+
* `audio`: dictionary containing a relative audio filename,
|
146 |
+
a decoded audio array, and the sampling rate. Note that when accessing
|
147 |
+
the audio column: `dataset[0]["audio"]` the audio is automatically decoded
|
148 |
+
and resampled to `dataset.features["audio"].sampling_rate`.
|
149 |
+
Decoding and resampling of a large number of audios might take a significant
|
150 |
+
amount of time. Thus, it is important to first query the sample index before
|
151 |
+
the `"audio"` column, i.e. `dataset[0]["audio"]` should always be preferred
|
152 |
+
over `dataset["audio"][0]`.
|
153 |
+
* `label`: either word pronounced in an audio sample or background noise (`_silence_`) class.
|
154 |
+
Note that it's an integer value corresponding to the class name.
|
155 |
+
* `is_unknown`: if a word is auxiliary. Equals to `False` if a word is a core word or `_silence_`,
|
156 |
+
`True` if a word is an auxiliary word.
|
157 |
+
* `speaker_id`: unique id of a speaker. Equals to `None` if label is `_silence_`.
|
158 |
+
* `utterance_id`: incremental id of a word utterance within the same speaker.
|
159 |
+
|
160 |
+
### Data Splits
|
161 |
+
|
162 |
+
The dataset has two versions (= configurations): `"v0.01"` and `"v0.02"`. `"v0.02"`
|
163 |
+
contains more words (see section [Source Data](#source-data) for more details).
|
164 |
+
|
165 |
+
| | train | validation | test |
|
166 |
+
|----- |------:|-----------:|-----:|
|
167 |
+
| v0.01 | 51093 | 6799 | 3081 |
|
168 |
+
| v0.02 | 84848 | 9982 | 4890 |
|
169 |
+
|
170 |
+
Note that in train and validation sets examples of `_silence_` class are longer than 1 second.
|
171 |
+
You can use the following code to sample 1-second examples from the longer ones:
|
172 |
+
|
173 |
+
```python
|
174 |
+
def sample_noise(example):
|
175 |
+
# Use this function to extract random 1 sec slices of each _silence_ utterance,
|
176 |
+
# e.g. inside `torch.utils.data.Dataset.__getitem__()`
|
177 |
+
from random import randint
|
178 |
+
|
179 |
+
if example["label"] == "_silence_":
|
180 |
+
random_offset = randint(0, len(example["speech"]) - example["sample_rate"] - 1)
|
181 |
+
example["speech"] = example["speech"][random_offset : random_offset + example["sample_rate"]]
|
182 |
+
|
183 |
+
return example
|
184 |
+
```
|
185 |
+
|
186 |
+
## Dataset Creation
|
187 |
+
|
188 |
+
### Curation Rationale
|
189 |
+
|
190 |
+
The primary goal of the dataset is to provide a way to build and test small
|
191 |
+
models that can detect a single word from a set of target words and differentiate it
|
192 |
+
from background noise or unrelated speech with as few false positives as possible.
|
193 |
+
|
194 |
+
### Source Data
|
195 |
+
|
196 |
+
#### Initial Data Collection and Normalization
|
197 |
+
|
198 |
+
The audio files were collected using crowdsourcing, see
|
199 |
+
[aiyprojects.withgoogle.com/open_speech_recording](https://github.com/petewarden/extract_loudest_section)
|
200 |
+
for some of the open source audio collection code that was used. The goal was to gather examples of
|
201 |
+
people speaking single-word commands, rather than conversational sentences, so
|
202 |
+
they were prompted for individual words over the course of a five minute
|
203 |
+
session.
|
204 |
+
|
205 |
+
In version 0.01 thirty different words were recoded: "Yes", "No", "Up", "Down", "Left",
|
206 |
+
"Right", "On", "Off", "Stop", "Go", "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine",
|
207 |
+
"Bed", "Bird", "Cat", "Dog", "Happy", "House", "Marvin", "Sheila", "Tree", "Wow".
|
208 |
+
|
209 |
+
|
210 |
+
In version 0.02 more words were added: "Backward", "Forward", "Follow", "Learn", "Visual".
|
211 |
+
|
212 |
+
In both versions, ten of them are used as commands by convention: "Yes", "No", "Up", "Down", "Left",
|
213 |
+
"Right", "On", "Off", "Stop", "Go". Other words are considered to be auxiliary (in current implementation
|
214 |
+
it is marked by `True` value of `"is_unknown"` feature). Their function is to teach a model to distinguish core words
|
215 |
+
from unrecognized ones.
|
216 |
+
|
217 |
+
The `_silence_` label contains a set of longer audio clips that are either recordings or
|
218 |
+
a mathematical simulation of noise.
|
219 |
+
|
220 |
+
#### Who are the source language producers?
|
221 |
+
|
222 |
+
The audio files were collected using crowdsourcing.
|
223 |
+
|
224 |
+
### Annotations
|
225 |
+
|
226 |
+
#### Annotation process
|
227 |
+
|
228 |
+
Labels are the list of words prepared in advances.
|
229 |
+
Speakers were prompted for individual words over the course of a five minute
|
230 |
+
session.
|
231 |
+
|
232 |
+
#### Who are the annotators?
|
233 |
+
|
234 |
+
[More Information Needed]
|
235 |
+
|
236 |
+
### Personal and Sensitive Information
|
237 |
+
|
238 |
+
[More Information Needed]
|
239 |
+
|
240 |
+
## Considerations for Using the Data
|
241 |
+
|
242 |
+
### Social Impact of Dataset
|
243 |
+
|
244 |
+
[More Information Needed]
|
245 |
+
|
246 |
+
### Discussion of Biases
|
247 |
+
|
248 |
+
[More Information Needed]
|
249 |
+
|
250 |
+
### Other Known Limitations
|
251 |
+
|
252 |
+
[More Information Needed]
|
253 |
+
|
254 |
+
## Additional Information
|
255 |
+
|
256 |
+
### Dataset Curators
|
257 |
+
|
258 |
+
[More Information Needed]
|
259 |
+
|
260 |
+
### Licensing Information
|
261 |
+
|
262 |
+
Creative Commons BY 4.0 License.
|
263 |
+
|
264 |
+
### Citation Information
|
265 |
+
|
266 |
+
```
|
267 |
+
@article{speechcommandsv2,
|
268 |
+
author = { {Warden}, P.},
|
269 |
+
title = "{Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition}",
|
270 |
+
journal = {ArXiv e-prints},
|
271 |
+
archivePrefix = "arXiv",
|
272 |
+
eprint = {1804.03209},
|
273 |
+
primaryClass = "cs.CL",
|
274 |
+
keywords = {Computer Science - Computation and Language, Computer Science - Human-Computer Interaction},
|
275 |
+
year = 2018,
|
276 |
+
month = apr,
|
277 |
+
url = {https://arxiv.org/abs/1804.03209},
|
278 |
+
}
|
279 |
+
```
|
280 |
+
### Contributions
|
281 |
+
|
282 |
+
Thanks to [@polinaeterna](https://github.com/polinaeterna) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"v0.01": {"description": "\nThis is a set of one-second .wav audio files, each containing a single spoken\nEnglish word or background noise. These words are from a small set of commands, and are spoken by a\nvariety of different speakers. This data set is designed to help train simple\nmachine learning models. This dataset is covered in more detail at\n[https://arxiv.org/abs/1804.03209](https://arxiv.org/abs/1804.03209).\n\nVersion 0.01 of the data set (configuration `\"v0.01\"`) was released on August 3rd 2017 and contains\n64,727 audio files.\n\nIn version 0.01 thirty different words were recoded: \"Yes\", \"No\", \"Up\", \"Down\", \"Left\",\n\"Right\", \"On\", \"Off\", \"Stop\", \"Go\", \"Zero\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\",\n\"Bed\", \"Bird\", \"Cat\", \"Dog\", \"Happy\", \"House\", \"Marvin\", \"Sheila\", \"Tree\", \"Wow\".\n\n\nIn version 0.02 more words were added: \"Backward\", \"Forward\", \"Follow\", \"Learn\", \"Visual\".\n\nIn both versions, ten of them are used as commands by convention: \"Yes\", \"No\", \"Up\", \"Down\", \"Left\",\n\"Right\", \"On\", \"Off\", \"Stop\", \"Go\". Other words are considered to be auxiliary (in current implementation\nit is marked by `True` value of `\"is_unknown\"` feature). Their function is to teach a model to distinguish core words\nfrom unrecognized ones.\n\nThe `_silence_` class contains a set of longer audio clips that are either recordings or\na mathematical simulation of noise.\n\n", "citation": "\n@article{speechcommandsv2,\n author = { {Warden}, P.},\n title = \"{Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition}\",\n journal = {ArXiv e-prints},\n archivePrefix = \"arXiv\",\n eprint = {1804.03209},\n primaryClass = \"cs.CL\",\n keywords = {Computer Science - Computation and Language, Computer Science - Human-Computer Interaction},\n year = 2018,\n month = apr,\n url = {https://arxiv.org/abs/1804.03209},\n}\n", "homepage": "https://www.tensorflow.org/datasets/catalog/speech_commands", "license": "Creative Commons BY 4.0 License", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "audio": {"sampling_rate": 16000, "mono": true, "_storage_dtype": "struct", "id": null, "_type": "Audio"}, "label": {"num_classes": 31, "names": ["yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "bed", "bird", "cat", "dog", "happy", "house", "marvin", "sheila", "tree", "wow", "_silence_"], "names_file": null, "id": null, "_type": "ClassLabel"}, "is_unknown": {"dtype": "bool", "id": null, "_type": "Value"}, "speaker_id": {"dtype": "string", "id": null, "_type": "Value"}, "utterance_id": {"dtype": "int8", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "speech_commands", "config_name": "v0.01", "version": {"version_str": "0.1.0", "description": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1626283624, "num_examples": 51093, "dataset_name": "speech_commands"}, "validation": {"name": "validation", "num_bytes": 217204539, "num_examples": 6799, "dataset_name": "speech_commands"}, "test": {"name": "test", "num_bytes": 98979965, "num_examples": 3081, "dataset_name": "speech_commands"}}, "download_checksums": {"https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/v0.01/v0.01_train.tar.gz": {"num_bytes": 1176079446, "checksum": "41e4893c0750e576fae0b9c2bb066f6b93b8b7be7be58c60faf037835e7ccb3b"}, "https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/v0.01/v0.01_validation.tar.gz": {"num_bytes": 153663590, "checksum": "8f9e1dd79699be3b34552960aa03af1e1c24b4ee014ca28d18d01faca72e1dc0"}, "https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/v0.01/v0.01_test.tar.gz": {"num_bytes": 124959719, "checksum": "0ccb217235db6b9e12a3ba3436180bac56d488155ce857614d14584d2b6a3546"}}, "download_size": 1454702755, "post_processing_size": null, "dataset_size": 1942468128, "size_in_bytes": 3397170883}, "v0.02": {"description": "\nThis is a set of one-second .wav audio files, each containing a single spoken\nEnglish word or background noise. These words are from a small set of commands, and are spoken by a\nvariety of different speakers. This data set is designed to help train simple\nmachine learning models. This dataset is covered in more detail at\n[https://arxiv.org/abs/1804.03209](https://arxiv.org/abs/1804.03209).\n\nVersion 0.01 of the data set (configuration `\"v0.01\"`) was released on August 3rd 2017 and contains\n64,727 audio files.\n\nIn version 0.01 thirty different words were recoded: \"Yes\", \"No\", \"Up\", \"Down\", \"Left\",\n\"Right\", \"On\", \"Off\", \"Stop\", \"Go\", \"Zero\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\",\n\"Bed\", \"Bird\", \"Cat\", \"Dog\", \"Happy\", \"House\", \"Marvin\", \"Sheila\", \"Tree\", \"Wow\".\n\n\nIn version 0.02 more words were added: \"Backward\", \"Forward\", \"Follow\", \"Learn\", \"Visual\".\n\nIn both versions, ten of them are used as commands by convention: \"Yes\", \"No\", \"Up\", \"Down\", \"Left\",\n\"Right\", \"On\", \"Off\", \"Stop\", \"Go\". Other words are considered to be auxiliary (in current implementation\nit is marked by `True` value of `\"is_unknown\"` feature). Their function is to teach a model to distinguish core words\nfrom unrecognized ones.\n\nThe `_silence_` class contains a set of longer audio clips that are either recordings or\na mathematical simulation of noise.\n\n", "citation": "\n@article{speechcommandsv2,\n author = { {Warden}, P.},\n title = \"{Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition}\",\n journal = {ArXiv e-prints},\n archivePrefix = \"arXiv\",\n eprint = {1804.03209},\n primaryClass = \"cs.CL\",\n keywords = {Computer Science - Computation and Language, Computer Science - Human-Computer Interaction},\n year = 2018,\n month = apr,\n url = {https://arxiv.org/abs/1804.03209},\n}\n", "homepage": "https://www.tensorflow.org/datasets/catalog/speech_commands", "license": "Creative Commons BY 4.0 License", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "audio": {"sampling_rate": 16000, "mono": true, "_storage_dtype": "struct", "id": null, "_type": "Audio"}, "label": {"num_classes": 36, "names": ["yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "bed", "bird", "cat", "dog", "happy", "house", "marvin", "sheila", "tree", "wow", "backward", "forward", "follow", "learn", "visual", "_silence_"], "names_file": null, "id": null, "_type": "ClassLabel"}, "is_unknown": {"dtype": "bool", "id": null, "_type": "Value"}, "speaker_id": {"dtype": "string", "id": null, "_type": "Value"}, "utterance_id": {"dtype": "int8", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "speech_commands", "config_name": "v0.02", "version": {"version_str": "0.2.0", "description": null, "major": 0, "minor": 2, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2684381672, "num_examples": 84848, "dataset_name": "speech_commands"}, "validation": {"name": "validation", "num_bytes": 316435178, "num_examples": 9982, "dataset_name": "speech_commands"}, "test": {"name": "test", "num_bytes": 157096106, "num_examples": 4890, "dataset_name": "speech_commands"}}, "download_checksums": {"https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/v0.02/v0.02_train.tar.gz": {"num_bytes": 1944462432, "checksum": "acfc1a9e5f020ef5d20f13bb5c1035dcc19a3cc6d5fd1fe775d99814ce840399"}, "https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/v0.02/v0.02_validation.tar.gz": {"num_bytes": 229117586, "checksum": "868bdecd3dc12276ee55d2aeca5b1f02d913d6f17875181c1bf9d465fa2f7be1"}, "https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/v0.02/v0.02_test.tar.gz": {"num_bytes": 112395851, "checksum": "45aedb39cb2c9f03e098a8d5c98350d6d8473c432ad4558fce26c6feb478a812"}}, "download_size": 2285975869, "post_processing_size": null, "dataset_size": 3157912956, "size_in_bytes": 5443888825}}
|
dummy/v0.01/0.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39ca9ffcaa077c432fc12db15f532bd64763809cbe96743e8719647cba993137
|
3 |
+
size 3159718
|
dummy/v0.02/0.2.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bb7ec694a31b76eddaf8a026a2ff077a5e50e17aeb51f678aeaf170067f294f9
|
3 |
+
size 3346327
|
speech_commands.py
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
"""Speech Commands, an audio dataset of spoken words designed to help train and evaluate keyword spotting systems. """
|
17 |
+
|
18 |
+
|
19 |
+
import textwrap
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """
|
25 |
+
@article{speechcommandsv2,
|
26 |
+
author = { {Warden}, P.},
|
27 |
+
title = "{Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition}",
|
28 |
+
journal = {ArXiv e-prints},
|
29 |
+
archivePrefix = "arXiv",
|
30 |
+
eprint = {1804.03209},
|
31 |
+
primaryClass = "cs.CL",
|
32 |
+
keywords = {Computer Science - Computation and Language, Computer Science - Human-Computer Interaction},
|
33 |
+
year = 2018,
|
34 |
+
month = apr,
|
35 |
+
url = {https://arxiv.org/abs/1804.03209},
|
36 |
+
}
|
37 |
+
"""
|
38 |
+
|
39 |
+
_DESCRIPTION = """
|
40 |
+
This is a set of one-second .wav audio files, each containing a single spoken
|
41 |
+
English word or background noise. These words are from a small set of commands, and are spoken by a
|
42 |
+
variety of different speakers. This data set is designed to help train simple
|
43 |
+
machine learning models. This dataset is covered in more detail at
|
44 |
+
[https://arxiv.org/abs/1804.03209](https://arxiv.org/abs/1804.03209).
|
45 |
+
|
46 |
+
Version 0.01 of the data set (configuration `"v0.01"`) was released on August 3rd 2017 and contains
|
47 |
+
64,727 audio files.
|
48 |
+
|
49 |
+
In version 0.01 thirty different words were recoded: "Yes", "No", "Up", "Down", "Left",
|
50 |
+
"Right", "On", "Off", "Stop", "Go", "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine",
|
51 |
+
"Bed", "Bird", "Cat", "Dog", "Happy", "House", "Marvin", "Sheila", "Tree", "Wow".
|
52 |
+
|
53 |
+
|
54 |
+
In version 0.02 more words were added: "Backward", "Forward", "Follow", "Learn", "Visual".
|
55 |
+
|
56 |
+
In both versions, ten of them are used as commands by convention: "Yes", "No", "Up", "Down", "Left",
|
57 |
+
"Right", "On", "Off", "Stop", "Go". Other words are considered to be auxiliary (in current implementation
|
58 |
+
it is marked by `True` value of `"is_unknown"` feature). Their function is to teach a model to distinguish core words
|
59 |
+
from unrecognized ones.
|
60 |
+
|
61 |
+
The `_silence_` class contains a set of longer audio clips that are either recordings or
|
62 |
+
a mathematical simulation of noise.
|
63 |
+
|
64 |
+
"""
|
65 |
+
|
66 |
+
_LICENSE = "Creative Commons BY 4.0 License"
|
67 |
+
|
68 |
+
_URL = "https://www.tensorflow.org/datasets/catalog/speech_commands"
|
69 |
+
|
70 |
+
_DL_URL = "https://s3.amazonaws.com/datasets.huggingface.co/SpeechCommands/{name}/{name}_{split}.tar.gz"
|
71 |
+
|
72 |
+
WORDS = [
|
73 |
+
"yes",
|
74 |
+
"no",
|
75 |
+
"up",
|
76 |
+
"down",
|
77 |
+
"left",
|
78 |
+
"right",
|
79 |
+
"on",
|
80 |
+
"off",
|
81 |
+
"stop",
|
82 |
+
"go",
|
83 |
+
]
|
84 |
+
|
85 |
+
UNKNOWN_WORDS_V1 = [
|
86 |
+
"zero",
|
87 |
+
"one",
|
88 |
+
"two",
|
89 |
+
"three",
|
90 |
+
"four",
|
91 |
+
"five",
|
92 |
+
"six",
|
93 |
+
"seven",
|
94 |
+
"eight",
|
95 |
+
"nine",
|
96 |
+
"bed",
|
97 |
+
"bird",
|
98 |
+
"cat",
|
99 |
+
"dog",
|
100 |
+
"happy",
|
101 |
+
"house",
|
102 |
+
"marvin",
|
103 |
+
"sheila",
|
104 |
+
"tree",
|
105 |
+
"wow",
|
106 |
+
]
|
107 |
+
|
108 |
+
UNKNOWN_WORDS_V2 = UNKNOWN_WORDS_V1 + [
|
109 |
+
"backward",
|
110 |
+
"forward",
|
111 |
+
"follow",
|
112 |
+
"learn",
|
113 |
+
"visual",
|
114 |
+
]
|
115 |
+
|
116 |
+
SILENCE = "_silence_" # background noise
|
117 |
+
LABELS_V1 = WORDS + UNKNOWN_WORDS_V1 + [SILENCE]
|
118 |
+
LABELS_V2 = WORDS + UNKNOWN_WORDS_V2 + [SILENCE]
|
119 |
+
|
120 |
+
|
121 |
+
class SpeechCommandsConfig(datasets.BuilderConfig):
|
122 |
+
"""BuilderConfig for SpeechCommands."""
|
123 |
+
|
124 |
+
def __init__(self, labels, **kwargs):
|
125 |
+
super(SpeechCommandsConfig, self).__init__(**kwargs)
|
126 |
+
self.labels = labels
|
127 |
+
|
128 |
+
|
129 |
+
class SpeechCommands(datasets.GeneratorBasedBuilder):
|
130 |
+
BUILDER_CONFIGS = [
|
131 |
+
SpeechCommandsConfig(
|
132 |
+
name="v0.01",
|
133 |
+
description=textwrap.dedent(
|
134 |
+
"""\
|
135 |
+
Version 0.01 of the SpeechCommands dataset. Contains 30 words
|
136 |
+
(20 of them are auxiliary) and background noise.
|
137 |
+
"""
|
138 |
+
),
|
139 |
+
labels=LABELS_V1,
|
140 |
+
version=datasets.Version("0.1.0"),
|
141 |
+
),
|
142 |
+
SpeechCommandsConfig(
|
143 |
+
name="v0.02",
|
144 |
+
description=textwrap.dedent(
|
145 |
+
"""\
|
146 |
+
Version 0.02 of the SpeechCommands dataset.
|
147 |
+
Contains 35 words (25 of them are auxiliary) and background noise.
|
148 |
+
"""
|
149 |
+
),
|
150 |
+
labels=LABELS_V2,
|
151 |
+
version=datasets.Version("0.2.0"),
|
152 |
+
),
|
153 |
+
]
|
154 |
+
|
155 |
+
def _info(self):
|
156 |
+
return datasets.DatasetInfo(
|
157 |
+
description=_DESCRIPTION,
|
158 |
+
features=datasets.Features(
|
159 |
+
{
|
160 |
+
"file": datasets.Value("string"),
|
161 |
+
"audio": datasets.features.Audio(sampling_rate=16_000),
|
162 |
+
"label": datasets.ClassLabel(names=self.config.labels),
|
163 |
+
"is_unknown": datasets.Value("bool"),
|
164 |
+
"speaker_id": datasets.Value("string"),
|
165 |
+
"utterance_id": datasets.Value("int8"),
|
166 |
+
}
|
167 |
+
),
|
168 |
+
homepage=_URL,
|
169 |
+
citation=_CITATION,
|
170 |
+
license=_LICENSE,
|
171 |
+
version=self.config.version,
|
172 |
+
)
|
173 |
+
|
174 |
+
def _split_generators(self, dl_manager):
|
175 |
+
|
176 |
+
archive_paths = dl_manager.download(
|
177 |
+
{
|
178 |
+
"train": _DL_URL.format(name=self.config.name, split="train"),
|
179 |
+
"validation": _DL_URL.format(name=self.config.name, split="validation"),
|
180 |
+
"test": _DL_URL.format(name=self.config.name, split="test"),
|
181 |
+
}
|
182 |
+
)
|
183 |
+
|
184 |
+
return [
|
185 |
+
datasets.SplitGenerator(
|
186 |
+
name=datasets.Split.TRAIN,
|
187 |
+
gen_kwargs={
|
188 |
+
"archive": dl_manager.iter_archive(archive_paths["train"]),
|
189 |
+
},
|
190 |
+
),
|
191 |
+
datasets.SplitGenerator(
|
192 |
+
name=datasets.Split.VALIDATION,
|
193 |
+
gen_kwargs={
|
194 |
+
"archive": dl_manager.iter_archive(archive_paths["validation"]),
|
195 |
+
},
|
196 |
+
),
|
197 |
+
datasets.SplitGenerator(
|
198 |
+
name=datasets.Split.TEST,
|
199 |
+
gen_kwargs={
|
200 |
+
"archive": dl_manager.iter_archive(archive_paths["test"]),
|
201 |
+
},
|
202 |
+
),
|
203 |
+
]
|
204 |
+
|
205 |
+
def _generate_examples(self, archive):
|
206 |
+
for path, file in archive:
|
207 |
+
if not path.endswith(".wav"):
|
208 |
+
continue
|
209 |
+
|
210 |
+
word, audio_filename = path.split("/")
|
211 |
+
is_unknown = False
|
212 |
+
|
213 |
+
if word == SILENCE:
|
214 |
+
speaker_id, utterance_id = None, 0
|
215 |
+
|
216 |
+
else: # word is either in WORDS or unknown
|
217 |
+
if word not in WORDS:
|
218 |
+
is_unknown = True
|
219 |
+
# an audio filename looks like `0bac8a71_nohash_0.wav`
|
220 |
+
speaker_id, _, utterance_id = audio_filename.split(".wav")[0].split("_")
|
221 |
+
|
222 |
+
yield path, {
|
223 |
+
"file": path,
|
224 |
+
"audio": {"path": path, "bytes": file.read()},
|
225 |
+
"label": word,
|
226 |
+
"is_unknown": is_unknown,
|
227 |
+
"speaker_id": speaker_id,
|
228 |
+
"utterance_id": utterance_id,
|
229 |
+
}
|