MCPcopy Create free account
hub / github.com/allenai/OLMoASR / load

Method load

scripts/eval/eval.py:474–490  ·  view source on GitHub ↗

Load VoxPopuli audio files and transcripts. Parses the ASR test TSV file to extract audio file paths and normalized transcript texts for English parliamentary speech. Returns: Tuple[list, list]: A tuple containing: - List of audio file paths (WAV

(self)

Source from the content-addressed store, hash-verified

472 """
473
474 def load(self) -> Tuple[list, list]:
475 """Load VoxPopuli audio files and transcripts.
476
477 Parses the ASR test TSV file to extract audio file paths and normalized
478 transcript texts for English parliamentary speech.
479
480 Returns:
481 Tuple[list, list]: A tuple containing:
482 - List of audio file paths (WAV format)
483 - List of corresponding normalized transcript strings
484 """
485 with open(f"{self.root_dir}/asr_test.tsv", "r") as f:
486 next(f) # Skip header
487 file_text = [line.split("\t")[:2] for line in f]
488 audio_files, transcript_texts = zip(*file_text)
489 audio_files = [f"{self.root_dir}/test/{f}.wav" for f in audio_files]
490 return list(audio_files), list(transcript_texts)
491
492
493class AMILoader(BaseDatasetLoader):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected