Class OpennlpUtil

java.lang.Object
opennlp.uima.util.OpennlpUtil

public final class OpennlpUtil extends Object
This class contains util methods for the maxent library.
  • Method Details

    • serialize

      public static void serialize(BaseModel model, File modelFile) throws IOException
      Serializes a GIS model and writes it to the given File.
      Parameters:
      model - The BaseModel to serialize.
      modelFile - The File to serialize into.
      Throws:
      IOException - Thrown if IO errors occurred.
    • loadBytes

      public static byte[] loadBytes(File inFile) throws IOException
      Loads data from a given File.
      Parameters:
      inFile - The File to 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 given File.
      Parameters:
      inFileValue - The name of the File to read bytes from.
      isSequenceTrainingAllowed - Whether the TrainerFactory.TrainerType.SEQUENCE_TRAINER method is allowed or not.
      Returns:
      The TrainingParameters that have been read.
      Throws:
      org.apache.uima.resource.ResourceInitializationException - Thrown if IO errors occurred or the inFileValue does not reference a valid training parameters file.