code: protected void train() throws Exception {
        Dataset<Sequence> train = loadDataset();
        if (minFeatureCount > 1) {
           train = train.preprocess(PreprocessorList.create(new MinCountFilter(minFeatureCount).asSequenceProcessor()));
        }
        SequenceLabeler labeler = getLearner().train(train);
        POSTagger tagger = new POSTagger(featurizer.get(), labeler);
        tagger.write(model);
     }
docs: Train.
  
  @throws Exception the exception