Class AbstractMLModelWriter
java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
opennlp.tools.ml.AbstractMLModelWriter
- Direct Known Subclasses:
GISModelWriter, NaiveBayesModelWriter, PerceptronModelWriter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<List<ComparablePredicate>> compressOutcomes(ComparablePredicate[] sorted) Compresses outcome patterns.protected List<List<ComparablePredicate>> computeOutcomePatterns(ComparablePredicate[] sorted) Computes outcome patterns viapredicates.voidpersist()Serializes themodelusing theAbstractModelWriter.writeUTF(String),AbstractModelWriter.writeDouble(double), orAbstractModelWriter.writeInt(int)} methods implemented by extending classes.protected abstract ComparablePredicate[]Sorts and optimizes the model parameters.Methods inherited from class AbstractModelWriter
close, writeDouble, writeInt, writeUTF
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
PARAMS
-
OUTCOME_LABELS
-
PRED_LABELS
-
numOutcomes
protected int numOutcomes
-
-
Constructor Details
-
AbstractMLModelWriter
public AbstractMLModelWriter()
-
-
Method Details
-
sortValues
Sorts and optimizes the model parameters. Thereby, parameters with0weight and predicates with no parameters are removed.- Returns:
- A
ComparablePredicate.
-
computeOutcomePatterns
Computes outcome patterns viapredicates.- Returns:
- A
ListofList<ComparablePredicate>that represent the outcomes patterns.
-
compressOutcomes
Compresses outcome patterns.- Returns:
- A
ListofList<ComparablePredicate>that represent the remaining outcomes patterns.
-
persist
Description copied from class:AbstractModelWriterSerializes themodelusing theAbstractModelWriter.writeUTF(String),AbstractModelWriter.writeDouble(double), orAbstractModelWriter.writeInt(int)} methods implemented by extending classes.- Specified by:
persistin classAbstractModelWriter- Throws:
IOException- Thrown if IO errors occurred.
-