code: def main():
      args = get_parser().parse_args()
      logger.debug(f"Args: {args}")
  
      ref_uid_to_tra = load_tra(args.ref_tra)
      hyp_uid_to_tra = load_tra(args.hyp_tra)
      assert not bool(
          set(hyp_uid_to_tra.keys()) - set(ref_uid_to_tra.keys())
      )
  
      lm = kenlm.Model(args.kenlm_path)
      skipwords = set(args.skipwords.split(","))
  
      def compute_lm_score(s):
          s = " ".join(w for w in s.split() if w not in skipwords)
          s = s.upper() if args.uppercase else s
          return lm.score(s)
  
      g2p, g2p_dict = None, None
      if args.phonemize:
          if args.phonemize_lexicon:
              g2p_dict = load_lex(args.phonemize_lexicon)
          else:
              g2p = G2p()
  
      wer = compute_wer(ref_uid_to_tra, hyp_uid_to_tra, g2p, g2p_dict)
      lm_ppl = compute_lm_ppl(hyp_uid_to_tra, compute_lm_score)
  
      gt_wer = -math.inf
      if args.gt_tra:
          gt_uid_to_tra = load_tra(args.gt_tra)
          gt_wer = compute_wer(
              gt_uid_to_tra, hyp_uid_to_tra, None, None
          )
  
      score = math.log(lm_ppl) * max(wer, args.min_vt_uer)
      logging.info(
          f"{args.hyp_tra}: score={score:.4f}; wer={wer*100:.2f}%; lm_ppl={lm_ppl:.4f}; gt_wer={gt_wer*100:.2f}%"
      )
  
file_path: fairseq/examples/wav2vec/unsupervised/kaldi_self_train/st/local/unsup_select.py
imports: import argparse
  import logging
  import math
  import sys
  import kenlm
  import editdistance
  from g2p_en import G2p
label_desc: Use image node_id 6 for calling a global function with example usage: main() and returns: lm