Algorithm Search⌘K

Modeladvanced

Tree-adjoining grammar

Also called TAG.

A mildly context-sensitive formalism that builds trees from elementary trees by substitution and adjunction, parsed in O(n^6) time.

Tree-adjoining grammar (TAG) builds parse trees from a finite set of elementary trees with two operations: substitution, which plugs a tree into a leaf, and adjunction, which splices a tree into the middle of another tree. Adjunction lets a grammar stretch a tree from inside, so it can keep a verb and its arguments in one elementary tree however far apart they end up, and it generates some languages that no context-free grammar can. TAG is mildly context-sensitive: it is weakly equivalent to combinatory categorial grammar, which reaches the same languages with categories instead of trees, and its recognition problem takes O(n6)O(n^6) time for a sentence of nn words.

The machine

Grammar. A TAG is a tuple (N,Σ,I,A,S)(N, \Sigma, I, A, S), which plays the role of G=(N,Σ,R,S)G = (N, \Sigma, R, S) for context-free grammars with the rules R=I∪AR = I \cup A split in two. NN is the set of nonterminals, Σ\Sigma the set of terminals and S∈NS \in N the start symbol. II is a finite set of initial trees and AA a finite set of auxiliary trees. In both, every internal node has a label in NN and every leaf has a label in Σ∪N∪{ε}\Sigma \cup N \cup \{\varepsilon\}. A nonterminal leaf of an initial tree is a substitution node, marked X↓X{\downarrow}. An auxiliary tree has exactly one special leaf, the foot, marked X∗X^*, whose label equals the label XX of the root; its other nonterminal leaves are substitution nodes. The size gg is the total number of nodes of the elementary trees.

Substitution. A substitution node X↓X{\downarrow} is replaced by an initial tree, or a tree derived from one, whose root has the label XX.

Adjunction. Let η\eta be an internal node with label XX in a tree γ\gamma, and let β\beta be an auxiliary tree with root and foot XX. Adjoining β\beta at η\eta cuts out the subtree of γ\gamma at η\eta, puts β\beta in its place, and hangs the cut subtree at the foot of β\beta. The words of β\beta left of the foot end up left of the words of the subtree, and the rest end up right of them, so one adjunction can add words on both sides.

Constraints. Each internal node can carry a null adjunction constraint (NA, no adjunction here), a selective one (SA, only these auxiliary trees) or an obligatory one (OA, some adjunction must happen here).

Language. A derived tree is complete if its root is labeled SS, it came from an initial tree, no substitution node is left and every OA constraint is met. The string language is the set of yields of complete derived trees. The derivation tree records which elementary tree was substituted or adjoined at which node of which other tree; it is the main output of a TAG parser.

Lexicalized TAG. In a lexicalized TAG (LTAG), every elementary tree has at least one terminal leaf, its anchor. The tree of a transitive verb holds the verb, the subject slot and the object slot, so all the arguments of the verb are local to one tree, and adjunction adds modifiers or stretches the tree for long-distance dependencies.

An example. Let the initial tree be α=S→ε\alpha = S \to \varepsilon, and let β\beta be the auxiliary tree whose root SNAS_{NA} has the children aa, SS, dd, where that middle SS has the children bb, SNA∗S^*_{NA}, cc. Adjoining β\beta at the root of α\alpha gives the yield a b c da\,b\,c\,d. Adjoining β\beta again at the middle SS of the copy just added gives a a b b c c d da\,a\,b\,b\,c\,c\,d\,d, and in general the grammar generates {ambmcmdm:m≥0}\{a^m b^m c^m d^m : m \ge 0\}. This language is not context-free (theorem, by the pumping lemma for context-free languages). The same mechanism gives the cross-serial dependencies of Dutch and Swiss German verb clusters.

What it counts

