Class LemmatizerModel

java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.lemmatizer.LemmatizerModel
All Implemented Interfaces:
Serializable, opennlp.tools.util.model.ArtifactProvider

public class LemmatizerModel extends BaseModel
The LemmatizerModel is the model used by a learnable Lemmatizer.
See Also:
  • Constructor Details

    • LemmatizerModel

      public LemmatizerModel(String languageCode, opennlp.tools.ml.model.SequenceClassificationModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
      Initializes a LemmatizerModel instance via given parameters.
      Parameters:
      languageCode - An ISO conform language code.
      lemmatizerModel - A valid SequenceClassificationModel.
      manifestInfoEntries - Additional information kept in the manifest.
      factory - The LemmatizerFactory for creating related objects.
    • LemmatizerModel

      public LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
      Initializes a LemmatizerModel instance via given parameters.
      Parameters:
      languageCode - An ISO conform language code.
      lemmatizerModel - A valid MaxentModel.
      manifestInfoEntries - Additional information kept in the manifest.
      factory - The LemmatizerFactory for creating related objects.
    • LemmatizerModel

      public LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, int beamSize, Map<String,String> manifestInfoEntries, LemmatizerFactory factory)
      Initializes a LemmatizerModel instance via given parameters.
      Parameters:
      languageCode - An ISO conform language code.
      lemmatizerModel - A valid MaxentModel.
      beamSize - The size of the beam that should be used when decoding sequences.
      manifestInfoEntries - Additional information kept in the manifest.
      factory - The LemmatizerFactory for creating related objects.
    • LemmatizerModel

      public LemmatizerModel(String languageCode, opennlp.tools.ml.model.MaxentModel lemmatizerModel, LemmatizerFactory factory)
      Initializes a LemmatizerModel instance via given parameters.
      Parameters:
      languageCode - An ISO conform language code.
      lemmatizerModel - A valid MaxentModel.
      factory - The LemmatizerFactory for creating related objects.
    • LemmatizerModel

      public LemmatizerModel(InputStream in) throws IOException
      Initializes a LemmatizerModel instance via a valid InputStream.
      Parameters:
      in - The InputStream used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
    • LemmatizerModel

      public LemmatizerModel(File modelFile) throws IOException
      Initializes a LemmatizerModel instance via a valid File.
      Parameters:
      modelFile - The File used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
    • LemmatizerModel

      public LemmatizerModel(Path modelPath) throws IOException
      Initializes a LemmatizerModel instance via a valid Path.
      Parameters:
      modelPath - The Path used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
    • LemmatizerModel

      public LemmatizerModel(URL modelURL) throws IOException
      Initializes a LemmatizerModel instance via a valid URL.
      Parameters:
      modelURL - The URL used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
  • Method Details

    • getLemmatizerSequenceModel

      public opennlp.tools.ml.model.SequenceClassificationModel getLemmatizerSequenceModel()
      Returns:
      Retrieves a SequenceClassificationModel instance.
    • getFactory

      public LemmatizerFactory getFactory()
      Returns:
      Retrieves the active LemmatizerFactory.