code: def normalize(text, replacements):
      # lower case every word
      text = text.lower()
  
      # replace white spaces in front and end
      text = re.sub(r"^\s*|\s*$", "", text)
  
      # hotel domain pfb30
      text = re.sub(r"b&b", "bed and breakfast", text)
      text = re.sub(r"b and b", "bed and breakfast", text)
  
      # weird unicode bug
      text = re.sub("(\u2018|\u2019)", "'", text)
  
      # replace st.
      text = text.replace(";", ",")
      text = re.sub(r"$\/", "", text)
      text = text.replace("/", " and ")
  
      # replace other special characters
      text = text.replace("-", " ")
      text = re.sub(r'["\<>@\(\)]', "", text)  # remove
  
      # insert white space before and after tokens:
      for token in ["?", ".", ",", "!"]:
          text = insertSpace(token, text)
  
      # insert white space for 's
      text = insertSpace("'s", text)
  
      # replace it's, does't, you'd ... etc
      text = re.sub("^'", "", text)
      text = re.sub(r"'$", "", text)
      text = re.sub(r"'\s", " ", text)
      text = re.sub(r"\s'", " ", text)
      for fromx, tox in replacements:
          text = " " + text + " "
          text = text.replace(fromx, tox)[1:-1]
  
      # remove multiple spaces
      text = re.sub(" +", " ", text)
  
      # concatenate numbers
      tokens = text.split()
      i = 1
      while i < len(tokens):
          if re.match(r"^\d+$", tokens[i]) and re.match(
              r"\d+$", tokens[i - 1]
          ):
              tokens[i - 1] += tokens[i]
              del tokens[i]
          else:
              i += 1
      text = " ".join(tokens)
      return text
  
imports: from itertools import product
  from statistics import mean
  from typing import Any, Dict, List, Optional, Set, Tuple
  import json
  import logging
  import os
  import re
  import shutil
  from tqdm import tqdm
  from speechbrain.utils.data_utils import download_file
label_desc: Use image node_id 10 for calling a global function with example usage: normalize(text, replacements) and returns: text