code: def word_to_phonemes(
      sent: str, phonemizer: str, checkpoint: str
  ) -> List[str]:
      if phonemizer == "DeepPhonemizer":
          from dp.phonemizer import Phonemizer
  
          global _phonemizer
          _other_symbols = "".join(list(_special) + list(_punctuation))
          _phone_symbols_re = (
              r"(\[[A-Z]+?\]|" + "[" + _other_symbols + "])"
          )  # [\[([A-Z]+?)\]|[-!'(),.:;? ]]
  
          if _phonemizer is None:
              # using a global variable so that we don't have to relode checkpoint
              # everytime this function is called
              _phonemizer = Phonemizer.from_checkpoint(checkpoint)
  
          # Example:
          # sent = "hello world!"
          # '[HH][AH][L][OW] [W][ER][L][D]!'
          sent = _phonemizer(sent, lang="en_us")
  
          # ['[HH]', '[AH]', '[L]', '[OW]', ' ', '[W]', '[ER]', '[L]', '[D]', '!']
          ret = re.findall(_phone_symbols_re, sent)
  
          # ['HH', 'AH', 'L', 'OW', ' ', 'W', 'ER', 'L', 'D', '!']
          ret = [r.replace("[", "").replace("]", "") for r in ret]
  
          return ret
      else:
          raise ValueError(
              f"The `phonemizer` {phonemizer} is not supported. "
              "Supported `symbol_list` includes `'DeepPhonemizer'`."
          )
  
file_path: audio/examples/pipeline_tacotron2/text/text_preprocessing.py
imports: import re
  from typing import List, Optional, Union
  from torchaudio.datasets import CMUDict
  from unidecode import unidecode
  from .numbers import normalize_numbers
label_desc: Use image node_id 2 for calling a global function with example usage: word_to_phonemes(sent, phonemizer, checkpoint) and returns: ret