Commit
·
68cee86
1
Parent(s):
53591ab
Upload
Browse files- CommonLanguage.tar.gz +3 -0
- README.md +238 -0
- common_language.py +173 -0
- dataset_infos.json +1 -0
CommonLanguage.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94bde611700887527c223363bb1d2a22d0a5b55e0e381c5dc74ad67b06a267d7
|
| 3 |
+
size 3761951178
|
README.md
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: Common Language
|
| 3 |
+
annotations_creators:
|
| 4 |
+
- crowdsourced
|
| 5 |
+
language_creators:
|
| 6 |
+
- crowdsourced
|
| 7 |
+
languages:
|
| 8 |
+
- ar
|
| 9 |
+
- br
|
| 10 |
+
- ca
|
| 11 |
+
- cnh
|
| 12 |
+
- cs
|
| 13 |
+
- cv
|
| 14 |
+
- cy
|
| 15 |
+
- de
|
| 16 |
+
- dv
|
| 17 |
+
- el
|
| 18 |
+
- en
|
| 19 |
+
- eo
|
| 20 |
+
- es
|
| 21 |
+
- et
|
| 22 |
+
- eu
|
| 23 |
+
- fa
|
| 24 |
+
- fr
|
| 25 |
+
- fy-NL
|
| 26 |
+
- ia
|
| 27 |
+
- id
|
| 28 |
+
- it
|
| 29 |
+
- ja
|
| 30 |
+
- ka
|
| 31 |
+
- kab
|
| 32 |
+
- ky
|
| 33 |
+
- lv
|
| 34 |
+
- mn
|
| 35 |
+
- mt
|
| 36 |
+
- nl
|
| 37 |
+
- pl
|
| 38 |
+
- pt
|
| 39 |
+
- rm-sursilv
|
| 40 |
+
- ro
|
| 41 |
+
- ru
|
| 42 |
+
- rw
|
| 43 |
+
- sah
|
| 44 |
+
- sl
|
| 45 |
+
- sv-SE
|
| 46 |
+
- ta
|
| 47 |
+
- tr
|
| 48 |
+
- tt
|
| 49 |
+
- uk
|
| 50 |
+
- zh-CN
|
| 51 |
+
- zh-HK
|
| 52 |
+
- zh-TW
|
| 53 |
+
licenses:
|
| 54 |
+
- cc-by-nc-4.0
|
| 55 |
+
multilinguality:
|
| 56 |
+
- multilingual
|
| 57 |
+
size_categories:
|
| 58 |
+
- 100K<n<1M
|
| 59 |
+
source_datasets:
|
| 60 |
+
- extended|common_voice
|
| 61 |
+
task_categories:
|
| 62 |
+
- speech-processing
|
| 63 |
+
task_ids:
|
| 64 |
+
- speech-classification
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
# Dataset Card for common_language
|
| 68 |
+
|
| 69 |
+
## Table of Contents
|
| 70 |
+
- [Dataset Description](#dataset-description)
|
| 71 |
+
- [Dataset Summary](#dataset-summary)
|
| 72 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
| 73 |
+
- [Languages](#languages)
|
| 74 |
+
- [Dataset Structure](#dataset-structure)
|
| 75 |
+
- [Data Instances](#data-instances)
|
| 76 |
+
- [Data Fields](#data-fields)
|
| 77 |
+
- [Data Splits](#data-splits)
|
| 78 |
+
- [Dataset Creation](#dataset-creation)
|
| 79 |
+
- [Curation Rationale](#curation-rationale)
|
| 80 |
+
- [Source Data](#source-data)
|
| 81 |
+
- [Annotations](#annotations)
|
| 82 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
| 83 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
| 84 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
| 85 |
+
- [Discussion of Biases](#discussion-of-biases)
|
| 86 |
+
- [Other Known Limitations](#other-known-limitations)
|
| 87 |
+
- [Additional Information](#additional-information)
|
| 88 |
+
- [Dataset Curators](#dataset-curators)
|
| 89 |
+
- [Licensing Information](#licensing-information)
|
| 90 |
+
- [Citation Information](#citation-information)
|
| 91 |
+
- [Contributions](#contributions)
|
| 92 |
+
|
| 93 |
+
## Dataset Description
|
| 94 |
+
|
| 95 |
+
- **Homepage:** https://zenodo.org/record/5036977
|
| 96 |
+
- **Repository:** https://github.com/speechbrain/speechbrain/tree/develop/recipes/CommonLanguage
|
| 97 |
+
- **Paper:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 98 |
+
- **Leaderboard:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 99 |
+
- **Point of Contact:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 100 |
+
|
| 101 |
+
### Dataset Summary
|
| 102 |
+
|
| 103 |
+
This dataset is composed of speech recordings from languages that were carefully selected from the CommonVoice database. The total duration of audio recordings is 45.1 hours (i.e., 1 hour of material for each language). The dataset has been extracted from CommonVoice to train language-id systems.
|
| 104 |
+
|
| 105 |
+
### Supported Tasks and Leaderboards
|
| 106 |
+
|
| 107 |
+
The baselines for language-id are available in the SpeechBrain toolkit (see recipes/CommonLanguage):
|
| 108 |
+
https://github.com/speechbrain/speechbrain
|
| 109 |
+
|
| 110 |
+
### Languages
|
| 111 |
+
|
| 112 |
+
List of included languages:
|
| 113 |
+
```
|
| 114 |
+
Arabic, Basque, Breton, Catalan, Chinese_China, Chinese_Hongkong, Chinese_Taiwan, Chuvash, Czech, Dhivehi, Dutch, English, Esperanto, Estonian, French, Frisian, Georgian, German, Greek, Hakha_Chin, Indonesian, Interlingua, Italian, Japanese, Kabyle, Kinyarwanda, Kyrgyz, Latvian, Maltese, Mongolian, Persian, Polish, Portuguese, Romanian, Romansh_Sursilvan, Russian, Sakha, Slovenian, Spanish, Swedish, Tamil, Tatar, Turkish, Ukranian, Welsh
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
## Dataset Structure
|
| 118 |
+
|
| 119 |
+
### Data Instances
|
| 120 |
+
|
| 121 |
+
A typical data point comprises the `path` to the audio file, and its label `language`. Additional fields include `age`, `client_id`, `gender` and `sentence`.
|
| 122 |
+
|
| 123 |
+
```python
|
| 124 |
+
{
|
| 125 |
+
'client_id': 'itln_trn_sp_175',
|
| 126 |
+
'path': '/path/common_voice_kpd/Italian/train/itln_trn_sp_175/common_voice_it_18279446.wav',
|
| 127 |
+
'sentence': 'Con gli studenti è leggermente simile.',
|
| 128 |
+
'age': 'not_defined',
|
| 129 |
+
'gender': 'not_defined',
|
| 130 |
+
'language': 22
|
| 131 |
+
}
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
### Data Fields
|
| 135 |
+
|
| 136 |
+
`client_id` (`string`): An id for which client (voice) made the recording
|
| 137 |
+
|
| 138 |
+
`path` (`string`): The path to the audio file
|
| 139 |
+
|
| 140 |
+
`language` (`ClassLabel`): The language of the recording (see the `Languages` section above)
|
| 141 |
+
|
| 142 |
+
`sentence` (`string`): The sentence the user was prompted to speak
|
| 143 |
+
|
| 144 |
+
`age` (`string`): The age of the speaker.
|
| 145 |
+
|
| 146 |
+
`gender` (`string`): The gender of the speaker
|
| 147 |
+
|
| 148 |
+
### Data Splits
|
| 149 |
+
|
| 150 |
+
The dataset is already balanced and split into train, dev (validation) and test sets.
|
| 151 |
+
|
| 152 |
+
| Name | Train | Dev | Test |
|
| 153 |
+
|:---------------------------------:|:------:|:------:|:-----:|
|
| 154 |
+
| **# of utterances** | 177552 | 47104 | 47704 |
|
| 155 |
+
| **# unique speakers** | 11189 | 1297 | 1322 |
|
| 156 |
+
| **Total duration, hr** | 30.04 | 7.53 | 7.53 |
|
| 157 |
+
| **Min duration, sec** | 0.86 | 0.98 | 0.89 |
|
| 158 |
+
| **Mean duration, sec** | 4.87 | 4.61 | 4.55 |
|
| 159 |
+
| **Max duration, sec** | 21.72 | 105.67 | 29.83 |
|
| 160 |
+
| **Duration per language, min** | ~40 | ~10 | ~10 |
|
| 161 |
+
|
| 162 |
+
## Dataset Creation
|
| 163 |
+
|
| 164 |
+
### Curation Rationale
|
| 165 |
+
|
| 166 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 167 |
+
|
| 168 |
+
### Source Data
|
| 169 |
+
|
| 170 |
+
#### Initial Data Collection and Normalization
|
| 171 |
+
|
| 172 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 173 |
+
|
| 174 |
+
#### Who are the source language producers?
|
| 175 |
+
|
| 176 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 177 |
+
|
| 178 |
+
### Annotations
|
| 179 |
+
|
| 180 |
+
#### Annotation process
|
| 181 |
+
|
| 182 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 183 |
+
|
| 184 |
+
#### Who are the annotators?
|
| 185 |
+
|
| 186 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 187 |
+
|
| 188 |
+
### Personal and Sensitive Information
|
| 189 |
+
|
| 190 |
+
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.
|
| 191 |
+
|
| 192 |
+
## Considerations for Using the Data
|
| 193 |
+
|
| 194 |
+
### Social Impact of Dataset
|
| 195 |
+
|
| 196 |
+
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.
|
| 197 |
+
|
| 198 |
+
### Discussion of Biases
|
| 199 |
+
|
| 200 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 201 |
+
|
| 202 |
+
### Other Known Limitations
|
| 203 |
+
|
| 204 |
+
The Mongolian and Ukrainian languages are spelled as "Mangolian" and "Ukranian" in this version of the dataset.
|
| 205 |
+
|
| 206 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 207 |
+
|
| 208 |
+
## Additional Information
|
| 209 |
+
|
| 210 |
+
### Dataset Curators
|
| 211 |
+
|
| 212 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 213 |
+
|
| 214 |
+
### Licensing Information
|
| 215 |
+
|
| 216 |
+
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
| 217 |
+
|
| 218 |
+
### Citation Information
|
| 219 |
+
|
| 220 |
+
```
|
| 221 |
+
@dataset{ganesh_sinisetty_2021_5036977,
|
| 222 |
+
author = {Ganesh Sinisetty and
|
| 223 |
+
Pavlo Ruban and
|
| 224 |
+
Oleksandr Dymov and
|
| 225 |
+
Mirco Ravanelli},
|
| 226 |
+
title = {CommonLanguage},
|
| 227 |
+
month = jun,
|
| 228 |
+
year = 2021,
|
| 229 |
+
publisher = {Zenodo},
|
| 230 |
+
version = {0.1},
|
| 231 |
+
doi = {10.5281/zenodo.5036977},
|
| 232 |
+
url = {https://doi.org/10.5281/zenodo.5036977}
|
| 233 |
+
}
|
| 234 |
+
```
|
| 235 |
+
|
| 236 |
+
### Contributions
|
| 237 |
+
|
| 238 |
+
Thanks to [@anton-l](https://github.com/anton-l) for adding this dataset.
|
common_language.py
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
""" Common Language Dataset"""
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
import glob
|
| 19 |
+
import os
|
| 20 |
+
|
| 21 |
+
import datasets
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
_DATA_URL = "CommonLanguage.tar.gz"
|
| 25 |
+
|
| 26 |
+
_CITATION = """\
|
| 27 |
+
@dataset{ganesh_sinisetty_2021_5036977,
|
| 28 |
+
author = {Ganesh Sinisetty and
|
| 29 |
+
Pavlo Ruban and
|
| 30 |
+
Oleksandr Dymov and
|
| 31 |
+
Mirco Ravanelli},
|
| 32 |
+
title = {CommonLanguage},
|
| 33 |
+
month = jun,
|
| 34 |
+
year = 2021,
|
| 35 |
+
publisher = {Zenodo},
|
| 36 |
+
version = {0.1},
|
| 37 |
+
doi = {10.5281/zenodo.5036977},
|
| 38 |
+
url = {https://doi.org/10.5281/zenodo.5036977}
|
| 39 |
+
}
|
| 40 |
+
"""
|
| 41 |
+
|
| 42 |
+
_DESCRIPTION = """\
|
| 43 |
+
This dataset is composed of speech recordings from languages that were carefully selected from the CommonVoice database.
|
| 44 |
+
The total duration of audio recordings is 45.1 hours (i.e., 1 hour of material for each language).
|
| 45 |
+
The dataset has been extracted from CommonVoice to train language-id systems.
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
_HOMEPAGE = "https://zenodo.org/record/5036977"
|
| 49 |
+
|
| 50 |
+
_LICENSE = "https://creativecommons.org/licenses/by/4.0/legalcode"
|
| 51 |
+
|
| 52 |
+
_LANGUAGES = [
|
| 53 |
+
"Arabic",
|
| 54 |
+
"Basque",
|
| 55 |
+
"Breton",
|
| 56 |
+
"Catalan",
|
| 57 |
+
"Chinese_China",
|
| 58 |
+
"Chinese_Hongkong",
|
| 59 |
+
"Chinese_Taiwan",
|
| 60 |
+
"Chuvash",
|
| 61 |
+
"Czech",
|
| 62 |
+
"Dhivehi",
|
| 63 |
+
"Dutch",
|
| 64 |
+
"English",
|
| 65 |
+
"Esperanto",
|
| 66 |
+
"Estonian",
|
| 67 |
+
"French",
|
| 68 |
+
"Frisian",
|
| 69 |
+
"Georgian",
|
| 70 |
+
"German",
|
| 71 |
+
"Greek",
|
| 72 |
+
"Hakha_Chin",
|
| 73 |
+
"Indonesian",
|
| 74 |
+
"Interlingua",
|
| 75 |
+
"Italian",
|
| 76 |
+
"Japanese",
|
| 77 |
+
"Kabyle",
|
| 78 |
+
"Kinyarwanda",
|
| 79 |
+
"Kyrgyz",
|
| 80 |
+
"Latvian",
|
| 81 |
+
"Maltese",
|
| 82 |
+
"Mangolian",
|
| 83 |
+
"Persian",
|
| 84 |
+
"Polish",
|
| 85 |
+
"Portuguese",
|
| 86 |
+
"Romanian",
|
| 87 |
+
"Romansh_Sursilvan",
|
| 88 |
+
"Russian",
|
| 89 |
+
"Sakha",
|
| 90 |
+
"Slovenian",
|
| 91 |
+
"Spanish",
|
| 92 |
+
"Swedish",
|
| 93 |
+
"Tamil",
|
| 94 |
+
"Tatar",
|
| 95 |
+
"Turkish",
|
| 96 |
+
"Ukranian",
|
| 97 |
+
"Welsh",
|
| 98 |
+
]
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
class CommonLanguage(datasets.GeneratorBasedBuilder):
|
| 102 |
+
VERSION = datasets.Version("0.1.0")
|
| 103 |
+
|
| 104 |
+
BUILDER_CONFIGS = [
|
| 105 |
+
datasets.BuilderConfig(name="full", version=VERSION, description="The entire Common Language dataset"),
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
+
def _info(self):
|
| 109 |
+
features = datasets.Features(
|
| 110 |
+
{
|
| 111 |
+
"client_id": datasets.Value("string"),
|
| 112 |
+
"path": datasets.Value("string"),
|
| 113 |
+
"sentence": datasets.Value("string"),
|
| 114 |
+
"age": datasets.Value("string"),
|
| 115 |
+
"gender": datasets.Value("string"),
|
| 116 |
+
"language": datasets.ClassLabel(names=_LANGUAGES),
|
| 117 |
+
}
|
| 118 |
+
)
|
| 119 |
+
|
| 120 |
+
return datasets.DatasetInfo(
|
| 121 |
+
description=_DESCRIPTION,
|
| 122 |
+
features=features,
|
| 123 |
+
supervised_keys=None,
|
| 124 |
+
homepage=_HOMEPAGE,
|
| 125 |
+
license=_LICENSE,
|
| 126 |
+
citation=_CITATION,
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
def _split_generators(self, dl_manager):
|
| 130 |
+
"""Returns SplitGenerators."""
|
| 131 |
+
|
| 132 |
+
dl_path = dl_manager.download_and_extract(_DATA_URL)
|
| 133 |
+
archive_path = os.path.join(dl_path, "common_voice_kpd/")
|
| 134 |
+
|
| 135 |
+
return [
|
| 136 |
+
datasets.SplitGenerator(
|
| 137 |
+
name=datasets.Split.TRAIN,
|
| 138 |
+
gen_kwargs={"archive_path": archive_path, "split": "train"},
|
| 139 |
+
),
|
| 140 |
+
datasets.SplitGenerator(
|
| 141 |
+
name=datasets.Split.VALIDATION,
|
| 142 |
+
gen_kwargs={"archive_path": archive_path, "split": "dev"},
|
| 143 |
+
),
|
| 144 |
+
datasets.SplitGenerator(
|
| 145 |
+
name=datasets.Split.TEST,
|
| 146 |
+
gen_kwargs={"archive_path": archive_path, "split": "test"},
|
| 147 |
+
),
|
| 148 |
+
]
|
| 149 |
+
|
| 150 |
+
def _generate_examples(self, archive_path, split):
|
| 151 |
+
"""Yields examples."""
|
| 152 |
+
|
| 153 |
+
csv_path_glob = os.path.join(archive_path, "**/", f"{split}.csv")
|
| 154 |
+
|
| 155 |
+
key = 0
|
| 156 |
+
for csv_path in sorted(glob.glob(csv_path_glob)):
|
| 157 |
+
with open(csv_path, encoding="utf-16") as fin:
|
| 158 |
+
next(fin) # skip the header
|
| 159 |
+
for line in fin:
|
| 160 |
+
client_id, wav_name, sentence, age, gender = line.strip().split("\t")[1:]
|
| 161 |
+
language = csv_path.split("/")[-2]
|
| 162 |
+
path = os.path.join(os.path.splitext(csv_path)[0], client_id, wav_name)
|
| 163 |
+
|
| 164 |
+
yield key, {
|
| 165 |
+
"client_id": client_id,
|
| 166 |
+
"path": path,
|
| 167 |
+
"sentence": sentence,
|
| 168 |
+
"age": age,
|
| 169 |
+
"gender": gender,
|
| 170 |
+
"language": language,
|
| 171 |
+
}
|
| 172 |
+
key += 1
|
| 173 |
+
|
dataset_infos.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"full": {"description": "This dataset is composed of speech recordings from languages that were carefully selected from the CommonVoice database.\nThe total duration of audio recordings is 45.1 hours (i.e., 1 hour of material for each language).\nThe dataset has been extracted from CommonVoice to train language-id systems.\n", "citation": "@dataset{ganesh_sinisetty_2021_5036977,\n author = {Ganesh Sinisetty and\n Pavlo Ruban and\n Oleksandr Dymov and\n Mirco Ravanelli},\n title = {CommonLanguage},\n month = jun,\n year = 2021,\n publisher = {Zenodo},\n version = {0.1},\n doi = {10.5281/zenodo.5036977},\n url = {https://doi.org/10.5281/zenodo.5036977}\n}\n", "homepage": "https://zenodo.org/record/5036977", "license": "https://creativecommons.org/licenses/by/4.0/legalcode", "features": {"client_id": {"dtype": "string", "id": null, "_type": "Value"}, "path": {"dtype": "string", "id": null, "_type": "Value"}, "sentence": {"dtype": "string", "id": null, "_type": "Value"}, "age": {"dtype": "string", "id": null, "_type": "Value"}, "gender": {"dtype": "string", "id": null, "_type": "Value"}, "language": {"num_classes": 45, "names": ["Arabic", "Basque", "Breton", "Catalan", "Chinese_China", "Chinese_Hongkong", "Chinese_Taiwan", "Chuvash", "Czech", "Dhivehi", "Dutch", "English", "Esperanto", "Estonian", "French", "Frisian", "Georgian", "German", "Greek", "Hakha_Chin", "Indonesian", "Interlingua", "Italian", "Japanese", "Kabyle", "Kinyarwanda", "Kyrgyz", "Latvian", "Maltese", "Mangolian", "Persian", "Polish", "Portuguese", "Romanian", "Romansh_Sursilvan", "Russian", "Sakha", "Slovenian", "Spanish", "Swedish", "Tamil", "Tatar", "Turkish", "Ukranian", "Welsh"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "common_language", "config_name": "full", "version": {"version_str": "0.1.0", "description": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7116761, "num_examples": 22194, "dataset_name": "common_language"}, "validation": {"name": "validation", "num_bytes": 1855233, "num_examples": 5888, "dataset_name": "common_language"}, "test": {"name": "test", "num_bytes": 1877970, "num_examples": 5963, "dataset_name": "common_language"}}, "download_checksums": {"CommonLanguage.tar.gz": {"num_bytes": 3761951178, "checksum": "94bde611700887527c223363bb1d2a22d0a5b55e0e381c5dc74ad67b06a267d7"}}, "download_size": 3761951178, "post_processing_size": null, "dataset_size": 10849964, "size_in_bytes": 3772801142}}
|