code: def _generate_librispeech_examples(transcript_file: str):
      """Generate examples from a Librispeech transcript file."""
      audio_dir = os.path.dirname(transcript_file)
      with tf.io.gfile.GFile(transcript_file) as f:
          for line in f:
              line = line.strip()
              key, transcript = line.split(" ", 1)
              audio_file = "%s.flac" % key
              speaker_id, chapter_id = [
                  int(el) for el in key.split("-")[:2]
              ]
              example = {
                  "id": key,
                  "speaker_id": speaker_id,
                  "chapter_id": chapter_id,
                  "speech": os.path.join(audio_dir, audio_file),
                  "text": transcript,
              }
              yield key, example
  
file_path: datasets/tensorflow_datasets/datasets/librispeech/librispeech_dataset_builder.py
imports: from __future__ import annotations
  import os
  from typing import Iterable, List
  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 1 for calling a global function with example usage: _generate_librispeech_examples(transcript_file) without return types