code: def collect_data(
      data_dir: Union[Path, str], split: str, prefix: str
  ) -> List[List[Utterance]]:
      """Collect utterances in each long talk."""
      sph_dir = Path(data_dir) / split / "sph"
      stm_dir = Path(data_dir) / split / "stm"
  
      ret = []
      for stm in stm_dir.iterdir():
          if stm.stem in overlapped_ids:
              print(f"Exclude {stm.stem} from {split} set.")
              continue
  
          sph = sph_dir / (stm.stem + ".sph")
          assert sph.is_file(), sph
  
          utts = []
          with open(stm, "r") as fp:
              for line in fp.readlines():
                  line = line.strip()
                  (
                      filename,
                      channel,
                      speaker,
                      start_time,
                      end_time,
                      label,
                      transcript,
                  ) = line.split(" ", 6)
                  if "ignore_time_segment_in_scoring" not in transcript:
                      transcript = _maybe_trim_suffix(transcript)
                      transcript = transcript.replace("<unk>", "")
                      transcript = " ".join(transcript.split())
                      if transcript:
                          utts.append(
                              Utterance(
                                  utt_id=(
                                      f"{prefix}_{filename}_"
                                      f"{float(start_time) * 1000:09.0f}_"
                                      f"{float(end_time) * 1000:09.0f}"
                                  ),
                                  wav_id=f"{prefix}_{filename}",
                                  wav_path=f"sph2pipe -f wav -p {sph} |",
                                  start_time=float(start_time),
                                  end_time=float(end_time),
                                  lang="<en>",
                                  task="<asr>",
                                  text=transcript,
                                  asr_text=transcript,
                              )
                          )
          ret.append(utts)
  
      return ret
  
file_path: espnet/egs2/owsm_v2/s2t1/local/prepare_tedlium_filtered.py
imports: from argparse import ArgumentParser
  from collections import defaultdict
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple, Union
  from utils import SYMBOL_NA, SYMBOL_NOSPEECH, SYMBOLS_TIME, LongUtterance, Utterance, generate_long_utterances
label_desc: Use image node_id 2 for calling a global function with example usage: collect_data(data_dir, split, prefix) and returns: ret