Recognition time. Vijay-Shanker and Joshi (1985) gave a CKY-style recognizer that runs in O(n6)O(n^6) time for a fixed grammar (theorem). An item says that the subtree at a node η\eta of an elementary tree, with any adjunctions inside it, derives the words of a span (i,l)(i, l), where spans are fenceposts: (i,l)(i, l) covers the words i+1i + 1 to ll. If the subtree contains the foot of an auxiliary tree, the item also records the gap (j,k)(j, k) that the foot covers. So there are O(g n4)O(g\,n^4) items. The costly step adjoins an auxiliary tree, whose item has span (i,l)(i, l) and gap (j,k)(j, k), at a node whose item has the span (j,k)(j, k) and its own gap (p,q)(p, q); it combines six positions, which gives O(n6)O(n^6) steps for a fixed grammar. Space is O(n4)O(n^4) for a fixed grammar.

Comparison. For context-free grammars the CYK algorithm takes O(n3)O(n^3), so the extra power costs three more factors of nn. In practice, lexicalized parsers first prune the elementary trees of each word with a supertagger (heuristic).

Closure and growth. Tree-adjoining languages are closed under union, concatenation, Kleene star, homomorphism and intersection with regular languages, so they form a full abstract family of languages (theorem, Joshi and Schabes 1997). They have the constant growth property: the lengths of the strings, in increasing order, differ by bounded steps (theorem).

Relation to other models

  • Context-free grammar. A TAG with substitution only, a tree substitution grammar, generates exactly the context-free languages (theorem). Every context-free grammar has a weakly equivalent TAG, so tree-adjoining languages contain the context-free ones, and the example above shows that the inclusion is strict.
  • CCG and others. TAG, CCG, linear indexed grammar and head grammar generate the same string languages (theorem, Vijay-Shanker and Weir 1994). These classes are the standard examples of mildly context-sensitive grammars, a notion Joshi proposed in 1985: they contain the context-free languages, capture limited cross-serial dependencies, have constant growth and parse in polynomial time. The derivations differ: TAG composes trees, CCG composes categories.
  • Dependency trees. In a lexicalized TAG each node of the derivation tree is a word, and each edge joins a word to a word that it substitutes into or adjoins to. The derivation tree is therefore close to a dependency tree, and TAG parsers are often evaluated by its arcs.
  • Feature structures. Feature-based TAG puts a top and a bottom feature structure on each node and joins them by feature structure unification when the derivation is complete, which replaces the adjunction constraints.
  • Synchronous grammars. Synchronous TAG pairs the trees of two grammars, in the way that a synchronous context-free grammar pairs rules, for translation or for syntax-semantics mappings.

Known results in the model

  • Lexicalization. Tree substitution grammars cannot in general lexicalize a finitely ambiguous context-free grammar while keeping its trees, and TAGs can (theorem, discussed in Joshi and Schabes 1997). This is one of the main arguments for adjunction.
  • Supertagging. Bangalore and Joshi (1999) treated the elementary trees of an LTAG as rich part-of-speech tags and chose them with a tagger before parsing, which they called almost parsing. This idea is the supertagging technique that CCG parsers later adopted.
  • Wide-coverage grammars. Large hand-written LTAGs for English, such as the XTAG grammar, and grammars extracted from treebanks were built in the 1990s and 2000s. They give each common word many elementary trees, which is the ambiguity that supertagging reduces.

References

  1. Aravind K. Joshi, Leon S. Levy and Masako Takahashi, Tree adjunct grammars, the definition of tree adjunct grammars and their string languages
  2. Aravind K. Joshi and Yves Schabes, Tree-adjoining grammars, in Handbook of Formal Languages, Volume 3, Springer, 1997, 69-123, the definitions of substitution, adjunction and adjoining constraints, lexicalized TAG, derivation trees, the closure properties and the parsing algorithms
  3. K. Vijay-Shanker and Aravind K. Joshi, Some computational properties of tree adjoining grammars, Proceedings of ACL 1985, 82-93, the CKY-style recognition algorithm in O(n^6) time
  4. K. Vijay-Shanker and David J. Weir, The equivalence of four extensions of context-free grammars, the weak equivalence of TAG, CCG, linear indexed grammar and head grammar
  5. Srinivas Bangalore and Aravind K. Joshi, Supertagging: an approach to almost parsing, the elementary trees of lexicalized TAG as supertags

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/CT08GA/text.yaml