Datasets:
Update files from the datasets library (from 1.13.3)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.13.3
- README.md +5 -0
- common_language.py +2 -0
README.md
CHANGED
@@ -124,6 +124,9 @@ A typical data point comprises the `path` to the audio file, and its label `lang
|
|
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',
|
@@ -137,6 +140,8 @@ A typical data point comprises the `path` to the audio file, and its label `lang
|
|
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
|
|
|
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 |
+
'audio': {'path': '/path/common_voice_kpd/Italian/train/itln_trn_sp_175/common_voice_it_18279446.wav',
|
128 |
+
'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
|
129 |
+
'sampling_rate': 48000},
|
130 |
'sentence': 'Con gli studenti è leggermente simile.',
|
131 |
'age': 'not_defined',
|
132 |
'gender': 'not_defined',
|
|
|
140 |
|
141 |
`path` (`string`): The path to the audio file
|
142 |
|
143 |
+
- `audio` (`dict`): 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]`.
|
144 |
+
|
145 |
`language` (`ClassLabel`): The language of the recording (see the `Languages` section above)
|
146 |
|
147 |
`sentence` (`string`): The sentence the user was prompted to speak
|
common_language.py
CHANGED
@@ -110,6 +110,7 @@ class CommonLanguage(datasets.GeneratorBasedBuilder):
|
|
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"),
|
@@ -164,6 +165,7 @@ class CommonLanguage(datasets.GeneratorBasedBuilder):
|
|
164 |
yield key, {
|
165 |
"client_id": client_id,
|
166 |
"path": path,
|
|
|
167 |
"sentence": sentence,
|
168 |
"age": age,
|
169 |
"gender": gender,
|
|
|
110 |
{
|
111 |
"client_id": datasets.Value("string"),
|
112 |
"path": datasets.Value("string"),
|
113 |
+
"audio": datasets.features.Audio(sampling_rate=48_000),
|
114 |
"sentence": datasets.Value("string"),
|
115 |
"age": datasets.Value("string"),
|
116 |
"gender": datasets.Value("string"),
|
|
|
165 |
yield key, {
|
166 |
"client_id": client_id,
|
167 |
"path": path,
|
168 |
+
"audio": path,
|
169 |
"sentence": sentence,
|
170 |
"age": age,
|
171 |
"gender": gender,
|