Algorithm Search⌘K

Definitionintro

Treebank

Also called syntactically annotated corpus.

A corpus of sentences annotated with their syntactic trees, used to read off grammars and to train and test parsers.

A treebank is a collection of sentences, each paired with a syntactic tree that a trained annotator has checked. The trees follow a written scheme, which fixes the labels, the shape of each construction and the treatment of punctuation and of missing words. A treebank serves three purposes in parsing: grammars are read off its trees, statistical parsers are trained on it, and parsers are tested against its held-out trees with the PARSEVAL measures. The best known is the Penn Treebank of Marcus, Santorini and Marcinkiewicz (1993), whose Wall Street Journal part is the usual benchmark for English constituency parsing. A treebank can also hold dependency trees instead of phrase structure trees.

Definition

An annotation scheme fixes a set of word categories (the part-of-speech tags), a set of phrase labels, and rules for drawing a tree over a sentence. A treebank under such a scheme is a finite sequence of pairs

D=((w(1),t(1)),…,(w(K),t(K))),D = \big( (w^{(1)}, t^{(1)}), \ldots, (w^{(K)}, t^{(K)}) \big),

where each w(k)w^{(k)} is a tokenized sentence and each t(k)t^{(k)} is a parse tree whose yield is w(k)w^{(k)} and whose labels come from the scheme. In a constituency treebank, the leaves are the words, the parents of the leaves are the tags (the preterminals), and the other nodes carry phrase labels such as S, NP and VP. In a dependency treebank, t(k)t^{(k)} is a set of arcs from heads to dependents.

The treebank grammar. For every internal node of every tree, with label AA and children labeled α=X1⋯Xk\alpha = X_1 \cdots X_k, the treebank contains one occurrence of the rule A→αA \to \alpha. The treebank grammar has these rules, with the relative frequency estimate

q(A→α)=count(A→α)∑βcount(A→β),q(A \to \alpha) = \frac{\mathrm{count}(A \to \alpha)}{\sum_{\beta} \mathrm{count}(A \to \beta)},

which is the maximum likelihood estimate of a PCFG from fully observed trees. This is a theorem: the log likelihood of the trees separates into one multinomial per left side AA, and the relative frequencies maximize each one.

The Penn Treebank. The trees of the Wall Street Journal part are divided into sections 00 to 24. The standard split for parsing is sections 02 to 21 for training, section 22 for development and section 23 for test. Each tree is wrapped in an outer bracket without a label, which has one child, usually S. Parsers usually remove the function tags (as in NP-SBJ) and the empty elements (tag -NONE-) before training. In the Universal Dependencies treebanks, the root of every dependency tree has exactly one child.

Examples and non-examples

  • A four-tree treebank. The trees

    (S (NP (PRP she)) (VP (VBD saw) (NP (DT the) (NN cat)))), (S (NP (PRP he)) (VP (VBD fed) (NP (DT the) (NN dog)))), (S (NP (DT the) (NN dog)) (VP (VBD saw) (NP (PRP her)))), (S (NP (PRP they)) (VP (VBD left)))

    form a small treebank. Its grammar has the rules S→NP VPS \to NP\ VP with probability 1, NP→PRPNP \to PRP with 4/74/7, NP→DT NNNP \to DT\ NN with 3/73/7, VP→VBD NPVP \to VBD\ NP with 3/43/4 and VP→VBDVP \to VBD with 1/41/4, and lexical rules such as VBD→sawVBD \to saw with 2/4=1/22/4 = 1/2. The tree of they left has probability 1⋅4/7⋅1/4⋅1/4⋅1/4=1/1121 \cdot 4/7 \cdot 1/4 \cdot 1/4 \cdot 1/4 = 1/112. These exact values are checked by the tests of parent annotation, which uses the same treebank.

  • The Penn Treebank grammar. Charniak (1996) read a grammar off about a million words of Wall Street Journal trees. It had 15953 rules, of which 6785 occur more than once. Parsing the part-of-speech tags of test sentences of 2 to 40 words, it reached a bracket precision of 82.0 and a recall of 80.0. Charniak argued that such grammars do better than was commonly believed. This is a measurement.

  • A measured baseline. Klein and Manning (2003) report an F1 of 72.62 for the plain treebank grammar, with 9657 rules, on their development set. Their preprocessing differs from Charniak's, so the two results are not directly comparable. Tree transforms such as parent annotation and models with head words such as lexicalized PCFGs improve on it.

  • Non-example: a tagged corpus. A corpus in which each word has a part-of-speech tag but no tree is not a treebank. It trains part-of-speech taggers, but no grammar can be read off it.

  • Non-example: a grammar. A hand-written grammar describes the trees that are allowed, but it is not a treebank: it says nothing about which tree is right for a given sentence, or how often a rule is used.

  • Non-example: parser output. A corpus parsed automatically, without checking by annotators, has the form of a treebank, but its trees contain the errors of the parser. Training on it and testing on it measure the parser against itself.

References

  1. Marcus, Santorini and Marcinkiewicz, Building a Large Annotated Corpus of English, The Penn Treebank, pp. 313-330; the part-of-speech tagset, the bracketing scheme and the annotation process
  2. Eugene Charniak, Tree-bank Grammars, the grammar read off the Wall Street Journal trees, its 15953 rules, and its bracket precision and recall
  3. Dan Klein and Christopher D. Manning, Accurate Unlexicalized Parsing, ACL 2003, pp. 423-430; Figure 2, the F1 of the plain treebank grammar

Where this leads

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/FJT4Y5/text.yaml