Class ChunkerModel

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

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

    • ChunkerModel

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

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

      public ChunkerModel(String languageCode, opennlp.tools.ml.model.MaxentModel chunkerModel, int beamSize, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
      Initializes a ChunkerModel instance via given parameters.
      Parameters:
      languageCode - An ISO conform language code.
      chunkerModel - 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 ChunkerFactory for creating related objects.
    • ChunkerModel

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

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

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

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

      public ChunkerModel(URL modelURL) throws IOException
      Initializes a ChunkerModel 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

    • getChunkerSequenceModel

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

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