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
- timit_asr.py +2 -0
README.md
CHANGED
@@ -77,6 +77,9 @@ A typical data point comprises the path to the audio file, usually called `file`
|
|
77 |
```
|
78 |
{
|
79 |
'file': '/data/TRAIN/DR4/MMDM0/SI681.WAV',
|
|
|
|
|
|
|
80 |
'text': 'Would such an act of refusal be useful?',
|
81 |
'phonetic_detail': [{'start': '0', 'stop': '1960', 'utterance': 'h#'},
|
82 |
{'start': '1960', 'stop': '2466', 'utterance': 'w'},
|
@@ -130,6 +133,8 @@ A typical data point comprises the path to the audio file, usually called `file`
|
|
130 |
|
131 |
- file: A path to the downloaded audio file in .wav format.
|
132 |
|
|
|
|
|
133 |
- text: The transcription of the audio file.
|
134 |
|
135 |
- phonetic_detail: The phonemes that make up the sentence. The PHONCODE.DOC contains a table of all the phonemic and phonetic symbols used in TIMIT lexicon.
|
|
|
77 |
```
|
78 |
{
|
79 |
'file': '/data/TRAIN/DR4/MMDM0/SI681.WAV',
|
80 |
+
'audio': {'path': '/data/TRAIN/DR4/MMDM0/SI681.WAV',
|
81 |
+
'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346, 0.00091553, 0.00085449], dtype=float32),
|
82 |
+
'sampling_rate': 16000},
|
83 |
'text': 'Would such an act of refusal be useful?',
|
84 |
'phonetic_detail': [{'start': '0', 'stop': '1960', 'utterance': 'h#'},
|
85 |
{'start': '1960', 'stop': '2466', 'utterance': 'w'},
|
|
|
133 |
|
134 |
- file: A path to the downloaded audio file in .wav format.
|
135 |
|
136 |
+
- 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]`.
|
137 |
+
|
138 |
- text: The transcription of the audio file.
|
139 |
|
140 |
- phonetic_detail: The phonemes that make up the sentence. The PHONCODE.DOC contains a table of all the phonemic and phonetic symbols used in TIMIT lexicon.
|
timit_asr.py
CHANGED
@@ -77,6 +77,7 @@ class TimitASR(datasets.GeneratorBasedBuilder):
|
|
77 |
features=datasets.Features(
|
78 |
{
|
79 |
"file": datasets.Value("string"),
|
|
|
80 |
"text": datasets.Value("string"),
|
81 |
"phonetic_detail": datasets.Sequence(
|
82 |
{
|
@@ -163,6 +164,7 @@ class TimitASR(datasets.GeneratorBasedBuilder):
|
|
163 |
|
164 |
example = {
|
165 |
"file": wav_path,
|
|
|
166 |
"text": transcript,
|
167 |
"phonetic_detail": phonemes,
|
168 |
"word_detail": words,
|
|
|
77 |
features=datasets.Features(
|
78 |
{
|
79 |
"file": datasets.Value("string"),
|
80 |
+
"audio": datasets.features.Audio(sampling_rate=16_000),
|
81 |
"text": datasets.Value("string"),
|
82 |
"phonetic_detail": datasets.Sequence(
|
83 |
{
|
|
|
164 |
|
165 |
example = {
|
166 |
"file": wav_path,
|
167 |
+
"audio": wav_path,
|
168 |
"text": transcript,
|
169 |
"phonetic_detail": phonemes,
|
170 |
"word_detail": words,
|