Package opennlp.tools.parser.chunking
Class Parser
- java.lang.Object
-
- opennlp.tools.parser.AbstractBottomUpParser
-
- opennlp.tools.parser.chunking.Parser
-
- All Implemented Interfaces:
Parser
public class Parser extends AbstractBottomUpParser
A shift reduce styleParserimplementation based on Adwait Ratnaparkhi's 1998 thesis.- See Also:
AbstractBottomUpParser,Parser
-
-
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
Constructors Constructor Description Parser(ParserModel model)Instantiates aParservia a givenmodel.Parser(ParserModel model, int beamSize, double advancePercentage)Instantiates aParservia a givenmodeland other configuration parameters.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmergeReportIntoManifest(Map<String,String> manifest, Map<String,String> report, String namespace)static ParserModeltrain(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 Detail
-
Parser
public Parser(ParserModel model, int beamSize, double advancePercentage)
Instantiates aParservia a givenmodeland other configuration parameters. Uses the default implementations ofPOSTaggerMEandChunkerME.- Parameters:
model- TheParserModelto 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 topadvancePercentagewill be explored.- Throws:
IllegalStateException- Thrown if theParserTypeis not supported.- See Also:
ParserModel,POSTaggerME,ChunkerME
-
Parser
public Parser(ParserModel model)
Instantiates aParservia a givenmodel. Uses the default implementations ofPOSTaggerMEandChunkerMEand default values forbeamSizeandadvancePercentage.- Parameters:
model- TheParserModelto use.- Throws:
IllegalStateException- Thrown if theParserTypeis not supported.- See Also:
ParserModel,POSTaggerME,ChunkerME
-
-
Method Detail
-
mergeReportIntoManifest
public static void mergeReportIntoManifest(Map<String,String> manifest, Map<String,String> report, String namespace)
-
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- Thesamplesas input.rules- TheHeadRulesto use.mlParams- Theparametersfor training.- Returns:
- A valid
ParserModel. - Throws:
IOException- Thrown if IO errors occurred during training.
-
-