code: def clean_text(text):
      """Performs invalid character removal and whitespace cleanup on text."""
      text = (
          text.replace("“", '"')
          .replace("”", '"')
          .replace("‘", "'")
          .replace("’", "'")
          .replace("—", "-")
      )
  
      output = []
      for char in text:
          if _is_control(char):
              continue
          if _is_whitespace(char):
              output.append(" ")
          else:
              output.append(char)
      return "".join(output)
  
imports: import collections
  import sentencepiece
  import unicodedata
  from .args import str2bool
label_desc: Use image node_id 1 for calling a global function with example usage: clean_text(text) and returns: str