code: def concate_transcriptions_by_mapping_file(
      speech_folder: str,
      mapping_file_path: str,
      extracted_transcriptions: List[TDF],
  ) -> List[Data]:
      """return concated transcriptions from the given mapping file"""
  
      with open(
          mapping_file_path, "r", encoding="utf-8"
      ) as fisher_mapping_file:
          fisher_mapping = fisher_mapping_file.readlines()
          utterances = []
  
          for fisher_mapping_line in fisher_mapping:
              fisher_mapping_line = fisher_mapping_line.strip()
              fisher_mapping_line = fisher_mapping_line.split(" ")
              uid = fisher_mapping_line[0]
              need_to_be_concate_lines = fisher_mapping_line[1].split(
                  "_"
              )
              need_to_be_concate_lines = list(
                  map(int, need_to_be_concate_lines)
              )
  
              selected_transcription = extracted_transcriptions[uid]
  
              # concate multiple transcripts
              if len(need_to_be_concate_lines) > 1:
                  # index shift one is because id is count from 1 in file however, list start from 0
                  concated_transcripts = selected_transcription[
                      need_to_be_concate_lines[0]
                      - 1 : need_to_be_concate_lines[-1]
                  ]
                  concated_transcripts = list(
                      map(
                          lambda tdf: tdf.transcript,
                          concated_transcripts,
                      )
                  )
                  concated_transcripts = " ".join(concated_transcripts)
  
                  start = selected_transcription[
                      need_to_be_concate_lines[0] - 1
                  ].start
                  end = selected_transcription[
                      need_to_be_concate_lines[-1] - 1
                  ].end
              else:
                  concated_transcripts = selected_transcription[
                      need_to_be_concate_lines[-1] - 1
                  ].transcript
                  start = selected_transcription[
                      need_to_be_concate_lines[-1] - 1
                  ].start
                  end = selected_transcription[
                      need_to_be_concate_lines[-1] - 1
                  ].end
  
              # clean up
              concated_transcripts = normalize_punctuation(
                  concated_transcripts
              )
              concated_transcripts = es_normalizer.normalize(
                  concated_transcripts
              )
  
              channel = selected_transcription[
                  need_to_be_concate_lines[0] - 1
              ].channel
              channel_symbol = "B" if channel == 1 else "A"
              uttrance_id = (
                  f"{uid}-{channel_symbol}-{start:06d}-{end:06d}"
              )
  
              utterances.append(
                  Data(
                      uid=uttrance_id,
                      transcription=concated_transcripts,
                      wav=f"{speech_folder}/{uid}.sph {channel} {start} {end}",
                      duration=(end - start) / 100,
                  )
              )
  
          return utterances
  
imports: import os
  import re
  import json
  import string
  import logging
  import subprocess
  from typing import List
  from dataclasses import dataclass, field
  import torch
  import torchaudio
  from tqdm import tqdm
  from speechbrain.utils.data_utils import get_all_files
  from speechbrain.utils.torch_audio_backend import check_torchaudio_backend
  from speechbrain.augment.time_domain import Resample
label_desc: Use image node_id 6 for calling a global function with example usage: concate_transcriptions_by_mapping_file(speech_folder, mapping_file_path, extracted_transcriptions) and returns: utterances