opennlp.tools.chunker

## Class ChunkerModel

- java.lang.Object
- - opennlp.tools.util.model.BaseModel
  - - opennlp.tools.chunker.ChunkerModel

- All Implemented Interfaces:
    Serializable, ArtifactProvider

      public class ChunkerModel
      extends BaseModel

  The `ChunkerModel` is the model used by a learnable `Chunker`.
  See Also:
    `ChunkerME`, Serialized Form

- - ### Field Summary

    - ### Fields inherited from class opennlp.tools.util.model.BaseModel

      `TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChunkerModel(File modelFile)`
    `ChunkerModel(InputStream in)`
    `ChunkerModel(Path modelPath)`
    `ChunkerModel(String languageCode, MaxentModel chunkerModel, ChunkerFactory factory)`
    `ChunkerModel(String languageCode, MaxentModel chunkerModel, int beamSize, Map<String,String> manifestInfoEntries, ChunkerFactory factory)`
    `ChunkerModel(String languageCode, MaxentModel chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)`
    `ChunkerModel(String languageCode, SequenceClassificationModel<String> chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)`
    `ChunkerModel(URL modelURL)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `MaxentModel` | `getChunkerModel()` Deprecated. use getChunkerSequenceModel instead. This method will be removed soon.
    `SequenceClassificationModel<TokenTag>` | `getChunkerSequenceModel()`
    `ChunkerFactory` | `getFactory()`

    - ### Methods inherited from class opennlp.tools.util.model.BaseModel

      `getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ChunkerModel

          public ChunkerModel(String languageCode,
                              SequenceClassificationModel<String> chunkerModel,
                              Map<String,String> manifestInfoEntries,
                              ChunkerFactory factory)

    - #### ChunkerModel

          public ChunkerModel(String languageCode,
                              MaxentModel chunkerModel,
                              Map<String,String> manifestInfoEntries,
                              ChunkerFactory factory)

    - #### ChunkerModel

          public ChunkerModel(String languageCode,
                              MaxentModel chunkerModel,
                              int beamSize,
                              Map<String,String> manifestInfoEntries,
                              ChunkerFactory factory)

    - #### ChunkerModel

          public ChunkerModel(String languageCode,
                              MaxentModel chunkerModel,
                              ChunkerFactory factory)

    - #### ChunkerModel

          public ChunkerModel(InputStream in)
                       throws IOException,
                              InvalidFormatException

      Throws:
        `IOException`
        `InvalidFormatException`

    - #### ChunkerModel

          public ChunkerModel(File modelFile)
                       throws IOException,
                              InvalidFormatException

      Throws:
        `IOException`
        `InvalidFormatException`

    - #### ChunkerModel

          public ChunkerModel(Path modelPath)
                       throws IOException,
                              InvalidFormatException

      Throws:
        `IOException`
        `InvalidFormatException`

    - #### ChunkerModel

          public ChunkerModel(URL modelURL)
                       throws IOException,
                              InvalidFormatException

      Throws:
        `IOException`
        `InvalidFormatException`

  - ### Method Detail

    - #### getChunkerModel

          @Deprecated
          public MaxentModel getChunkerModel()

      Deprecated. use getChunkerSequenceModel instead. This method will be removed soon.

    - #### getChunkerSequenceModel

          public SequenceClassificationModel<TokenTag> getChunkerSequenceModel()

    - #### getFactory

          public ChunkerFactory getFactory()

Copyright © 2026 The Apache Software Foundation. All rights reserved.