Package opennlp.uima.util
Class OpennlpUtil
java.lang.Object
opennlp.uima.util.OpennlpUtil
This class contains util methods for the maxent library.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Loads data from a givenFile.static TrainingParametersloadTrainingParams(String inFileValue, boolean isSequenceTrainingAllowed) Loads data from a givenFile.static void
-
Method Details
-
serialize
- Parameters:
model- TheBaseModelto serialize.modelFile- TheFileto serialize into.- Throws:
IOException- Thrown if IO errors occurred.
-
loadBytes
Loads data from a givenFile.- Parameters:
inFile- TheFileto read bytes from.- Returns:
- The bytes that have been read.
- Throws:
IOException- Thrown if IO errors occurred.
-
loadTrainingParams
public static TrainingParameters loadTrainingParams(String inFileValue, boolean isSequenceTrainingAllowed) throws org.apache.uima.resource.ResourceInitializationException Loads data from a givenFile.- Parameters:
inFileValue- The name of theFileto read bytes from.isSequenceTrainingAllowed- Whether theTrainerFactory.TrainerType.SEQUENCE_TRAINERmethod is allowed or not.- Returns:
- The
TrainingParametersthat have been read. - Throws:
org.apache.uima.resource.ResourceInitializationException- Thrown if IO errors occurred or theinFileValuedoes not reference a valid training parameters file.
-