code: def text_standardize(text):
      """
      fixes some issues the spacy tokenizer had on books corpus also does some whitespace standardization
      """
      text = text.replace("—", "-")
      text = text.replace("–", "-")
      text = text.replace("―", "-")
      text = text.replace("…", "...")
      text = text.replace("´", "'")
      text = re.sub(
          r"""(-+|~+|!+|"+|;+|\?+|\++|,+|\)+|\(+|\\+|\/+|\*+|\[+|\]+|}+|{+|\|+|_+)""",
          r" \1 ",
          text,
      )
      text = re.sub(r"\s*\n\s*", " \n ", text)
      text = re.sub(r"[^\S\n]+", " ", text)
      return text.strip()
  
imports: import json
  import os
  import re
  import unicodedata
  from typing import Optional, Tuple
  from ...tokenization_utils import PreTrainedTokenizer, _is_control, _is_punctuation, _is_whitespace
  from ...utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: text_standardize(text) and returns: text