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:
- Trainer,- EventTrainer
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
- See Also:
- 
Field SummaryFieldsFields inherited from class opennlp.tools.ml.AbstractEventTrainerDATA_INDEXER_ONE_PASS_REAL_VALUE, DATA_INDEXER_ONE_PASS_VALUE, DATA_INDEXER_PARAM, DATA_INDEXER_TWO_PASS_VALUEFields inherited from interface opennlp.tools.ml.EventTrainerEVENT_VALUE
- 
Constructor SummaryConstructorsConstructorDescriptionInstantiates aNaiveBayesTrainerwith default training parameters.NaiveBayesTrainer(TrainingParameters parameters) Instantiates aNaiveBayesTrainerwith specificTrainingParameters.
- 
Method SummaryModifier and TypeMethodDescriptiondoTrain(DataIndexer indexer) booleanTrains aNaiveBayesModelwith given parameters.Methods inherited from class opennlp.tools.ml.AbstractEventTrainergetDataIndexer, train, train, validateMethods inherited from class opennlp.tools.ml.AbstractTrainergetAlgorithm, getCutoff, getIterations, getTrainingConfiguration, init, init
- 
Field Details- 
NAIVE_BAYES_VALUE- See Also:
 
 
- 
- 
Constructor Details- 
NaiveBayesTrainerpublic NaiveBayesTrainer()Instantiates aNaiveBayesTrainerwith default training parameters.
- 
NaiveBayesTrainerInstantiates aNaiveBayesTrainerwith specificTrainingParameters.- Parameters:
- parameters- The- parameterto use.
 
 
- 
- 
Method Details- 
isSortAndMergepublic boolean isSortAndMerge()- Specified by:
- isSortAndMergein class- AbstractEventTrainer
 
- 
doTrain- Specified by:
- doTrainin class- AbstractEventTrainer
- Throws:
- IOException
 
- 
trainModelTrains aNaiveBayesModelwith given parameters.- Parameters:
- di- The- DataIndexerused as data input.
- Returns:
- A valid, trained Naive Bayes model.
 
 
-