Package opennlp.tools.ml.naivebayes
Class NaiveBayesTrainer
- java.lang.Object
- 
- opennlp.tools.ml.AbstractTrainer
- 
- opennlp.tools.ml.AbstractEventTrainer
- 
- opennlp.tools.ml.naivebayes.NaiveBayesTrainer
 
 
 
- 
- All Implemented Interfaces:
- EventTrainer
 
 public class NaiveBayesTrainer extends AbstractEventTrainer Trains models using the combination of EM algorithm and Naive Bayes classifier which is described in: Text Classification from Labeled and Unlabeled Documents using EM Nigam, McCallum, et al paper of 2000
- 
- 
Field SummaryFields Modifier and Type Field Description static StringNAIVE_BAYES_VALUE- 
Fields inherited from class opennlp.tools.ml.AbstractEventTrainerDATA_INDEXER_ONE_PASS_REAL_VALUE, DATA_INDEXER_ONE_PASS_VALUE, DATA_INDEXER_PARAM, DATA_INDEXER_TWO_PASS_VALUE
 - 
Fields inherited from class opennlp.tools.ml.AbstractTrainerALGORITHM_PARAM, CUTOFF_DEFAULT, CUTOFF_PARAM, ITERATIONS_DEFAULT, ITERATIONS_PARAM, TRAINER_TYPE_PARAM, VERBOSE_DEFAULT, VERBOSE_PARAM
 - 
Fields inherited from interface opennlp.tools.ml.EventTrainerEVENT_VALUE
 
- 
 - 
Constructor SummaryConstructors Constructor Description NaiveBayesTrainer()NaiveBayesTrainer(TrainingParameters parameters)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractModeldoTrain(DataIndexer indexer)booleanisSortAndMerge()AbstractModeltrainModel(DataIndexer di)- 
Methods inherited from class opennlp.tools.ml.AbstractEventTrainergetDataIndexer, isValid, train, train, validate
 - 
Methods inherited from class opennlp.tools.ml.AbstractTrainergetAlgorithm, getCutoff, getIterations, init, init
 - 
Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface opennlp.tools.ml.EventTrainerinit, init
 
- 
 
- 
- 
- 
Field Detail- 
NAIVE_BAYES_VALUEpublic static final String NAIVE_BAYES_VALUE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
NaiveBayesTrainerpublic NaiveBayesTrainer() 
 - 
NaiveBayesTrainerpublic NaiveBayesTrainer(TrainingParameters parameters) 
 
- 
 - 
Method Detail- 
isSortAndMergepublic boolean isSortAndMerge() - Specified by:
- isSortAndMergein class- AbstractEventTrainer
 
 - 
doTrainpublic AbstractModel doTrain(DataIndexer indexer) throws IOException - Specified by:
- doTrainin class- AbstractEventTrainer
- Throws:
- IOException
 
 - 
trainModelpublic AbstractModel trainModel(DataIndexer di) 
 
- 
 
-