system HF staff commited on
Commit
319a66a
1 Parent(s): 3cf9038

Update files from the datasets library (from 1.13.3)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.13.3

Files changed (2) hide show
  1. README.md +7 -1
  2. lj_speech.py +2 -0
README.md CHANGED
@@ -85,6 +85,10 @@ A normalized version of the text is also provided.
85
  {
86
  'id': 'LJ002-0026',
87
  'file': '/datasets/downloads/extracted/05bfe561f096e4c52667e3639af495226afe4e5d08763f2d76d069e7a453c543/LJSpeech-1.1/wavs/LJ002-0026.wav',
 
 
 
 
88
  'text': 'in the three years between 1813 and 1816,'
89
  'normalized_text': 'in the three years between eighteen thirteen and eighteen sixteen,',
90
  }
@@ -98,6 +102,8 @@ Each audio file is a single-channel 16-bit PCM WAV with a sample rate of 22050 H
98
 
99
  - file: a path to the downloaded audio file in .wav format.
100
 
 
 
101
  - text: the transcription of the audio file.
102
 
103
  - normalized_text: the transcription with numbers, ordinals, and monetary units expanded into full words.
@@ -220,4 +226,4 @@ Public Domain ([LibriVox](https://librivox.org/pages/public-domain/))
220
 
221
  ### Contributions
222
 
223
- Thanks to [@anton-l](https://github.com/anton-l) for adding this dataset.
 
85
  {
86
  'id': 'LJ002-0026',
87
  'file': '/datasets/downloads/extracted/05bfe561f096e4c52667e3639af495226afe4e5d08763f2d76d069e7a453c543/LJSpeech-1.1/wavs/LJ002-0026.wav',
88
+ 'audio': {'path': '/datasets/downloads/extracted/05bfe561f096e4c52667e3639af495226afe4e5d08763f2d76d069e7a453c543/LJSpeech-1.1/wavs/LJ002-0026.wav',
89
+ 'array': array([-0.00048828, -0.00018311, -0.00137329, ..., 0.00079346,
90
+ 0.00091553, 0.00085449], dtype=float32),
91
+ 'sampling_rate': 22050},
92
  'text': 'in the three years between 1813 and 1816,'
93
  'normalized_text': 'in the three years between eighteen thirteen and eighteen sixteen,',
94
  }
 
102
 
103
  - file: a path to the downloaded audio file in .wav format.
104
 
105
+ - 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]`.
106
+
107
  - text: the transcription of the audio file.
108
 
109
  - normalized_text: the transcription with numbers, ordinals, and monetary units expanded into full words.
 
226
 
227
  ### Contributions
228
 
229
+ Thanks to [@anton-l](https://github.com/anton-l) for adding this dataset.
lj_speech.py CHANGED
@@ -74,6 +74,7 @@ class LJSpeech(datasets.GeneratorBasedBuilder):
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"),
@@ -108,6 +109,7 @@ class LJSpeech(datasets.GeneratorBasedBuilder):
108
  example = {
109
  "id": uid,
110
  "file": os.path.join(wav_path, filename),
 
111
  "text": text,
112
  "normalized_text": norm_text,
113
  }
 
74
  features=datasets.Features(
75
  {
76
  "id": datasets.Value("string"),
77
+ "audio": datasets.features.Audio(sampling_rate=22050),
78
  "file": datasets.Value("string"),
79
  "text": datasets.Value("string"),
80
  "normalized_text": datasets.Value("string"),
 
109
  example = {
110
  "id": uid,
111
  "file": os.path.join(wav_path, filename),
112
+ "audio": os.path.join(wav_path, filename),
113
  "text": text,
114
  "normalized_text": norm_text,
115
  }