code: public static void main(String[] args) throws Exception {
      StringUtils.printErrInvocationString("CMMClassifier", args);
  
      Properties props = StringUtils.argsToProperties(args);
      CMMClassifier cmm = new CMMClassifier<CoreLabel>(props);
      String testFile = cmm.flags.testFile;
      String textFile = cmm.flags.textFile;
      String loadPath = cmm.flags.loadClassifier;
      String serializeTo = cmm.flags.serializeTo;
  
      // cmm.crossValidateTrainAndTest(trainFile);
      if (loadPath != null) {
        cmm.loadClassifierNoExceptions(loadPath, props);
      } else if (cmm.flags.loadJarClassifier != null) {
        cmm.loadJarClassifier(cmm.flags.loadJarClassifier, props);
      } else if (cmm.flags.trainFile != null) {
        if (cmm.flags.biasedTrainFile != null) {
          cmm.trainSemiSup();
        } else {
          cmm.train();
        }
      } else {
        cmm.loadDefaultClassifier();
      }
  
      if (serializeTo != null) {
        cmm.serializeClassifier(serializeTo);
      }
  
      if (testFile != null) {
        cmm.classifyAndWriteAnswers(testFile, cmm.makeReaderAndWriter());
      } else if (cmm.flags.testFiles != null) {
        cmm.classifyAndWriteAnswers(cmm.flags.baseTestDir, cmm.flags.testFiles,
                                    cmm.makeReaderAndWriter());
      }
  
      if (textFile != null) {
        DocumentReaderAndWriter readerAndWriter =
          new PlainTextDocumentReaderAndWriter();
        cmm.classifyAndWriteAnswers(textFile, readerAndWriter);
      }
    }
docs: Command-line version of the classifier.  See the class
  comments for examples of use, and SeqClassifierFlags
  for more information on supported flags.