code: public static void main(String[] args) {
      if (args.length < 2) {
        System.err.println("Input and output files not provided");
        System.err
            .println("You need to provide both the input binary openfst model");
        System.err.println("and the output serialized java fst model.");
        System.exit(1);
      }
  
      MutableFst fst = Convert.importFst(args[0], TropicalSemiring.INSTANCE);
  
      // Serialize the java fst model to disk
      System.out.println("Saving as binary java fst model...");
      try {
        fst.saveModel(new File(args[1]));
  
      } catch (IOException e) {
        System.err.println("Cannot write to file " + args[1]);
        System.exit(1);
      }
    }
docs: Imports an openfst text format and serializes it as java binary model Several files are imported as follows: -
  basename.input.syms - basename.output.syms - basename.fst.txt
  
  args[0] openfst's files basename
  args[1] the java binary model filename