Class NaiveBayesModelWriter
java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
opennlp.tools.ml.AbstractMLModelWriter
opennlp.tools.ml.naivebayes.NaiveBayesModelWriter
- Direct Known Subclasses:
BinaryNaiveBayesModelWriter, PlainTextNaiveBayesModelWriter
public abstract class NaiveBayesModelWriter
extends opennlp.tools.ml.AbstractMLModelWriter
The base class for
NaiveBayesModel writers.
It provides the persist() method which takes care of the structure
of a stored document, and requires an extending class to define precisely
how the data should be stored.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model) Initializes aNaiveBayesModelWriterfor aNaiveBayes model. -
Method Summary
Modifier and TypeMethodDescriptionvoidpersist()Writes theperceptron model, using theAbstractModelWriter.writeUTF(String),AbstractModelWriter.writeDouble(double), orAbstractModelWriter.writeInt(int)} methods implemented by extending classes.Methods inherited from class opennlp.tools.ml.model.AbstractModelWriter
close, writeDouble, writeInt, writeUTF
-
Constructor Details
-
NaiveBayesModelWriter
public NaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model) Initializes aNaiveBayesModelWriterfor aNaiveBayes model.- Parameters:
model- TheNaiveBayes modelto be written.
-
-
Method Details
-
persist
Writes theperceptron model, using theAbstractModelWriter.writeUTF(String),AbstractModelWriter.writeDouble(double), orAbstractModelWriter.writeInt(int)} methods implemented by extending classes.If you wish to create a
NaiveBayesModelWriterwhich uses a different structure, it will be necessary to override thepersist()method in addition to implementing thewriteX(..)methods.- Overrides:
persistin classopennlp.tools.ml.AbstractMLModelWriter- Throws:
IOException- Thrown if IO errors occurred.
-