code: def _generate_examples_from_stm_file(stm_path):
      """Generate examples from a TED-LIUM stm file."""
      stm_dir = os.path.dirname(stm_path)
      sph_dir = os.path.join(os.path.dirname(stm_dir), "sph")
      with epath.Path(stm_path).open() as f:
          for line in f:
              line = line.strip()
              (
                  fn,
                  channel,
                  speaker,
                  start,
                  end,
                  label,
                  transcript,
              ) = line.split(" ", 6)
              transcript = _maybe_trim_suffix(transcript)
  
              audio_file = "%s.sph" % fn
              samples = _extract_audio_segment(
                  os.path.join(sph_dir, audio_file),
                  int(channel),
                  float(start),
                  float(end),
              )
  
              key = "-".join([speaker, start, end, label])
              example = {
                  "speech": samples,
                  "text": transcript,
                  "speaker_id": speaker,
                  "gender": _parse_gender(label),
                  "id": key,
              }
              yield key, example
  
file_path: datasets/tensorflow_datasets/datasets/tedlium/tedlium_dataset_builder.py
imports: import os
  import re
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling a global function with example usage: _generate_examples_from_stm_file(stm_path) without return types