speech-test commited on
Commit
ca73f1c
1 Parent(s): 028da04
README.md ADDED
@@ -0,0 +1,542 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - other
4
+ language_creators:
5
+ - other
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: SUPERB
13
+ size_categories:
14
+ - unknown
15
+ source_datasets:
16
+ - original
17
+ - extended|librispeech_asr
18
+ - extended|other-librimix
19
+ - extended|other-speech_commands
20
+ task_categories:
21
+ - speech-processing
22
+ task_ids:
23
+ - automatic-speech-recognition
24
+ - phoneme-recognition
25
+ - keyword-spotting
26
+ - query-by-example-spoken-term-detection
27
+ - speaker-identification
28
+ - automatic-speaker-verification
29
+ - speaker-diarization
30
+ - intent-classification
31
+ - slot-filling
32
+ - emotion-recognition
33
+ ---
34
+
35
+ # Dataset Card for SUPERB
36
+
37
+ ## Table of Contents
38
+ - [Table of Contents](#table-of-contents)
39
+ - [Dataset Description](#dataset-description)
40
+ - [Dataset Summary](#dataset-summary)
41
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
42
+ - [Languages](#languages)
43
+ - [Dataset Structure](#dataset-structure)
44
+ - [Data Instances](#data-instances)
45
+ - [Data Fields](#data-fields)
46
+ - [Data Splits](#data-splits)
47
+ - [Dataset Creation](#dataset-creation)
48
+ - [Curation Rationale](#curation-rationale)
49
+ - [Source Data](#source-data)
50
+ - [Annotations](#annotations)
51
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
52
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
53
+ - [Social Impact of Dataset](#social-impact-of-dataset)
54
+ - [Discussion of Biases](#discussion-of-biases)
55
+ - [Other Known Limitations](#other-known-limitations)
56
+ - [Additional Information](#additional-information)
57
+ - [Dataset Curators](#dataset-curators)
58
+ - [Licensing Information](#licensing-information)
59
+ - [Citation Information](#citation-information)
60
+ - [Contributions](#contributions)
61
+
62
+ ## Dataset Description
63
+
64
+ - **Homepage:** [http://superbbenchmark.org](http://superbbenchmark.org)
65
+ - **Repository:** [https://github.com/s3prl/s3prl](https://github.com/s3prl/s3prl)
66
+ - **Paper:** [SUPERB: Speech processing Universal PERformance Benchmark](https://arxiv.org/abs/2105.01051)
67
+ - **Leaderboard:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
68
+ - **Point of Contact:** [Lewis Tunstall](mailto:lewis@huggingface.co) and [Albert Villanova](mailto:albert@huggingface.co)
69
+
70
+ ### Dataset Summary
71
+
72
+ SUPERB is a leaderboard to benchmark the performance of a shared model across a wide range of speech processing tasks with minimal architecture changes and labeled data.
73
+
74
+ ### Supported Tasks and Leaderboards
75
+
76
+ The SUPERB leaderboard can be found here https://superbbenchmark.org/leaderboard and consists of the following tasks:
77
+
78
+ #### pr
79
+
80
+ Phoneme Recognition (PR) transcribes an utterance into the smallest content units. This task includes alignment modeling to avoid potentially inaccurate forced alignment. [LibriSpeech](https://huggingface.co/datasets/librispeech_asr) train-clean-100/dev-clean/test-clean subsets are adopted in SUPERB for training/validation/testing. Phoneme transcriptions are obtained from the LibriSpeech official g2p-model-5 and the conversion script in Kaldi librispeech s5 recipe. The evaluation metric is phone error rate (PER).
81
+
82
+ #### asr
83
+
84
+ Automatic Speech Recognition (ASR) transcribes utterances into words. While PR analyzes the improvement in modeling phonetics, ASR reflects the significance of the improvement in a real-world scenario. [LibriSpeech](https://huggingface.co/datasets/librispeech_asr) train-clean-100/devclean/test-clean subsets are used for training/validation/testing. The evaluation metric is word error rate (WER).
85
+
86
+ #### ks
87
+
88
+ Keyword Spotting (KS) detects preregistered keywords by classifying utterances into a predefined set of words. The task is usually performed on-device for the fast response time. Thus, accuracy, model size, and inference time are all crucial. SUPERB uses the widely used [Speech Commands dataset v1.0](https://www.tensorflow.org/datasets/catalog/speech_commands) for the task. The dataset consists of ten classes of keywords, a class for silence, and an unknown class to include the false positive. The evaluation metric is accuracy (ACC)
89
+
90
+ ##### Example of usage:
91
+
92
+ Use these auxillary functions to:
93
+ - load the audio file into an audio data array
94
+ - sample from long `_silence_` audio clips
95
+
96
+ For other examples of handling long `_silence_` clips see the [S3PRL](https://github.com/s3prl/s3prl/blob/099ce807a6ffa6bf2482ceecfcaf83dea23da355/s3prl/downstream/speech_commands/dataset.py#L80)
97
+ or [TFDS](https://github.com/tensorflow/datasets/blob/6b8cfdb7c3c0a04e731caaa8660ce948d0a67b1e/tensorflow_datasets/audio/speech_commands.py#L143) implementations.
98
+
99
+ ```python
100
+ def map_to_array(example):
101
+ import soundfile as sf
102
+
103
+ speech_array, sample_rate = sf.read(example["file"])
104
+ example["speech"] = speech_array
105
+ example["sample_rate"] = sample_rate
106
+ return example
107
+
108
+
109
+ def sample_noise(example):
110
+ # Use this function to extract random 1 sec slices of each _silence_ utterance,
111
+ # e.g. inside `torch.utils.data.Dataset.__getitem__()`
112
+ from random import randint
113
+
114
+ if example["label"] == "_silence_":
115
+ random_offset = randint(0, len(example["speech"]) - example["sample_rate"] - 1)
116
+ example["speech"] = example["speech"][random_offset : random_offset + example["sample_rate"]]
117
+
118
+ return example
119
+ ```
120
+
121
+ #### qbe
122
+
123
+ Query by Example Spoken Term Detection (QbE) detects a spoken term (query) in an audio database (documents) by binary discriminating a given pair of query and document into a match or not. The English subset in [QUESST 2014 challenge](https://github.com/s3prl/s3prl/tree/master/downstream#qbe-query-by-example-spoken-term-detection) is adopted since we focus on investigating English as the first step. The evaluation metric is maximum term weighted value (MTWV) which balances misses and false alarms.
124
+
125
+ #### ic
126
+
127
+ Intent Classification (IC) classifies utterances into predefined classes to determine the intent of speakers. SUPERB uses the [Fluent Speech Commands dataset](https://github.com/s3prl/s3prl/tree/master/downstream#ic-intent-classification---fluent-speech-commands), where each utterance is tagged with three intent labels: action, object, and location. The evaluation metric is accuracy (ACC).
128
+
129
+ #### sf
130
+
131
+ Slot Filling (SF) predicts a sequence of semantic slot-types from an utterance, like a slot-type FromLocation for a spoken word Taipei, which is known as a slot-value. Both slot-types and slot-values are essential for an SLU system to function. The evaluation metrics thus include slot-type F1 score and slotvalue CER. [Audio SNIPS](https://github.com/s3prl/s3prl/tree/master/downstream#sf-end-to-end-slot-filling) is adopted, which synthesized multi-speaker utterances for SNIPS. Following the standard split in SNIPS, US-accent speakers are further selected for training, and others are for validation/testing.
132
+
133
+ #### si
134
+ Speaker Identification (SI) classifies each utterance for its speaker identity as a multi-class classification, where speakers are in the same predefined set for both training and testing. The widely used [VoxCeleb1 dataset](https://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox1.html) is adopted, and the evaluation metric is accuracy (ACC).
135
+
136
+ #### asv
137
+
138
+ Automatic Speaker Verification (ASV) verifies whether the speakers of a pair of utterances match as a binary classification, and speakers in the testing set may not appear in the training set. Thus, ASV is more challenging than SID. VoxCeleb1 is used without VoxCeleb2 training data and noise augmentation. The evaluation metric is equal error rate (EER).
139
+
140
+ #### sd
141
+
142
+ Speaker Diarization (SD) predicts *who is speaking when* for each timestamp, and multiple speakers can speak simultaneously. The model has to encode rich speaker characteristics for each frame and should be able to represent mixtures of signals. [LibriMix](https://github.com/s3prl/s3prl/tree/master/downstream#sd-speaker-diarization) is adopted where LibriSpeech train-clean-100/dev-clean/test-clean are used to generate mixtures for training/validation/testing. We focus on the two-speaker scenario as the first step. The time-coded speaker labels were generated using alignments from Kaldi LibriSpeech ASR model. The evaluation metric is diarization error rate (DER).
143
+
144
+ ##### Example of usage
145
+
146
+ Use these auxiliary functions to:
147
+ - load the audio file into an audio data array
148
+ - generate the label array
149
+
150
+ ```python
151
+ def load_audio_file(example, frame_shift=160):
152
+ import soundfile as sf
153
+
154
+ example["array"], example["sample_rate"] = sf.read(
155
+ example["file"], start=example["start"] * frame_shift, stop=example["end"] * frame_shift
156
+ )
157
+ return example
158
+
159
+
160
+ def generate_label(example, frame_shift=160, num_speakers=2, rate=16000):
161
+ import numpy as np
162
+
163
+ start = example["start"]
164
+ end = example["end"]
165
+ frame_num = end - start
166
+ speakers = sorted({speaker["speaker_id"] for speaker in example["speakers"]})
167
+ label = np.zeros((frame_num, num_speakers), dtype=np.int32)
168
+ for speaker in example["speakers"]:
169
+ speaker_index = speakers.index(speaker["speaker_id"])
170
+ start_frame = np.rint(speaker["start"] * rate / frame_shift).astype(int)
171
+ end_frame = np.rint(speaker["end"] * rate / frame_shift).astype(int)
172
+ rel_start = rel_end = None
173
+ if start <= start_frame < end:
174
+ rel_start = start_frame - start
175
+ if start < end_frame <= end:
176
+ rel_end = end_frame - start
177
+ if rel_start is not None or rel_end is not None:
178
+ label[rel_start:rel_end, speaker_index] = 1
179
+ example["label"] = label
180
+ return example
181
+ ```
182
+
183
+ #### er
184
+
185
+ Emotion Recognition (ER) predicts an emotion class for each utterance. The most widely used ER dataset [IEMOCAP](https://github.com/s3prl/s3prl/tree/master/downstream#er-emotion-recognition) is adopted, and we follow the conventional evaluation protocol: we drop the unbalance emotion classes to leave the final four classes with a similar amount of data points and cross-validates on five folds of the standard splits. The evaluation metric is accuracy (ACC).
186
+
187
+ ### Languages
188
+
189
+ The language data in SUPERB is in English (BCP-47 `en`)
190
+
191
+
192
+ ## Dataset Structure
193
+
194
+ ### Data Instances
195
+
196
+ #### pr
197
+
198
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
199
+
200
+
201
+ #### asr
202
+
203
+ An example from each split looks like:
204
+
205
+ ```python
206
+ {'chapter_id': 1240,
207
+ 'file': 'path/to/file.flac',
208
+ 'audio': {'path': 'path/to/file.flac',
209
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
210
+ 'sampling_rate': 16000},
211
+ 'id': '103-1240-0000',
212
+ 'speaker_id': 103,
213
+ 'text': 'CHAPTER ONE MISSUS RACHEL LYNDE IS SURPRISED MISSUS RACHEL LYNDE '
214
+ 'LIVED JUST WHERE THE AVONLEA MAIN ROAD DIPPED DOWN INTO A LITTLE '
215
+ 'HOLLOW FRINGED WITH ALDERS AND LADIES EARDROPS AND TRAVERSED BY A '
216
+ 'BROOK'}
217
+ ```
218
+
219
+ #### ks
220
+
221
+ An example from each split looks like:
222
+
223
+ ```python
224
+ {
225
+ 'file': '/path/yes/af7a8296_nohash_1.wav',
226
+ 'audio': {'path': '/path/yes/af7a8296_nohash_1.wav',
227
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
228
+ 'sampling_rate': 16000},
229
+ 'label': 0 # 'yes'
230
+ }
231
+ ```
232
+
233
+ #### qbe
234
+
235
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
236
+
237
+
238
+ #### ic
239
+
240
+ ```python
241
+ {
242
+ 'file': "/path/wavs/speakers/2BqVo8kVB2Skwgyb/063aa8f0-4479-11e9-a9a5-5dbec3b8816a.wav",
243
+ 'audio': {'path': '/path/wavs/speakers/2BqVo8kVB2Skwgyb/063aa8f0-4479-11e9-a9a5-5dbec3b8816a.wav',
244
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
245
+ 'sampling_rate': 16000},
246
+ 'speaker_id': '2BqVo8kVB2Skwgyb',
247
+ 'text': 'Turn the bedroom lights off',
248
+ 'action': 3, # 'deactivate'
249
+ 'object': 7, # 'lights'
250
+ 'location': 0 # 'bedroom'
251
+ }
252
+ ```
253
+
254
+ #### sf
255
+
256
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
257
+
258
+
259
+ #### si
260
+
261
+ ```python
262
+ {
263
+ 'file': '/path/wav/id10003/na8-QEFmj44/00003.wav',
264
+ 'audio': {'path': '/path/wav/id10003/na8-QEFmj44/00003.wav',
265
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
266
+ 'sampling_rate': 16000},
267
+ 'label': 2 # 'id10003'
268
+ }
269
+ ```
270
+
271
+ #### asv
272
+
273
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
274
+
275
+
276
+ #### sd
277
+
278
+ An example from each split looks like:
279
+ ```python
280
+ {
281
+ 'record_id': '1578-6379-0038_6415-111615-0009',
282
+ 'file': 'path/to/file.wav',
283
+ 'audio': {'path': 'path/to/file.wav',
284
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
285
+ 'sampling_rate': 16000},
286
+ 'start': 0,
287
+ 'end': 1590,
288
+ 'speakers': [
289
+ {'speaker_id': '1578', 'start': 28, 'end': 657},
290
+ {'speaker_id': '6415', 'start': 28, 'end': 1576}
291
+ ]
292
+ }
293
+ ```
294
+
295
+
296
+ #### er
297
+
298
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
299
+
300
+
301
+
302
+
303
+ ### Data Fields
304
+
305
+ ####Note abouth the `audio` fields
306
+
307
+ When accessing the audio column: `dataset[0]["audio"]` the audio file is automatically decoded and resampled to `dataset.features["audio"].sampling_rate`. Decoding and resampling of a large number of audio files might take a significant amount of time. Thus it is important to first query the sample index before the `"audio"` column, *i.e.* `dataset[0]["audio"]` should **always** be preferred over `dataset["audio"][0]`.
308
+
309
+ #### pr
310
+
311
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
312
+
313
+
314
+ #### asr
315
+
316
+ - `file` (`string`): Path to the WAV audio file.
317
+ - `audio` (`dict`): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate.
318
+ - `text` (`string`): The transcription of the audio file.
319
+ - `speaker_id` (`integer`): A unique ID of the speaker. The same speaker id can be found for multiple data samples.
320
+ - `chapter_id` (`integer`): ID of the audiobook chapter which includes the transcription.
321
+ - `id` (`string`): A unique ID of the data sample.
322
+
323
+ #### ks
324
+
325
+ - `file` (`string`): Path to the WAV audio file.
326
+ - `audio` (`dict`): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate.
327
+ - `label` (`ClassLabel`): Label of the spoken command. Possible values:
328
+ - `0: "yes", 1: "no", 2: "up", 3: "down", 4: "left", 5: "right", 6: "on", 7: "off", 8: "stop", 9: "go", 10: "_silence_", 11: "_unknown_"`
329
+
330
+ #### qbe
331
+
332
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
333
+
334
+ #### ic
335
+
336
+ - `file` (`string`): Path to the WAV audio file.
337
+ - `audio` (`dict`): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate.
338
+ - `speaker_id` (`string`): ID of the speaker.
339
+ - `text` (`string`): Transcription of the spoken command.
340
+ - `action` (`ClassLabel`): Label of the command's action. Possible values:
341
+ - `0: "activate", 1: "bring", 2: "change language", 3: "deactivate", 4: "decrease", 5: "increase"`
342
+ - `object` (`ClassLabel`): Label of the command's object. Possible values:
343
+ - `0: "Chinese", 1: "English", 2: "German", 3: "Korean", 4: "heat", 5: "juice", 6: "lamp", 7: "lights", 8: "music", 9: "newspaper", 10: "none", 11: "shoes", 12: "socks", 13: "volume"`
344
+ - `location` (`ClassLabel`): Label of the command's location. Possible values:
345
+ - `0: "bedroom", 1: "kitchen", 2: "none", 3: "washroom"`
346
+
347
+ #### sf
348
+
349
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
350
+
351
+
352
+ #### si
353
+
354
+ - `file` (`string`): Path to the WAV audio file.
355
+ - `audio` (`dict`): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate.
356
+ - `label` (`ClassLabel`): Label (ID) of the speaker. Possible values:
357
+ - `0: "id10001", 1: "id10002", 2: "id10003", ..., 1250: "id11251"`
358
+
359
+ #### asv
360
+
361
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
362
+
363
+
364
+ #### sd
365
+
366
+ The data fields in all splits are:
367
+ - `record_id` (`string`): ID of the record.
368
+ - `file` (`string`): Path to the WAV audio file.
369
+ - `audio` (`dict`): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate.
370
+ - `start` (`integer`): Start frame of the audio.
371
+ - `end` (`integer`): End frame of the audio.
372
+ - `speakers` (`list` of `dict`): List of speakers in the audio. Each item contains the fields:
373
+ - `speaker_id` (`string`): ID of the speaker.
374
+ - `start` (`integer`): Frame when the speaker starts speaking.
375
+ - `end` (`integer`): Frame when the speaker stops speaking.
376
+
377
+ #### er
378
+
379
+ - `file` (`string`): Path to the WAV audio file.
380
+ - `audio` (`dict`): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate.
381
+ - `label` (`ClassLabel`): Label of the speech emotion. Possible values:
382
+ - `0: "neu", 1: "hap", 2: "ang", 3: "sad"`
383
+
384
+ ### Data Splits
385
+
386
+ #### pr
387
+
388
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
389
+
390
+
391
+ #### asr
392
+
393
+ | | train | validation | test |
394
+ |-----|------:|-----------:|-----:|
395
+ | asr | 28539 | 2703 | 2620 |
396
+
397
+ #### ks
398
+
399
+ | | train | validation | test |
400
+ |----|------:|-----------:|-----:|
401
+ | ks | 51094 | 6798 | 3081 |
402
+
403
+ #### qbe
404
+
405
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
406
+
407
+
408
+ #### ic
409
+
410
+ | | train | validation | test |
411
+ |----|------:|-----------:|-----:|
412
+ | ic | 23132 | 3118 | 3793 |
413
+
414
+ #### sf
415
+
416
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
417
+
418
+
419
+ #### si
420
+
421
+ | | train | validation | test |
422
+ |----|-------:|-----------:|-----:|
423
+ | si | 138361 | 6904 | 8251 |
424
+
425
+ #### asv
426
+
427
+ [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
428
+
429
+
430
+ #### sd
431
+
432
+ The data is split into "train", "dev" and "test" sets, each containing the following number of examples:
433
+
434
+ | | train | dev | test |
435
+ |----|------:|-----:|-----:|
436
+ | sd | 13901 | 3014 | 3002 |
437
+
438
+ #### er
439
+
440
+ The data is split into 5 sets intended for 5-fold cross-validation:
441
+
442
+ | | session1 | session2 | session3 | session4 | session5 |
443
+ |----|---------:|---------:|---------:|---------:|---------:|
444
+ | er | 1085 | 1023 | 1151 | 1031 | 1241 |
445
+
446
+ ## Dataset Creation
447
+
448
+ ### Curation Rationale
449
+
450
+ [More Information Needed]
451
+
452
+ ### Source Data
453
+
454
+ #### Initial Data Collection and Normalization
455
+
456
+ [More Information Needed]
457
+
458
+ #### Who are the source language producers?
459
+
460
+ [More Information Needed]
461
+
462
+ ### Annotations
463
+
464
+ #### Annotation process
465
+
466
+ [More Information Needed]
467
+
468
+ #### Who are the annotators?
469
+
470
+ [More Information Needed]
471
+
472
+ ### Personal and Sensitive Information
473
+
474
+ [More Information Needed]
475
+
476
+ ## Considerations for Using the Data
477
+
478
+ ### Social Impact of Dataset
479
+
480
+ [More Information Needed]
481
+
482
+ ### Discussion of Biases
483
+
484
+ [More Information Needed]
485
+
486
+ ### Other Known Limitations
487
+
488
+ [More Information Needed]
489
+
490
+ ## Additional Information
491
+
492
+ ### Dataset Curators
493
+
494
+ [More Information Needed]
495
+
496
+ ### Licensing Information
497
+
498
+ [More Information Needed]
499
+
500
+ ### Citation Information
501
+
502
+ ```
503
+ @article{DBLP:journals/corr/abs-2105-01051,
504
+ author = {Shu{-}Wen Yang and
505
+ Po{-}Han Chi and
506
+ Yung{-}Sung Chuang and
507
+ Cheng{-}I Jeff Lai and
508
+ Kushal Lakhotia and
509
+ Yist Y. Lin and
510
+ Andy T. Liu and
511
+ Jiatong Shi and
512
+ Xuankai Chang and
513
+ Guan{-}Ting Lin and
514
+ Tzu{-}Hsien Huang and
515
+ Wei{-}Cheng Tseng and
516
+ Ko{-}tik Lee and
517
+ Da{-}Rong Liu and
518
+ Zili Huang and
519
+ Shuyan Dong and
520
+ Shang{-}Wen Li and
521
+ Shinji Watanabe and
522
+ Abdelrahman Mohamed and
523
+ Hung{-}yi Lee},
524
+ title = {{SUPERB:} Speech processing Universal PERformance Benchmark},
525
+ journal = {CoRR},
526
+ volume = {abs/2105.01051},
527
+ year = {2021},
528
+ url = {https://arxiv.org/abs/2105.01051},
529
+ archivePrefix = {arXiv},
530
+ eprint = {2105.01051},
531
+ timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},
532
+ biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},
533
+ bibsource = {dblp computer science bibliography, https://dblp.org}
534
+ }
535
+
536
+ Note that each SUPERB dataset has its own citation. Please see the source to see
537
+ the correct citation for each contained dataset.
538
+ ```
539
+
540
+ ### Contributions
541
+
542
+ Thanks to [@lewtun](https://github.com/lewtun), [@albertvillanova](https://github.com/albertvillanova) and [@anton-l](https://github.com/anton-l) for adding this dataset.
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"asr": {"description": "Self-supervised learning (SSL) has proven vital for advancing research in\nnatural language processing (NLP) and computer vision (CV). The paradigm\npretrains a shared model on large volumes of unlabeled data and achieves\nstate-of-the-art (SOTA) for various tasks with minimal adaptation. However, the\nspeech processing community lacks a similar setup to systematically explore the\nparadigm. To bridge this gap, we introduce Speech processing Universal\nPERformance Benchmark (SUPERB). SUPERB is a leaderboard to benchmark the\nperformance of a shared model across a wide range of speech processing tasks\nwith minimal architecture changes and labeled data. Among multiple usages of the\nshared model, we especially focus on extracting the representation learned from\nSSL due to its preferable re-usability. We present a simple framework to solve\nSUPERB tasks by learning task-specialized lightweight prediction heads on top of\nthe frozen shared model. Our results demonstrate that the framework is promising\nas SSL representations show competitive generalizability and accessibility\nacross SUPERB tasks. We release SUPERB as a challenge with a leaderboard and a\nbenchmark toolkit to fuel the research in representation learning and general\nspeech processing.\n\nNote that in order to limit the required storage for preparing this dataset, the\naudio is stored in the .wav format and is not converted to a float32 array. To\nconvert the audio file to a float32 array, please make use of the `.map()`\nfunction as follows:\n\n\n```python\nimport soundfile as sf\n\ndef map_to_array(batch):\n speech_array, _ = sf.read(batch[\"file\"])\n batch[\"speech\"] = speech_array\n return batch\n\ndataset = dataset.map(map_to_array, remove_columns=[\"file\"])\n```\n", "citation": "@article{DBLP:journals/corr/abs-2105-01051,\n author = {Shu{-}Wen Yang and\n Po{-}Han Chi and\n Yung{-}Sung Chuang and\n Cheng{-}I Jeff Lai and\n Kushal Lakhotia and\n Yist Y. Lin and\n Andy T. Liu and\n Jiatong Shi and\n Xuankai Chang and\n Guan{-}Ting Lin and\n Tzu{-}Hsien Huang and\n Wei{-}Cheng Tseng and\n Ko{-}tik Lee and\n Da{-}Rong Liu and\n Zili Huang and\n Shuyan Dong and\n Shang{-}Wen Li and\n Shinji Watanabe and\n Abdelrahman Mohamed and\n Hung{-}yi Lee},\n title = {{SUPERB:} Speech processing Universal PERformance Benchmark},\n journal = {CoRR},\n volume = {abs/2105.01051},\n year = {2021},\n url = {https://arxiv.org/abs/2105.01051},\n archivePrefix = {arXiv},\n eprint = {2105.01051},\n timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},\n biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n", "homepage": "http://www.openslr.org/12", "license": "", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "speaker_id": {"dtype": "int64", "id": null, "_type": "Value"}, "chapter_id": {"dtype": "int64", "id": null, "_type": "Value"}, "id": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "file", "output": "text"}, "task_templates": [{"task": "automatic-speech-recognition", "audio_file_path_column": "file", "transcription_column": "text"}], "builder_name": "superb", "config_name": "asr", "version": {"version_str": "1.9.0", "description": "", "major": 1, "minor": 9, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 11852430, "num_examples": 28539, "dataset_name": "superb"}, "validation": {"name": "validation", "num_bytes": 897213, "num_examples": 2703, "dataset_name": "superb"}, "test": {"name": "test", "num_bytes": 871234, "num_examples": 2620, "dataset_name": "superb"}}, "download_checksums": {"http://www.openslr.org/resources/12/dev-clean.tar.gz": {"num_bytes": 337926286, "checksum": "76f87d090650617fca0cac8f88b9416e0ebf80350acb97b343a85fa903728ab3"}, "http://www.openslr.org/resources/12/test-clean.tar.gz": {"num_bytes": 346663984, "checksum": "39fde525e59672dc6d1551919b1478f724438a95aa55f874b576be21967e6c23"}, "http://www.openslr.org/resources/12/train-clean-100.tar.gz": {"num_bytes": 6387309499, "checksum": "d4ddd1d5a6ab303066f14971d768ee43278a5f2a0aa43dc716b0e64ecbbbf6e2"}}, "download_size": 7071899769, "post_processing_size": null, "dataset_size": 13620877, "size_in_bytes": 7085520646}, "sd": {"description": "Self-supervised learning (SSL) has proven vital for advancing research in\nnatural language processing (NLP) and computer vision (CV). The paradigm\npretrains a shared model on large volumes of unlabeled data and achieves\nstate-of-the-art (SOTA) for various tasks with minimal adaptation. However, the\nspeech processing community lacks a similar setup to systematically explore the\nparadigm. To bridge this gap, we introduce Speech processing Universal\nPERformance Benchmark (SUPERB). SUPERB is a leaderboard to benchmark the\nperformance of a shared model across a wide range of speech processing tasks\nwith minimal architecture changes and labeled data. Among multiple usages of the\nshared model, we especially focus on extracting the representation learned from\nSSL due to its preferable re-usability. We present a simple framework to solve\nSUPERB tasks by learning task-specialized lightweight prediction heads on top of\nthe frozen shared model. Our results demonstrate that the framework is promising\nas SSL representations show competitive generalizability and accessibility\nacross SUPERB tasks. We release SUPERB as a challenge with a leaderboard and a\nbenchmark toolkit to fuel the research in representation learning and general\nspeech processing.\n\nNote that in order to limit the required storage for preparing this dataset, the\naudio is stored in the .flac format and is not converted to a float32 array. To\nconvert, the audio file to a float32 array, please make use of the `.map()`\nfunction as follows:\n\n\n```python\nimport soundfile as sf\n\ndef map_to_array(batch):\n speech_array, _ = sf.read(batch[\"file\"])\n batch[\"speech\"] = speech_array\n return batch\n\ndataset = dataset.map(map_to_array, remove_columns=[\"file\"])\n```\n", "citation": "@article{DBLP:journals/corr/abs-2105-01051,\n author = {Shu{-}Wen Yang and\n Po{-}Han Chi and\n Yung{-}Sung Chuang and\n Cheng{-}I Jeff Lai and\n Kushal Lakhotia and\n Yist Y. Lin and\n Andy T. Liu and\n Jiatong Shi and\n Xuankai Chang and\n Guan{-}Ting Lin and\n Tzu{-}Hsien Huang and\n Wei{-}Cheng Tseng and\n Ko{-}tik Lee and\n Da{-}Rong Liu and\n Zili Huang and\n Shuyan Dong and\n Shang{-}Wen Li and\n Shinji Watanabe and\n Abdelrahman Mohamed and\n Hung{-}yi Lee},\n title = {{SUPERB:} Speech processing Universal PERformance Benchmark},\n journal = {CoRR},\n volume = {abs/2105.01051},\n year = {2021},\n url = {https://arxiv.org/abs/2105.01051},\n archivePrefix = {arXiv},\n eprint = {2105.01051},\n timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},\n biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n", "homepage": "https://github.com/ftshijt/LibriMix", "license": "", "features": {"record_id": {"dtype": "string", "id": null, "_type": "Value"}, "file": {"dtype": "string", "id": null, "_type": "Value"}, "start": {"dtype": "int64", "id": null, "_type": "Value"}, "end": {"dtype": "int64", "id": null, "_type": "Value"}, "speakers": [{"speaker_id": {"dtype": "string", "id": null, "_type": "Value"}, "start": {"dtype": "int64", "id": null, "_type": "Value"}, "end": {"dtype": "int64", "id": null, "_type": "Value"}}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "superb", "config_name": "sd", "version": {"version_str": "1.9.0", "description": "", "major": 1, "minor": 9, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4622013, "num_examples": 13901, "dataset_name": "superb"}, "dev": {"name": "dev", "num_bytes": 860472, "num_examples": 3014, "dataset_name": "superb"}, "test": {"name": "test", "num_bytes": 847803, "num_examples": 3002, "dataset_name": "superb"}}, "download_checksums": {"https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/train/reco2dur": {"num_bytes": 540906, "checksum": "879dca4b1108c93bd86df879463fca15a4de42a0f95a7e6987138dc6029b5554"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/train/segments": {"num_bytes": 5723993, "checksum": "f19cb0ecc342f8d2cd855118879a111822d7cf55fcd078ef156f5147233a8e11"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/train/utt2spk": {"num_bytes": 3165995, "checksum": "a4295726caf05d72f5ad24706180b9dbccffe6c0c2fc0128ca4b02b7b828a28a"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/train/wav.zip": {"num_bytes": 5706733518, "checksum": "4231070427ffbc9b3bddae874dba32f3985a0db0b0feb4dfa29ed4d1d11bf41b"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/dev/reco2dur": {"num_bytes": 115918, "checksum": "a30fd59ad01db0315a82cad7a64baea009e6c2bcdfb6b2501bc8873ede72de06"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/dev/segments": {"num_bytes": 673006, "checksum": "2b977917e7ab9feec03afb4fd6a4662df90e48dbcc42977a4b9c89c8d40432ee"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/dev/utt2spk": {"num_bytes": 374794, "checksum": "9f47a7bed76e7a03e57d66ba9cc5f57d85d91f748d0b1eb20301d09e6c24cd20"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/dev/wav.zip": {"num_bytes": 765594100, "checksum": "e28b3422ce59e2a5273be924e6ed6b8f115c0983db1997e56441973c27ee1cd8"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/test/reco2dur": {"num_bytes": 113357, "checksum": "6e013d917015031e2f1383871b52dfc1122e7b16cdee53bd8e5e0a7fbc57e406"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/test/segments": {"num_bytes": 650742, "checksum": "92f8de0f56c55a34e9111542c24ea13f2d2efaf9ebe64af31250cadab020f987"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/test/utt2spk": {"num_bytes": 361548, "checksum": "19dcb558aa886f0d553d8d9b8735ea1998b83e96d5245e5511cb732c84625ffd"}, "https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/test/wav.zip": {"num_bytes": 706322334, "checksum": "9c8ee97d3068759c0101bf88684abab77183374dbb3bb40f7c0b25d385992ea6"}}, "download_size": 7190370211, "post_processing_size": null, "dataset_size": 6330288, "size_in_bytes": 7196700499}, "ks": {"description": "Self-supervised learning (SSL) has proven vital for advancing research in\nnatural language processing (NLP) and computer vision (CV). The paradigm\npretrains a shared model on large volumes of unlabeled data and achieves\nstate-of-the-art (SOTA) for various tasks with minimal adaptation. However, the\nspeech processing community lacks a similar setup to systematically explore the\nparadigm. To bridge this gap, we introduce Speech processing Universal\nPERformance Benchmark (SUPERB). SUPERB is a leaderboard to benchmark the\nperformance of a shared model across a wide range of speech processing tasks\nwith minimal architecture changes and labeled data. Among multiple usages of the\nshared model, we especially focus on extracting the representation learned from\nSSL due to its preferable re-usability. We present a simple framework to solve\nSUPERB tasks by learning task-specialized lightweight prediction heads on top of\nthe frozen shared model. Our results demonstrate that the framework is promising\nas SSL representations show competitive generalizability and accessibility\nacross SUPERB tasks. We release SUPERB as a challenge with a leaderboard and a\nbenchmark toolkit to fuel the research in representation learning and general\nspeech processing.\n\nNote that in order to limit the required storage for preparing this dataset, the\naudio is stored in the .wav format and is not converted to a float32 array. To\nconvert the audio file to a float32 array, please make use of the `.map()`\nfunction as follows:\n\n\n```python\nimport soundfile as sf\n\ndef map_to_array(batch):\n speech_array, _ = sf.read(batch[\"file\"])\n batch[\"speech\"] = speech_array\n return batch\n\ndataset = dataset.map(map_to_array, remove_columns=[\"file\"])\n```\n", "citation": "@article{DBLP:journals/corr/abs-2105-01051,\n author = {Shu{-}Wen Yang and\n Po{-}Han Chi and\n Yung{-}Sung Chuang and\n Cheng{-}I Jeff Lai and\n Kushal Lakhotia and\n Yist Y. Lin and\n Andy T. Liu and\n Jiatong Shi and\n Xuankai Chang and\n Guan{-}Ting Lin and\n Tzu{-}Hsien Huang and\n Wei{-}Cheng Tseng and\n Ko{-}tik Lee and\n Da{-}Rong Liu and\n Zili Huang and\n Shuyan Dong and\n Shang{-}Wen Li and\n Shinji Watanabe and\n Abdelrahman Mohamed and\n Hung{-}yi Lee},\n title = {{SUPERB:} Speech processing Universal PERformance Benchmark},\n journal = {CoRR},\n volume = {abs/2105.01051},\n year = {2021},\n url = {https://arxiv.org/abs/2105.01051},\n archivePrefix = {arXiv},\n eprint = {2105.01051},\n timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},\n biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n", "homepage": "https://www.tensorflow.org/datasets/catalog/speech_commands", "license": "", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 12, "names": ["yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go", "_silence_", "_unknown_"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "file", "output": "label"}, "task_templates": null, "builder_name": "superb", "config_name": "ks", "version": {"version_str": "1.9.0", "description": "", "major": 1, "minor": 9, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8467781, "num_examples": 51094, "dataset_name": "superb"}, "validation": {"name": "validation", "num_bytes": 1126476, "num_examples": 6798, "dataset_name": "superb"}, "test": {"name": "test", "num_bytes": 510619, "num_examples": 3081, "dataset_name": "superb"}}, "download_checksums": {"http://download.tensorflow.org/data/speech_commands_v0.01.tar.gz": {"num_bytes": 1489096277, "checksum": "743935421bb51cccdb6bdd152e04c5c70274e935c82119ad7faeec31780d811d"}, "http://download.tensorflow.org/data/speech_commands_test_set_v0.01.tar.gz": {"num_bytes": 71271436, "checksum": "baa084f6b62c91de660ff0588ae4dfc4e4d534aa99ac0e5f406cba75836cbd00"}}, "download_size": 1560367713, "post_processing_size": null, "dataset_size": 10104876, "size_in_bytes": 1570472589}, "ic": {"description": "Self-supervised learning (SSL) has proven vital for advancing research in\nnatural language processing (NLP) and computer vision (CV). The paradigm\npretrains a shared model on large volumes of unlabeled data and achieves\nstate-of-the-art (SOTA) for various tasks with minimal adaptation. However, the\nspeech processing community lacks a similar setup to systematically explore the\nparadigm. To bridge this gap, we introduce Speech processing Universal\nPERformance Benchmark (SUPERB). SUPERB is a leaderboard to benchmark the\nperformance of a shared model across a wide range of speech processing tasks\nwith minimal architecture changes and labeled data. Among multiple usages of the\nshared model, we especially focus on extracting the representation learned from\nSSL due to its preferable re-usability. We present a simple framework to solve\nSUPERB tasks by learning task-specialized lightweight prediction heads on top of\nthe frozen shared model. Our results demonstrate that the framework is promising\nas SSL representations show competitive generalizability and accessibility\nacross SUPERB tasks. We release SUPERB as a challenge with a leaderboard and a\nbenchmark toolkit to fuel the research in representation learning and general\nspeech processing.\n\nNote that in order to limit the required storage for preparing this dataset, the\naudio is stored in the .flac format and is not converted to a float32 array. To\nconvert, the audio file to a float32 array, please make use of the `.map()`\nfunction as follows:\n\n\n```python\nimport soundfile as sf\n\ndef map_to_array(batch):\n speech_array, _ = sf.read(batch[\"file\"])\n batch[\"speech\"] = speech_array\n return batch\n\ndataset = dataset.map(map_to_array, remove_columns=[\"file\"])\n```\n", "citation": "@article{DBLP:journals/corr/abs-2105-01051,\n author = {Shu{-}Wen Yang and\n Po{-}Han Chi and\n Yung{-}Sung Chuang and\n Cheng{-}I Jeff Lai and\n Kushal Lakhotia and\n Yist Y. Lin and\n Andy T. Liu and\n Jiatong Shi and\n Xuankai Chang and\n Guan{-}Ting Lin and\n Tzu{-}Hsien Huang and\n Wei{-}Cheng Tseng and\n Ko{-}tik Lee and\n Da{-}Rong Liu and\n Zili Huang and\n Shuyan Dong and\n Shang{-}Wen Li and\n Shinji Watanabe and\n Abdelrahman Mohamed and\n Hung{-}yi Lee},\n title = {{SUPERB:} Speech processing Universal PERformance Benchmark},\n journal = {CoRR},\n volume = {abs/2105.01051},\n year = {2021},\n url = {https://arxiv.org/abs/2105.01051},\n archivePrefix = {arXiv},\n eprint = {2105.01051},\n timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},\n biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n", "homepage": "https://fluent.ai/fluent-speech-commands-a-dataset-for-spoken-language-understanding-research/", "license": "", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "speaker_id": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "action": {"num_classes": 6, "names": ["activate", "bring", "change language", "deactivate", "decrease", "increase"], "names_file": null, "id": null, "_type": "ClassLabel"}, "object": {"num_classes": 14, "names": ["Chinese", "English", "German", "Korean", "heat", "juice", "lamp", "lights", "music", "newspaper", "none", "shoes", "socks", "volume"], "names_file": null, "id": null, "_type": "ClassLabel"}, "location": {"num_classes": 4, "names": ["bedroom", "kitchen", "none", "washroom"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "superb", "config_name": "ic", "version": {"version_str": "1.9.0", "description": "", "major": 1, "minor": 9, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7071466, "num_examples": 23132, "dataset_name": "superb"}, "validation": {"name": "validation", "num_bytes": 953622, "num_examples": 3118, "dataset_name": "superb"}, "test": {"name": "test", "num_bytes": 1158347, "num_examples": 3793, "dataset_name": "superb"}}, "download_checksums": {"http://fluent.ai:2052/jf8398hf30f0381738rucj3828chfdnchs.tar.gz": {"num_bytes": 1544093324, "checksum": "4376699f7daf134a9fa57a1d880ffcaaf94a3e2551ba0b40ad894d7abb71aacb"}}, "download_size": 1544093324, "post_processing_size": null, "dataset_size": 9183435, "size_in_bytes": 1553276759}, "si": {"description": "Self-supervised learning (SSL) has proven vital for advancing research in\nnatural language processing (NLP) and computer vision (CV). The paradigm\npretrains a shared model on large volumes of unlabeled data and achieves\nstate-of-the-art (SOTA) for various tasks with minimal adaptation. However, the\nspeech processing community lacks a similar setup to systematically explore the\nparadigm. To bridge this gap, we introduce Speech processing Universal\nPERformance Benchmark (SUPERB). SUPERB is a leaderboard to benchmark the\nperformance of a shared model across a wide range of speech processing tasks\nwith minimal architecture changes and labeled data. Among multiple usages of the\nshared model, we especially focus on extracting the representation learned from\nSSL due to its preferable re-usability. We present a simple framework to solve\nSUPERB tasks by learning task-specialized lightweight prediction heads on top of\nthe frozen shared model. Our results demonstrate that the framework is promising\nas SSL representations show competitive generalizability and accessibility\nacross SUPERB tasks. We release SUPERB as a challenge with a leaderboard and a\nbenchmark toolkit to fuel the research in representation learning and general\nspeech processing.\n\nNote that in order to limit the required storage for preparing this dataset, the\naudio is stored in the .flac format and is not converted to a float32 array. To\nconvert, the audio file to a float32 array, please make use of the `.map()`\nfunction as follows:\n\n\n```python\nimport soundfile as sf\n\ndef map_to_array(batch):\n speech_array, _ = sf.read(batch[\"file\"])\n batch[\"speech\"] = speech_array\n return batch\n\ndataset = dataset.map(map_to_array, remove_columns=[\"file\"])\n```\n", "citation": "@article{DBLP:journals/corr/abs-2105-01051,\n author = {Shu{-}Wen Yang and\n Po{-}Han Chi and\n Yung{-}Sung Chuang and\n Cheng{-}I Jeff Lai and\n Kushal Lakhotia and\n Yist Y. Lin and\n Andy T. Liu and\n Jiatong Shi and\n Xuankai Chang and\n Guan{-}Ting Lin and\n Tzu{-}Hsien Huang and\n Wei{-}Cheng Tseng and\n Ko{-}tik Lee and\n Da{-}Rong Liu and\n Zili Huang and\n Shuyan Dong and\n Shang{-}Wen Li and\n Shinji Watanabe and\n Abdelrahman Mohamed and\n Hung{-}yi Lee},\n title = {{SUPERB:} Speech processing Universal PERformance Benchmark},\n journal = {CoRR},\n volume = {abs/2105.01051},\n year = {2021},\n url = {https://arxiv.org/abs/2105.01051},\n archivePrefix = {arXiv},\n eprint = {2105.01051},\n timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},\n biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n", "homepage": "https://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox1.html", "license": "", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 1251, "names": ["id10001", "id10002", "id10003", "id10004", "id10005", "id10006", "id10007", "id10008", "id10009", "id10010", "id10011", "id10012", "id10013", "id10014", "id10015", "id10016", "id10017", "id10018", "id10019", "id10020", "id10021", "id10022", "id10023", "id10024", "id10025", "id10026", "id10027", "id10028", "id10029", "id10030", "id10031", "id10032", "id10033", "id10034", "id10035", "id10036", "id10037", "id10038", "id10039", "id10040", "id10041", "id10042", "id10043", "id10044", "id10045", "id10046", "id10047", "id10048", "id10049", "id10050", "id10051", "id10052", "id10053", "id10054", "id10055", "id10056", "id10057", "id10058", "id10059", "id10060", "id10061", "id10062", "id10063", "id10064", "id10065", "id10066", "id10067", "id10068", "id10069", "id10070", "id10071", "id10072", "id10073", "id10074", "id10075", "id10076", "id10077", "id10078", "id10079", "id10080", "id10081", "id10082", "id10083", "id10084", "id10085", "id10086", "id10087", "id10088", "id10089", "id10090", "id10091", "id10092", "id10093", "id10094", "id10095", "id10096", "id10097", "id10098", "id10099", "id10100", "id10101", "id10102", "id10103", "id10104", "id10105", "id10106", "id10107", "id10108", "id10109", "id10110", "id10111", "id10112", "id10113", "id10114", "id10115", "id10116", "id10117", "id10118", "id10119", "id10120", "id10121", "id10122", "id10123", "id10124", "id10125", "id10126", "id10127", "id10128", "id10129", "id10130", "id10131", "id10132", "id10133", "id10134", "id10135", "id10136", "id10137", "id10138", "id10139", "id10140", "id10141", "id10142", "id10143", "id10144", "id10145", "id10146", "id10147", "id10148", "id10149", "id10150", "id10151", "id10152", "id10153", "id10154", "id10155", "id10156", "id10157", "id10158", "id10159", "id10160", "id10161", "id10162", "id10163", "id10164", "id10165", "id10166", "id10167", "id10168", "id10169", "id10170", "id10171", "id10172", "id10173", "id10174", "id10175", "id10176", "id10177", "id10178", "id10179", "id10180", "id10181", "id10182", "id10183", "id10184", "id10185", "id10186", "id10187", "id10188", "id10189", "id10190", "id10191", "id10192", "id10193", "id10194", "id10195", "id10196", "id10197", "id10198", "id10199", "id10200", "id10201", "id10202", "id10203", "id10204", "id10205", "id10206", "id10207", "id10208", "id10209", "id10210", "id10211", "id10212", "id10213", "id10214", "id10215", "id10216", "id10217", "id10218", "id10219", "id10220", "id10221", "id10222", "id10223", "id10224", "id10225", "id10226", "id10227", "id10228", "id10229", "id10230", "id10231", "id10232", "id10233", "id10234", "id10235", "id10236", "id10237", "id10238", "id10239", "id10240", "id10241", "id10242", "id10243", "id10244", "id10245", "id10246", "id10247", "id10248", "id10249", "id10250", "id10251", "id10252", "id10253", "id10254", "id10255", "id10256", "id10257", "id10258", "id10259", "id10260", "id10261", "id10262", "id10263", "id10264", "id10265", "id10266", "id10267", "id10268", "id10269", "id10270", "id10271", "id10272", "id10273", "id10274", "id10275", "id10276", "id10277", "id10278", "id10279", "id10280", "id10281", "id10282", "id10283", "id10284", "id10285", "id10286", "id10287", "id10288", "id10289", "id10290", "id10291", "id10292", "id10293", "id10294", "id10295", "id10296", "id10297", "id10298", "id10299", "id10300", "id10301", "id10302", "id10303", "id10304", "id10305", "id10306", "id10307", "id10308", "id10309", "id10310", "id10311", "id10312", "id10313", "id10314", "id10315", "id10316", "id10317", "id10318", "id10319", "id10320", "id10321", "id10322", "id10323", "id10324", "id10325", "id10326", "id10327", "id10328", "id10329", "id10330", "id10331", "id10332", "id10333", "id10334", "id10335", "id10336", "id10337", "id10338", "id10339", "id10340", "id10341", "id10342", "id10343", "id10344", "id10345", "id10346", "id10347", "id10348", "id10349", "id10350", "id10351", "id10352", "id10353", "id10354", "id10355", "id10356", "id10357", "id10358", "id10359", "id10360", "id10361", "id10362", "id10363", "id10364", "id10365", "id10366", "id10367", "id10368", "id10369", "id10370", "id10371", "id10372", "id10373", "id10374", "id10375", "id10376", "id10377", "id10378", "id10379", "id10380", "id10381", "id10382", "id10383", "id10384", "id10385", "id10386", "id10387", "id10388", "id10389", "id10390", "id10391", "id10392", "id10393", "id10394", "id10395", "id10396", "id10397", "id10398", "id10399", "id10400", "id10401", "id10402", "id10403", "id10404", "id10405", "id10406", "id10407", "id10408", "id10409", "id10410", "id10411", "id10412", "id10413", "id10414", "id10415", "id10416", "id10417", "id10418", "id10419", "id10420", "id10421", "id10422", "id10423", "id10424", "id10425", "id10426", "id10427", "id10428", "id10429", "id10430", "id10431", "id10432", "id10433", "id10434", "id10435", "id10436", "id10437", "id10438", "id10439", "id10440", "id10441", "id10442", "id10443", "id10444", "id10445", "id10446", "id10447", "id10448", "id10449", "id10450", "id10451", "id10452", "id10453", "id10454", "id10455", "id10456", "id10457", "id10458", "id10459", "id10460", "id10461", "id10462", "id10463", "id10464", "id10465", "id10466", "id10467", "id10468", "id10469", "id10470", "id10471", "id10472", "id10473", "id10474", "id10475", "id10476", "id10477", "id10478", "id10479", "id10480", "id10481", "id10482", "id10483", "id10484", "id10485", "id10486", "id10487", "id10488", "id10489", "id10490", "id10491", "id10492", "id10493", "id10494", "id10495", "id10496", "id10497", "id10498", "id10499", "id10500", "id10501", "id10502", "id10503", "id10504", "id10505", "id10506", "id10507", "id10508", "id10509", "id10510", "id10511", "id10512", "id10513", "id10514", "id10515", "id10516", "id10517", "id10518", "id10519", "id10520", "id10521", "id10522", "id10523", "id10524", "id10525", "id10526", "id10527", "id10528", "id10529", "id10530", "id10531", "id10532", "id10533", "id10534", "id10535", "id10536", "id10537", "id10538", "id10539", "id10540", "id10541", "id10542", "id10543", "id10544", "id10545", "id10546", "id10547", "id10548", "id10549", "id10550", "id10551", "id10552", "id10553", "id10554", "id10555", "id10556", "id10557", "id10558", "id10559", "id10560", "id10561", "id10562", "id10563", "id10564", "id10565", "id10566", "id10567", "id10568", "id10569", "id10570", "id10571", "id10572", "id10573", "id10574", "id10575", "id10576", "id10577", "id10578", "id10579", "id10580", "id10581", "id10582", "id10583", "id10584", "id10585", "id10586", "id10587", "id10588", "id10589", "id10590", "id10591", "id10592", "id10593", "id10594", "id10595", "id10596", "id10597", "id10598", "id10599", "id10600", "id10601", "id10602", "id10603", "id10604", "id10605", "id10606", "id10607", "id10608", "id10609", "id10610", "id10611", "id10612", "id10613", "id10614", "id10615", "id10616", "id10617", "id10618", "id10619", "id10620", "id10621", "id10622", "id10623", "id10624", "id10625", "id10626", "id10627", "id10628", "id10629", "id10630", "id10631", "id10632", "id10633", "id10634", "id10635", "id10636", "id10637", "id10638", "id10639", "id10640", "id10641", "id10642", "id10643", "id10644", "id10645", "id10646", "id10647", "id10648", "id10649", "id10650", "id10651", "id10652", "id10653", "id10654", "id10655", "id10656", "id10657", "id10658", "id10659", "id10660", "id10661", "id10662", "id10663", "id10664", "id10665", "id10666", "id10667", "id10668", "id10669", "id10670", "id10671", "id10672", "id10673", "id10674", "id10675", "id10676", "id10677", "id10678", "id10679", "id10680", "id10681", "id10682", "id10683", "id10684", "id10685", "id10686", "id10687", "id10688", "id10689", "id10690", "id10691", "id10692", "id10693", "id10694", "id10695", "id10696", "id10697", "id10698", "id10699", "id10700", "id10701", "id10702", "id10703", "id10704", "id10705", "id10706", "id10707", "id10708", "id10709", "id10710", "id10711", "id10712", "id10713", "id10714", "id10715", "id10716", "id10717", "id10718", "id10719", "id10720", "id10721", "id10722", "id10723", "id10724", "id10725", "id10726", "id10727", "id10728", "id10729", "id10730", "id10731", "id10732", "id10733", "id10734", "id10735", "id10736", "id10737", "id10738", "id10739", "id10740", "id10741", "id10742", "id10743", "id10744", "id10745", "id10746", "id10747", "id10748", "id10749", "id10750", "id10751", "id10752", "id10753", "id10754", "id10755", "id10756", "id10757", "id10758", "id10759", "id10760", "id10761", "id10762", "id10763", "id10764", "id10765", "id10766", "id10767", "id10768", "id10769", "id10770", "id10771", "id10772", "id10773", "id10774", "id10775", "id10776", "id10777", "id10778", "id10779", "id10780", "id10781", "id10782", "id10783", "id10784", "id10785", "id10786", "id10787", "id10788", "id10789", "id10790", "id10791", "id10792", "id10793", "id10794", "id10795", "id10796", "id10797", "id10798", "id10799", "id10800", "id10801", "id10802", "id10803", "id10804", "id10805", "id10806", "id10807", "id10808", "id10809", "id10810", "id10811", "id10812", "id10813", "id10814", "id10815", "id10816", "id10817", "id10818", "id10819", "id10820", "id10821", "id10822", "id10823", "id10824", "id10825", "id10826", "id10827", "id10828", "id10829", "id10830", "id10831", "id10832", "id10833", "id10834", "id10835", "id10836", "id10837", "id10838", "id10839", "id10840", "id10841", "id10842", "id10843", "id10844", "id10845", "id10846", "id10847", "id10848", "id10849", "id10850", "id10851", "id10852", "id10853", "id10854", "id10855", "id10856", "id10857", "id10858", "id10859", "id10860", "id10861", "id10862", "id10863", "id10864", "id10865", "id10866", "id10867", "id10868", "id10869", "id10870", "id10871", "id10872", "id10873", "id10874", "id10875", "id10876", "id10877", "id10878", "id10879", "id10880", "id10881", "id10882", "id10883", "id10884", "id10885", "id10886", "id10887", "id10888", "id10889", "id10890", "id10891", "id10892", "id10893", "id10894", "id10895", "id10896", "id10897", "id10898", "id10899", "id10900", "id10901", "id10902", "id10903", "id10904", "id10905", "id10906", "id10907", "id10908", "id10909", "id10910", "id10911", "id10912", "id10913", "id10914", "id10915", "id10916", "id10917", "id10918", "id10919", "id10920", "id10921", "id10922", "id10923", "id10924", "id10925", "id10926", "id10927", "id10928", "id10929", "id10930", "id10931", "id10932", "id10933", "id10934", "id10935", "id10936", "id10937", "id10938", "id10939", "id10940", "id10941", "id10942", "id10943", "id10944", "id10945", "id10946", "id10947", "id10948", "id10949", "id10950", "id10951", "id10952", "id10953", "id10954", "id10955", "id10956", "id10957", "id10958", "id10959", "id10960", "id10961", "id10962", "id10963", "id10964", "id10965", "id10966", "id10967", "id10968", "id10969", "id10970", "id10971", "id10972", "id10973", "id10974", "id10975", "id10976", "id10977", "id10978", "id10979", "id10980", "id10981", "id10982", "id10983", "id10984", "id10985", "id10986", "id10987", "id10988", "id10989", "id10990", "id10991", "id10992", "id10993", "id10994", "id10995", "id10996", "id10997", "id10998", "id10999", "id11000", "id11001", "id11002", "id11003", "id11004", "id11005", "id11006", "id11007", "id11008", "id11009", "id11010", "id11011", "id11012", "id11013", "id11014", "id11015", "id11016", "id11017", "id11018", "id11019", "id11020", "id11021", "id11022", "id11023", "id11024", "id11025", "id11026", "id11027", "id11028", "id11029", "id11030", "id11031", "id11032", "id11033", "id11034", "id11035", "id11036", "id11037", "id11038", "id11039", "id11040", "id11041", "id11042", "id11043", "id11044", "id11045", "id11046", "id11047", "id11048", "id11049", "id11050", "id11051", "id11052", "id11053", "id11054", "id11055", "id11056", "id11057", "id11058", "id11059", "id11060", "id11061", "id11062", "id11063", "id11064", "id11065", "id11066", "id11067", "id11068", "id11069", "id11070", "id11071", "id11072", "id11073", "id11074", "id11075", "id11076", "id11077", "id11078", "id11079", "id11080", "id11081", "id11082", "id11083", "id11084", "id11085", "id11086", "id11087", "id11088", "id11089", "id11090", "id11091", "id11092", "id11093", "id11094", "id11095", "id11096", "id11097", "id11098", "id11099", "id11100", "id11101", "id11102", "id11103", "id11104", "id11105", "id11106", "id11107", "id11108", "id11109", "id11110", "id11111", "id11112", "id11113", "id11114", "id11115", "id11116", "id11117", "id11118", "id11119", "id11120", "id11121", "id11122", "id11123", "id11124", "id11125", "id11126", "id11127", "id11128", "id11129", "id11130", "id11131", "id11132", "id11133", "id11134", "id11135", "id11136", "id11137", "id11138", "id11139", "id11140", "id11141", "id11142", "id11143", "id11144", "id11145", "id11146", "id11147", "id11148", "id11149", "id11150", "id11151", "id11152", "id11153", "id11154", "id11155", "id11156", "id11157", "id11158", "id11159", "id11160", "id11161", "id11162", "id11163", "id11164", "id11165", "id11166", "id11167", "id11168", "id11169", "id11170", "id11171", "id11172", "id11173", "id11174", "id11175", "id11176", "id11177", "id11178", "id11179", "id11180", "id11181", "id11182", "id11183", "id11184", "id11185", "id11186", "id11187", "id11188", "id11189", "id11190", "id11191", "id11192", "id11193", "id11194", "id11195", "id11196", "id11197", "id11198", "id11199", "id11200", "id11201", "id11202", "id11203", "id11204", "id11205", "id11206", "id11207", "id11208", "id11209", "id11210", "id11211", "id11212", "id11213", "id11214", "id11215", "id11216", "id11217", "id11218", "id11219", "id11220", "id11221", "id11222", "id11223", "id11224", "id11225", "id11226", "id11227", "id11228", "id11229", "id11230", "id11231", "id11232", "id11233", "id11234", "id11235", "id11236", "id11237", "id11238", "id11239", "id11240", "id11241", "id11242", "id11243", "id11244", "id11245", "id11246", "id11247", "id11248", "id11249", "id11250", "id11251"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": {"input": "file", "output": "label"}, "task_templates": null, "builder_name": "superb", "config_name": "si", "version": {"version_str": "1.9.0", "description": "", "major": 1, "minor": 9, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 12729268, "num_examples": 138361, "dataset_name": "superb"}, "validation": {"name": "validation", "num_bytes": 635172, "num_examples": 6904, "dataset_name": "superb"}, "test": {"name": "test", "num_bytes": 759096, "num_examples": 8251, "dataset_name": "superb"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 14123536, "size_in_bytes": 14123536}}
dummy/asr/1.9.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ff8f5cf44cc18aa16659d42a5ef7ebd754ef594130762f9e6d48909292154b8
3
+ size 805749
dummy/ks/1.9.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb2268a62de98190c456b9bc7eefdbd749b732a49068b54767e94250475aee08
3
+ size 4763
dummy/sd/1.9.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ba0c33b119a2c65fd6748fd623d14adde2ca70536fa5475f848316441b25c0a
3
+ size 3463
superb.py ADDED
@@ -0,0 +1,691 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
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
+ # Lint as: python3
17
+ """SUPERB: Speech processing Universal PERformance Benchmark."""
18
+
19
+ import csv
20
+ import glob
21
+ import os
22
+ import textwrap
23
+ from dataclasses import dataclass
24
+
25
+ import datasets
26
+ from datasets.tasks import AutomaticSpeechRecognition
27
+
28
+
29
+ _CITATION = """\
30
+ @article{DBLP:journals/corr/abs-2105-01051,
31
+ author = {Shu{-}Wen Yang and
32
+ Po{-}Han Chi and
33
+ Yung{-}Sung Chuang and
34
+ Cheng{-}I Jeff Lai and
35
+ Kushal Lakhotia and
36
+ Yist Y. Lin and
37
+ Andy T. Liu and
38
+ Jiatong Shi and
39
+ Xuankai Chang and
40
+ Guan{-}Ting Lin and
41
+ Tzu{-}Hsien Huang and
42
+ Wei{-}Cheng Tseng and
43
+ Ko{-}tik Lee and
44
+ Da{-}Rong Liu and
45
+ Zili Huang and
46
+ Shuyan Dong and
47
+ Shang{-}Wen Li and
48
+ Shinji Watanabe and
49
+ Abdelrahman Mohamed and
50
+ Hung{-}yi Lee},
51
+ title = {{SUPERB:} Speech processing Universal PERformance Benchmark},
52
+ journal = {CoRR},
53
+ volume = {abs/2105.01051},
54
+ year = {2021},
55
+ url = {https://arxiv.org/abs/2105.01051},
56
+ archivePrefix = {arXiv},
57
+ eprint = {2105.01051},
58
+ timestamp = {Thu, 01 Jul 2021 13:30:22 +0200},
59
+ biburl = {https://dblp.org/rec/journals/corr/abs-2105-01051.bib},
60
+ bibsource = {dblp computer science bibliography, https://dblp.org}
61
+ }
62
+ """
63
+
64
+ _DESCRIPTION = """\
65
+ Self-supervised learning (SSL) has proven vital for advancing research in
66
+ natural language processing (NLP) and computer vision (CV). The paradigm
67
+ pretrains a shared model on large volumes of unlabeled data and achieves
68
+ state-of-the-art (SOTA) for various tasks with minimal adaptation. However, the
69
+ speech processing community lacks a similar setup to systematically explore the
70
+ paradigm. To bridge this gap, we introduce Speech processing Universal
71
+ PERformance Benchmark (SUPERB). SUPERB is a leaderboard to benchmark the
72
+ performance of a shared model across a wide range of speech processing tasks
73
+ with minimal architecture changes and labeled data. Among multiple usages of the
74
+ shared model, we especially focus on extracting the representation learned from
75
+ SSL due to its preferable re-usability. We present a simple framework to solve
76
+ SUPERB tasks by learning task-specialized lightweight prediction heads on top of
77
+ the frozen shared model. Our results demonstrate that the framework is promising
78
+ as SSL representations show competitive generalizability and accessibility
79
+ across SUPERB tasks. We release SUPERB as a challenge with a leaderboard and a
80
+ benchmark toolkit to fuel the research in representation learning and general
81
+ speech processing.
82
+
83
+ Note that in order to limit the required storage for preparing this dataset, the
84
+ audio is stored in the .wav format and is not converted to a float32 array. To
85
+ convert the audio file to a float32 array, please make use of the `.map()`
86
+ function as follows:
87
+
88
+
89
+ ```python
90
+ import soundfile as sf
91
+
92
+ def map_to_array(batch):
93
+ speech_array, _ = sf.read(batch["file"])
94
+ batch["speech"] = speech_array
95
+ return batch
96
+
97
+ dataset = dataset.map(map_to_array, remove_columns=["file"])
98
+ ```
99
+ """
100
+
101
+
102
+ class SuperbConfig(datasets.BuilderConfig):
103
+ """BuilderConfig for Superb."""
104
+
105
+ def __init__(
106
+ self,
107
+ features,
108
+ url,
109
+ data_url=None,
110
+ supervised_keys=None,
111
+ task_templates=None,
112
+ **kwargs,
113
+ ):
114
+ super().__init__(version=datasets.Version("1.9.0", ""), **kwargs)
115
+ self.features = features
116
+ self.data_url = data_url
117
+ self.url = url
118
+ self.supervised_keys = supervised_keys
119
+ self.task_templates = task_templates
120
+
121
+
122
+ class Superb(datasets.GeneratorBasedBuilder):
123
+ """Superb dataset."""
124
+
125
+ BUILDER_CONFIGS = [
126
+ SuperbConfig(
127
+ name="asr",
128
+ description=textwrap.dedent(
129
+ """\
130
+ ASR transcribes utterances into words. While PR analyzes the
131
+ improvement in modeling phonetics, ASR reflects the significance of
132
+ the improvement in a real-world scenario. LibriSpeech
133
+ train-clean-100/dev-clean/test-clean subsets are used for
134
+ training/validation/testing. The evaluation metric is word error
135
+ rate (WER)."""
136
+ ),
137
+ features=datasets.Features(
138
+ {
139
+ "file": datasets.Value("string"),
140
+ "audio": datasets.features.Audio(sampling_rate=16_000),
141
+ "text": datasets.Value("string"),
142
+ "speaker_id": datasets.Value("int64"),
143
+ "chapter_id": datasets.Value("int64"),
144
+ "id": datasets.Value("string"),
145
+ }
146
+ ),
147
+ supervised_keys=("file", "text"),
148
+ url="http://www.openslr.org/12",
149
+ data_url="http://www.openslr.org/resources/12/",
150
+ task_templates=[AutomaticSpeechRecognition(audio_file_path_column="file", transcription_column="text")],
151
+ ),
152
+ SuperbConfig(
153
+ name="ks",
154
+ description=textwrap.dedent(
155
+ """\
156
+ Keyword Spotting (KS) detects preregistered keywords by classifying utterances into a predefined set of
157
+ words. The task is usually performed on-device for the fast response time. Thus, accuracy, model size, and
158
+ inference time are all crucial. SUPERB uses the widely used Speech Commands dataset v1.0 for the task.
159
+ The dataset consists of ten classes of keywords, a class for silence, and an unknown class to include the
160
+ false positive. The evaluation metric is accuracy (ACC)"""
161
+ ),
162
+ features=datasets.Features(
163
+ {
164
+ "file": datasets.Value("string"),
165
+ "audio": datasets.features.Audio(sampling_rate=16_000),
166
+ "label": datasets.ClassLabel(
167
+ names=[
168
+ "yes",
169
+ "no",
170
+ "up",
171
+ "down",
172
+ "left",
173
+ "right",
174
+ "on",
175
+ "off",
176
+ "stop",
177
+ "go",
178
+ "_silence_",
179
+ "_unknown_",
180
+ ]
181
+ ),
182
+ }
183
+ ),
184
+ supervised_keys=("file", "label"),
185
+ url="https://www.tensorflow.org/datasets/catalog/speech_commands",
186
+ data_url="http://download.tensorflow.org/data/{filename}",
187
+ ),
188
+ SuperbConfig(
189
+ name="ic",
190
+ description=textwrap.dedent(
191
+ """\
192
+ Intent Classification (IC) classifies utterances into predefined classes to determine the intent of
193
+ speakers. SUPERB uses the Fluent Speech Commands dataset, where each utterance is tagged with three intent
194
+ labels: action, object, and location. The evaluation metric is accuracy (ACC)."""
195
+ ),
196
+ features=datasets.Features(
197
+ {
198
+ "file": datasets.Value("string"),
199
+ "audio": datasets.features.Audio(sampling_rate=16_000),
200
+ "speaker_id": datasets.Value("string"),
201
+ "text": datasets.Value("string"),
202
+ "action": datasets.ClassLabel(
203
+ names=["activate", "bring", "change language", "deactivate", "decrease", "increase"]
204
+ ),
205
+ "object": datasets.ClassLabel(
206
+ names=[
207
+ "Chinese",
208
+ "English",
209
+ "German",
210
+ "Korean",
211
+ "heat",
212
+ "juice",
213
+ "lamp",
214
+ "lights",
215
+ "music",
216
+ "newspaper",
217
+ "none",
218
+ "shoes",
219
+ "socks",
220
+ "volume",
221
+ ]
222
+ ),
223
+ "location": datasets.ClassLabel(names=["bedroom", "kitchen", "none", "washroom"]),
224
+ }
225
+ ),
226
+ supervised_keys=None,
227
+ url="https://fluent.ai/fluent-speech-commands-a-dataset-for-spoken-language-understanding-research/",
228
+ data_url="http://fluent.ai:2052/jf8398hf30f0381738rucj3828chfdnchs.tar.gz",
229
+ ),
230
+ SuperbConfig(
231
+ name="si",
232
+ description=textwrap.dedent(
233
+ """\
234
+ Speaker Identification (SI) classifies each utterance for its speaker identity as a multi-class
235
+ classification, where speakers are in the same predefined set for both training and testing. The widely
236
+ used VoxCeleb1 dataset is adopted, and the evaluation metric is accuracy (ACC)."""
237
+ ),
238
+ features=datasets.Features(
239
+ {
240
+ "file": datasets.Value("string"),
241
+ "audio": datasets.features.Audio(sampling_rate=16_000),
242
+ # VoxCeleb1 contains 1251 speaker IDs in range ["id10001",..."id11251"]
243
+ "label": datasets.ClassLabel(names=[f"id{i + 10001}" for i in range(1251)]),
244
+ }
245
+ ),
246
+ supervised_keys=("file", "label"),
247
+ url="https://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox1.html",
248
+ ),
249
+ SuperbConfig(
250
+ name="sd",
251
+ description=textwrap.dedent(
252
+ """\
253
+ Speaker Diarization (SD) predicts `who is speaking when` for each timestamp, and multiple speakers can
254
+ speak simultaneously. The model has to encode rich speaker characteristics for each frame and should be
255
+ able to represent mixtures of signals. [LibriMix] is adopted where LibriSpeech
256
+ train-clean-100/dev-clean/test-clean are used to generate mixtures for training/validation/testing.
257
+ We focus on the two-speaker scenario as the first step. The time-coded speaker labels were generated using
258
+ alignments from Kaldi LibriSpeech ASR model. The evaluation metric is diarization error rate (DER)."""
259
+ ),
260
+ features=datasets.Features(
261
+ {
262
+ "record_id": datasets.Value("string"),
263
+ "file": datasets.Value("string"),
264
+ "audio": datasets.features.Audio(sampling_rate=16_000),
265
+ "start": datasets.Value("int64"),
266
+ "end": datasets.Value("int64"),
267
+ "speakers": [
268
+ {
269
+ "speaker_id": datasets.Value("string"),
270
+ "start": datasets.Value("int64"),
271
+ "end": datasets.Value("int64"),
272
+ }
273
+ ],
274
+ }
275
+ ), # TODO
276
+ supervised_keys=None, # TODO
277
+ url="https://github.com/ftshijt/LibriMix",
278
+ data_url="https://huggingface.co/datasets/superb/superb-data/resolve/main/sd/{split}/{filename}",
279
+ ),
280
+ SuperbConfig(
281
+ name="er",
282
+ description=textwrap.dedent(
283
+ """\
284
+ Emotion Recognition (ER) predicts an emotion class for each utterance. The most widely used ER dataset
285
+ IEMOCAP is adopted, and we follow the conventional evaluation protocol: we drop the unbalanced emotion
286
+ classes to leave the final four classes with a similar amount of data points and cross-validate on five
287
+ folds of the standard splits. The evaluation metric is accuracy (ACC)."""
288
+ ),
289
+ features=datasets.Features(
290
+ {
291
+ "file": datasets.Value("string"),
292
+ "audio": datasets.features.Audio(sampling_rate=16_000),
293
+ "label": datasets.ClassLabel(names=["neu", "hap", "ang", "sad"]),
294
+ }
295
+ ),
296
+ supervised_keys=("file", "label"),
297
+ url="https://sail.usc.edu/iemocap/",
298
+ ),
299
+ ]
300
+
301
+ @property
302
+ def manual_download_instructions(self):
303
+ if self.config.name == "si":
304
+ return textwrap.dedent(
305
+ """
306
+ Please download the VoxCeleb dataset using the following script,
307
+ which should create `VoxCeleb1/wav/id*` directories for both train and test speakers`:
308
+ ```
309
+ mkdir VoxCeleb1
310
+ cd VoxCeleb1
311
+
312
+ wget https://thor.robots.ox.ac.uk/~vgg/data/voxceleb/vox1a/vox1_dev_wav_partaa
313
+ wget https://thor.robots.ox.ac.uk/~vgg/data/voxceleb/vox1a/vox1_dev_wav_partab
314
+ wget https://thor.robots.ox.ac.uk/~vgg/data/voxceleb/vox1a/vox1_dev_wav_partac
315
+ wget https://thor.robots.ox.ac.uk/~vgg/data/voxceleb/vox1a/vox1_dev_wav_partad
316
+ cat vox1_dev* > vox1_dev_wav.zip
317
+ unzip vox1_dev_wav.zip
318
+
319
+ wget https://thor.robots.ox.ac.uk/~vgg/data/voxceleb/vox1a/vox1_test_wav.zip
320
+ unzip vox1_test_wav.zip
321
+
322
+ # download the official SUPERB train-dev-test split
323
+ wget https://raw.githubusercontent.com/s3prl/s3prl/master/s3prl/downstream/voxceleb1/veri_test_class.txt
324
+ ```"""
325
+ )
326
+ elif self.config.name == "er":
327
+ return textwrap.dedent(
328
+ """
329
+ Please download the IEMOCAP dataset after submitting the request form here:
330
+ https://sail.usc.edu/iemocap/iemocap_release.htm
331
+ Having downloaded the dataset you can extract it with `tar -xvzf IEMOCAP_full_release.tar.gz`
332
+ which should create a folder called `IEMOCAP_full_release`
333
+ """
334
+ )
335
+ return None
336
+
337
+ def _info(self):
338
+ return datasets.DatasetInfo(
339
+ description=_DESCRIPTION,
340
+ features=self.config.features,
341
+ supervised_keys=self.config.supervised_keys,
342
+ homepage=self.config.url,
343
+ citation=_CITATION,
344
+ task_templates=self.config.task_templates,
345
+ )
346
+
347
+ def _split_generators(self, dl_manager):
348
+ if self.config.name == "asr":
349
+ _DL_URLS = {
350
+ "dev": self.config.data_url + "dev-clean.tar.gz",
351
+ "test": self.config.data_url + "test-clean.tar.gz",
352
+ "train": self.config.data_url + "train-clean-100.tar.gz",
353
+ }
354
+ archive_path = dl_manager.download_and_extract(_DL_URLS)
355
+
356
+ return [
357
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"archive_path": archive_path["train"]}),
358
+ datasets.SplitGenerator(
359
+ name=datasets.Split.VALIDATION, gen_kwargs={"archive_path": archive_path["dev"]}
360
+ ),
361
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"archive_path": archive_path["test"]}),
362
+ ]
363
+ elif self.config.name == "ks":
364
+ _DL_URLS = {
365
+ "train_val_test": self.config.data_url.format(filename="speech_commands_v0.01.tar.gz"),
366
+ "test": self.config.data_url.format(filename="speech_commands_test_set_v0.01.tar.gz"),
367
+ }
368
+ archive_path = dl_manager.download_and_extract(_DL_URLS)
369
+ return [
370
+ datasets.SplitGenerator(
371
+ name=datasets.Split.TRAIN,
372
+ gen_kwargs={"archive_path": archive_path["train_val_test"], "split": "train"},
373
+ ),
374
+ datasets.SplitGenerator(
375
+ name=datasets.Split.VALIDATION,
376
+ gen_kwargs={"archive_path": archive_path["train_val_test"], "split": "val"},
377
+ ),
378
+ datasets.SplitGenerator(
379
+ name=datasets.Split.TEST, gen_kwargs={"archive_path": archive_path["test"], "split": "test"}
380
+ ),
381
+ ]
382
+ elif self.config.name == "ic":
383
+ archive_path = dl_manager.download_and_extract(self.config.data_url)
384
+ return [
385
+ datasets.SplitGenerator(
386
+ name=datasets.Split.TRAIN,
387
+ gen_kwargs={"archive_path": archive_path, "split": "train"},
388
+ ),
389
+ datasets.SplitGenerator(
390
+ name=datasets.Split.VALIDATION,
391
+ gen_kwargs={"archive_path": archive_path, "split": "valid"},
392
+ ),
393
+ datasets.SplitGenerator(
394
+ name=datasets.Split.TEST, gen_kwargs={"archive_path": archive_path, "split": "test"}
395
+ ),
396
+ ]
397
+ elif self.config.name == "si":
398
+ manual_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
399
+ return [
400
+ datasets.SplitGenerator(
401
+ name=datasets.Split.TRAIN,
402
+ gen_kwargs={"archive_path": manual_dir, "split": 1},
403
+ ),
404
+ datasets.SplitGenerator(
405
+ name=datasets.Split.VALIDATION,
406
+ gen_kwargs={"archive_path": manual_dir, "split": 2},
407
+ ),
408
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"archive_path": manual_dir, "split": 3}),
409
+ ]
410
+ elif self.config.name == "sd":
411
+ splits = ["train", "dev", "test"]
412
+ _DL_URLS = {
413
+ split: {
414
+ filename: self.config.data_url.format(split=split, filename=filename)
415
+ for filename in ["reco2dur", "segments", "utt2spk", "wav.zip"]
416
+ }
417
+ for split in splits
418
+ }
419
+ archive_path = dl_manager.download_and_extract(_DL_URLS)
420
+ return [
421
+ datasets.SplitGenerator(
422
+ name=datasets.NamedSplit(split), gen_kwargs={"archive_path": archive_path[split], "split": split}
423
+ )
424
+ for split in splits
425
+ ]
426
+ elif self.config.name == "er":
427
+ manual_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
428
+ return [
429
+ datasets.SplitGenerator(
430
+ name=f"session{i}",
431
+ gen_kwargs={"archive_path": manual_dir, "split": i},
432
+ )
433
+ for i in range(1, 6)
434
+ ]
435
+
436
+ def _generate_examples(self, archive_path, split=None):
437
+ """Generate examples."""
438
+ if self.config.name == "asr":
439
+ transcripts_glob = os.path.join(archive_path, "LibriSpeech", "*", "*", "*", "*.txt")
440
+ key = 0
441
+ for transcript_path in sorted(glob.glob(transcripts_glob)):
442
+ transcript_dir_path = os.path.dirname(transcript_path)
443
+ with open(transcript_path, "r", encoding="utf-8") as f:
444
+ for line in f:
445
+ line = line.strip()
446
+ id_, transcript = line.split(" ", 1)
447
+ audio_file = f"{id_}.flac"
448
+ speaker_id, chapter_id = [int(el) for el in id_.split("-")[:2]]
449
+ audio_path = os.path.join(transcript_dir_path, audio_file)
450
+ yield key, {
451
+ "id": id_,
452
+ "speaker_id": speaker_id,
453
+ "chapter_id": chapter_id,
454
+ "file": audio_path,
455
+ "audio": audio_path,
456
+ "text": transcript,
457
+ }
458
+ key += 1
459
+ elif self.config.name == "ks":
460
+ words = ["yes", "no", "up", "down", "left", "right", "on", "off", "stop", "go"]
461
+ splits = _split_ks_files(archive_path, split)
462
+ for key, audio_file in enumerate(sorted(splits[split])):
463
+ base_dir, file_name = os.path.split(audio_file)
464
+ _, word = os.path.split(base_dir)
465
+ if word in words:
466
+ label = word
467
+ elif word == "_silence_" or word == "_background_noise_":
468
+ label = "_silence_"
469
+ else:
470
+ label = "_unknown_"
471
+ yield key, {"file": audio_file, "audio": audio_file, "label": label}
472
+ elif self.config.name == "ic":
473
+ root_path = os.path.join(archive_path, "fluent_speech_commands_dataset")
474
+ csv_path = os.path.join(root_path, "data", f"{split}_data.csv")
475
+ with open(csv_path, encoding="utf-8") as csv_file:
476
+ csv_reader = csv.reader(csv_file, delimiter=",", skipinitialspace=True)
477
+ next(csv_reader)
478
+ for row in csv_reader:
479
+ key, file_path, speaker_id, text, action, object_, location = row
480
+ audio_path = os.path.join(root_path, file_path)
481
+ yield key, {
482
+ "file": audio_path,
483
+ "audio": audio_path,
484
+ "speaker_id": speaker_id,
485
+ "text": text,
486
+ "action": action,
487
+ "object": object_,
488
+ "location": location,
489
+ }
490
+ elif self.config.name == "si":
491
+ wav_path = os.path.join(archive_path, "wav")
492
+ splits_path = os.path.join(archive_path, "veri_test_class.txt")
493
+ with open(splits_path, "r", encoding="utf-8") as f:
494
+ for key, line in enumerate(f):
495
+ split_id, file_path = line.strip().split(" ")
496
+ if int(split_id) != split:
497
+ continue
498
+ speaker_id = file_path.split("/")[0]
499
+ audio_path = os.path.join(wav_path, file_path)
500
+ yield key, {
501
+ "file": audio_path,
502
+ "audio": audio_path,
503
+ "label": speaker_id,
504
+ }
505
+ elif self.config.name == "sd":
506
+ data = SdData(archive_path)
507
+ args = SdArgs()
508
+ chunk_indices = _generate_chunk_indices(data, args, split=split)
509
+ if split != "test":
510
+ for key, (rec, st, ed) in enumerate(chunk_indices):
511
+ speakers = _get_speakers(rec, data, args)
512
+ yield key, {
513
+ "record_id": rec,
514
+ "file": data.wavs[rec],
515
+ "audio": data.wavs[rec],
516
+ "start": st,
517
+ "end": ed,
518
+ "speakers": speakers,
519
+ }
520
+ else:
521
+ key = 0
522
+ for rec in chunk_indices:
523
+ for rec, st, ed in chunk_indices[rec]:
524
+ speakers = _get_speakers(rec, data, args)
525
+ yield key, {
526
+ "record_id": rec,
527
+ "file": data.wavs[rec],
528
+ "audio": data.wavs[rec],
529
+ "start": st,
530
+ "end": ed,
531
+ "speakers": speakers,
532
+ }
533
+ key += 1
534
+ elif self.config.name == "er":
535
+ root_path = os.path.join(archive_path, f"Session{split}")
536
+ wav_path = os.path.join(root_path, "sentences", "wav")
537
+ labels_path = os.path.join(root_path, "dialog", "EmoEvaluation", "*.txt")
538
+ emotions = ["neu", "hap", "ang", "sad", "exc"]
539
+ key = 0
540
+ for labels_file in sorted(glob.glob(labels_path)):
541
+ with open(labels_file, "r", encoding="utf-8") as f:
542
+ for line in f:
543
+ if line[0] != "[":
544
+ continue
545
+ _, filename, emo, _ = line.split("\t")
546
+ if emo not in emotions:
547
+ continue
548
+ wav_subdir = filename.rsplit("_", 1)[0]
549
+ filename = f"{filename}.wav"
550
+ audio_path = os.path.join(wav_path, wav_subdir, filename)
551
+ yield key, {
552
+ "file": audio_path,
553
+ "audio": audio_path,
554
+ "label": emo.replace("exc", "hap"),
555
+ }
556
+ key += 1
557
+
558
+
559
+ class SdData:
560
+ def __init__(self, data_dir):
561
+ """Load sd data."""
562
+ self.segments = self._load_segments_rechash(data_dir["segments"])
563
+ self.utt2spk = self._load_utt2spk(data_dir["utt2spk"])
564
+ self.wavs = self._load_wav_zip(data_dir["wav.zip"])
565
+ self.reco2dur = self._load_reco2dur(data_dir["reco2dur"])
566
+
567
+ def _load_segments_rechash(self, segments_file):
568
+ """Load segments file as dict with recid index."""
569
+ ret = {}
570
+ if not os.path.exists(segments_file):
571
+ return None
572
+ with open(segments_file, encoding="utf-8") as f:
573
+ for line in f:
574
+ utt, rec, st, et = line.strip().split()
575
+ if rec not in ret:
576
+ ret[rec] = []
577
+ ret[rec].append({"utt": utt, "st": float(st), "et": float(et)})
578
+ return ret
579
+
580
+ def _load_wav_zip(self, wav_zip):
581
+ """Return dictionary { rec: wav_rxfilename }."""
582
+ wav_dir = os.path.join(wav_zip, "wav")
583
+ return {
584
+ os.path.splitext(filename)[0]: os.path.join(wav_dir, filename) for filename in sorted(os.listdir(wav_dir))
585
+ }
586
+
587
+ def _load_utt2spk(self, utt2spk_file):
588
+ """Returns dictionary { uttid: spkid }."""
589
+ with open(utt2spk_file, encoding="utf-8") as f:
590
+ lines = [line.strip().split(None, 1) for line in f]
591
+ return {x[0]: x[1] for x in lines}
592
+
593
+ def _load_reco2dur(self, reco2dur_file):
594
+ """Returns dictionary { recid: duration }."""
595
+ if not os.path.exists(reco2dur_file):
596
+ return None
597
+ with open(reco2dur_file, encoding="utf-8") as f:
598
+ lines = [line.strip().split(None, 1) for line in f]
599
+ return {x[0]: float(x[1]) for x in lines}
600
+
601
+
602
+ @dataclass
603
+ class SdArgs:
604
+ chunk_size: int = 2000
605
+ frame_shift: int = 160
606
+ subsampling: int = 1
607
+ label_delay: int = 0
608
+ num_speakers: int = 2
609
+ rate: int = 16000
610
+ use_last_samples: bool = True
611
+
612
+
613
+ def _generate_chunk_indices(data, args, split=None):
614
+ chunk_indices = [] if split != "test" else {}
615
+ # make chunk indices: filepath, start_frame, end_frame
616
+ for rec in data.wavs:
617
+ data_len = int(data.reco2dur[rec] * args.rate / args.frame_shift)
618
+ data_len = int(data_len / args.subsampling)
619
+ if split == "test":
620
+ chunk_indices[rec] = []
621
+ if split != "test":
622
+ for st, ed in _gen_frame_indices(
623
+ data_len,
624
+ args.chunk_size,
625
+ args.chunk_size,
626
+ args.use_last_samples,
627
+ label_delay=args.label_delay,
628
+ subsampling=args.subsampling,
629
+ ):
630
+ chunk_indices.append((rec, st * args.subsampling, ed * args.subsampling))
631
+ else:
632
+ for st, ed in _gen_chunk_indices(data_len, args.chunk_size):
633
+ chunk_indices[rec].append((rec, st * args.subsampling, ed * args.subsampling))
634
+ return chunk_indices
635
+
636
+
637
+ def _count_frames(data_len, size, step):
638
+ # no padding at edges, last remaining samples are ignored
639
+ return int((data_len - size + step) / step)
640
+
641
+
642
+ def _gen_frame_indices(data_length, size=2000, step=2000, use_last_samples=False, label_delay=0, subsampling=1):
643
+ i = -1
644
+ for i in range(_count_frames(data_length, size, step)):
645
+ yield i * step, i * step + size
646
+ if use_last_samples and i * step + size < data_length:
647
+ if data_length - (i + 1) * step - subsampling * label_delay > 0:
648
+ yield (i + 1) * step, data_length
649
+
650
+
651
+ def _gen_chunk_indices(data_len, chunk_size):
652
+ step = chunk_size
653
+ start = 0
654
+ while start < data_len:
655
+ end = min(data_len, start + chunk_size)
656
+ yield start, end
657
+ start += step
658
+
659
+
660
+ def _get_speakers(rec, data, args):
661
+ return [
662
+ {
663
+ "speaker_id": data.utt2spk[segment["utt"]],
664
+ "start": round(segment["st"] * args.rate / args.frame_shift),
665
+ "end": round(segment["et"] * args.rate / args.frame_shift),
666
+ }
667
+ for segment in data.segments[rec]
668
+ ]
669
+
670
+
671
+ def _split_ks_files(archive_path, split):
672
+ audio_path = os.path.join(archive_path, "**", "*.wav")
673
+ audio_paths = glob.glob(audio_path)
674
+ if split == "test":
675
+ # use all available files for the test archive
676
+ return {"test": audio_paths}
677
+
678
+ val_list_file = os.path.join(archive_path, "validation_list.txt")
679
+ test_list_file = os.path.join(archive_path, "testing_list.txt")
680
+ with open(val_list_file, encoding="utf-8") as f:
681
+ val_paths = f.read().strip().splitlines()
682
+ val_paths = [os.path.join(archive_path, p) for p in val_paths]
683
+ with open(test_list_file, encoding="utf-8") as f:
684
+ test_paths = f.read().strip().splitlines()
685
+ test_paths = [os.path.join(archive_path, p) for p in test_paths]
686
+
687
+ # the paths for the train set is just whichever paths that do not exist in
688
+ # either the test or validation splits
689
+ train_paths = list(set(audio_paths) - set(val_paths) - set(test_paths))
690
+
691
+ return {"train": train_paths, "val": val_paths}