Package 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
TheChunkerModel
is the model used by a learnableChunker
.- 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 Description ChunkerModel(File modelFile)
Initializes aChunkerModel
instance via a validFile
.ChunkerModel(InputStream in)
Initializes aChunkerModel
instance via a validInputStream
.ChunkerModel(String languageCode, MaxentModel chunkerModel, int beamSize, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.ChunkerModel(String languageCode, MaxentModel chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.ChunkerModel(String languageCode, MaxentModel chunkerModel, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.ChunkerModel(String languageCode, SequenceClassificationModel<String> chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.ChunkerModel(URL modelURL)
Initializes aChunkerModel
instance via a validURL
.ChunkerModel(Path modelPath)
Initializes aChunkerModel
instance via a validPath
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MaxentModel
getChunkerModel()
Deprecated.usegetChunkerSequenceModel()
instead.SequenceClassificationModel<TokenTag>
getChunkerSequenceModel()
ChunkerFactory
getFactory()
-
Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
-
-
-
Constructor Detail
-
ChunkerModel
public ChunkerModel(String languageCode, SequenceClassificationModel<String> chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.chunkerModel
- A validSequenceClassificationModel
.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheChunkerFactory
for creating related objects.
-
ChunkerModel
public ChunkerModel(String languageCode, MaxentModel chunkerModel, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.chunkerModel
- A validMaxentModel
.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheChunkerFactory
for creating related objects.
-
ChunkerModel
public ChunkerModel(String languageCode, MaxentModel chunkerModel, int beamSize, Map<String,String> manifestInfoEntries, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.chunkerModel
- A validMaxentModel
.beamSize
- The size of the beam that should be used when decoding sequences.manifestInfoEntries
- Additional information kept in the manifest.factory
- TheChunkerFactory
for creating related objects.
-
ChunkerModel
public ChunkerModel(String languageCode, MaxentModel chunkerModel, ChunkerFactory factory)
Initializes aChunkerModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.chunkerModel
- A validMaxentModel
.factory
- TheChunkerFactory
for creating related objects.
-
ChunkerModel
public ChunkerModel(InputStream in) throws IOException
Initializes aChunkerModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
ChunkerModel
public ChunkerModel(File modelFile) throws IOException
Initializes aChunkerModel
instance via a validFile
.- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
ChunkerModel
public ChunkerModel(Path modelPath) throws IOException
Initializes aChunkerModel
instance via a validPath
.- Parameters:
modelPath
- ThePath
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
ChunkerModel
public ChunkerModel(URL modelURL) throws IOException
Initializes aChunkerModel
instance via a validURL
.- Parameters:
modelURL
- TheURL
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Detail
-
getChunkerModel
@Deprecated public MaxentModel getChunkerModel()
Deprecated.usegetChunkerSequenceModel()
instead. This method will be removed soon.
-
getChunkerSequenceModel
public SequenceClassificationModel<TokenTag> getChunkerSequenceModel()
- Returns:
- Retrieves a
SequenceClassificationModel
.
-
getFactory
public ChunkerFactory getFactory()
- Returns:
- Retrieves the active
ChunkerFactory
.
-
-