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

Method load

scripts/eval/eval.py:436–451  ·  view source on GitHub ↗

Load FLEURS dataset audio files and transcripts. Parses the test.tsv file to extract audio file paths and transcriptions for the English language subset. Returns: Tuple[list, list]: A tuple containing: - List of audio file paths from test directo

(self)

Source from the content-addressed store, hash-verified

434 """
435
436 def load(self) -> Tuple[list, list]:
437 """Load FLEURS dataset audio files and transcripts.
438
439 Parses the test.tsv file to extract audio file paths and transcriptions
440 for the English language subset.
441
442 Returns:
443 Tuple[list, list]: A tuple containing:
444 - List of audio file paths from test directory
445 - List of corresponding transcript strings
446 """
447 with open(f"{self.root_dir}/test.tsv", "r") as f:
448 file_text = [line.split("\t")[1:3] for line in f]
449 audio_files, transcript_texts = zip(*file_text)
450 audio_files = [f"{self.root_dir}/test/{f}" for f in audio_files]
451 return list(audio_files), list(transcript_texts)
452
453
454class VoxPopuliLoader(BaseDatasetLoader):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected