[Update] Update
Browse files- custom_common_voice.py +11 -13
custom_common_voice.py
CHANGED
@@ -17,6 +17,7 @@
|
|
17 |
|
18 |
import datasets
|
19 |
from datasets.tasks import AutomaticSpeechRecognition
|
|
|
20 |
|
21 |
|
22 |
_DATA_URL = "https://drive.google.com/uc?export=download&id=18ssh3gjpsMmjBfaIhcCwrfJMAvsdLGaI"
|
@@ -165,21 +166,18 @@ class CustomCommonVoice(datasets.GeneratorBasedBuilder):
|
|
165 |
|
166 |
# audio is not a header of the csv files
|
167 |
data_fields.remove("audio")
|
168 |
-
path_idx = data_fields.index("file_path")
|
169 |
-
script_idx = data_fields.index("script")
|
170 |
examples = {}
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
}
|
183 |
|
184 |
inside_clips_dir = False
|
185 |
for path, f in audio_files:
|
|
|
17 |
|
18 |
import datasets
|
19 |
from datasets.tasks import AutomaticSpeechRecognition
|
20 |
+
import pandas as pd
|
21 |
|
22 |
|
23 |
_DATA_URL = "https://drive.google.com/uc?export=download&id=18ssh3gjpsMmjBfaIhcCwrfJMAvsdLGaI"
|
|
|
166 |
|
167 |
# audio is not a header of the csv files
|
168 |
data_fields.remove("audio")
|
|
|
|
|
169 |
examples = {}
|
170 |
|
171 |
+
df = pd.read_csv(tsv_files, sep="\t", header=0)
|
172 |
+
df = df.dropna()
|
173 |
+
|
174 |
+
for file_path, script in zip(df["file_path"], df["script"]):
|
175 |
+
# set full path for mp3 audio file
|
176 |
+
audio_path = path_to_clips + "/" + file_path
|
177 |
+
examples[audio_path] = {
|
178 |
+
"file_path": audio_path,
|
179 |
+
"script": script,
|
180 |
+
}
|
|
|
181 |
|
182 |
inside_clips_dir = False
|
183 |
for path, f in audio_files:
|