Quentin Lhoest commited on
Commit
a6d1389
1 Parent(s): bf92cf2

Release: 2.0.0

Browse files

Commit from https://github.com/huggingface/datasets/commit/983f46ddae2f5b253db2b3c5691d38c75241cadb

Files changed (1) hide show
  1. timit_asr.py +3 -3
timit_asr.py CHANGED
@@ -137,11 +137,11 @@ class TimitASR(datasets.GeneratorBasedBuilder):
137
  wav_path = os.path.join(data_path, *(audio_data["path_from_data_dir"].split("/")))
138
 
139
  # extract transcript
140
- with open(wav_path.replace(".WAV", ".TXT"), "r", encoding="utf-8") as op:
141
  transcript = " ".join(op.readlines()[0].split()[2:]) # first two items are sample number
142
 
143
  # extract phonemes
144
- with open(wav_path.replace(".WAV", ".PHN"), "r", encoding="utf-8") as op:
145
  phonemes = [
146
  {
147
  "start": i.split(" ")[0],
@@ -152,7 +152,7 @@ class TimitASR(datasets.GeneratorBasedBuilder):
152
  ]
153
 
154
  # extract words
155
- with open(wav_path.replace(".WAV", ".WRD"), "r", encoding="utf-8") as op:
156
  words = [
157
  {
158
  "start": i.split(" ")[0],
 
137
  wav_path = os.path.join(data_path, *(audio_data["path_from_data_dir"].split("/")))
138
 
139
  # extract transcript
140
+ with open(wav_path.replace(".WAV", ".TXT"), encoding="utf-8") as op:
141
  transcript = " ".join(op.readlines()[0].split()[2:]) # first two items are sample number
142
 
143
  # extract phonemes
144
+ with open(wav_path.replace(".WAV", ".PHN"), encoding="utf-8") as op:
145
  phonemes = [
146
  {
147
  "start": i.split(" ")[0],
 
152
  ]
153
 
154
  # extract words
155
+ with open(wav_path.replace(".WAV", ".WRD"), encoding="utf-8") as op:
156
  words = [
157
  {
158
  "start": i.split(" ")[0],