protected static void generate(String[] args) {
    if (args.length != 3) {
      System.out.println(
          "Please specify the number of instances as the second argument "
              + "and the path to save the instances as the third argument.");
    } else {
      final int numInstances = Integer.parseInt(args[1]);
      final String dataFilename = args[2];

      // Initialize the classifier from the file data.
      DiscretizingNaiveBayesClassifier classifier = new DiscretizingNaiveBayesClassifier();
      classifier.initializeFromFileData(loadTrainedModelFileData());

      SparseLineAST.saveSparseEncoding(
          dataFilename, classifier.generateLabeledInstances(numInstances));
    }
  }