code: def read_trans(data_dict, pth, phs, audio_list, aduio_pth):
      """read transcriptions (SEAME/{type}/transcript/phaseII/??.txt)"""
  
      audio_dict = set(audio_list)
  
      with open(pth, "r") as f:
          for line in f:
              line = line.strip()
              if line == "":
                  continue
  
              if phs.lower() == "phasei":
                  lang = None
                  if len(line.split("\t")) == 4:
                      idx, start, end, text = line.split("\t")
                  else:
                      idx, cont = line.split("\t", 1)
                      print(
                          f"Skip {idx} with {cont}... (no transcript)"
                      )
                      continue
              elif phs.lower() == "phaseii":
                  idx, start, end, lang, text = line.split("\t")
              else:
                  print("folder error! not PhaseI or PhaseII")
                  raise
              # start: start time in msec
              # end: end time in msec
  
              start_ms = start
              end_ms = end
  
              # fit the devset format
              s_len, e_len = len(start), len(end)
              if s_len < 5:
                  start = int(round(fit_format(start) / 10, 0))
                  start = str(start).zfill(5)
              else:
                  start = int(round(float(start) / 10, 0))
              if e_len < 5:
                  end = int(round(fit_format(end) / 10, 0))
                  end = str(end).zfill(5)
              else:
                  end = int(round(float(end) / 10, 0))
  
              name = f"{idx}-{start}-{end}"
              if name not in data_dict:
                  if idx.split("_")[0][0].isdigit():
                      spkr = idx.split("_")[0][2:-2].lower()
                  else:
                      spkr = idx.split("_")[0][:5].lower()
  
                  if idx.split("-")[0] in audio_dict:
                      apth = os.path.join(
                          audio_pth, name.split("-")[0] + ".flac"
                      )
                  else:
                      print("FLAC idx error!")
                      raise
  
                  data_dict[name.lower()] = {
                      "text": text,
                      "start": start,
                      "end": end,
                      "speaker": spkr,
                      "split": "train",
                      "audio_pth": apth,
                      "start_ms": start_ms,
                      "end_ms": end_ms,
                      "phase": phs,
                  }
              else:
                  print("Repeated idx!")
                  raise
  
imports: import argparse
  import collections
  import itertools
  import os
  import random
  import re
  import sys
label_desc: Use image node_id 12 for calling a global function with example usage: read_trans(data_dict, pth, phs, audio_list, aduio_pth) without return types