Definitioncore
PARSEVAL measures
Also called labeled bracket F1, bracketing precision and recall.
Precision, recall and F1 of the labeled constituent spans of a predicted tree against a gold tree, the standard score of constituency parsers.
The PARSEVAL measures score a predicted parse tree against the gold tree of the same sentence by comparing their constituents. Each constituent is written as a labeled bracket: its label and the span of words it covers. Labeled precision is the fraction of predicted brackets that are also gold brackets, labeled recall is the fraction of gold brackets that are also predicted, and F1 is their harmonic mean, as on the precision and recall page. The measures go back to a 1991 workshop procedure of Black and others, and the program EVALB of Sekine and Collins fixed the details that most papers use. They are the standard score of constituency parsing. Dependency parsers are scored by the attachment score instead, and general span tasks such as named entities by the span F1 score, which uses the same counting on spans that do not nest.
Definition
A sentence has words, and a fencepost span with covers the words to . Let be a tree over the sentence. The brackets of are the multiset
with one element for each node that is not a preterminal and not a word. Preterminals, the part-of-speech tags, are not brackets; their accuracy is reported separately as tagging accuracy. A multiset is used because a unary chain such as (NP (NP ...)) gives the same bracket twice.
For a predicted tree and a gold tree of the same sentence, the number of matched brackets is the size of the multiset intersection, , where a bracket that occurs times in and times in counts times. Then
On a test set the counts are added over all sentences before the division: and . This is a micro average, and it is not the mean of the per-sentence scores.
Settings. The scores depend on what is removed before the brackets are counted. This page uses the settings of the EVALB parameter file COLLINS.prm, which most Penn Treebank papers use:
- the label TOP, the unlabeled outer bracket that wraps each tree, is deleted, so the root span of TOP is not counted; the S bracket over the whole sentence is counted;
- the empty elements (tag -NONE-) are deleted and do not count toward the sentence length;
- the words tagged with the punctuation tags , : `` '' and . are deleted, and the spans are counted again on the remaining words;
- the labels ADVP and PRT are treated as equal;
- the scores are given for all sentences and again for the sentences of at most 40 words.
Other tags, such as the brackets -LRB- and -RRB- and the tag #, are kept by COLLINS.prm. Function tags such as -SBJ are usually removed from the gold trees before training and evaluation, so NP-SBJ counts as NP. The root bracket S may have any number of children; the measures do not depend on it.
Related counts. Unlabeled precision and recall ignore the label and compare spans only. A predicted bracket crosses a gold bracket if the two spans overlap and neither contains the other; the crossing brackets count is the number of predicted brackets that cross at least one gold bracket. Exact match is the fraction of sentences with .
Precision rewards trees with few brackets and recall rewards trees with many. A parser can raise precision by predicting a flat tree, which is why the two are reported together or as .
Examples and non-examples
The examples use two gold trees, in Penn Treebank form:
- = (TOP (S (NP (NNS astronomers)) (VP (VBD saw) (NP (NP (NNS stars)) (PP (IN with) (NP (NNS ears))))) (. .)))
- = (TOP (S (NP (PRP she)) (VP (VBD gave) (PRT (RP up))) (. .)))
and three predicted trees:
- = (TOP (S (NP (NNS astronomers)) (VP (VP (VBD saw) (NP (NNS stars))) (PP (IN with) (NP (NNS ears)))) (. .))), where with ears modifies saw;
- = (TOP (S (NP (NNS astronomers)) (VP (VBD saw) (NP (NNS stars)) (PP (IN with) (NP (NNS ears)))) (. .))), a flat VP;
- = (TOP (S (NP (PRP she)) (VP (VBD gave) (ADVP (RB up)) (. .)))), with the period inside the VP.
After the COLLINS.prm deletions, has 5 words and the 7 brackets S(0,5), NP(0,1), VP(1,5), NP(2,5), NP(2,3), PP(3,5), NP(4,5). All values below are exact fractions.
| gold | predicted | LP | LR | ||||
|---|---|---|---|---|---|---|---|
| 7 | 7 | 6 | 6/7 | 6/7 | 6/7 | ||
| 6 | 7 | 6 | 1 | 6/7 | 12/13 | ||
| 4 | 4 | 4 | 1 | 1 | 1 | ||
| both | , | 11 | 11 | 10 | 10/11 | 10/11 | 10/11 |
- An attachment error costs one bracket each way. has VP(1,3) instead of NP(2,5). VP(1,3) also crosses NP(2,5), so has one crossing bracket.
- A flat tree has perfect precision. misses NP(2,5) and predicts nothing wrong, so its precision is 1, though it does not say what with ears modifies.
- The settings matter. For and , the period lies inside the VP of , and says ADVP where says PRT. With the COLLINS.prm settings the period is deleted, VP covers (1,3) in both trees, and ADVP equals PRT, so all 4 brackets match. With no deletion and no label merge, TOP is counted, the VP spans are (1,3) and (1,4), and only 3 of 5 brackets match, . For both sentences together, the raw counts give instead of .
- Micro average. The per-sentence values and have the mean , but the corpus is , because the longer sentence has more brackets and more weight.
- Non-example: a different sentence. PARSEVAL compares trees over the same words. If the parser tokenizes the sentence differently from the gold tree, the spans do not line up, and EVALB counts the sentence as an error instead of scoring it.
- Non-example: dependency trees. A dependency tree has no phrase nodes, so it has no brackets. Its score is the attachment score. Converting it to brackets, or converting the constituency tree to dependencies with head rules, gives a different measure.
Related definitions
- Precision and recall: the general definitions, of which LP and LR are the case of brackets.
- Span F1 score: the same counting for flat spans with labels, such as named entities.
- Attachment score: the fraction of words with the right head, the score of dependency parsers.
- Smatch: an F1 over the triples of a semantic graph, with a search for the best match of the variables.
- Treebank: the source of the gold trees and of the conventions that the settings depend on.
References
- Black et al., A Procedure for Quantitatively Comparing the Syntactic Coverage of English Grammars, the bracket comparison procedure (ACL Anthology H91-1060)
- Satoshi Sekine and Michael Collins, EVALB, a bracket scoring program (copy of the 1997 distribution), the README (the definitions of recall, precision and crossing brackets) and the parameter file COLLINS.prm
- Eugene Charniak, Tree-bank Grammars, the evaluation by bracket precision and recall of a treebank grammar
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag KB4Z5N Edit this page History Report an error Markdown