docstr: This function reads an ARPA n-gram model and converts it to a binary format. The binary model is saved to the same directory as the ARPA model with a ".mod" extension. If the binary model file already exists and force argument is False, then the function skips conversion and returns a message. Otherwise, it executes the command to create a binary model using the subprocess.run method.
  
  Parameters:
      arpa_path (string): The file path to the ARPA n-gram model.
      force (bool): If True, the function will convert the ARPA model to binary even if the binary file already exists. If False and the binary file exists, the function will skip the conversion.
  Returns:
      If the binary model file already exists and force argument is False, returns a message indicating that the file exists and the conversion is skipped.
      Otherwise, returns a subprocess.CompletedProcess object, which contains information about the executed command. The subprocess's output and error streams are redirected to stdout and stderr, respectively.
docstr_tok: ["This","function","reads","an","ARPA","n-gram","model","and","converts","it","to","a","binary","format",".","The","binary","model","is","saved","to","the","same","directory","as","the","ARPA","model","with","a","``",".mod","''","extension",".","If","the","binary","model","file","already","exists","and","force","argument","is","False",",","then","the","function","skips","conversion","and","returns","a","message",".","Otherwise",",","it","executes","the","command","to","create","a","binary","model","using","the","subprocess.run","method",".","Parameters",":","arpa_path","(","string",")",":","The","file","path","to","the","ARPA","n-gram","model",".","force","(","bool",")",":","If","True",",","the","function","will","convert","the","ARPA","model","to","binary","even","if","the","binary","file","already","exists",".","If","False","and","the","binary","file","exists",",","the","function","will","skip","the","conversion",".","Returns",":","If","the","binary","model","file","already","exists","and","force","argument","is","False",",","returns","a","message","indicating","that","the","file","exists","and","the","conversion","is","skipped",".","Otherwise",",","returns","a","subprocess.CompletedProcess","object",",","which","contains","information","about","the","executed","command",".","The","subprocess","'s","output","and","error","streams","are","redirected","to","stdout","and","stderr",",","respectively","."]
code: def arpa2mod(self, arpa_path: str, force: bool):
      """
      This function reads an ARPA n-gram model and converts it to a binary format. The binary model is saved to the same directory as the ARPA model with a ".mod" extension. If the binary model file already exists and force argument is False, then the function skips conversion and returns a message. Otherwise, it executes the command to create a binary model using the subprocess.run method.
  
      Parameters:
          arpa_path (string): The file path to the ARPA n-gram model.
          force (bool): If True, the function will convert the ARPA model to binary even if the binary file already exists. If False and the binary file exists, the function will skip the conversion.
      Returns:
          If the binary model file already exists and force argument is False, returns a message indicating that the file exists and the conversion is skipped.
          Otherwise, returns a subprocess.CompletedProcess object, which contains information about the executed command. The subprocess's output and error streams are redirected to stdout and stderr, respectively.
      """
      mod_path = arpa_path + ".mod"
      if os.path.isfile(mod_path) and not force:
          return "File " + mod_path + " exists. Skipping."
      else:
          sh_args = [
              os.path.join(self.ngram_bin_path, "ngramread"),
              "--ARPA",
              arpa_path,
              mod_path,
          ]
          return subprocess.run(
              sh_args,
              capture_output=False,
              text=True,
              stdout=sys.stdout,
              stderr=sys.stderr,
          )
  
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 3 for calling the NgramMerge obj's underlying member method code with example usage: obj.arpa2mod(arpa_path, force) and returns: unknown, subprocess