docstr: Tests the perplexity of a given ngram model on a test file.
  
  Args:
      mod_c (str): The path to the ngram model file.
      symbols (str): The path to the symbol table file.
      test_txt (str): The path to the test text file.
      nemo_model_file (str): The path to the NeMo model file.
      tmp_path (str): The path to the temporary directory where the test far file will be created.
      force (bool): If True, overwrites any existing far file.
  
  Returns:
      str: A string representation of the perplexity calculated.
  
  Example:
      >>> test_perplexity("/path/to/ngram_model", "/path/to/symbol_table", "/path/to/test_file", "/path/to/tokenizer_model", "/path/to/tmp_dir", True)
      'Perplexity: 123.45'
docstr_tok: ["Tests","the","perplexity","of","a","given","ngram","model","on","a","test","file",".","Args",":","mod_c","(","str",")",":","The","path","to","the","ngram","model","file",".","symbols","(","str",")",":","The","path","to","the","symbol","table","file",".","test_txt","(","str",")",":","The","path","to","the","test","text","file",".","nemo_model_file","(","str",")",":","The","path","to","the","NeMo","model","file",".","tmp_path","(","str",")",":","The","path","to","the","temporary","directory","where","the","test","far","file","will","be","created",".","force","(","bool",")",":","If","True",",","overwrites","any","existing","far","file",".","Returns",":","str",":","A","string","representation","of","the","perplexity","calculated",".","Example",":",">",">",">","test_perplexity","(","``","\/path\/to\/ngram_model","''",",","``","\/path\/to\/symbol_table","''",",","``","\/path\/to\/test_file","''",",","``","\/path\/to\/tokenizer_model","''",",","``","\/path\/to\/tmp_dir","''",",","True",")","'Perplexity",":","123.45","'"]
code: def test_perplexity(
      self,
      mod_c: str,
      symbols: str,
      test_txt: str,
      nemo_model_file: str,
      tmp_path: str,
  ) -> str:
      """
      Tests the perplexity of a given ngram model on a test file.
  
      Args:
          mod_c (str): The path to the ngram model file.
          symbols (str): The path to the symbol table file.
          test_txt (str): The path to the test text file.
          nemo_model_file (str): The path to the NeMo model file.
          tmp_path (str): The path to the temporary directory where the test far file will be created.
          force (bool): If True, overwrites any existing far file.
  
      Returns:
          str: A string representation of the perplexity calculated.
  
      Example:
          >>> test_perplexity("/path/to/ngram_model", "/path/to/symbol_table", "/path/to/test_file", "/path/to/tokenizer_model", "/path/to/tmp_dir", True)
          'Perplexity: 123.45'
      """
  
      test_far = farcompile(
          symbols, test_txt, tmp_path, nemo_model_file
      )
      res_p = self.perplexity(mod_c, test_far)
      return res_p
  
imports: import argparse
  import os
  import subprocess
  import sys
  from typing import Tuple
  import kenlm_utils
  import torch
  import nemo.collections.asr
  from nemo.collections.asr.modules.rnnt import RNNTDecoder
  from nemo.collections.asr.parts.submodules.ctc_beam_decoding import DEFAULT_TOKEN_OFFSET
  from nemo.utils import logging
label_desc: Use image node_id 7 for calling the NgramMerge obj's underlying member method code with example usage: obj.test_perplexity(mod_c, symbols, test_txt, nemo_model_file, tmp_path) and returns: res_p