Package opennlp.tools.depparse
Class AttachmentScores
java.lang.Object
opennlp.tools.depparse.AttachmentScores
Accumulates the unlabeled and labeled attachment scores over all tokens and over the
tokens that are not punctuation.
DependencyEvaluator adds single tokens and
DependencyCrossValidator merges the totals of each fold.
Instances are not thread safe.
- Since:
- 3.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidadd(boolean headMatches, boolean labelMatches, boolean punctuation) Adds the outcome of one token.(package private) voidadd(AttachmentScores other) Adds every token counted by another accumulator, weighted by its token counts.(package private) doublegetLas()(package private) double(package private) doublegetUas()(package private) double(package private) long(package private) long
-
Field Details
-
uas
-
las
-
uasExcludingPunctuation
-
lasExcludingPunctuation
-
-
Constructor Details
-
AttachmentScores
AttachmentScores()
-
-
Method Details
-
add
void add(boolean headMatches, boolean labelMatches, boolean punctuation) Adds the outcome of one token.- Parameters:
headMatches- Whether the predicted head equals the gold head.labelMatches- Whether the predicted head and relation both equal the gold ones.punctuation- Whether the token is punctuation and therefore left out of the punctuation-free scores.
-
add
Adds every token counted by another accumulator, weighted by its token counts.- Parameters:
other- The accumulator to merge. Must not benull.
-
getUas
double getUas()- Returns:
- The unlabeled attachment score over all tokens, or
0if none.
-
getLas
double getLas()- Returns:
- The labeled attachment score over all tokens, or
0if none.
-
getWordCount
long getWordCount()- Returns:
- The number of tokens added.
-
getUasExcludingPunctuation
double getUasExcludingPunctuation()- Returns:
- The unlabeled attachment score over the tokens that are not punctuation, or
0if none.
-
getLasExcludingPunctuation
double getLasExcludingPunctuation()- Returns:
- The labeled attachment score over the tokens that are not punctuation, or
0if none.
-
getWordCountExcludingPunctuation
long getWordCountExcludingPunctuation()- Returns:
- The number of tokens added that are not punctuation.
-