Datasets:
Commit
•
38d4e64
0
Parent(s):
Update files from the datasets library (from 1.3.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.3.0
- .gitattributes +27 -0
- README.md +222 -0
- dataset_infos.json +1 -0
- dummy/main/1.1.0/dummy_data.zip +3 -0
- lj_speech.py +113 -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,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- other-public-domain
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- other
|
18 |
+
task_ids:
|
19 |
+
- other-other-automatic-speech-recognition
|
20 |
+
- other-other-text-to-speech
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card for lj_speech
|
24 |
+
|
25 |
+
## Table of Contents
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
- [Contributions](#contributions)
|
48 |
+
|
49 |
+
## Dataset Description
|
50 |
+
|
51 |
+
- **Homepage:** [The LJ Speech Dataset](https://keithito.com/LJ-Speech-Dataset/)
|
52 |
+
- **Repository:** [N/A]
|
53 |
+
- **Paper:** [N/A]
|
54 |
+
- **Leaderboard:** [Paperswithcode Leaderboard](https://paperswithcode.com/sota/text-to-speech-synthesis-on-ljspeech)
|
55 |
+
- **Point of Contact:** [Keith Ito](mailto:kito@kito.us)
|
56 |
+
|
57 |
+
### Dataset Summary
|
58 |
+
|
59 |
+
This is a public domain speech dataset consisting of 13,100 short audio clips of a single speaker reading passages from 7 non-fiction books in English. A transcription is provided for each clip. Clips vary in length from 1 to 10 seconds and have a total length of approximately 24 hours.
|
60 |
+
|
61 |
+
The texts were published between 1884 and 1964, and are in the public domain. The audio was recorded in 2016-17 by the LibriVox project and is also in the public domain.
|
62 |
+
|
63 |
+
### Supported Tasks and Leaderboards
|
64 |
+
|
65 |
+
The dataset can be used to train a model for Automatic Speech Recognition (ASR) or Text-to-Speech (TTS).
|
66 |
+
- `other:automatic-speech-recognition`: An ASR model is presented with an audio file and asked to transcribe the audio file to written text.
|
67 |
+
The most common ASR evaluation metric is the word error rate (WER).
|
68 |
+
- `other:text-to-speech`: A TTS model is given a written text in natural language and asked to generate a speech audio file.
|
69 |
+
A reasonable evaluation metric is the mean opinion score (MOS) of audio quality.
|
70 |
+
The dataset has an active leaderboard which can be found at https://paperswithcode.com/sota/text-to-speech-synthesis-on-ljspeech
|
71 |
+
|
72 |
+
### Languages
|
73 |
+
|
74 |
+
The transcriptions and audio are in English.
|
75 |
+
|
76 |
+
## Dataset Structure
|
77 |
+
|
78 |
+
### Data Instances
|
79 |
+
|
80 |
+
A data point comprises the path to the audio file, called `file` and its transcription, called `text`.
|
81 |
+
A normalized version of the text is also provided.
|
82 |
+
|
83 |
+
```
|
84 |
+
{
|
85 |
+
'id': 'LJ002-0026',
|
86 |
+
'file': '/datasets/downloads/extracted/05bfe561f096e4c52667e3639af495226afe4e5d08763f2d76d069e7a453c543/LJSpeech-1.1/wavs/LJ002-0026.wav',
|
87 |
+
'text': 'in the three years between 1813 and 1816,'
|
88 |
+
'normalized_text': 'in the three years between eighteen thirteen and eighteen sixteen,',
|
89 |
+
}
|
90 |
+
```
|
91 |
+
|
92 |
+
Each audio file is a single-channel 16-bit PCM WAV with a sample rate of 22050 Hz.
|
93 |
+
|
94 |
+
### Data Fields
|
95 |
+
|
96 |
+
- id: unique id of the data sample.
|
97 |
+
|
98 |
+
- file: a path to the downloaded audio file in .wav format.
|
99 |
+
|
100 |
+
- text: the transcription of the audio file.
|
101 |
+
|
102 |
+
- normalized_text: the transcription with numbers, ordinals, and monetary units expanded into full words.
|
103 |
+
|
104 |
+
### Data Splits
|
105 |
+
|
106 |
+
The dataset is not pre-split. Some statistics:
|
107 |
+
|
108 |
+
- Total Clips: 13,100
|
109 |
+
- Total Words: 225,715
|
110 |
+
- Total Characters: 1,308,678
|
111 |
+
- Total Duration: 23:55:17
|
112 |
+
- Mean Clip Duration: 6.57 sec
|
113 |
+
- Min Clip Duration: 1.11 sec
|
114 |
+
- Max Clip Duration: 10.10 sec
|
115 |
+
- Mean Words per Clip: 17.23
|
116 |
+
- Distinct Words: 13,821
|
117 |
+
|
118 |
+
## Dataset Creation
|
119 |
+
|
120 |
+
### Curation Rationale
|
121 |
+
|
122 |
+
[Needs More Information]
|
123 |
+
|
124 |
+
### Source Data
|
125 |
+
|
126 |
+
#### Initial Data Collection and Normalization
|
127 |
+
|
128 |
+
This dataset consists of excerpts from the following works:
|
129 |
+
|
130 |
+
- Morris, William, et al. Arts and Crafts Essays. 1893.
|
131 |
+
- Griffiths, Arthur. The Chronicles of Newgate, Vol. 2. 1884.
|
132 |
+
- Roosevelt, Franklin D. The Fireside Chats of Franklin Delano Roosevelt. 1933-42.
|
133 |
+
- Harland, Marion. Marion Harland's Cookery for Beginners. 1893.
|
134 |
+
- Rolt-Wheeler, Francis. The Science - History of the Universe, Vol. 5: Biology. 1910.
|
135 |
+
- Banks, Edgar J. The Seven Wonders of the Ancient World. 1916.
|
136 |
+
- President's Commission on the Assassination of President Kennedy. Report of the President's Commission on the Assassination of President Kennedy. 1964.
|
137 |
+
|
138 |
+
Some details about normalization:
|
139 |
+
- The normalized transcription has the numbers, ordinals, and monetary units expanded into full words (UTF-8)
|
140 |
+
- 19 of the transcriptions contain non-ASCII characters (for example, LJ016-0257 contains "raison d'être").
|
141 |
+
- The following abbreviations appear in the text. They may be expanded as follows:
|
142 |
+
|
143 |
+
| Abbreviation | Expansion |
|
144 |
+
|--------------|-----------|
|
145 |
+
| Mr. | Mister |
|
146 |
+
| Mrs. | Misess (*) |
|
147 |
+
| Dr. | Doctor |
|
148 |
+
| No. | Number |
|
149 |
+
| St. | Saint |
|
150 |
+
| Co. | Company |
|
151 |
+
| Jr. | Junior |
|
152 |
+
| Maj. | Major |
|
153 |
+
| Gen. | General |
|
154 |
+
| Drs. | Doctors |
|
155 |
+
| Rev. | Reverend |
|
156 |
+
| Lt. | Lieutenant |
|
157 |
+
| Hon. | Honorable |
|
158 |
+
| Sgt. | Sergeant |
|
159 |
+
| Capt. | Captain |
|
160 |
+
| Esq. | Esquire |
|
161 |
+
| Ltd. | Limited |
|
162 |
+
| Col. | Colonel |
|
163 |
+
| Ft. | Fort |
|
164 |
+
(*) there's no standard expansion for "Mrs."
|
165 |
+
|
166 |
+
#### Who are the source language producers?
|
167 |
+
|
168 |
+
[Needs More Information]
|
169 |
+
|
170 |
+
### Annotations
|
171 |
+
|
172 |
+
#### Annotation process
|
173 |
+
|
174 |
+
- The audio clips range in length from approximately 1 second to 10 seconds. They were segmented automatically based on silences in the recording. Clip boundaries generally align with sentence or clause boundaries, but not always.
|
175 |
+
- The text was matched to the audio manually, and a QA pass was done to ensure that the text accurately matched the words spoken in the audio.
|
176 |
+
|
177 |
+
#### Who are the annotators?
|
178 |
+
|
179 |
+
Recordings by Linda Johnson from LibriVox. Alignment and annotation by Keith Ito.
|
180 |
+
|
181 |
+
### Personal and Sensitive Information
|
182 |
+
|
183 |
+
[Needs More Information]
|
184 |
+
|
185 |
+
## Considerations for Using the Data
|
186 |
+
|
187 |
+
### Social Impact of Dataset
|
188 |
+
|
189 |
+
[Needs More Information]
|
190 |
+
|
191 |
+
### Discussion of Biases
|
192 |
+
|
193 |
+
[Needs More Information]
|
194 |
+
|
195 |
+
### Other Known Limitations
|
196 |
+
|
197 |
+
- The original LibriVox recordings were distributed as 128 kbps MP3 files. As a result, they may contain artifacts introduced by the MP3 encoding.
|
198 |
+
|
199 |
+
## Additional Information
|
200 |
+
|
201 |
+
### Dataset Curators
|
202 |
+
|
203 |
+
The dataset was initially created by Keith Ito and Linda Johnson.
|
204 |
+
|
205 |
+
### Licensing Information
|
206 |
+
|
207 |
+
Public Domain ([LibriVox](https://librivox.org/pages/public-domain/))
|
208 |
+
|
209 |
+
### Citation Information
|
210 |
+
|
211 |
+
```
|
212 |
+
@misc{ljspeech17,
|
213 |
+
author = {Keith Ito and Linda Johnson},
|
214 |
+
title = {The LJ Speech Dataset},
|
215 |
+
howpublished = {\url{https://keithito.com/LJ-Speech-Dataset/}},
|
216 |
+
year = 2017
|
217 |
+
}
|
218 |
+
```
|
219 |
+
|
220 |
+
### Contributions
|
221 |
+
|
222 |
+
Thanks to [@anton-l](https://github.com/anton-l) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"main": {"description": "This is a public domain speech dataset consisting of 13,100 short audio clips of a single speaker reading \npassages from 7 non-fiction books in English. A transcription is provided for each clip. Clips vary in length \nfrom 1 to 10 seconds and have a total length of approximately 24 hours.\n\nNote that in order to limit the required storage for preparing this dataset, the audio\nis stored in the .wav format and is not converted to a float32 array. To convert the audio\nfile to a float32 array, please make use of the `.map()` function as follows:\n\n\n```python\nimport soundfile as sf\n\ndef map_to_array(batch):\n speech_array, _ = sf.read(batch[\"file\"])\n batch[\"speech\"] = speech_array\n return batch\n\ndataset = dataset.map(map_to_array, remove_columns=[\"file\"])\n```\n", "citation": "@misc{ljspeech17,\n author = {Keith Ito and Linda Johnson},\n title = {The LJ Speech Dataset},\n howpublished = {\\url{https://keithito.com/LJ-Speech-Dataset/}},\n year = 2017\n}\n", "homepage": "https://keithito.com/LJ-Speech-Dataset/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "file": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "normalized_text": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "file", "output": "text"}, "builder_name": "lj_speech", "config_name": "main", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4667022, "num_examples": 13100, "dataset_name": "lj_speech"}}, "download_checksums": {"https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2": {"num_bytes": 2748572632, "checksum": "be1a30453f28eb8dd26af4101ae40cbf2c50413b1bb21936cbcdc6fae3de8aa5"}}, "download_size": 2748572632, "post_processing_size": null, "dataset_size": 4667022, "size_in_bytes": 2753239654}}
|
dummy/main/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fbc98fcaf43b89df9c4c4e218613298edc79211af75c3fa516ec31ef35020db6
|
3 |
+
size 74086
|
lj_speech.py
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""LJ automatic speech recognition dataset."""
|
18 |
+
|
19 |
+
from __future__ import absolute_import, division, print_function
|
20 |
+
|
21 |
+
import csv
|
22 |
+
import os
|
23 |
+
|
24 |
+
import datasets
|
25 |
+
|
26 |
+
|
27 |
+
_CITATION = """\
|
28 |
+
@misc{ljspeech17,
|
29 |
+
author = {Keith Ito and Linda Johnson},
|
30 |
+
title = {The LJ Speech Dataset},
|
31 |
+
howpublished = {\\url{https://keithito.com/LJ-Speech-Dataset/}},
|
32 |
+
year = 2017
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
This is a public domain speech dataset consisting of 13,100 short audio clips of a single speaker reading
|
38 |
+
passages from 7 non-fiction books in English. A transcription is provided for each clip. Clips vary in length
|
39 |
+
from 1 to 10 seconds and have a total length of approximately 24 hours.
|
40 |
+
|
41 |
+
Note that in order to limit the required storage for preparing this dataset, the audio
|
42 |
+
is stored in the .wav format and is not converted to a float32 array. To convert the audio
|
43 |
+
file to a float32 array, please make use of the `.map()` function as follows:
|
44 |
+
|
45 |
+
|
46 |
+
```python
|
47 |
+
import soundfile as sf
|
48 |
+
|
49 |
+
def map_to_array(batch):
|
50 |
+
speech_array, _ = sf.read(batch["file"])
|
51 |
+
batch["speech"] = speech_array
|
52 |
+
return batch
|
53 |
+
|
54 |
+
dataset = dataset.map(map_to_array, remove_columns=["file"])
|
55 |
+
```
|
56 |
+
"""
|
57 |
+
|
58 |
+
_URL = "https://keithito.com/LJ-Speech-Dataset/"
|
59 |
+
_DL_URL = "https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2"
|
60 |
+
|
61 |
+
|
62 |
+
class LJSpeech(datasets.GeneratorBasedBuilder):
|
63 |
+
"""LJ Speech dataset."""
|
64 |
+
|
65 |
+
VERSION = datasets.Version("1.1.0")
|
66 |
+
|
67 |
+
BUILDER_CONFIGS = [
|
68 |
+
datasets.BuilderConfig(name="main", version=VERSION, description="The full LJ Speech dataset"),
|
69 |
+
]
|
70 |
+
|
71 |
+
def _info(self):
|
72 |
+
return datasets.DatasetInfo(
|
73 |
+
description=_DESCRIPTION,
|
74 |
+
features=datasets.Features(
|
75 |
+
{
|
76 |
+
"id": datasets.Value("string"),
|
77 |
+
"file": datasets.Value("string"),
|
78 |
+
"text": datasets.Value("string"),
|
79 |
+
"normalized_text": datasets.Value("string"),
|
80 |
+
}
|
81 |
+
),
|
82 |
+
supervised_keys=("file", "text"),
|
83 |
+
homepage=_URL,
|
84 |
+
citation=_CITATION,
|
85 |
+
)
|
86 |
+
|
87 |
+
def _split_generators(self, dl_manager):
|
88 |
+
root_path = dl_manager.download_and_extract(_DL_URL)
|
89 |
+
root_path = os.path.join(root_path, "LJSpeech-1.1/")
|
90 |
+
wav_path = os.path.join(root_path, "wavs/")
|
91 |
+
csv_path = os.path.join(root_path, "metadata.csv")
|
92 |
+
|
93 |
+
return [
|
94 |
+
datasets.SplitGenerator(
|
95 |
+
name=datasets.Split.TRAIN, gen_kwargs={"wav_path": wav_path, "csv_path": csv_path}
|
96 |
+
),
|
97 |
+
]
|
98 |
+
|
99 |
+
def _generate_examples(self, wav_path, csv_path):
|
100 |
+
"""Generate examples from an LJ Speech archive_path."""
|
101 |
+
|
102 |
+
with open(csv_path, encoding="utf-8") as csv_file:
|
103 |
+
csv_reader = csv.reader(csv_file, delimiter="|", quotechar=None, skipinitialspace=True)
|
104 |
+
for row in csv_reader:
|
105 |
+
uid, text, norm_text = row
|
106 |
+
filename = f"{uid}.wav"
|
107 |
+
example = {
|
108 |
+
"id": uid,
|
109 |
+
"file": os.path.join(wav_path, filename),
|
110 |
+
"text": text,
|
111 |
+
"normalized_text": norm_text,
|
112 |
+
}
|
113 |
+
yield uid, example
|