code: def convert_ctm_to_text(ctm_file_path: str) -> Tuple[List[str], str]:
      """
      Convert ctm file into a list containing transcription (space seperated string) per each speaker.
  
      Args:
          ctm_file_path (str):
              Filepath to the reference CTM files.
  
      Returns:
          spk_reference (list):
              List containing the reference transcripts for each speaker.
  
              Example:
              >>> spk_reference = ["hi how are you well that's nice", "i'm good yeah how is your sister"]
  
          mix_reference (str):
              Reference transcript from CTM file. This transcript has word sequence in temporal order.
  
              Example:
              >>> mix_reference = "hi how are you i'm good well that's nice yeah how is your sister"
      """
      mix_reference, per_spk_ref_trans_dict = [], {}
      ctm_content = open(ctm_file_path).readlines()
      for ctm_line in ctm_content:
          ctm_split = ctm_line.split()
          spk = ctm_split[1]
          if spk not in per_spk_ref_trans_dict:
              per_spk_ref_trans_dict[spk] = []
          per_spk_ref_trans_dict[spk].append(ctm_split[4])
          mix_reference.append(ctm_split[4])
      spk_reference = [
          " ".join(word_list)
          for word_list in per_spk_ref_trans_dict.values()
      ]
      mix_reference = " ".join(mix_reference)
      return spk_reference, mix_reference
  
imports: import copy
  import csv
  import json
  import os
  from collections import OrderedDict
  from datetime import datetime
  from typing import Dict, List, Tuple
  import numpy
  from nemo.collections.asr.metrics.der import concat_perm_word_error_rate
  from nemo.collections.asr.metrics.wer import word_error_rate
  from nemo.collections.asr.models import ClusteringDiarizer
  from nemo.collections.asr.parts.utils.speaker_utils import audio_rttm_map, get_uniqname_from_filepath, labels_to_rttmfile, rttm_to_labels, write_rttm2manifest
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: convert_ctm_to_text(ctm_file_path) and returns: spk_reference,  mix_reference