Update app.py
Browse files
app.py
CHANGED
@@ -119,12 +119,11 @@ class HySpeech(datasets.GeneratorBasedBuilder):
|
|
119 |
|
120 |
|
121 |
def _generate_examples(self, audio_archives, local_extracted_archives_paths, metadata_paths):
|
122 |
-
features = ["raw_text", "normalized_text", "speaker_id", "gender"]
|
123 |
|
124 |
meta_path = metadata_paths
|
125 |
with open(meta_path) as f:
|
126 |
-
metadata = {x["
|
127 |
-
|
128 |
|
129 |
for audio_archive, local_extracted_archive_path in zip(audio_archives, local_extracted_archives_paths):
|
130 |
for audio_filename, audio_file in audio_archive:
|
@@ -133,6 +132,7 @@ class HySpeech(datasets.GeneratorBasedBuilder):
|
|
133 |
|
134 |
yield audio_id, {
|
135 |
"audio_id": audio_id,
|
|
|
136 |
**{feature: metadata[audio_id][feature] for feature in features},
|
137 |
"audio": {"path": path, "bytes": audio_file.read()},
|
138 |
}
|
|
|
119 |
|
120 |
|
121 |
def _generate_examples(self, audio_archives, local_extracted_archives_paths, metadata_paths):
|
122 |
+
features = ["raw_text", "normalized_text", "speaker_id", "gender", "is_gold_transcript", "accent"]
|
123 |
|
124 |
meta_path = metadata_paths
|
125 |
with open(meta_path) as f:
|
126 |
+
metadata = {x["id"]: x for x in csv.DictReader(f, delimiter="\t")}
|
|
|
127 |
|
128 |
for audio_archive, local_extracted_archive_path in zip(audio_archives, local_extracted_archives_paths):
|
129 |
for audio_filename, audio_file in audio_archive:
|
|
|
132 |
|
133 |
yield audio_id, {
|
134 |
"audio_id": audio_id,
|
135 |
+
"language": lang,
|
136 |
**{feature: metadata[audio_id][feature] for feature in features},
|
137 |
"audio": {"path": path, "bytes": audio_file.read()},
|
138 |
}
|