Package opennlp.tools.parser.chunking
Class Parser
java.lang.Object
opennlp.tools.parser.AbstractBottomUpParser
opennlp.tools.parser.chunking.Parser
- All Implemented Interfaces:
Parser
A shift reduce style
Parser
implementation
based on Adwait Ratnaparkhi's 1998 thesis.- See Also:
-
Field Summary
Fields inherited from class opennlp.tools.parser.AbstractBottomUpParser
COMPLETE, CONT, defaultAdvancePercentage, defaultBeamSize, INC_NODE, INCOMPLETE, OTHER, START, TOK_NODE, TOP_NODE
-
Constructor Summary
ConstructorDescriptionParser
(ParserModel model) Instantiates aParser
via a givenmodel
.Parser
(ParserModel model, int beamSize, double advancePercentage) Instantiates aParser
via a givenmodel
and other configuration parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static ParserModel
train
(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, TrainingParameters mlParams) Starts a training of aParserModel
.Methods inherited from class opennlp.tools.parser.AbstractBottomUpParser
buildDictionary, buildDictionary, collapsePunctuation, parse, parse, setErrorReporting, setParents
-
Constructor Details
-
Parser
Instantiates aParser
via a givenmodel
and other configuration parameters. Uses the default implementations ofPOSTaggerME
andChunkerME
.- Parameters:
model
- TheParserModel
to use.beamSize
- The number of different parses kept during parsing.advancePercentage
- The minimal amount of probability mass which advanced outcomes must represent. Only outcomes which contribute to the topadvancePercentage
will be explored.- Throws:
IllegalStateException
- Thrown if theParserType
is not supported.- See Also:
-
Parser
Instantiates aParser
via a givenmodel
. Uses the default implementations ofPOSTaggerME
andChunkerME
and default values forbeamSize
andadvancePercentage
.- Parameters:
model
- TheParserModel
to use.- Throws:
IllegalStateException
- Thrown if theParserType
is not supported.- See Also:
-
-
Method Details
-
mergeReportIntoManifest
-
train
public static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, TrainingParameters mlParams) throws IOException Starts a training of aParserModel
.- Parameters:
languageCode
- An ISO conform language code.parseSamples
- Thesamples
as input.rules
- TheHeadRules
to use.mlParams
- Theparameters
for training.- Returns:
- A valid
ParserModel
. - Throws:
IOException
- Thrown if IO errors occurred during training.
-