Package opennlp.tools.parser
Class ParserModel
java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.parser.ParserModel
- All Implemented Interfaces:
Serializable
,ArtifactProvider
This is the default
ParserModel
implementation.- See Also:
-
Field Summary
Fields inherited from class opennlp.tools.util.model.BaseModel
TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY
-
Constructor Summary
ConstructorDescriptionParserModel
(File modelFile) Initializes aParserModel
instance via a validFile
.Initializes aParserModel
instance via a validInputStream
.ParserModel
(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType) Initializes aParserModel
instance via given parameters.ParserModel
(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType, Map<String, String> manifestInfoEntries) Initializes aParserModel
instance via given parameters.ParserModel
(String languageCode, MaxentModel buildModel, MaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType type, Map<String, String> manifestInfoEntries) Initializes aParserModel
instance via given parameters.ParserModel
(URL modelURL) Initializes aParserModel
instance via a validURL
.ParserModel
(Path modelPath) Initializes aParserModel
instance via a validPath
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
updateBuildModel
(MaxentModel buildModel) Instantiates a newParserModel
instance from the existing configuration with the specifiedbuildModel
for exchange.updateCheckModel
(MaxentModel checkModel) Instantiates a newParserModel
instance from the existing configuration with the specifiedcheckModel
for exchange.updateChunkerModel
(ChunkerModel chunkModel) Instantiates a newParserModel
instance from the existing configuration with the specifiedchunkModel
for exchange.updateTaggerModel
(POSModel taggerModel) Instantiates a newParserModel
instance from the existing configuration with the specifiedtaggerModel
for exchange.Methods inherited from class opennlp.tools.util.model.BaseModel
getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize
-
Constructor Details
-
ParserModel
public ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType, Map<String, String> manifestInfoEntries) Initializes aParserModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.buildModel
- A validMaxentModel
used to build.checkModel
- A validMaxentModel
used to check.attachModel
- A validMaxentModel
used to attach.parserTagger
- A validPOSModel
to parse.chunkerTagger
- A validChunkerModel
to chunk.headRules
- TheHeadRules
to to use for parsing.modelType
- TheParserType
to use.manifestInfoEntries
- Additional information kept in the manifest.
-
ParserModel
public ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType) Initializes aParserModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.buildModel
- A validMaxentModel
used to build.checkModel
- A validMaxentModel
used to check.parserTagger
- A validPOSModel
to parse.chunkerTagger
- A validChunkerModel
to chunk.headRules
- TheHeadRules
to to use for parsing.modelType
- TheParserType
to use.
-
ParserModel
public ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType type, Map<String, String> manifestInfoEntries) Initializes aParserModel
instance via given parameters.- Parameters:
languageCode
- An ISO conform language code.buildModel
- A validMaxentModel
used to build.checkModel
- A validMaxentModel
used to check.parserTagger
- A validPOSModel
to parse.chunkerTagger
- A validChunkerModel
to chunk.headRules
- TheHeadRules
to to use for parsing.type
- TheParserType
to use.manifestInfoEntries
- Additional information kept in the manifest.
-
ParserModel
Initializes aParserModel
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
ParserModel
Initializes aParserModel
instance via a validFile
.- Parameters:
modelFile
- TheFile
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
ParserModel
Initializes aParserModel
instance via a validPath
.- Parameters:
modelPath
- ThePath
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
ParserModel
Initializes aParserModel
instance via a validURL
.- Parameters:
modelURL
- TheURL
used for loading the model.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Details
-
getParserType
- Returns:
- Retrieves the
ParserType
as configured in the manifest.
-
getBuildModel
- Returns:
- Retrieves the
build model
as configured in the manifest.
-
getCheckModel
- Returns:
- Retrieves the
check model
as configured in the manifest.
-
getAttachModel
- Returns:
- Retrieves the
attach model
as configured in the manifest.
-
getParserTaggerModel
- Returns:
- Retrieves the
POSModel
as configured in the manifest.
-
getParserChunkerModel
- Returns:
- Retrieves the
ChunkerModel
as configured in the manifest.
-
getHeadRules
- Returns:
- Retrieves the
HeadRules
as configured in the manifest.
-
updateBuildModel
Instantiates a newParserModel
instance from the existing configuration with the specifiedbuildModel
for exchange.- Parameters:
buildModel
- A validMaxentModel
used to build.- Returns:
- A valid
ParserModel
.
-
updateCheckModel
Instantiates a newParserModel
instance from the existing configuration with the specifiedcheckModel
for exchange.- Parameters:
checkModel
- A validMaxentModel
used to check.- Returns:
- A valid
ParserModel
.
-
updateTaggerModel
Instantiates a newParserModel
instance from the existing configuration with the specifiedtaggerModel
for exchange.- Parameters:
taggerModel
- A validPOSModel
used to tag.- Returns:
- A valid
ParserModel
.
-
updateChunkerModel
Instantiates a newParserModel
instance from the existing configuration with the specifiedchunkModel
for exchange.- Parameters:
chunkModel
- A validChunkerModel
used to tag.- Returns:
- A valid
ParserModel
.
-
hashCode
public int hashCode() -
equals
-