sanchit-gandhi
commited on
Commit
·
e77dbf3
1
Parent(s):
726794d
uniform dataset ids
Browse files- spgispeech.py +2 -1
spgispeech.py
CHANGED
|
@@ -102,7 +102,7 @@ class Spgispeech(datasets.GeneratorBasedBuilder):
|
|
| 102 |
description=_DESCRIPTION,
|
| 103 |
features=datasets.Features(
|
| 104 |
{
|
| 105 |
-
"
|
| 106 |
"audio": datasets.Audio(sampling_rate=16_000),
|
| 107 |
"wav_filesize": datasets.Value("int32"),
|
| 108 |
"text": datasets.Value("string"),
|
|
@@ -230,6 +230,7 @@ class Spgispeech(datasets.GeneratorBasedBuilder):
|
|
| 230 |
# get the .wav filename by removing the directory path from the audio filename
|
| 231 |
wav_filename = "/".join(audio_filename.split("/")[-2:])
|
| 232 |
example = dict(metadata[wav_filename])
|
|
|
|
| 233 |
example["text"] = example.pop("transcript")
|
| 234 |
example["audio"] = {"path": path, "bytes": audio_file.read()}
|
| 235 |
example["whisper_transcript"] = whisper_transcripts[idx]
|
|
|
|
| 102 |
description=_DESCRIPTION,
|
| 103 |
features=datasets.Features(
|
| 104 |
{
|
| 105 |
+
"id": datasets.Value("string"),
|
| 106 |
"audio": datasets.Audio(sampling_rate=16_000),
|
| 107 |
"wav_filesize": datasets.Value("int32"),
|
| 108 |
"text": datasets.Value("string"),
|
|
|
|
| 230 |
# get the .wav filename by removing the directory path from the audio filename
|
| 231 |
wav_filename = "/".join(audio_filename.split("/")[-2:])
|
| 232 |
example = dict(metadata[wav_filename])
|
| 233 |
+
example["id"] = example.pop("wav_filename")
|
| 234 |
example["text"] = example.pop("transcript")
|
| 235 |
example["audio"] = {"path": path, "bytes": audio_file.read()}
|
| 236 |
example["whisper_transcript"] = whisper_transcripts[idx]
|