Update librispeech_asr_test.py
Browse files- librispeech_asr_test.py +2 -2
librispeech_asr_test.py
CHANGED
|
@@ -106,12 +106,12 @@ class LibrispeechASR(datasets.GeneratorBasedBuilder):
|
|
| 106 |
def _split_generators(self, dl_manager):
|
| 107 |
archive_path = dl_manager.download_and_extract(_DL_URLS[self.config.name])
|
| 108 |
return [
|
| 109 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"archive_path": archive_path["test"], "split_name": f"
|
| 110 |
]
|
| 111 |
|
| 112 |
def _generate_examples(self, archive_path, split_name):
|
| 113 |
"""Generate examples from a Librispeech archive_path."""
|
| 114 |
-
transcripts_glob = os.path.join(archive_path, split_name, "*/*/*.txt")
|
| 115 |
for transcript_file in glob.glob(transcripts_glob):
|
| 116 |
path = os.path.dirname(transcript_file)
|
| 117 |
with open(os.path.join(path, transcript_file)) as f:
|
|
|
|
| 106 |
def _split_generators(self, dl_manager):
|
| 107 |
archive_path = dl_manager.download_and_extract(_DL_URLS[self.config.name])
|
| 108 |
return [
|
| 109 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"archive_path": archive_path["test"], "split_name": f"test-{self.config.name}"}),
|
| 110 |
]
|
| 111 |
|
| 112 |
def _generate_examples(self, archive_path, split_name):
|
| 113 |
"""Generate examples from a Librispeech archive_path."""
|
| 114 |
+
transcripts_glob = os.path.join(archive_path, "LibriSpeech", split_name, "*/*/*.txt")
|
| 115 |
for transcript_file in glob.glob(transcripts_glob):
|
| 116 |
path = os.path.dirname(transcript_file)
|
| 117 |
with open(os.path.join(path, transcript_file)) as f:
|