phongdtd
commited on
Commit
·
a873fa7
1
Parent(s):
1c1db08
update link
Browse files- .idea/custom_common_voice.iml +1 -1
- README.md +36 -238
- dataset_infos.json +2 -2
- custom_common_voice.py → youtube_casual_audio.py +11 -77
.idea/custom_common_voice.iml
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
<content url="file://$MODULE_DIR$">
|
| 5 |
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
| 6 |
</content>
|
| 7 |
-
<orderEntry type="
|
| 8 |
<orderEntry type="sourceFolder" forTests="false" />
|
| 9 |
</component>
|
| 10 |
</module>
|
|
|
|
| 4 |
<content url="file://$MODULE_DIR$">
|
| 5 |
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
| 6 |
</content>
|
| 7 |
+
<orderEntry type="inheritedJdk" />
|
| 8 |
<orderEntry type="sourceFolder" forTests="false" />
|
| 9 |
</component>
|
| 10 |
</module>
|
README.md
CHANGED
|
@@ -1,202 +1,30 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
language_creators:
|
| 6 |
- crowdsourced
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
- ca
|
| 13 |
-
- cnh
|
| 14 |
-
- cs
|
| 15 |
-
- cv
|
| 16 |
-
- cy
|
| 17 |
-
- de
|
| 18 |
-
- dv
|
| 19 |
-
- el
|
| 20 |
-
- en
|
| 21 |
-
- eo
|
| 22 |
-
- es
|
| 23 |
-
- et
|
| 24 |
-
- eu
|
| 25 |
-
- fa
|
| 26 |
-
- fi
|
| 27 |
-
- fr
|
| 28 |
-
- fy-NL
|
| 29 |
-
- ga-IE
|
| 30 |
-
- hi
|
| 31 |
-
- hsb
|
| 32 |
-
- hu
|
| 33 |
-
- ia
|
| 34 |
-
- id
|
| 35 |
-
- it
|
| 36 |
-
- ja
|
| 37 |
-
- ka
|
| 38 |
-
- kab
|
| 39 |
-
- ky
|
| 40 |
-
- lg
|
| 41 |
-
- lt
|
| 42 |
-
- lv
|
| 43 |
-
- mn
|
| 44 |
-
- mt
|
| 45 |
-
- nl
|
| 46 |
-
- or
|
| 47 |
-
- pa-IN
|
| 48 |
-
- pl
|
| 49 |
-
- pt
|
| 50 |
-
- rm-sursilv
|
| 51 |
-
- rm-vallader
|
| 52 |
-
- ro
|
| 53 |
-
- ru
|
| 54 |
-
- rw
|
| 55 |
-
- sah
|
| 56 |
-
- sl
|
| 57 |
-
- sv-SE
|
| 58 |
-
- ta
|
| 59 |
-
- th
|
| 60 |
-
- tr
|
| 61 |
-
- tt
|
| 62 |
-
- uk
|
| 63 |
- vi
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
- zh-HK
|
| 67 |
-
- zh-TW
|
| 68 |
-
licenses:
|
| 69 |
- cc0-1.0
|
|
|
|
| 70 |
multilinguality:
|
| 71 |
-
- multilingual
|
| 72 |
-
size_categories:
|
| 73 |
-
ab:
|
| 74 |
-
- n<1K
|
| 75 |
-
ar:
|
| 76 |
-
- 10K<n<100K
|
| 77 |
-
as:
|
| 78 |
-
- n<1K
|
| 79 |
-
br:
|
| 80 |
-
- 10K<n<100K
|
| 81 |
-
ca:
|
| 82 |
-
- 100K<n<1M
|
| 83 |
-
cnh:
|
| 84 |
-
- 1K<n<10K
|
| 85 |
-
cs:
|
| 86 |
-
- 10K<n<100K
|
| 87 |
-
cv:
|
| 88 |
-
- 10K<n<100K
|
| 89 |
-
cy:
|
| 90 |
-
- 10K<n<100K
|
| 91 |
-
de:
|
| 92 |
-
- 100K<n<1M
|
| 93 |
-
dv:
|
| 94 |
-
- 1K<n<10K
|
| 95 |
-
el:
|
| 96 |
-
- 10K<n<100K
|
| 97 |
-
en:
|
| 98 |
-
- 100K<n<1M
|
| 99 |
-
eo:
|
| 100 |
-
- 10K<n<100K
|
| 101 |
-
es:
|
| 102 |
-
- 100K<n<1M
|
| 103 |
-
et:
|
| 104 |
-
- 10K<n<100K
|
| 105 |
-
eu:
|
| 106 |
-
- 10K<n<100K
|
| 107 |
-
fa:
|
| 108 |
-
- 10K<n<100K
|
| 109 |
-
fi:
|
| 110 |
-
- 1K<n<10K
|
| 111 |
-
fr:
|
| 112 |
-
- 100K<n<1M
|
| 113 |
-
fy-NL:
|
| 114 |
-
- 10K<n<100K
|
| 115 |
-
ga-IE:
|
| 116 |
-
- 1K<n<10K
|
| 117 |
-
hi:
|
| 118 |
-
- n<1K
|
| 119 |
-
hsb:
|
| 120 |
-
- 1K<n<10K
|
| 121 |
-
hu:
|
| 122 |
-
- 1K<n<10K
|
| 123 |
-
ia:
|
| 124 |
-
- 1K<n<10K
|
| 125 |
-
id:
|
| 126 |
-
- 10K<n<100K
|
| 127 |
-
it:
|
| 128 |
-
- 100K<n<1M
|
| 129 |
-
ja:
|
| 130 |
-
- 1K<n<10K
|
| 131 |
-
ka:
|
| 132 |
-
- 1K<n<10K
|
| 133 |
-
kab:
|
| 134 |
-
- 100K<n<1M
|
| 135 |
-
ky:
|
| 136 |
-
- 10K<n<100K
|
| 137 |
-
lg:
|
| 138 |
-
- 1K<n<10K
|
| 139 |
-
lt:
|
| 140 |
-
- 1K<n<10K
|
| 141 |
-
lv:
|
| 142 |
-
- 1K<n<10K
|
| 143 |
-
mn:
|
| 144 |
-
- 1K<n<10K
|
| 145 |
-
mt:
|
| 146 |
-
- 10K<n<100K
|
| 147 |
-
nl:
|
| 148 |
-
- 10K<n<100K
|
| 149 |
-
or:
|
| 150 |
-
- 1K<n<10K
|
| 151 |
-
pa-IN:
|
| 152 |
-
- 1K<n<10K
|
| 153 |
-
pl:
|
| 154 |
-
- 10K<n<100K
|
| 155 |
-
pt:
|
| 156 |
-
- 10K<n<100K
|
| 157 |
-
rm-sursilv:
|
| 158 |
-
- 1K<n<10K
|
| 159 |
-
rm-vallader:
|
| 160 |
-
- 1K<n<10K
|
| 161 |
-
ro:
|
| 162 |
-
- 1K<n<10K
|
| 163 |
-
ru:
|
| 164 |
-
- 10K<n<100K
|
| 165 |
-
rw:
|
| 166 |
-
- 100K<n<1M
|
| 167 |
-
sah:
|
| 168 |
-
- 1K<n<10K
|
| 169 |
-
sl:
|
| 170 |
-
- 1K<n<10K
|
| 171 |
-
sv-SE:
|
| 172 |
-
- 1K<n<10K
|
| 173 |
-
ta:
|
| 174 |
-
- 10K<n<100K
|
| 175 |
-
th:
|
| 176 |
-
- 10K<n<100K
|
| 177 |
-
tr:
|
| 178 |
-
- 1K<n<10K
|
| 179 |
-
tt:
|
| 180 |
-
- 10K<n<100K
|
| 181 |
-
uk:
|
| 182 |
-
- 10K<n<100K
|
| 183 |
vi:
|
| 184 |
-
-
|
| 185 |
-
|
| 186 |
-
- n<1K
|
| 187 |
-
zh-CN:
|
| 188 |
-
- 10K<n<100K
|
| 189 |
-
zh-HK:
|
| 190 |
-
- 10K<n<100K
|
| 191 |
-
zh-TW:
|
| 192 |
-
- 10K<n<100K
|
| 193 |
source_datasets:
|
| 194 |
-
- extended|
|
|
|
|
| 195 |
task_categories:
|
| 196 |
- speech-processing
|
|
|
|
| 197 |
task_ids:
|
| 198 |
- automatic-speech-recognition
|
| 199 |
-
paperswithcode_id: common-voice
|
| 200 |
---
|
| 201 |
|
| 202 |
# Dataset Card for common_voice
|
|
@@ -227,17 +55,15 @@ paperswithcode_id: common-voice
|
|
| 227 |
|
| 228 |
## Dataset Description
|
| 229 |
|
| 230 |
-
- **Homepage:**
|
| 231 |
-
- **Repository:**
|
| 232 |
-
- **Paper:**
|
| 233 |
- **Leaderboard:** [Needs More Information]
|
| 234 |
- **Point of Contact:** [Needs More Information]
|
| 235 |
|
| 236 |
### Dataset Summary
|
| 237 |
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
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.
|
| 241 |
|
| 242 |
### Supported Tasks and Leaderboards
|
| 243 |
|
|
@@ -245,7 +71,7 @@ The dataset currently consists of 7,335 validated hours in 60 languages, but we
|
|
| 245 |
|
| 246 |
### Languages
|
| 247 |
|
| 248 |
-
|
| 249 |
|
| 250 |
## Dataset Structure
|
| 251 |
|
|
@@ -254,47 +80,27 @@ English
|
|
| 254 |
A typical data point comprises the path to the audio file, called path and its sentence. Additional fields include accent, age, client_id, up_votes down_votes, gender, locale and segment.
|
| 255 |
|
| 256 |
`
|
| 257 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
`
|
| 259 |
|
| 260 |
### Data Fields
|
| 261 |
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
path: The path to the audio file
|
| 265 |
|
| 266 |
audio: A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate. Note that 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]`.
|
| 267 |
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
up_votes: How many upvotes the audio file has received from reviewers
|
| 271 |
-
|
| 272 |
-
down_votes: How many downvotes the audio file has received from reviewers
|
| 273 |
-
|
| 274 |
-
age: The age of the speaker.
|
| 275 |
-
|
| 276 |
-
gender: The gender of the speaker
|
| 277 |
-
|
| 278 |
-
accent: Accent of the speaker
|
| 279 |
-
|
| 280 |
-
locale: The locale of the speaker
|
| 281 |
-
|
| 282 |
-
segment: Usually empty field
|
| 283 |
|
| 284 |
### Data Splits
|
| 285 |
|
| 286 |
-
The speech material has been subdivided into portions for
|
| 287 |
-
|
| 288 |
-
The validated data is data that has been validated with reviewers and recieved upvotes that the data is of high quality.
|
| 289 |
-
|
| 290 |
-
The invalidated data is data has been invalidated by reviewers
|
| 291 |
-
and recieved downvotes that the data is of low quality.
|
| 292 |
|
| 293 |
-
The
|
| 294 |
-
|
| 295 |
-
The other data is data that has not yet been reviewed.
|
| 296 |
-
|
| 297 |
-
The dev, test, train are all data that has been reviewed, deemed of high quality and split into dev, test and train.
|
| 298 |
|
| 299 |
## Dataset Creation
|
| 300 |
|
|
@@ -324,13 +130,13 @@ The dev, test, train are all data that has been reviewed, deemed of high quality
|
|
| 324 |
|
| 325 |
### Personal and Sensitive Information
|
| 326 |
|
| 327 |
-
|
| 328 |
|
| 329 |
## Considerations for Using the Data
|
| 330 |
|
| 331 |
### Social Impact of Dataset
|
| 332 |
|
| 333 |
-
|
| 334 |
|
| 335 |
### Discussion of Biases
|
| 336 |
|
|
@@ -348,20 +154,12 @@ The dataset consists of people who have donated their voice online. You agree t
|
|
| 348 |
|
| 349 |
### Licensing Information
|
| 350 |
|
| 351 |
-
|
| 352 |
|
| 353 |
### Citation Information
|
| 354 |
|
| 355 |
-
|
| 356 |
-
@inproceedings{commonvoice:2020,
|
| 357 |
-
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.},
|
| 358 |
-
title = {Common Voice: A Massively-Multilingual Speech Corpus},
|
| 359 |
-
booktitle = {Proceedings of the 12th Conference on Language Resources and Evaluation (LREC 2020)},
|
| 360 |
-
pages = {4211--4215},
|
| 361 |
-
year = 2020
|
| 362 |
-
}
|
| 363 |
-
```
|
| 364 |
|
| 365 |
### Contributions
|
| 366 |
|
| 367 |
-
Thanks to [@
|
|
|
|
| 1 |
---
|
| 2 |
+
Pretty_name: Youtube Casual Audio
|
| 3 |
+
|
| 4 |
+
Annotations_creators:
|
|
|
|
| 5 |
- crowdsourced
|
| 6 |
+
|
| 7 |
+
Language_creators:
|
| 8 |
+
- datlq
|
| 9 |
+
|
| 10 |
+
Languages:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
- vi
|
| 12 |
+
|
| 13 |
+
Licenses:
|
|
|
|
|
|
|
|
|
|
| 14 |
- cc0-1.0
|
| 15 |
+
|
| 16 |
multilinguality:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
vi:
|
| 18 |
+
- 190K<n<200K
|
| 19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
source_datasets:
|
| 21 |
+
- extended|youtube
|
| 22 |
+
|
| 23 |
task_categories:
|
| 24 |
- speech-processing
|
| 25 |
+
|
| 26 |
task_ids:
|
| 27 |
- automatic-speech-recognition
|
|
|
|
| 28 |
---
|
| 29 |
|
| 30 |
# Dataset Card for common_voice
|
|
|
|
| 55 |
|
| 56 |
## Dataset Description
|
| 57 |
|
| 58 |
+
- **Homepage:** [Needs More Information]
|
| 59 |
+
- **Repository:** [Needs More Information]
|
| 60 |
+
- **Paper:** [Needs More Information]
|
| 61 |
- **Leaderboard:** [Needs More Information]
|
| 62 |
- **Point of Contact:** [Needs More Information]
|
| 63 |
|
| 64 |
### Dataset Summary
|
| 65 |
|
| 66 |
+
[Needs More Information]
|
|
|
|
|
|
|
| 67 |
|
| 68 |
### Supported Tasks and Leaderboards
|
| 69 |
|
|
|
|
| 71 |
|
| 72 |
### Languages
|
| 73 |
|
| 74 |
+
Vietnamese
|
| 75 |
|
| 76 |
## Dataset Structure
|
| 77 |
|
|
|
|
| 80 |
A typical data point comprises the path to the audio file, called path and its sentence. Additional fields include accent, age, client_id, up_votes down_votes, gender, locale and segment.
|
| 81 |
|
| 82 |
`
|
| 83 |
+
{
|
| 84 |
+
'file_path': 'audio/_1OsFqkFI38_34.304_39.424.wav',
|
| 85 |
+
'script': 'Ik vind dat een dubieuze procedure.',
|
| 86 |
+
'audio': {'path': 'audio/_1OsFqkFI38_34.304_39.424.wav',
|
| 87 |
+
'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
|
| 88 |
+
'sampling_rate': 16000}
|
| 89 |
`
|
| 90 |
|
| 91 |
### Data Fields
|
| 92 |
|
| 93 |
+
file_path: The path to the audio file
|
|
|
|
|
|
|
| 94 |
|
| 95 |
audio: A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate. Note that 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]`.
|
| 96 |
|
| 97 |
+
script: The sentence the user was prompted to speak
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
### Data Splits
|
| 100 |
|
| 101 |
+
The speech material has been subdivided into portions for train, test, validated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
+
The val, test, train are all data that has been reviewed, deemed of high quality and split into val, test and train.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
## Dataset Creation
|
| 106 |
|
|
|
|
| 130 |
|
| 131 |
### Personal and Sensitive Information
|
| 132 |
|
| 133 |
+
[Needs More Information]
|
| 134 |
|
| 135 |
## Considerations for Using the Data
|
| 136 |
|
| 137 |
### Social Impact of Dataset
|
| 138 |
|
| 139 |
+
[Needs More Information]
|
| 140 |
|
| 141 |
### Discussion of Biases
|
| 142 |
|
|
|
|
| 154 |
|
| 155 |
### Licensing Information
|
| 156 |
|
| 157 |
+
[Needs More Information]
|
| 158 |
|
| 159 |
### Citation Information
|
| 160 |
|
| 161 |
+
[Needs More Information]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
### Contributions
|
| 164 |
|
| 165 |
+
Thanks to [@datlq](https://github.com/datlq98) for adding this dataset.
|
dataset_infos.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04c7ab7fce049fbadb625937bd5594f09763621100cf5ad7601850795f702654
|
| 3 |
+
size 1081
|
custom_common_voice.py → youtube_casual_audio.py
RENAMED
|
@@ -21,25 +21,22 @@ import pandas as pd
|
|
| 21 |
import re
|
| 22 |
|
| 23 |
|
| 24 |
-
_DATA_URL = "https://dutudn-my.sharepoint.com/:u:/g/personal/122180028_sv1_dut_udn_vn/
|
| 25 |
_PROMPTS_URLS = {
|
| 26 |
-
"train": "https://drive.google.com/uc?export=download&id=
|
| 27 |
-
"test": "https://drive.google.com/uc?export=download&id=
|
| 28 |
-
"validation": "https://drive.google.com/uc?export=download&id=
|
| 29 |
}
|
| 30 |
|
| 31 |
_DESCRIPTION = """\
|
| 32 |
-
Common Voice is Mozilla's initiative to help teach machines how real people speak.
|
| 33 |
-
The dataset currently consists of 7,335 validated hours of speech in 60 languages, but we’re always adding more voices
|
| 34 |
-
and languages.
|
| 35 |
"""
|
| 36 |
|
| 37 |
_LANGUAGES = {
|
| 38 |
"vi": {
|
| 39 |
"Language": "Vietnamese",
|
| 40 |
-
"Date": "
|
| 41 |
-
"Size": "
|
| 42 |
-
"Version": "
|
| 43 |
"Validated_Hr_Total": 0.74,
|
| 44 |
"Overall_Hr_Total": 1,
|
| 45 |
"Number_Of_Voice": 62,
|
|
@@ -83,11 +80,6 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 83 |
name=lang_id,
|
| 84 |
language=_LANGUAGES[lang_id]["Language"],
|
| 85 |
sub_version=_LANGUAGES[lang_id]["Version"],
|
| 86 |
-
# date=_LANGUAGES[lang_id]["Date"],
|
| 87 |
-
# size=_LANGUAGES[lang_id]["Size"],
|
| 88 |
-
# val_hrs=_LANGUAGES[lang_id]["Validated_Hr_Total"],
|
| 89 |
-
# total_hrs=_LANGUAGES[lang_id]["Overall_Hr_Total"],
|
| 90 |
-
# num_of_voice=_LANGUAGES[lang_id]["Number_Of_Voice"],
|
| 91 |
)
|
| 92 |
for lang_id in _LANGUAGES.keys()
|
| 93 |
]
|
|
@@ -115,8 +107,7 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 115 |
"""Returns SplitGenerators."""
|
| 116 |
archive = dl_manager.download(_DATA_URL)
|
| 117 |
tsv_files = dl_manager.download(_PROMPTS_URLS)
|
| 118 |
-
path_to_data = "
|
| 119 |
-
path_to_clips = path_to_data + "audio"
|
| 120 |
|
| 121 |
return [
|
| 122 |
datasets.SplitGenerator(
|
|
@@ -124,7 +115,7 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 124 |
gen_kwargs={
|
| 125 |
"tsv_files": tsv_files["train"],
|
| 126 |
"audio_files": dl_manager.iter_archive(archive),
|
| 127 |
-
"path_to_clips":
|
| 128 |
},
|
| 129 |
),
|
| 130 |
datasets.SplitGenerator(
|
|
@@ -132,7 +123,7 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 132 |
gen_kwargs={
|
| 133 |
"tsv_files": tsv_files["test"],
|
| 134 |
"audio_files": dl_manager.iter_archive(archive),
|
| 135 |
-
"path_to_clips":
|
| 136 |
},
|
| 137 |
),
|
| 138 |
datasets.SplitGenerator(
|
|
@@ -140,25 +131,9 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 140 |
gen_kwargs={
|
| 141 |
"tsv_files": tsv_files["validation"],
|
| 142 |
"audio_files": dl_manager.iter_archive(archive),
|
| 143 |
-
"path_to_clips":
|
| 144 |
},
|
| 145 |
),
|
| 146 |
-
# datasets.SplitGenerator(
|
| 147 |
-
# name="other",
|
| 148 |
-
# gen_kwargs={
|
| 149 |
-
# "files": dl_manager.iter_archive(archive),
|
| 150 |
-
# "filepath": "/".join([path_to_data, "other.tsv"]),
|
| 151 |
-
# "path_to_clips": path_to_clips,
|
| 152 |
-
# },
|
| 153 |
-
# ),
|
| 154 |
-
# datasets.SplitGenerator(
|
| 155 |
-
# name="invalidated",
|
| 156 |
-
# gen_kwargs={
|
| 157 |
-
# "files": dl_manager.iter_archive(archive),
|
| 158 |
-
# "filepath": "/".join([path_to_data, "invalidated.tsv"]),
|
| 159 |
-
# "path_to_clips": path_to_clips,
|
| 160 |
-
# },
|
| 161 |
-
# ),
|
| 162 |
]
|
| 163 |
|
| 164 |
def _generate_examples(self, tsv_files, audio_files, path_to_clips):
|
|
@@ -190,49 +165,8 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 190 |
"duration": duration
|
| 191 |
}
|
| 192 |
|
| 193 |
-
# inside_clips_dir = False
|
| 194 |
-
|
| 195 |
for path, f in audio_files:
|
| 196 |
if path.startswith(path_to_clips):
|
| 197 |
-
# inside_clips_dir = True
|
| 198 |
if path in examples:
|
| 199 |
audio = {"path": path, "bytes": f.read()}
|
| 200 |
yield path, {**examples[path], "audio": audio}
|
| 201 |
-
# elif "custom_common_voice.tsv" in path:
|
| 202 |
-
# continue
|
| 203 |
-
# elif ".txt" in path:
|
| 204 |
-
# continue
|
| 205 |
-
# elif inside_clips_dir:
|
| 206 |
-
# break
|
| 207 |
-
|
| 208 |
-
# for path, f in tsv_files:
|
| 209 |
-
# if path == filepath:
|
| 210 |
-
# metadata_found = True
|
| 211 |
-
# lines = f.readlines()
|
| 212 |
-
# headline = lines[0]
|
| 213 |
-
# column_names = headline.strip().split("\t")
|
| 214 |
-
# assert (
|
| 215 |
-
# column_names == data_fields
|
| 216 |
-
# ), f"The file should have {data_fields} as column names, but has {column_names}"
|
| 217 |
-
# for line in lines[1:]:
|
| 218 |
-
# field_values = line.strip().split("\t")
|
| 219 |
-
# # set full path for mp3 audio file
|
| 220 |
-
# audio_path = path_to_clips + "/" + field_values[path_idx]
|
| 221 |
-
# all_field_values[audio_path] = field_values
|
| 222 |
-
# elif path.startswith(path_to_clips):
|
| 223 |
-
# assert metadata_found, "Found audio clips before the metadata TSV file."
|
| 224 |
-
# if not all_field_values:
|
| 225 |
-
# break
|
| 226 |
-
# if path in all_field_values:
|
| 227 |
-
# field_values = all_field_values[path]
|
| 228 |
-
#
|
| 229 |
-
# # if data is incomplete, fill with empty values
|
| 230 |
-
# if len(field_values) < len(data_fields):
|
| 231 |
-
# field_values += (len(data_fields) - len(field_values)) * ["''"]
|
| 232 |
-
#
|
| 233 |
-
# result = {key: value for key, value in zip(data_fields, field_values)}
|
| 234 |
-
#
|
| 235 |
-
# # set audio feature
|
| 236 |
-
# result["audio"] = {"path": path, "bytes": f.read()}
|
| 237 |
-
#
|
| 238 |
-
# yield path, result
|
|
|
|
| 21 |
import re
|
| 22 |
|
| 23 |
|
| 24 |
+
_DATA_URL = "https://dutudn-my.sharepoint.com/:u:/g/personal/122180028_sv1_dut_udn_vn/Ed5mI5CjXIxHgb2qqPOElj0BBgn7FGT75SUgPdIuMS1LDw?download=1"
|
| 25 |
_PROMPTS_URLS = {
|
| 26 |
+
"train": "https://drive.google.com/uc?export=download&id=1s5d-1ZTzcxsnxUjiBLsv9KCB-yBcXyQ9",
|
| 27 |
+
"test": "https://drive.google.com/uc?export=download&id=1-l1QdNQ98DGZM63-GOKIVnFvxTz2SGeK",
|
| 28 |
+
"validation": "https://drive.google.com/uc?export=download&id=1GM_6s5icko6zRrldx8LcbANyl0geMSl8"
|
| 29 |
}
|
| 30 |
|
| 31 |
_DESCRIPTION = """\
|
|
|
|
|
|
|
|
|
|
| 32 |
"""
|
| 33 |
|
| 34 |
_LANGUAGES = {
|
| 35 |
"vi": {
|
| 36 |
"Language": "Vietnamese",
|
| 37 |
+
"Date": "2021-12-11",
|
| 38 |
+
"Size": "17000 MB",
|
| 39 |
+
"Version": "vi_100h_2020-12-11",
|
| 40 |
"Validated_Hr_Total": 0.74,
|
| 41 |
"Overall_Hr_Total": 1,
|
| 42 |
"Number_Of_Voice": 62,
|
|
|
|
| 80 |
name=lang_id,
|
| 81 |
language=_LANGUAGES[lang_id]["Language"],
|
| 82 |
sub_version=_LANGUAGES[lang_id]["Version"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
)
|
| 84 |
for lang_id in _LANGUAGES.keys()
|
| 85 |
]
|
|
|
|
| 107 |
"""Returns SplitGenerators."""
|
| 108 |
archive = dl_manager.download(_DATA_URL)
|
| 109 |
tsv_files = dl_manager.download(_PROMPTS_URLS)
|
| 110 |
+
path_to_data = "audio"
|
|
|
|
| 111 |
|
| 112 |
return [
|
| 113 |
datasets.SplitGenerator(
|
|
|
|
| 115 |
gen_kwargs={
|
| 116 |
"tsv_files": tsv_files["train"],
|
| 117 |
"audio_files": dl_manager.iter_archive(archive),
|
| 118 |
+
"path_to_clips": path_to_data,
|
| 119 |
},
|
| 120 |
),
|
| 121 |
datasets.SplitGenerator(
|
|
|
|
| 123 |
gen_kwargs={
|
| 124 |
"tsv_files": tsv_files["test"],
|
| 125 |
"audio_files": dl_manager.iter_archive(archive),
|
| 126 |
+
"path_to_clips": path_to_data,
|
| 127 |
},
|
| 128 |
),
|
| 129 |
datasets.SplitGenerator(
|
|
|
|
| 131 |
gen_kwargs={
|
| 132 |
"tsv_files": tsv_files["validation"],
|
| 133 |
"audio_files": dl_manager.iter_archive(archive),
|
| 134 |
+
"path_to_clips": path_to_data,
|
| 135 |
},
|
| 136 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
]
|
| 138 |
|
| 139 |
def _generate_examples(self, tsv_files, audio_files, path_to_clips):
|
|
|
|
| 165 |
"duration": duration
|
| 166 |
}
|
| 167 |
|
|
|
|
|
|
|
| 168 |
for path, f in audio_files:
|
| 169 |
if path.startswith(path_to_clips):
|
|
|
|
| 170 |
if path in examples:
|
| 171 |
audio = {"path": path, "bytes": f.read()}
|
| 172 |
yield path, {**examples[path], "audio": audio}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|