Package opennlp.uima.util
Class OpennlpUtil
java.lang.Object
opennlp.uima.util.OpennlpUtil
Provides utility methods for OpenNLP's maxent library.
- 
Method SummaryModifier and TypeMethodDescriptionstatic byte[]Loads data from a givenFile.static TrainingParametersloadTrainingParams(String trainingFilePath, boolean isSequenceTrainingAllowed) Loads data from the specified training parametersfile.static void
- 
Method Details- 
serialize- Parameters:
- model- The- BaseModelto serialize.
- modelFile- The- Fileto serialize into.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
loadBytesLoads data from a givenFile.- Parameters:
- inFile- The- Fileto read bytes from.
- Returns:
- The bytes that have been read.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
loadTrainingParamspublic static TrainingParameters loadTrainingParams(String trainingFilePath, boolean isSequenceTrainingAllowed) throws org.apache.uima.resource.ResourceInitializationException Loads data from the specified training parametersfile.- Parameters:
- trainingFilePath- The path to the- Fileto load the training parameters from.
- isSequenceTrainingAllowed- Whether the- TrainerFactory.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 the- trainingFilePathdoes not reference a valid training parameters file.
 
 
-