code: def text_to_dict(trnpath):
      """
      This converts lines of text into a dictionary-
  
      Arguments
      ---------
      text_lst : str
          Path to the file containing the ksponspeech text transcription.
  
      Returns
      -------
      dict
          The dictionary containing the text transcriptions for each sentence.
  
      """
      # Initialization of the text dictionary
      text_dict = {}
      # Reading all the transcription files is text_lst
      with open(trnpath, "r") as f:
          # Reading all line of the transcription file
          for line in f:
              filename, raw_script = line.split(" :: ")
              file_id = filename.split("/")[-1].replace(".pcm", "")
              script = normalize(raw_script)
              text_dict[file_id] = script
      return text_dict
  
file_path: speechbrain/recipes/KsponSpeech/ASR/transformer/ksponspeech_prepare.py
imports: import csv
  import logging
  import os
  import re
  import torchaudio
  from speechbrain.dataio.dataio import load_pkl, merge_csvs, save_pkl
  from speechbrain.utils.data_utils import get_all_files
label_desc: Use image node_id 4 for calling a global function with example usage: text_to_dict(trnpath) and returns: text_dict