code: def do_g2p(g2p, sent, res_wrds, is_first_sent):
      if sent in res_wrds:
          pho_seq = [res_wrds[sent]]
      else:
          pho_seq = g2p(sent)
      if not is_first_sent:
          pho_seq = [" "] + pho_seq  # add space to separate
      return pho_seq
  
file_path: fairseq/examples/speech_text_joint_to_text/scripts/g2p_encode.py
imports: import argparse
  import itertools
  import logging
  import re
  import time
  from g2p_en import G2p
label_desc: Use image node_id 4 for calling a global function with example usage: do_g2p(g2p, sent, res_wrds, is_first_sent) and returns: pho_seq