Package opennlp.tools.parser
Klasse AbstractBottomUpParser
java.lang.Object
opennlp.tools.parser.AbstractBottomUpParser
- Alle implementierten Schnittstellen:
Parser
Abstract class which contains code to tag and chunk parses for bottom up parsing and
leaves implementation of advancing parses and completing parses to extend class.
Note:
The nodes within the returned parses are shared with other parses
and therefore their parent node references will not be consistent with their child
node reference. setParents
can be used to make the parents consistent
with a particular parse, but subsequent calls to setParents
can invalidate
the results of earlier calls.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
Outcome used when a constituent is complete.static final String
Prefix for outcomes continuing a constituent.static final double
The default amount of probability mass required of advanced outcomes.static final int
The default beam size used if no beam size is given.static final String
The label for the top if an incomplete node.static final String
Outcome used when a constituent is incomplete.static final String
Outcome for token which is not contained in a basal constituent.static final String
Prefix for outcomes starting a constituent.static final String
The label for a token node.static final String
The label for the top node. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungAbstractBottomUpParser
(POSTagger tagger, Chunker chunker, HeadRules headRules, int beamSize, double advancePercentage) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Dictionary
buildDictionary
(ObjectStream<Parse> data, HeadRules rules, int cutoff) Creates a n-gramDictionary
from the specified data stream usingHeadRules
and specified cut-off.static Dictionary
buildDictionary
(ObjectStream<Parse> data, HeadRules rules, TrainingParameters params) Creates a n-gramDictionary
from the specified data stream using the specified head rule and specified cut-off.static Parse[]
collapsePunctuation
(Parse[] chunks, Set<String> punctSet) Removes the punctuation from the specified set ofchunks
, adds it to the parses adjacent to the punctuation is specified, and returns a new array of parses with the punctuation removed.Parse[]
Returns the specified number of parses or fewer for the specified tokens.void
setErrorReporting
(boolean errorReporting) Specifies whether the parser should report when it was unable to find a parse for a particular sentence.static void
setParents
(Parse p) Assigns parent references for the specified parse so that they are consistent with the children references.
-
Felddetails
-
defaultBeamSize
public static final int defaultBeamSizeThe default beam size used if no beam size is given.- Siehe auch:
-
defaultAdvancePercentage
public static final double defaultAdvancePercentageThe default amount of probability mass required of advanced outcomes.- Siehe auch:
-
TOP_NODE
The label for the top node.- Siehe auch:
-
INC_NODE
The label for the top if an incomplete node.- Siehe auch:
-
TOK_NODE
The label for a token node.- Siehe auch:
-
START
Prefix for outcomes starting a constituent.- Siehe auch:
-
CONT
Prefix for outcomes continuing a constituent.- Siehe auch:
-
OTHER
Outcome for token which is not contained in a basal constituent.- Siehe auch:
-
COMPLETE
Outcome used when a constituent is complete.- Siehe auch:
-
INCOMPLETE
Outcome used when a constituent is incomplete.- Siehe auch:
-
-
Konstruktordetails
-
AbstractBottomUpParser
-
-
Methodendetails
-
setErrorReporting
public void setErrorReporting(boolean errorReporting) Specifies whether the parser should report when it was unable to find a parse for a particular sentence.- Parameter:
errorReporting
-true
if un-parsed sentences should be reported,false
otherwise.
-
setParents
Assigns parent references for the specified parse so that they are consistent with the children references.- Parameter:
p
- TheParse
whose parent references need to be assigned.
-
collapsePunctuation
Removes the punctuation from the specified set ofchunks
, adds it to the parses adjacent to the punctuation is specified, and returns a new array of parses with the punctuation removed. -
parse
Beschreibung aus Schnittstelle kopiert:Parser
Returns the specified number of parses or fewer for the specified tokens.Note: The nodes within the returned parses are shared with other parses and therefore their parent node references will not be consistent with their child node reference.
Parse.setParent(Parse)
can be used to make the parents consistent with a particular parse, but subsequent calls tosetParents
can invalidate the results of earlier calls. -
parse
Beschreibung aus Schnittstelle kopiert:Parser
-
buildDictionary
public static Dictionary buildDictionary(ObjectStream<Parse> data, HeadRules rules, TrainingParameters params) throws IOException Creates a n-gramDictionary
from the specified data stream using the specified head rule and specified cut-off.- Parameter:
data
- The data stream ofparses
.rules
- TheHeadRules
for the parses.params
- TheTrainingParameters
which can contain acutoff
, the minimum number of entries required for the n-gram to be saved as part of theDictionary
.- Gibt zurück:
- A
Dictionary
instance. - Löst aus:
IOException
-
buildDictionary
public static Dictionary buildDictionary(ObjectStream<Parse> data, HeadRules rules, int cutoff) throws IOException Creates a n-gramDictionary
from the specified data stream usingHeadRules
and specified cut-off.- Parameter:
data
- The data stream ofparses
.rules
- TheHeadRules
for theparses
.cutoff
- The minimum number of entries required for the n-gram to be saved as part of the dictionary.- Gibt zurück:
- A
Dictionary
instance. - Löst aus:
IOException
-