Toshiki Tomihira commited on
Commit
bc4eb78
1 Parent(s): db18c6f

Add common voice

Browse files
Files changed (2) hide show
  1. README.md +120 -0
  2. common_voice.py +797 -0
README.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [Needs More Information]
2
+
3
+ # Dataset Card for common_voice
4
+
5
+ ## Table of Contents
6
+ - [Dataset Description](#dataset-description)
7
+ - [Dataset Summary](#dataset-summary)
8
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
9
+ - [Languages](#languages)
10
+ - [Dataset Structure](#dataset-structure)
11
+ - [Data Instances](#data-instances)
12
+ - [Data Fields](#data-instances)
13
+ - [Data Splits](#data-instances)
14
+ - [Dataset Creation](#dataset-creation)
15
+ - [Curation Rationale](#curation-rationale)
16
+ - [Source Data](#source-data)
17
+ - [Annotations](#annotations)
18
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
19
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
20
+ - [Social Impact of Dataset](#social-impact-of-dataset)
21
+ - [Discussion of Biases](#discussion-of-biases)
22
+ - [Other Known Limitations](#other-known-limitations)
23
+ - [Additional Information](#additional-information)
24
+ - [Dataset Curators](#dataset-curators)
25
+ - [Licensing Information](#licensing-information)
26
+ - [Citation Information](#citation-information)
27
+
28
+ ## Dataset Description
29
+
30
+ - **Homepage:** https://commonvoice.mozilla.org/en/datasets
31
+ - **Repository:** https://github.com/common-voice/common-voice
32
+ - **Paper:** https://commonvoice.mozilla.org/en/datasets
33
+ - **Leaderboard:** [Needs More Information]
34
+ - **Point of Contact:** [Needs More Information]
35
+
36
+ ### Dataset Summary
37
+
38
+ The Common Voice dataset consists of a unique MP3 and corresponding text file. Many of the 9,283 recorded hours in the dataset also include demographic metadata like age, sex, and accent that can help train the accuracy of speech recognition engines.
39
+
40
+ The dataset currently consists of 7,335 validated hours in 60 languages, but were always adding more voices and languages. Take a look at our Languages page to request a language or start contributing.
41
+
42
+ ### Supported Tasks and Leaderboards
43
+
44
+ [Needs More Information]
45
+
46
+ ### Languages
47
+
48
+ English
49
+
50
+ ## Dataset Structure
51
+
52
+ ### Data Instances
53
+
54
+ [Needs More Information]
55
+
56
+ ### Data Fields
57
+
58
+ [Needs More Information]
59
+
60
+ ### Data Splits
61
+
62
+ [Needs More Information]
63
+
64
+ ## Dataset Creation
65
+
66
+ ### Curation Rationale
67
+
68
+ [Needs More Information]
69
+
70
+ ### Source Data
71
+
72
+ #### Initial Data Collection and Normalization
73
+
74
+ [Needs More Information]
75
+
76
+ #### Who are the source language producers?
77
+
78
+ [Needs More Information]
79
+
80
+ ### Annotations
81
+
82
+ #### Annotation process
83
+
84
+ [Needs More Information]
85
+
86
+ #### Who are the annotators?
87
+
88
+ [Needs More Information]
89
+
90
+ ### Personal and Sensitive Information
91
+
92
+ The dataset consists of people who have donated their voice online. You agree to not attempt to determine the identity of speakers in the Common Voice dataset.
93
+
94
+ ## Considerations for Using the Data
95
+
96
+ ### Social Impact of Dataset
97
+
98
+ The dataset consists of people who have donated their voice online. You agree to not attempt to determine the identity of speakers in the Common Voice dataset.
99
+
100
+ ### Discussion of Biases
101
+
102
+ [More Information Needed]
103
+
104
+ ### Other Known Limitations
105
+
106
+ [More Information Needed]
107
+
108
+ ## Additional Information
109
+
110
+ ### Dataset Curators
111
+
112
+ [More Information Needed]
113
+
114
+ ### Licensing Information
115
+
116
+ [More Information Needed]
117
+
118
+ ### Citation Information
119
+
120
+ [More Information Needed]
common_voice.py ADDED
@@ -0,0 +1,797 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 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
+ """TODO: Add a description here."""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import os
20
+
21
+ import datasets
22
+
23
+
24
+ # TODO: Add BibTeX citation
25
+ # Find for instance the citation on arxiv or on the dataset repo/website
26
+ _CITATION = """\
27
+ @inproceedings{commonvoice:2020,
28
+ author = {Ardila, R. and Branson, M. and Davis, K. and Henretty, M. and Kohler, M. and Meyer, J. and Morais, R. and Saunders, L. and Tyers, F. M. and Weber, G.},
29
+ title = {Common Voice: A Massively-Multilingual Speech Corpus},
30
+ booktitle = {Proceedings of the 12th Conference on Language Resources and Evaluation (LREC 2020)},
31
+ pages = {4211--4215},
32
+ year = 2020
33
+ }
34
+ """
35
+
36
+ # TODO: Add description of the dataset here
37
+ # You can copy an official description
38
+ _DESCRIPTION = """\
39
+ Common Voice is Mozilla's initiative to help teach machines how real people speak.
40
+ The dataset currently consists of 7,335 validated hours of speech in 60 languages, but we’re always adding more voices and languages.
41
+ """
42
+
43
+ # TODO: Add a link to an official homepage for the dataset here
44
+ _HOMEPAGE = "https://commonvoice.mozilla.org/en/datasets"
45
+
46
+ # TODO: Add the licence for the dataset here if you can find it
47
+ _LICENSE = "https://github.com/common-voice/common-voice/blob/main/LICENSE"
48
+
49
+ # TODO: Add link to the official dataset URLs here
50
+ # The HuggingFace dataset library don't host the datasets but only point to the original files
51
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
52
+ _URLs = {
53
+ 'first_domain': "https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-6.1-2020-12-11/en.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQ3GQRTO3CAFSOHXG%2F20210212%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210212T082132Z&X-Amz-Expires=43200&X-Amz-Security-Token=FwoGZXIvYXdzEOr%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDDBRxPQbFwld%2BrOewCKSBOR7k7VaqtnM0zucItVC0gdXyV4Uh5qtOx0vhTzhGRJ2r0mKkJ5FNL8bMe5TWtcX0IEH8HHTs28S%2BDerVhBD%2FGKfxy6J4BQCjhR0J8AoqwEYm0qRVm5b7tbWBNYetD5c8HxYGWWRppvaYxRxdnRbupfKuGpMEf3eYskfH8tAA739HbcKj44LGe4lkKsGvI1avxrxrNugcrNF%2BOccEdNInU%2F%2BVQvoFUu93oAEhJWl8dWXswDtZSCmuvfTjCbsZjphoSfTz5t0T25qXwP3PpcZTRVrYm9rQ4GGwaiva9qs0Q0nA0mC0skcMLF%2BZMxfo4wtaDfneDoPgNITqHtLyXLKeXRwIhHUzjNriniNNTp3XJyivc6qr6uNJ23IysUKfqNfQ2EiZC07VEQlVcYoSBKNHvGEIHsXfICaQ4MyHSl7dJa0CaSOAjBytNMxxhqCCLylJ%2BEgnO45VS5X12z8D3vTyyjR67hqXKDHwdTioVTlK3j%2FTXWRHDw31EbikSkhDKubD%2F2VDJLMul7cXjpCWygmJXHKG%2BNQKM09vP3pdmuVuQ1Z8an8OPMTnGKJEOsKXkrCJTOjvQVAl7z4KKlA9UW0Hp0u%2FoZnT%2Fxgi7dvqwu1Fq7%2BRQ%2BkXi3LT6lA%2B%2BJfO2HEOnlcsg1TFompSGp0dD12F3iTQNmKAuakCdunLyQRd%2Bgi2vRmwfsPyHOnRiJVbyghoEWyKLHtmIEGMir%2B01wURSgc46vtaXqBOz5Gtj4bF5wkpw6TCh%2FiHFn7Fx6igw69uJmKtpI%3D&X-Amz-Signature=573df56b8f6aa8e13b2fa26fa0763718e25f2d7a33e0be97ea5ff82680d82474&X-Amz-SignedHeaders=host"
54
+ }
55
+
56
+ #_FILES = {
57
+ # "dev.tsv": "fields": {
58
+ # "client_id": "client_id",
59
+ # "path": "path to sound file"
60
+ # "sentence": "sentence pronounced",
61
+ # "up_votes": "upvotes by reviewers",
62
+ # "down_votes": "down votes by reviewers"
63
+ # "age": "Age of the speaker":
64
+ # "gender" "Gender of the speaker",
65
+ # "accent": "accent of the speaker",
66
+ # "locale": "location of the speaker",
67
+ # "segment": "segment",
68
+ # }
69
+ # "invalidated.tsv": {
70
+ # "client_id": "client_id",
71
+ # "path": "path to sound file"
72
+ # "sentence": "sentence pronounced",
73
+ # "up_votes": "upvotes by reviewers",
74
+ # "down_votes": "down votes by reviewers"
75
+ # "age": "Age of the speaker":
76
+ # "gender" "Gender of the speaker",
77
+ # "accent": "accent of the speaker",
78
+ # "locale": "location of the speaker",
79
+ # "segment": "segment"}
80
+ # "other.tsv":
81
+ # {
82
+ # "client_id": "client_id",
83
+ # "path": "path to sound file"
84
+ # "sentence": "sentence pronounced",
85
+ # "up_votes": "upvotes by reviewers",
86
+ # "down_votes": "down votes by reviewers"
87
+ # "age": "Age of the speaker":
88
+ # "gender" "Gender of the speaker",
89
+ # "accent": "accent of the speaker",
90
+ # "locale": "location of the speaker",
91
+ # "segment": "segment", }
92
+ # "reported.tsv": {
93
+ # {
94
+ # "sentence": "sentence",
95
+ # "senetence_id": "sentence_id"
96
+ # "locale": "location of the speakr",
97
+ # "reason": "reason for report"
98
+ # }
99
+ # "test.tsv": {
100
+ # {
101
+ # "client_id": "client_id",
102
+ # "path": "path to sound file"
103
+ # "sentence": "sentence pronounced",
104
+ # "up_votes": "upvotes by reviewers",
105
+ # "down_votes": "down votes by reviewers"
106
+ # "age": "Age of the speaker":
107
+ # "gender" "Gender of the speaker",
108
+ # "accent": "accent of the speaker",
109
+ # "locale": "location of the speaker",
110
+ # "segment": "segment", }
111
+ # }
112
+ # "train.tsv": {
113
+ # {
114
+ # "client_id": "client_id",
115
+ # "path": "path to sound file"
116
+ # "sentence": "sentence pronounced",
117
+ # "up_votes": "upvotes by reviewers",
118
+ # "down_votes": "down votes by reviewers"
119
+ # "age": "Age of the speaker":
120
+ # "gender" "Gender of the speaker",
121
+ # "accent": "accent of the speaker",
122
+ # "locale": "location of the speaker",
123
+ # "segment": "segment", }
124
+ # }
125
+ # "validated.tsv": {
126
+ # {
127
+ # "client_id": "client_id",
128
+ # "path": "path to sound file"
129
+ # "sentence": "sentence pronounced",
130
+ # "up_votes": "upvotes by reviewers",
131
+ # "down_votes": "down votes by reviewers"
132
+ # "age": "Age of the speaker":
133
+ # "gender" "Gender of the speaker",
134
+ # "accent": "accent of the speaker",
135
+ # "locale": "location of the speaker",
136
+ # "segment": "segment", }
137
+ # }
138
+ #}
139
+
140
+ _LANGUAGES = {
141
+ "Abkhaz": {
142
+ "Date": "2020-12-11",
143
+ "Size": "39 MB",
144
+ "Version": "ab_1h_2020-12-11",
145
+ "Validated_Hr_Total": 0.05,
146
+ "Overall_Hr_Total": 1,
147
+ "Number_Of_Voice": 14
148
+ },
149
+ "Arabic": {
150
+ "Date": "2020-12-11",
151
+ "Size": "39 MB",
152
+ "Version": "ab_1h_2020-12-11",
153
+ "Validated_Hr_Total": 0.05,
154
+ "Overall_Hr_Total": 1,
155
+ "Number_Of_Voice": 14
156
+ },
157
+ "Assamese": {
158
+ "Date": "2020-12-11",
159
+ "Size": "39 MB",
160
+ "Version": "ab_1h_2020-12-11",
161
+ "Validated_Hr_Total": 0.05,
162
+ "Overall_Hr_Total": 1,
163
+ "Number_Of_Voice": 14
164
+ },
165
+ "Breton": {
166
+ "Date": "2020-12-11",
167
+ "Size": "39 MB",
168
+ "Version": "ab_1h_2020-12-11",
169
+ "Validated_Hr_Total": 0.05,
170
+ "Overall_Hr_Total": 1,
171
+ "Number_Of_Voice": 14
172
+ },
173
+ "Catalan": {
174
+ "Date": "2020-12-11",
175
+ "Size": "39 MB",
176
+ "Version": "ab_1h_2020-12-11",
177
+ "Validated_Hr_Total": 0.05,
178
+ "Overall_Hr_Total": 1,
179
+ "Number_Of_Voice": 14
180
+ },
181
+ "Hakha Chin": {
182
+ "Date": "2020-12-11",
183
+ "Size": "39 MB",
184
+ "Version": "ab_1h_2020-12-11",
185
+ "Validated_Hr_Total": 0.05,
186
+ "Overall_Hr_Total": 1,
187
+ "Number_Of_Voice": 14
188
+ },
189
+ "Czech": {
190
+ "Date": "2020-12-11",
191
+ "Size": "39 MB",
192
+ "Version": "ab_1h_2020-12-11",
193
+ "Validated_Hr_Total": 0.05,
194
+ "Overall_Hr_Total": 1,
195
+ "Number_Of_Voice": 14
196
+ },
197
+ "Chuvash": {
198
+ "Date": "2020-12-11",
199
+ "Size": "39 MB",
200
+ "Version": "ab_1h_2020-12-11",
201
+ "Validated_Hr_Total": 0.05,
202
+ "Overall_Hr_Total": 1,
203
+ "Number_Of_Voice": 14
204
+ },
205
+ "Welsh": {
206
+ "Date": "2020-12-11",
207
+ "Size": "39 MB",
208
+ "Version": "ab_1h_2020-12-11",
209
+ "Validated_Hr_Total": 0.05,
210
+ "Overall_Hr_Total": 1,
211
+ "Number_Of_Voice": 14
212
+ },
213
+ "Abkhaz": {
214
+ "Date": "2020-12-11",
215
+ "Size": "39 MB",
216
+ "Version": "ab_1h_2020-12-11",
217
+ "Validated_Hr_Total": 0.05,
218
+ "Overall_Hr_Total": 1,
219
+ "Number_Of_Voice": 14
220
+ },
221
+ "German": {
222
+ "Date": "2020-12-11",
223
+ "Size": "39 MB",
224
+ "Version": "ab_1h_2020-12-11",
225
+ "Validated_Hr_Total": 0.05,
226
+ "Overall_Hr_Total": 1,
227
+ "Number_Of_Voice": 14
228
+ },
229
+ "Dhivehi": {
230
+ "Date": "2020-12-11",
231
+ "Size": "39 MB",
232
+ "Version": "ab_1h_2020-12-11",
233
+ "Validated_Hr_Total": 0.05,
234
+ "Overall_Hr_Total": 1,
235
+ "Number_Of_Voice": 14
236
+ },
237
+ "Greek": {
238
+ "Date": "2020-12-11",
239
+ "Size": "39 MB",
240
+ "Version": "ab_1h_2020-12-11",
241
+ "Validated_Hr_Total": 0.05,
242
+ "Overall_Hr_Total": 1,
243
+ "Number_Of_Voice": 14
244
+ },
245
+ "English": {
246
+ "Date": "2020-12-11",
247
+ "Size": "39 MB",
248
+ "Version": "ab_1h_2020-12-11",
249
+ "Validated_Hr_Total": 0.05,
250
+ "Overall_Hr_Total": 1,
251
+ "Number_Of_Voice": 14
252
+ },
253
+ "Esperanto": {
254
+ "Date": "2020-12-11",
255
+ "Size": "39 MB",
256
+ "Version": "ab_1h_2020-12-11",
257
+ "Validated_Hr_Total": 0.05,
258
+ "Overall_Hr_Total": 1,
259
+ "Number_Of_Voice": 14
260
+ },
261
+ "Spanish": {
262
+ "Date": "2020-12-11",
263
+ "Size": "39 MB",
264
+ "Version": "ab_1h_2020-12-11",
265
+ "Validated_Hr_Total": 0.05,
266
+ "Overall_Hr_Total": 1,
267
+ "Number_Of_Voice": 14
268
+ },
269
+ "Estonian": {
270
+ "Date": "2020-12-11",
271
+ "Size": "39 MB",
272
+ "Version": "ab_1h_2020-12-11",
273
+ "Validated_Hr_Total": 0.05,
274
+ "Overall_Hr_Total": 1,
275
+ "Number_Of_Voice": 14
276
+ },
277
+ "Basque": {
278
+ "Date": "2020-12-11",
279
+ "Size": "39 MB",
280
+ "Version": "ab_1h_2020-12-11",
281
+ "Validated_Hr_Total": 0.05,
282
+ "Overall_Hr_Total": 1,
283
+ "Number_Of_Voice": 14
284
+ },
285
+ "Persian": {
286
+ "Date": "2020-12-11",
287
+ "Size": "39 MB",
288
+ "Version": "ab_1h_2020-12-11",
289
+ "Validated_Hr_Total": 0.05,
290
+ "Overall_Hr_Total": 1,
291
+ "Number_Of_Voice": 14
292
+ },
293
+ "Finnish": {
294
+ "Date": "2020-12-11",
295
+ "Size": "39 MB",
296
+ "Version": "ab_1h_2020-12-11",
297
+ "Validated_Hr_Total": 0.05,
298
+ "Overall_Hr_Total": 1,
299
+ "Number_Of_Voice": 14
300
+ },
301
+ "French": {
302
+ "Date": "2020-12-11",
303
+ "Size": "39 MB",
304
+ "Version": "ab_1h_2020-12-11",
305
+ "Validated_Hr_Total": 0.05,
306
+ "Overall_Hr_Total": 1,
307
+ "Number_Of_Voice": 14
308
+ },
309
+ "Frisian": {
310
+ "Date": "2020-12-11",
311
+ "Size": "39 MB",
312
+ "Version": "ab_1h_2020-12-11",
313
+ "Validated_Hr_Total": 0.05,
314
+ "Overall_Hr_Total": 1,
315
+ "Number_Of_Voice": 14
316
+ },
317
+ "Irish": {
318
+ "Date": "2020-12-11",
319
+ "Size": "39 MB",
320
+ "Version": "ab_1h_2020-12-11",
321
+ "Validated_Hr_Total": 0.05,
322
+ "Overall_Hr_Total": 1,
323
+ "Number_Of_Voice": 14
324
+ },
325
+ "Hindi": {
326
+ "Date": "2020-12-11",
327
+ "Size": "39 MB",
328
+ "Version": "ab_1h_2020-12-11",
329
+ "Validated_Hr_Total": 0.05,
330
+ "Overall_Hr_Total": 1,
331
+ "Number_Of_Voice": 14
332
+ },
333
+ "Sorbian, Upper": {
334
+ "Date": "2020-12-11",
335
+ "Size": "39 MB",
336
+ "Version": "ab_1h_2020-12-11",
337
+ "Validated_Hr_Total": 0.05,
338
+ "Overall_Hr_Total": 1,
339
+ "Number_Of_Voice": 14
340
+ },
341
+ "Hungarian": {
342
+ "Date": "2020-12-11",
343
+ "Size": "39 MB",
344
+ "Version": "ab_1h_2020-12-11",
345
+ "Validated_Hr_Total": 0.05,
346
+ "Overall_Hr_Total": 1,
347
+ "Number_Of_Voice": 14
348
+ },
349
+ "InterLinguia": {
350
+ "Date": "2020-12-11",
351
+ "Size": "39 MB",
352
+ "Version": "ab_1h_2020-12-11",
353
+ "Validated_Hr_Total": 0.05,
354
+ "Overall_Hr_Total": 1,
355
+ "Number_Of_Voice": 14
356
+ },
357
+ "Indonesian": {
358
+ "Date": "2020-12-11",
359
+ "Size": "39 MB",
360
+ "Version": "ab_1h_2020-12-11",
361
+ "Validated_Hr_Total": 0.05,
362
+ "Overall_Hr_Total": 1,
363
+ "Number_Of_Voice": 14
364
+ },
365
+ "Italian": {
366
+ "Date": "2020-12-11",
367
+ "Size": "39 MB",
368
+ "Version": "ab_1h_2020-12-11",
369
+ "Validated_Hr_Total": 0.05,
370
+ "Overall_Hr_Total": 1,
371
+ "Number_Of_Voice": 14
372
+ },
373
+ "Japanese": {
374
+ "Date": "2020-12-11",
375
+ "Size": "39 MB",
376
+ "Version": "ab_1h_2020-12-11",
377
+ "Validated_Hr_Total": 0.05,
378
+ "Overall_Hr_Total": 1,
379
+ "Number_Of_Voice": 14
380
+ },"Georgian": {
381
+ "Date": "2020-12-11",
382
+ "Size": "39 MB",
383
+ "Version": "ab_1h_2020-12-11",
384
+ "Validated_Hr_Total": 0.05,
385
+ "Overall_Hr_Total": 1,
386
+ "Number_Of_Voice": 14
387
+ },
388
+ "Kabyle": {
389
+ "Date": "2020-12-11",
390
+ "Size": "39 MB",
391
+ "Version": "ab_1h_2020-12-11",
392
+ "Validated_Hr_Total": 0.05,
393
+ "Overall_Hr_Total": 1,
394
+ "Number_Of_Voice": 14
395
+ },
396
+ "Kyrgyz": {
397
+ "Date": "2020-12-11",
398
+ "Size": "39 MB",
399
+ "Version": "ab_1h_2020-12-11",
400
+ "Validated_Hr_Total": 0.05,
401
+ "Overall_Hr_Total": 1,
402
+ "Number_Of_Voice": 14
403
+ },
404
+ "Luganda": {
405
+ "Date": "2020-12-11",
406
+ "Size": "39 MB",
407
+ "Version": "ab_1h_2020-12-11",
408
+ "Validated_Hr_Total": 0.05,
409
+ "Overall_Hr_Total": 1,
410
+ "Number_Of_Voice": 14
411
+ },
412
+ "German": {
413
+ "Date": "2020-12-11",
414
+ "Size": "39 MB",
415
+ "Version": "ab_1h_2020-12-11",
416
+ "Validated_Hr_Total": 0.05,
417
+ "Overall_Hr_Total": 1,
418
+ "Number_Of_Voice": 14
419
+ },
420
+ "Lithuanian": {
421
+ "Date": "2020-12-11",
422
+ "Size": "39 MB",
423
+ "Version": "ab_1h_2020-12-11",
424
+ "Validated_Hr_Total": 0.05,
425
+ "Overall_Hr_Total": 1,
426
+ "Number_Of_Voice": 14
427
+ },
428
+ "Latvian": {
429
+ "Date": "2020-12-11",
430
+ "Size": "39 MB",
431
+ "Version": "ab_1h_2020-12-11",
432
+ "Validated_Hr_Total": 0.05,
433
+ "Overall_Hr_Total": 1,
434
+ "Number_Of_Voice": 14
435
+ },
436
+ "Mongolian": {
437
+ "Date": "2020-12-11",
438
+ "Size": "39 MB",
439
+ "Version": "ab_1h_2020-12-11",
440
+ "Validated_Hr_Total": 0.05,
441
+ "Overall_Hr_Total": 1,
442
+ "Number_Of_Voice": 14
443
+ },
444
+ "Maltese": {
445
+ "Date": "2020-12-11",
446
+ "Size": "39 MB",
447
+ "Version": "ab_1h_2020-12-11",
448
+ "Validated_Hr_Total": 0.05,
449
+ "Overall_Hr_Total": 1,
450
+ "Number_Of_Voice": 14
451
+ },"Dutch": {
452
+ "Date": "2020-12-11",
453
+ "Size": "39 MB",
454
+ "Version": "ab_1h_2020-12-11",
455
+ "Validated_Hr_Total": 0.05,
456
+ "Overall_Hr_Total": 1,
457
+ "Number_Of_Voice": 14,
458
+ "Download_Link": "https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-6.1-2020-12-11/nl.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQ3GQRTO3ND4UAQXB%2F20210217%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210217T080740Z&X-Amz-Expires=43200&X-Amz-Security-Token=FwoGZXIvYXdzEGIaDCC6ALh%2FwIK9ovvRdCKSBCs5WaSJNsZ2h0SnhpnWFv4yiAJHJTe%2BY6pBcCqadRMs0RABHeQ2n1QDACJ5V9WOqIHfMfT0AI%2Bfe6iFkTGLgRrJOMYpgV%2FmIBcXCjeb72r4ZvudMA8tprkSxZsEh53bJkIDQx1tXqfpz0yoefM0geD3461suEGhHnLIyiwffrUpRg%2BkNZN9%2FLZZXpF5F2pogieKKV533Jetkd1xlWOR%2Bem9R2bENu2RV563XX3JvbWxSYN9IHkVT1xwd4ZiOpUtX7%2F2RoluJUKw%2BUPpyml3J%2FOPPGdr7CyPLjqNxdq9ceRi8lRybty64XvNYZGt45VNTQ3pkTTz4VpUCJAGkgxq95Ve%2BOwW%2Fsc8JtblTFKrH11vej62NB7C0n7JPPS4SLKXHKW%2B7ZbybcNf3BnsAVouPdsGTMslcgkD81b9trnjyXJdOZkzdHUf2KcWVXVceEsZnMhcCZQ1cJpI7qXPEk8QrKCQcNByPLHmPIEdHpj9IrIBKDkl2qO7VX7CCB65WDt2eZRltOcNHXWVFXFktMdQOQztI1j0XSZz2iOX4jPKKaqz193VEytlAqmehNi8pePOnxkP9Z1SP7d3I6rayuBF3phmpHxw499tY3ECYYgoCnJ6QSFa3KxMjFmEpQlmjxuwEMHd4CDL2FJYGcCiIxbCcL1r8ZE3%2BbGdcu7PRsVCHX3Huh%2FqGIaF4h40FgteN6teyKCHKOebs4EGMipb9xmEMZ9ZbVopz4bkhLdMTrjKon9w624Xem0MTPqN7XY%2BB6lRgrW8rd4%3D&X-Amz-Signature=28eabdfce72a472a70b0f9e1e2c37fe1471b5ec8ed60614fbe900bfa97ae1ac8&X-Amz-SignedHeaders=host"
459
+ },"Odia": {
460
+ "Date": "2020-12-11",
461
+ "Size": "39 MB",
462
+ "Version": "ab_1h_2020-12-11",
463
+ "Validated_Hr_Total": 0.05,
464
+ "Overall_Hr_Total": 1,
465
+ "Number_Of_Voice": 14
466
+ },
467
+ "Punjabi": {
468
+ "Date": "2020-12-11",
469
+ "Size": "39 MB",
470
+ "Version": "ab_1h_2020-12-11",
471
+ "Validated_Hr_Total": 0.05,
472
+ "Overall_Hr_Total": 1,
473
+ "Number_Of_Voice": 14
474
+ },
475
+ "Polish": {
476
+ "Date": "2020-12-11",
477
+ "Size": "39 MB",
478
+ "Version": "ab_1h_2020-12-11",
479
+ "Validated_Hr_Total": 0.05,
480
+ "Overall_Hr_Total": 1,
481
+ "Number_Of_Voice": 14
482
+ },"Portuguese": {
483
+ "Date": "2020-12-11",
484
+ "Size": "39 MB",
485
+ "Version": "ab_1h_2020-12-11",
486
+ "Validated_Hr_Total": 0.05,
487
+ "Overall_Hr_Total": 1,
488
+ "Number_Of_Voice": 14
489
+ },"Romansh Sursilvan": {
490
+ "Date": "2020-12-11",
491
+ "Size": "39 MB",
492
+ "Version": "ab_1h_2020-12-11",
493
+ "Validated_Hr_Total": 0.05,
494
+ "Overall_Hr_Total": 1,
495
+ "Number_Of_Voice": 14
496
+ },"Romansh Vallader": {
497
+ "Date": "2020-12-11",
498
+ "Size": "39 MB",
499
+ "Version": "ab_1h_2020-12-11",
500
+ "Validated_Hr_Total": 0.05,
501
+ "Overall_Hr_Total": 1,
502
+ "Number_Of_Voice": 14
503
+ },"Romanian": {
504
+ "Date": "2020-12-11",
505
+ "Size": "39 MB",
506
+ "Version": "ab_1h_2020-12-11",
507
+ "Validated_Hr_Total": 0.05,
508
+ "Overall_Hr_Total": 1,
509
+ "Number_Of_Voice": 14
510
+ },"Russian": {
511
+ "Date": "2020-12-11",
512
+ "Size": "39 MB",
513
+ "Version": "ab_1h_2020-12-11",
514
+ "Validated_Hr_Total": 0.05,
515
+ "Overall_Hr_Total": 1,
516
+ "Number_Of_Voice": 14
517
+ },"Kinyarwanda": {
518
+ "Date": "2020-12-11",
519
+ "Size": "39 MB",
520
+ "Version": "ab_1h_2020-12-11",
521
+ "Validated_Hr_Total": 0.05,
522
+ "Overall_Hr_Total": 1,
523
+ "Number_Of_Voice": 14
524
+ },"Sakha": {
525
+ "Date": "2020-12-11",
526
+ "Size": "39 MB",
527
+ "Version": "ab_1h_2020-12-11",
528
+ "Validated_Hr_Total": 0.05,
529
+ "Overall_Hr_Total": 1,
530
+ "Number_Of_Voice": 14
531
+ },"Slovenian": {
532
+ "Date": "2020-12-11",
533
+ "Size": "39 MB",
534
+ "Version": "ab_1h_2020-12-11",
535
+ "Validated_Hr_Total": 0.05,
536
+ "Overall_Hr_Total": 1,
537
+ "Number_Of_Voice": 14
538
+ },"Swedish": {
539
+ "Date": "2020-12-11",
540
+ "Size": "39 MB",
541
+ "Version": "ab_1h_2020-12-11",
542
+ "Validated_Hr_Total": 0.05,
543
+ "Overall_Hr_Total": 1,
544
+ "Number_Of_Voice": 14
545
+ },"Tamil": {
546
+ "Date": "2020-12-11",
547
+ "Size": "39 MB",
548
+ "Version": "ab_1h_2020-12-11",
549
+ "Validated_Hr_Total": 0.05,
550
+ "Overall_Hr_Total": 1,
551
+ "Number_Of_Voice": 14
552
+ },"Thai": {
553
+ "Date": "2020-12-11",
554
+ "Size": "39 MB",
555
+ "Version": "ab_1h_2020-12-11",
556
+ "Validated_Hr_Total": 0.05,
557
+ "Overall_Hr_Total": 1,
558
+ "Number_Of_Voice": 14
559
+ },"Turkish": {
560
+ "Date": "2020-12-11",
561
+ "Size": "39 MB",
562
+ "Version": "ab_1h_2020-12-11",
563
+ "Validated_Hr_Total": 0.05,
564
+ "Overall_Hr_Total": 1,
565
+ "Number_Of_Voice": 14
566
+ },"Tatar": {
567
+ "Date": "2020-12-11",
568
+ "Size": "39 MB",
569
+ "Version": "ab_1h_2020-12-11",
570
+ "Validated_Hr_Total": 0.05,
571
+ "Overall_Hr_Total": 1,
572
+ "Number_Of_Voice": 14
573
+ },"Ukrainian": {
574
+ "Date": "2020-12-11",
575
+ "Size": "39 MB",
576
+ "Version": "ab_1h_2020-12-11",
577
+ "Validated_Hr_Total": 0.05,
578
+ "Overall_Hr_Total": 1,
579
+ "Number_Of_Voice": 14
580
+ },"Vietnamese": {
581
+ "Date": "2020-12-11",
582
+ "Size": "39 MB",
583
+ "Version": "ab_1h_2020-12-11",
584
+ "Validated_Hr_Total": 0.05,
585
+ "Overall_Hr_Total": 1,
586
+ "Number_Of_Voice": 14
587
+ },"Votic": {
588
+ "Date": "2020-12-11",
589
+ "Size": "39 MB",
590
+ "Version": "ab_1h_2020-12-11",
591
+ "Validated_Hr_Total": 0.05,
592
+ "Overall_Hr_Total": 1,
593
+ "Number_Of_Voice": 14
594
+ },"Chinese (China)": {
595
+ "Date": "2020-12-11",
596
+ "Size": "39 MB",
597
+ "Version": "ab_1h_2020-12-11",
598
+ "Validated_Hr_Total": 0.05,
599
+ "Overall_Hr_Total": 1,
600
+ "Number_Of_Voice": 14
601
+ },"Chinese (Hong Kong)": {
602
+ "Date": "2020-12-11",
603
+ "Size": "39 MB",
604
+ "Version": "ab_1h_2020-12-11",
605
+ "Validated_Hr_Total": 0.05,
606
+ "Overall_Hr_Total": 1,
607
+ "Number_Of_Voice": 14
608
+ },"Chinese (Taiwan": {
609
+ "Date": "2020-12-11",
610
+ "Size": "39 MB",
611
+ "Version": "ab_1h_2020-12-11",
612
+ "Validated_Hr_Total": 0.05,
613
+ "Overall_Hr_Total": 1,
614
+ "Number_Of_Voice": 14
615
+ }
616
+ }
617
+
618
+
619
+ class CommonVoiceConfig(datasets.BuilderConfig):
620
+ """BuilderConfig for CommonVoice."""
621
+
622
+ def __init__(self, name, sub_version, **kwargs):
623
+ """
624
+ Args:
625
+ data_dir: `string`, the path to the folder containing the files in the
626
+ downloaded .tar
627
+ citation: `string`, citation for the data set
628
+ url: `string`, url for information about the data set
629
+ **kwargs: keyword arguments forwarded to super.
630
+ """
631
+ self.language = name
632
+ self.sub_version = sub_version
633
+ self.date_of_snapshot = kwargs.pop("date", None)
634
+ self.size = kwargs.pop("size", None)
635
+ self.validated_hr_total = kwargs.pop("val_hrs", None)
636
+ self.total_hr_total = kwargs.pop("total_hrs", None)
637
+ self.num_of_voice = kwargs.pop("num_of_voice", None)
638
+ description = f"Common Voice speech to text dataset in {self.language} version {self.sub_version} of {self.date_of_snapshot}. The dataset comprises {self.validated_hr_total} of validated transcribed speech data from {self.num_of_voice} speakers. The dataset has a size of {self.size}"
639
+ super(CommonVoiceConfig, self).__init__(name=name, version=datasets.Version("6.1.0", ""), description=description, **kwargs)
640
+
641
+
642
+ # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
643
+ class CommonVoice(datasets.GeneratorBasedBuilder):
644
+ """TODO: Short description of my dataset."""
645
+
646
+ @property
647
+ def manual_download_instructions(self):
648
+ return """\
649
+ You need to go to https://commonvoice.mozilla.org/en/datasets,
650
+ and manually download the dataset as a .tar file. Once it is completed,
651
+ a folder will be made containing the files, validated.tsv, train.tsv, test.tsv, reported.tsv, other.tsv, invalidated.tsv, dev.tsv
652
+ and the folder clips containing audiofiles sampled at 48khz. Each clip is around 3-4 seconds in duration with a size of around 20-50 khz"""
653
+
654
+ BUILDER_CONFIGS = [
655
+ CommonVoiceConfig(
656
+ name=lang,
657
+ sub_version=_LANGUAGES[lang]["Version"],
658
+ date=_LANGUAGES[lang]["Date"],
659
+ size=_LANGUAGES[lang]["Size"],
660
+ val_hrs=_LANGUAGES[lang]["Validated_Hr_Total"],
661
+ total_hrs=_LANGUAGES[lang]["Overall_Hr_Total"],
662
+ num_of_voice=_LANGUAGES[lang]["Number_Of_Voice"],
663
+ )
664
+ for lang in _LANGUAGES.keys()
665
+ ]
666
+
667
+ # DEFAULT_CONFIG_NAME = "first_domain" # It's not mandatory to have a default configuration. Just use one if it make sense.
668
+
669
+ def _info(self):
670
+ # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
671
+ # if self.config.name == "first_domain": # This is the name of the configuration selected in BUILDER_CONFIGS above
672
+ # features = datasets.Features(
673
+ # {
674
+ # "client_id": datasets.Value("string"),
675
+ # "path": datasets.Value("string"),
676
+ # "sentence": datasets.Value("string"),
677
+ # "up_votes": datasets.Value("int64"),
678
+ # "down_votes": datasets.Value("int64"),
679
+ # "age": datasets.Value("string"),
680
+ # "gender": datasets.Value("string"),
681
+ # "locale": datasets.Value("string"),
682
+ # "segmet": datasets.Value("string"),
683
+ #
684
+ # These are the features of your dataset like images, labels ...
685
+ # }
686
+ # )
687
+ #
688
+ # else: # This is an example to show how to have different features for "first_domain" and "second_domain"
689
+ features = datasets.Features(
690
+ {
691
+ "client_id": datasets.Value("string"),
692
+ "path": datasets.Value("string"),
693
+ "sentence": datasets.Value("string"),
694
+ "up_votes": datasets.Value("int64"),
695
+ "down_votes": datasets.Value("int64"),
696
+ "age": datasets.Value("string"),
697
+ "gender": datasets.Value("string"),
698
+ "accent": datasets.Value("string"),
699
+ "locale": datasets.Value("string"),
700
+ "segment": datasets.Value("string"),
701
+ }
702
+ )
703
+
704
+ return datasets.DatasetInfo(
705
+ # This is the description that will appear on the datasets page.
706
+ description=_DESCRIPTION,
707
+ # This defines the different columns of the dataset and their types
708
+ features=features, # Here we define them above because they are different between the two configurations
709
+ # If there's a common (input, target) tuple from the features,
710
+ # specify them here. They'll be used if as_supervised=True in
711
+ # builder.as_dataset.
712
+ supervised_keys=None,
713
+ # Homepage of the dataset for documentation
714
+ homepage=_HOMEPAGE,
715
+ # License for the dataset if available
716
+ license=_LICENSE,
717
+ # Citation for the dataset
718
+ citation=_CITATION,
719
+ )
720
+
721
+ def _split_generators(self, dl_manager):
722
+ """Returns SplitGenerators."""
723
+ # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
724
+ # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
725
+
726
+ # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
727
+ # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
728
+ # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
729
+ abs_path_to_data = os.path.abspath(dl_manager.manual_dir)
730
+ abs_path_to_clips = os.path.join(abs_path_to_data, "clips")
731
+
732
+ return [
733
+ datasets.SplitGenerator(
734
+ name=datasets.Split.TRAIN,
735
+ gen_kwargs={
736
+ "filepath": os.path.join(abs_path_to_data, "train.tsv"),
737
+ "path_to_clips": abs_path_to_clips,
738
+ },
739
+ ),
740
+ datasets.SplitGenerator(
741
+ name=datasets.Split.TEST,
742
+ gen_kwargs={
743
+ "filepath": os.path.join(abs_path_to_data, "test.tsv"),
744
+ "path_to_clips": abs_path_to_clips,
745
+ },
746
+ ),
747
+ datasets.SplitGenerator(
748
+ name=datasets.Split.VALIDATION,
749
+ gen_kwargs={
750
+ "filepath": os.path.join(abs_path_to_data, "dev.tsv"),
751
+ "path_to_clips": abs_path_to_clips,
752
+ },
753
+ ),
754
+ datasets.SplitGenerator(
755
+ name="other",
756
+ gen_kwargs={
757
+ "filepath": os.path.join(abs_path_to_data, "other.tsv"),
758
+ "path_to_clips": abs_path_to_clips,
759
+ },
760
+ ),
761
+ datasets.SplitGenerator(
762
+ name="invalidated",
763
+ gen_kwargs={
764
+ "filepath": os.path.join(abs_path_to_data, "invalidated.tsv"),
765
+ "path_to_clips": abs_path_to_clips,
766
+ },
767
+ ),
768
+ ]
769
+
770
+ def _generate_examples(self, filepath, path_to_clips):
771
+ """ Yields examples. """
772
+ # TODO: This method will receive as arguments the `gen_kwargs` defined in the previous `_split_generators` method.
773
+ # It is in charge of opening the given file and yielding (key, example) tuples from the dataset
774
+ # The key is not important, it's more here for legacy reason (legacy from tfds)
775
+ data_fields = list(self._info().features.keys())
776
+ path_idx = data_fields.index("path")
777
+
778
+ with open(filepath, encoding="utf-8") as f:
779
+ lines = f.readlines()
780
+ headline = lines[0]
781
+
782
+ column_names = headline.strip().split("\t")
783
+ assert column_names == data_fields, f"The file should have {data_fields} as column names, but has {column_names}"
784
+
785
+ for id_, line in enumerate(lines[1:]):
786
+ field_values = line.strip().split("\t")
787
+
788
+ # set absolute path for mp3 audio file
789
+ field_values[path_idx] = os.path.join(path_to_clips, field_values[path_idx])
790
+
791
+ # if data is incomplete, fill with empty values
792
+ if len(field_values) < len(data_fields):
793
+ field_values += (len(data_fields) - len(field_values)) * ["''"]
794
+
795
+ yield id_, {
796
+ key: value for key, value in zip(data_fields, field_values)
797
+ }