code: def custom_clean(text, model_name):
      """
      Uses custom criteria to clean text.
  
      Arguments
      ---------
      text : str
          Input text to be cleaned
      model_name : str
          whether to treat punctuations
  
      Returns
      -------
      text : str
          Cleaned text
      """
  
      _abbreviations = [
          (re.compile("\\b%s\\." % x[0], re.IGNORECASE), x[1])
          for x in [
              ("mrs", "misess"),
              ("mr", "mister"),
              ("dr", "doctor"),
              ("st", "saint"),
              ("co", "company"),
              ("jr", "junior"),
              ("maj", "major"),
              ("gen", "general"),
              ("drs", "doctors"),
              ("rev", "reverend"),
              ("lt", "lieutenant"),
              ("hon", "honorable"),
              ("sgt", "sergeant"),
              ("capt", "captain"),
              ("esq", "esquire"),
              ("ltd", "limited"),
              ("col", "colonel"),
              ("ft", "fort"),
          ]
      ]
      text = unidecode(text.lower())
      if model_name != "FastSpeech2WithAlignment":
          text = re.sub("[:;]", " - ", text)
          text = re.sub(r'[)(\[\]"]', " ", text)
          text = text.strip().strip().strip("-")
  
      text = re.sub(" +", " ", text)
      for regex, replacement in _abbreviations:
          text = re.sub(regex, replacement, text)
      return text
  
imports: import os
  import csv
  import json
  import random
  import logging
  import torch
  import torchaudio
  import numpy
  from tqdm import tqdm
  from speechbrain.utils.data_utils import download_file
  from speechbrain.dataio.dataio import load_pkl, save_pkl
  import tgt
  from speechbrain.inference.text import GraphemeToPhoneme
  import re
  from unidecode import unidecode
  from speechbrain.utils.text_to_sequence import _g2p_keep_punctuations
label_desc: Use image node_id 7 for calling a global function with example usage: custom_clean(text, model_name) and returns: text