Commit
•
d09cfcc
0
Parent(s):
Update files from the datasets library (from 1.4.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.4.0
- .gitattributes +27 -0
- README.md +223 -0
- dataset_infos.json +1 -0
- dummy/clean/2.0.1/dummy_data.zip +3 -0
- timit_asr.py +174 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- other-LDC-User-Agreement-for-Non-Members
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- other
|
18 |
+
task_ids:
|
19 |
+
- other-other-automatic speech recognition
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for timit_asr
|
23 |
+
|
24 |
+
## Table of Contents
|
25 |
+
- [Dataset Description](#dataset-description)
|
26 |
+
- [Dataset Summary](#dataset-summary)
|
27 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
28 |
+
- [Languages](#languages)
|
29 |
+
- [Dataset Structure](#dataset-structure)
|
30 |
+
- [Data Instances](#data-instances)
|
31 |
+
- [Data Fields](#data-instances)
|
32 |
+
- [Data Splits](#data-instances)
|
33 |
+
- [Dataset Creation](#dataset-creation)
|
34 |
+
- [Curation Rationale](#curation-rationale)
|
35 |
+
- [Source Data](#source-data)
|
36 |
+
- [Annotations](#annotations)
|
37 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
38 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
39 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
40 |
+
- [Discussion of Biases](#discussion-of-biases)
|
41 |
+
- [Other Known Limitations](#other-known-limitations)
|
42 |
+
- [Additional Information](#additional-information)
|
43 |
+
- [Dataset Curators](#dataset-curators)
|
44 |
+
- [Licensing Information](#licensing-information)
|
45 |
+
- [Citation Information](#citation-information)
|
46 |
+
- [Contributions](#contributions)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- **Homepage:** [TIMIT Acoustic-Phonetic Continuous Speech Corpus](https://catalog.ldc.upenn.edu/LDC93S1)
|
51 |
+
- **Repository:** [Needs More Information]
|
52 |
+
- **Paper:** [TIMIT: Dataset designed to provide speech data for acoustic-phonetic studies and for the development and evaluation of automatic speech recognition systems.](https://catalog.ldc.upenn.edu/LDC93S1)
|
53 |
+
- **Leaderboard:** [Paperswithcode Leaderboard](https://paperswithcode.com/sota/speech-recognition-on-timit)
|
54 |
+
- **Point of Contact:** [Needs More Information]
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
The TIMIT corpus of read speech is designed to provide speech data for acoustic-phonetic studies and for the development and evaluation of automatic speech recognition systems. TIMIT contains broadband recordings of 630 speakers of eight major dialects of American English, each reading ten phonetically rich sentences. The TIMIT corpus includes time-aligned orthographic, phonetic and word transcriptions as well as a 16-bit, 16kHz speech waveform file for each utterance. Corpus design was a joint effort among the Massachusetts Institute of Technology (MIT), SRI International (SRI) and Texas Instruments, Inc. (TI). The speech was recorded at TI, transcribed at MIT and verified and prepared for CD-ROM production by the National Institute of Standards and Technology (NIST).
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
- `automatic-speech-recognition`, `speaker-identification`: The dataset can be used to train a model for Automatic Speech Recognition (ASR). The model is presented with an audio file and asked to transcribe the audio file to written text. The most common evaluation metric is the word error rate (WER). The task has an active leaderboard which can be found at https://paperswithcode.com/sota/speech-recognition-on-timit and ranks models based on their WER.
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
The audio is in English.
|
67 |
+
The TIMIT corpus transcriptions have been hand verified. Test and training subsets, balanced for phonetic and dialectal coverage, are specified. Tabular computer-searchable information is included as well as written documentation.
|
68 |
+
|
69 |
+
## Dataset Structure
|
70 |
+
|
71 |
+
### Data Instances
|
72 |
+
|
73 |
+
A typical data point comprises the path to the audio file, usually called `file` and its transcription, called `text`. Some additional information about the speaker and the passage which contains the transcription is provided.
|
74 |
+
|
75 |
+
```
|
76 |
+
{
|
77 |
+
'file': '/data/TRAIN/DR4/MMDM0/SI681.WAV',
|
78 |
+
'text': 'Would such an act of refusal be useful?',
|
79 |
+
'phonetic_detail': [{'start': '0', 'stop': '1960', 'utterance': 'h#'},
|
80 |
+
{'start': '1960', 'stop': '2466', 'utterance': 'w'},
|
81 |
+
{'start': '2466', 'stop': '3480', 'utterance': 'ix'},
|
82 |
+
{'start': '3480', 'stop': '4000', 'utterance': 'dcl'},
|
83 |
+
{'start': '4000', 'stop': '5960', 'utterance': 's'},
|
84 |
+
{'start': '5960', 'stop': '7480', 'utterance': 'ah'},
|
85 |
+
{'start': '7480', 'stop': '7880', 'utterance': 'tcl'},
|
86 |
+
{'start': '7880', 'stop': '9400', 'utterance': 'ch'},
|
87 |
+
{'start': '9400', 'stop': '9960', 'utterance': 'ix'},
|
88 |
+
{'start': '9960', 'stop': '10680', 'utterance': 'n'},
|
89 |
+
{'start': '10680', 'stop': '13480', 'utterance': 'ae'},
|
90 |
+
{'start': '13480', 'stop': '15680', 'utterance': 'kcl'},
|
91 |
+
{'start': '15680', 'stop': '15880', 'utterance': 't'},
|
92 |
+
{'start': '15880', 'stop': '16920', 'utterance': 'ix'},
|
93 |
+
{'start': '16920', 'stop': '18297', 'utterance': 'v'},
|
94 |
+
{'start': '18297', 'stop': '18882', 'utterance': 'r'},
|
95 |
+
{'start': '18882', 'stop': '19480', 'utterance': 'ix'},
|
96 |
+
{'start': '19480', 'stop': '21723', 'utterance': 'f'},
|
97 |
+
{'start': '21723', 'stop': '22516', 'utterance': 'y'},
|
98 |
+
{'start': '22516', 'stop': '24040', 'utterance': 'ux'},
|
99 |
+
{'start': '24040', 'stop': '25190', 'utterance': 'zh'},
|
100 |
+
{'start': '25190', 'stop': '27080', 'utterance': 'el'},
|
101 |
+
{'start': '27080', 'stop': '28160', 'utterance': 'bcl'},
|
102 |
+
{'start': '28160', 'stop': '28560', 'utterance': 'b'},
|
103 |
+
{'start': '28560', 'stop': '30120', 'utterance': 'iy'},
|
104 |
+
{'start': '30120', 'stop': '31832', 'utterance': 'y'},
|
105 |
+
{'start': '31832', 'stop': '33240', 'utterance': 'ux'},
|
106 |
+
{'start': '33240', 'stop': '34640', 'utterance': 's'},
|
107 |
+
{'start': '34640', 'stop': '35968', 'utterance': 'f'},
|
108 |
+
{'start': '35968', 'stop': '37720', 'utterance': 'el'},
|
109 |
+
{'start': '37720', 'stop': '39920', 'utterance': 'h#'}],
|
110 |
+
'word_detail': [{'start': '1960', 'stop': '4000', 'utterance': 'would'},
|
111 |
+
{'start': '4000', 'stop': '9400', 'utterance': 'such'},
|
112 |
+
{'start': '9400', 'stop': '10680', 'utterance': 'an'},
|
113 |
+
{'start': '10680', 'stop': '15880', 'utterance': 'act'},
|
114 |
+
{'start': '15880', 'stop': '18297', 'utterance': 'of'},
|
115 |
+
{'start': '18297', 'stop': '27080', 'utterance': 'refusal'},
|
116 |
+
{'start': '27080', 'stop': '30120', 'utterance': 'be'},
|
117 |
+
{'start': '30120', 'stop': '37720', 'utterance': 'useful'}],
|
118 |
+
|
119 |
+
'dialect_region': 'DR4',
|
120 |
+
'sentence_type': 'SI',
|
121 |
+
'speaker_id': 'MMDM0',
|
122 |
+
'id': 'SI681'
|
123 |
+
}
|
124 |
+
```
|
125 |
+
|
126 |
+
|
127 |
+
### Data Fields
|
128 |
+
|
129 |
+
- file: A path to the downloaded audio file in .wav format.
|
130 |
+
|
131 |
+
- text: The transcription of the audio file.
|
132 |
+
|
133 |
+
- 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.
|
134 |
+
|
135 |
+
- word_detail: Word level split of the transcript.
|
136 |
+
|
137 |
+
- dialect_region: The dialect code of the recording.
|
138 |
+
|
139 |
+
- sentence_type: The type of the sentence - 'SA':'Dialect', 'SX':'Compact' or 'SI':'Diverse'.
|
140 |
+
|
141 |
+
- speaker_id: Unique id of the speaker. The same speaker id can be found for multiple data samples.
|
142 |
+
|
143 |
+
- id: Unique id of the data sample. Contains the <SENTENCE_TYPE><SENTENCE_NUMBER>.
|
144 |
+
|
145 |
+
|
146 |
+
### Data Splits
|
147 |
+
|
148 |
+
The speech material has been subdivided into portions for training and
|
149 |
+
testing. The default train-test split will be made available on data download.
|
150 |
+
|
151 |
+
The test data alone has a core portion containing 24 speakers, 2 male and 1 female
|
152 |
+
from each dialect region. More information about the test set can
|
153 |
+
be found [here](https://catalog.ldc.upenn.edu/docs/LDC93S1/TESTSET.TXT)
|
154 |
+
|
155 |
+
|
156 |
+
## Dataset Creation
|
157 |
+
|
158 |
+
### Curation Rationale
|
159 |
+
|
160 |
+
[Needs More Information]
|
161 |
+
|
162 |
+
### Source Data
|
163 |
+
|
164 |
+
#### Initial Data Collection and Normalization
|
165 |
+
|
166 |
+
[Needs More Information]
|
167 |
+
|
168 |
+
#### Who are the source language producers?
|
169 |
+
|
170 |
+
[Needs More Information]
|
171 |
+
|
172 |
+
### Annotations
|
173 |
+
|
174 |
+
#### Annotation process
|
175 |
+
|
176 |
+
[Needs More Information]
|
177 |
+
|
178 |
+
#### Who are the annotators?
|
179 |
+
|
180 |
+
[Needs More Information]
|
181 |
+
|
182 |
+
### Personal and Sensitive Information
|
183 |
+
|
184 |
+
[Needs More Information]
|
185 |
+
|
186 |
+
## Considerations for Using the Data
|
187 |
+
|
188 |
+
### Social Impact of Dataset
|
189 |
+
|
190 |
+
[More Information Needed]
|
191 |
+
|
192 |
+
### Discussion of Biases
|
193 |
+
|
194 |
+
[More Information Needed]
|
195 |
+
|
196 |
+
### Other Known Limitations
|
197 |
+
|
198 |
+
[Needs More Information]
|
199 |
+
|
200 |
+
## Additional Information
|
201 |
+
|
202 |
+
### Dataset Curators
|
203 |
+
|
204 |
+
The dataset was created by John S. Garofolo, Lori F. Lamel, William M. Fisher, Jonathan G. Fiscus, David S. Pallett, Nancy L. Dahlgren, Victor Zue
|
205 |
+
|
206 |
+
### Licensing Information
|
207 |
+
|
208 |
+
LDC User Agreement for Non-Members
|
209 |
+
|
210 |
+
### Citation Information
|
211 |
+
```
|
212 |
+
@inproceedings{
|
213 |
+
title={TIMIT Acoustic-Phonetic Continuous Speech Corpus},
|
214 |
+
author={Garofolo, John S., et al},
|
215 |
+
ldc_catalog_no={LDC93S1},
|
216 |
+
DOI={https://doi.org/10.35111/17gk-bn40},
|
217 |
+
journal={Linguistic Data Consortium, Philadelphia},
|
218 |
+
year={1983}
|
219 |
+
}
|
220 |
+
```
|
221 |
+
|
222 |
+
### Contributions
|
223 |
+
Thanks to [@vrindaprabhu](https://github.com/vrindaprabhu) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"clean": {"description": "The TIMIT corpus of reading speech has been developed to provide speech data for acoustic-phonetic research studies\nand for the evaluation of automatic speech recognition systems.\n\nTIMIT contains high quality recordings of 630 individuals/speakers with 8 different American English dialects,\nwith each individual reading upto 10 phonetically rich sentences.\n\nMore info on TIMIT dataset can be understood from the \"README\" which can be found here:\nhttps://catalog.ldc.upenn.edu/docs/LDC93S1/readme.txt\n", "citation": "@inproceedings{\n title={TIMIT Acoustic-Phonetic Continuous Speech Corpus},\n author={Garofolo, John S., et al},\n ldc_catalog_no={LDC93S1},\n DOI={https://doi.org/10.35111/17gk-bn40},\n journal={Linguistic Data Consortium, Philadelphia},\n year={1983}\n}\n", "homepage": "https://catalog.ldc.upenn.edu/LDC93S1", "license": "", "features": {"file": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "phonetic_detail": {"feature": {"start": {"dtype": "int64", "id": null, "_type": "Value"}, "stop": {"dtype": "int64", "id": null, "_type": "Value"}, "utterance": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "word_detail": {"feature": {"start": {"dtype": "int64", "id": null, "_type": "Value"}, "stop": {"dtype": "int64", "id": null, "_type": "Value"}, "utterance": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "dialect_region": {"dtype": "string", "id": null, "_type": "Value"}, "sentence_type": {"dtype": "string", "id": null, "_type": "Value"}, "speaker_id": {"dtype": "string", "id": null, "_type": "Value"}, "id": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "file", "output": "text"}, "builder_name": "timit_asr", "config_name": "clean", "version": {"version_str": "2.0.1", "description": "", "major": 2, "minor": 0, "patch": 1}, "splits": {"train": {"name": "train", "num_bytes": 5220656, "num_examples": 4620, "dataset_name": "timit_asr"}, "test": {"name": "test", "num_bytes": 2380616, "num_examples": 1680, "dataset_name": "timit_asr"}}, "download_checksums": {"https://data.deepai.org/timit.zip": {"num_bytes": 869007403, "checksum": "b79af42068b53045510d86854e2239a13ff77c4bd27803b40c28dce4bb5aeb0d"}}, "download_size": 869007403, "post_processing_size": null, "dataset_size": 7601272, "size_in_bytes": 876608675}}
|
dummy/clean/2.0.1/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1d415bf8a373d2b6304c0e866936e0e3df530fe6ee2b0308d5965dbf4f2b4fd7
|
3 |
+
size 292805
|
timit_asr.py
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
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 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
"""TIMIT automatic speech recognition dataset."""
|
18 |
+
|
19 |
+
from __future__ import absolute_import, division, print_function
|
20 |
+
|
21 |
+
import os
|
22 |
+
|
23 |
+
import pandas as pd
|
24 |
+
|
25 |
+
import datasets
|
26 |
+
|
27 |
+
|
28 |
+
_CITATION = """\
|
29 |
+
@inproceedings{
|
30 |
+
title={TIMIT Acoustic-Phonetic Continuous Speech Corpus},
|
31 |
+
author={Garofolo, John S., et al},
|
32 |
+
ldc_catalog_no={LDC93S1},
|
33 |
+
DOI={https://doi.org/10.35111/17gk-bn40},
|
34 |
+
journal={Linguistic Data Consortium, Philadelphia},
|
35 |
+
year={1983}
|
36 |
+
}
|
37 |
+
"""
|
38 |
+
|
39 |
+
_DESCRIPTION = """\
|
40 |
+
The TIMIT corpus of reading speech has been developed to provide speech data for acoustic-phonetic research studies
|
41 |
+
and for the evaluation of automatic speech recognition systems.
|
42 |
+
|
43 |
+
TIMIT contains high quality recordings of 630 individuals/speakers with 8 different American English dialects,
|
44 |
+
with each individual reading upto 10 phonetically rich sentences.
|
45 |
+
|
46 |
+
More info on TIMIT dataset can be understood from the "README" which can be found here:
|
47 |
+
https://catalog.ldc.upenn.edu/docs/LDC93S1/readme.txt
|
48 |
+
"""
|
49 |
+
|
50 |
+
_URL = "https://data.deepai.org/timit.zip"
|
51 |
+
_HOMEPAGE = "https://catalog.ldc.upenn.edu/LDC93S1"
|
52 |
+
|
53 |
+
|
54 |
+
class TimitASRConfig(datasets.BuilderConfig):
|
55 |
+
"""BuilderConfig for TimitASR."""
|
56 |
+
|
57 |
+
def __init__(self, **kwargs):
|
58 |
+
"""
|
59 |
+
Args:
|
60 |
+
data_dir: `string`, the path to the folder containing the files in the
|
61 |
+
downloaded .tar
|
62 |
+
citation: `string`, citation for the data set
|
63 |
+
url: `string`, url for information about the data set
|
64 |
+
**kwargs: keyword arguments forwarded to super.
|
65 |
+
"""
|
66 |
+
super(TimitASRConfig, self).__init__(version=datasets.Version("2.0.1", ""), **kwargs)
|
67 |
+
|
68 |
+
|
69 |
+
class TimitASR(datasets.GeneratorBasedBuilder):
|
70 |
+
"""TimitASR dataset."""
|
71 |
+
|
72 |
+
BUILDER_CONFIGS = [TimitASRConfig(name="clean", description="'Clean' speech.")]
|
73 |
+
|
74 |
+
def _info(self):
|
75 |
+
return datasets.DatasetInfo(
|
76 |
+
description=_DESCRIPTION,
|
77 |
+
features=datasets.Features(
|
78 |
+
{
|
79 |
+
"file": datasets.Value("string"),
|
80 |
+
"text": datasets.Value("string"),
|
81 |
+
"phonetic_detail": datasets.Sequence(
|
82 |
+
{
|
83 |
+
"start": datasets.Value("int64"),
|
84 |
+
"stop": datasets.Value("int64"),
|
85 |
+
"utterance": datasets.Value("string"),
|
86 |
+
}
|
87 |
+
),
|
88 |
+
"word_detail": datasets.Sequence(
|
89 |
+
{
|
90 |
+
"start": datasets.Value("int64"),
|
91 |
+
"stop": datasets.Value("int64"),
|
92 |
+
"utterance": datasets.Value("string"),
|
93 |
+
}
|
94 |
+
),
|
95 |
+
"dialect_region": datasets.Value("string"),
|
96 |
+
"sentence_type": datasets.Value("string"),
|
97 |
+
"speaker_id": datasets.Value("string"),
|
98 |
+
"id": datasets.Value("string"),
|
99 |
+
}
|
100 |
+
),
|
101 |
+
supervised_keys=("file", "text"),
|
102 |
+
homepage=_HOMEPAGE,
|
103 |
+
citation=_CITATION,
|
104 |
+
)
|
105 |
+
|
106 |
+
def _split_generators(self, dl_manager):
|
107 |
+
archive_path = dl_manager.download_and_extract(_URL)
|
108 |
+
|
109 |
+
train_csv_path = os.path.join(archive_path, "train_data.csv")
|
110 |
+
test_csv_path = os.path.join(archive_path, "test_data.csv")
|
111 |
+
|
112 |
+
return [
|
113 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"data_info_csv": train_csv_path}),
|
114 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"data_info_csv": test_csv_path}),
|
115 |
+
]
|
116 |
+
|
117 |
+
def _generate_examples(self, data_info_csv):
|
118 |
+
"""Generate examples from TIMIT archive_path based on the test/train csv information."""
|
119 |
+
# Extract the archive path
|
120 |
+
data_path = os.path.join(os.path.dirname(data_info_csv).strip(), "data")
|
121 |
+
|
122 |
+
# Read the data info to extract rows mentioning about non-converted audio only
|
123 |
+
data_info = pd.read_csv(data_info_csv, encoding="utf8")
|
124 |
+
# making sure that the columns having no information about the file paths are removed
|
125 |
+
data_info.dropna(subset=["path_from_data_dir"], inplace=True)
|
126 |
+
|
127 |
+
# filter out only the required information for data preparation
|
128 |
+
data_info = data_info.loc[(data_info["is_audio"]) & (~data_info["is_converted_audio"])]
|
129 |
+
|
130 |
+
# Iterating the contents of the data to extract the relevant information
|
131 |
+
for audio_idx in range(data_info.shape[0]):
|
132 |
+
audio_data = data_info.iloc[0]
|
133 |
+
|
134 |
+
# extract the path to audio
|
135 |
+
wav_path = os.path.join(data_path, *(audio_data["path_from_data_dir"].split("/")))
|
136 |
+
|
137 |
+
# extract transcript
|
138 |
+
with open(wav_path.replace(".WAV", ".TXT"), "r", encoding="utf-8") as op:
|
139 |
+
transcript = " ".join(op.readlines()[0].split()[2:]) # first two items are sample number
|
140 |
+
|
141 |
+
# extract phonemes
|
142 |
+
with open(wav_path.replace(".WAV", ".PHN"), "r", encoding="utf-8") as op:
|
143 |
+
phonemes = [
|
144 |
+
{
|
145 |
+
"start": i.split(" ")[0],
|
146 |
+
"stop": i.split(" ")[1],
|
147 |
+
"utterance": " ".join(i.split(" ")[2:]).strip(),
|
148 |
+
}
|
149 |
+
for i in op.readlines()
|
150 |
+
]
|
151 |
+
|
152 |
+
# extract words
|
153 |
+
with open(wav_path.replace(".WAV", ".WRD"), "r", encoding="utf-8") as op:
|
154 |
+
words = [
|
155 |
+
{
|
156 |
+
"start": i.split(" ")[0],
|
157 |
+
"stop": i.split(" ")[1],
|
158 |
+
"utterance": " ".join(i.split(" ")[2:]).strip(),
|
159 |
+
}
|
160 |
+
for i in op.readlines()
|
161 |
+
]
|
162 |
+
|
163 |
+
example = {
|
164 |
+
"file": wav_path,
|
165 |
+
"text": transcript,
|
166 |
+
"phonetic_detail": phonemes,
|
167 |
+
"word_detail": words,
|
168 |
+
"dialect_region": audio_data["dialect_region"],
|
169 |
+
"sentence_type": audio_data["filename"][0:2],
|
170 |
+
"speaker_id": audio_data["speaker_id"],
|
171 |
+
"id": audio_data["filename"].replace(".WAV", ""),
|
172 |
+
}
|
173 |
+
|
174 |
+
yield audio_idx, example
|