code: def load_rttm_text(
      path: Union[Path, str]
  ) -> Dict[str, List[Tuple[str, float, float]]]:
      """Read a RTTM file
  
      Note: only support speaker information now
      """
  
      assert check_argument_types()
      data = {}
      with Path(path).open("r", encoding="utf-8") as f:
          for linenum, line in enumerate(f, 1):
              sps = re.split(" +", line.rstrip())
  
              # RTTM format must have exactly 9 fields
              assert (
                  len(sps) == 9
              ), "{} does not have exactly 9 fields".format(path)
              (
                  label_type,
                  utt_id,
                  channel,
                  start,
                  end,
                  _,
                  _,
                  spk_id,
                  _,
              ) = sps
  
              # Only support speaker label now
              assert label_type in ["SPEAKER", "END"]
  
              spk_list, spk_event, max_duration = data.get(
                  utt_id, ([], [], 0)
              )
              if label_type == "END":
                  data[utt_id] = (spk_list, spk_event, int(end))
                  continue
              if spk_id not in spk_list:
                  spk_list.append(spk_id)
  
              data[utt_id] = (
                  spk_list,
                  spk_event
                  + [(spk_id, int(float(start)), int(float(end)))],
                  max_duration,
              )
  
      return data
  
file_path: espnet/espnet2/fileio/rttm.py
imports: import collections.abc
  import re
  from pathlib import Path
  from typing import Dict, List, Tuple, Union
  import numpy
  from typeguard import check_argument_types
label_desc: Use image node_id 1 for calling a global function with example usage: load_rttm_text(path) and returns: data