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

Method load

scripts/eval/eval.py:512–530  ·  view source on GitHub ↗

Load AMI corpus audio files and transcripts. Parses the text file to extract utterance IDs and maps them to corresponding audio files in the evaluation subset. Returns: Tuple[list, list]: A tuple containing: - List of audio file paths (WAV format

(self)

Source from the content-addressed store, hash-verified

510 """
511
512 def load(self) -> Tuple[list, list]:
513 """Load AMI corpus audio files and transcripts.
514
515 Parses the text file to extract utterance IDs and maps them to
516 corresponding audio files in the evaluation subset.
517
518 Returns:
519 Tuple[list, list]: A tuple containing:
520 - List of audio file paths (WAV format)
521 - List of corresponding transcript strings
522 """
523 with open(f"{self.root_dir}/text", "r") as f:
524 file_text = [line.split(" ", 1) for line in f]
525 audio_files, transcript_texts = zip(*file_text)
526 audio_files = [
527 f"{self.root_dir}/{f.split('_')[1]}/eval_{f.lower()}.wav"
528 for f in audio_files
529 ]
530 return list(audio_files), list(transcript_texts)
531
532
533class CORAALLoader(BaseDatasetLoader):

Callers 15

decode_audio_bytesFunction · 0.45
ow_decoding.pyFile · 0.45
process_jsonl_fileFunction · 0.45
load_language_mappingFunction · 0.45
npy_to_wavFunction · 0.45
loadMethod · 0.45
_init_custom_datasetMethod · 0.45
get_eval_setFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected