public class Parser extends AbstractBottomUpParser
Modifier and Type | Field and Description |
---|---|
static String |
ATTACH_DAUGHTER
Outcome used when a node should be attached as a daughter to another node.
|
static String |
ATTACH_SISTER
Outcome used when a node should be attached as a sister to another node.
|
static String |
BUILT
Label used to distinguish build nodes from non-built nodes.
|
static String |
DONE
Outcome used when a constituent needs an no additional parent node/building.
|
static String |
NON_ATTACH
Outcome used when a node should not be attached to another node.
|
chunker, COMPLETE, completeParses, CONT, createDerivationString, debugOn, defaultAdvancePercentage, defaultBeamSize, headRules, INC_NODE, INCOMPLETE, K, M, ndh, odh, OTHER, punctSet, Q, reportFailedParse, START, tagger, TOK_NODE, TOP_NODE, ZERO
Constructor and Description |
---|
Parser(AbstractModel buildModel,
AbstractModel attachModel,
AbstractModel checkModel,
POSTagger tagger,
Chunker chunker,
HeadRules headRules)
Deprecated.
|
Parser(AbstractModel buildModel,
AbstractModel attachModel,
AbstractModel checkModel,
POSTagger tagger,
Chunker chunker,
HeadRules headRules,
int beamSize,
double advancePercentage)
Deprecated.
|
Parser(ParserModel model) |
Parser(ParserModel model,
int beamSize,
double advancePercentage) |
Modifier and Type | Method and Description |
---|---|
protected Parse[] |
advanceChunks(Parse p,
double minChunkScore)
Returns the top chunk sequences for the specified parse.
|
protected Parse[] |
advanceParses(Parse p,
double probMass)
Advances the specified parse and returns the an array advanced parses whose probability accounts for
more than the specified amount of probability mass.
|
protected void |
advanceTop(Parse p)
Adds the "TOP" node to the specified parse.
|
static List<Parse> |
getRightFrontier(Parse root,
Set<String> punctSet)
Returns the right frontier of the specified parse tree with nodes ordered from deepest
to shallowest.
|
static AbstractModel |
train(EventStream es,
int iterations,
int cut)
Deprecated.
|
static ParserModel |
train(String languageCode,
ObjectStream<Parse> parseSamples,
HeadRules rules,
int iterations,
int cut) |
static ParserModel |
train(String languageCode,
ObjectStream<Parse> parseSamples,
HeadRules rules,
TrainingParameters mlParams) |
advanceTags, buildDictionary, buildDictionary, collapsePunctuation, mapParseIndex, parse, parse, setErrorReporting, setParents
public static final String DONE
public static final String ATTACH_SISTER
public static final String ATTACH_DAUGHTER
public static final String NON_ATTACH
public static final String BUILT
public Parser(ParserModel model, int beamSize, double advancePercentage)
public Parser(ParserModel model)
@Deprecated public Parser(AbstractModel buildModel, AbstractModel attachModel, AbstractModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules, int beamSize, double advancePercentage)
@Deprecated public Parser(AbstractModel buildModel, AbstractModel attachModel, AbstractModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules)
public static List<Parse> getRightFrontier(Parse root, Set<String> punctSet)
root
- The root of the parse tree.protected Parse[] advanceChunks(Parse p, double minChunkScore)
AbstractBottomUpParser
advanceChunks
in class AbstractBottomUpParser
p
- A pos-tag assigned parse.minChunkScore
- A minimum score below which chunks should not be advanced.protected Parse[] advanceParses(Parse p, double probMass)
AbstractBottomUpParser
advanceParses
in class AbstractBottomUpParser
p
- The parse to advance.probMass
- The amount of probability mass that should be accounted for by the advanced parses.protected void advanceTop(Parse p)
AbstractBottomUpParser
advanceTop
in class AbstractBottomUpParser
p
- The complete parse.public static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, TrainingParameters mlParams) throws IOException
IOException
public static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, int iterations, int cut) throws IOException
IOException
@Deprecated public static AbstractModel train(EventStream es, int iterations, int cut) throws IOException
IOException
Copyright © 2019 The Apache Software Foundation. All rights reserved.