Algorithms for Deterministic Incremental Dependency Parsing
Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics)
Subscriber deck — free during early access
30 cards
1 Introduction
- Why had deterministic parsing been considered inadequate for natural language, and what changed?Natural language grammars are massively ambiguous, so mainstream parsers derive many analyses in parallel (charts, dynamic programming) and rank them. But treebank-induced classifiers that predict the next derivation step can make a single left-to-right derivation highly accurate, especially for dependency parsing.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §1, pp. 513–514
- What is the trade-off of pseudo-deterministic, classifier-based parsing?It is an extreme form of pruning: parse selection happens incrementally and only one analysis is ever built, making parsing very simple and efficient, at the risk of losing accuracy through early commitment in greedy search. In practice it reached state-of-the-art accuracy, e.g. tying for top results at CoNLL-X 2006.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §1, pp. 513–514
- What are the three components of a deterministic classifier-based parser?A parsing algorithm (derivations as sequences of elementary actions), a feature model (a feature vector representation of the parser state), and a classifier mapping parser states to actions. Nivre (2008) focuses on the algorithms.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §1, pp. 513–514
2 Dependency Parsing
- When is a dependency graph well-formed, in Nivre’s definition?ROOT: node 0 has no head. SINGLE-HEAD: every node has at most one head and one label. ACYCLICITY: there are no cycles. Such a graph is a dependency forest; if also connected, a dependency tree rooted at 0. A forest becomes a tree by attaching all other roots to node 0.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §2, pp. 515–517
- Define PROJECTIVITY for a dependency graph.For every arc \((i, l, j)\) and every node \(k\) between \(i\) and \(j\), \(k\) is reachable from \(i\) (\(i \to^* k\)). Equivalently, every node’s projection (the nodes reachable from it) is continuous, the dependency analogue of banning discontinuous constituents.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §2, pp. 515–517
3 Deterministic Incremental Dependency Parsing
- What is a transition system for dependency parsing?A quadruple \(S = (C, T, c_s, C_t)\): configurations \(C\) (at least a buffer \(\beta\) of remaining nodes and an arc set \(A\)), transitions \(T\) (partial functions \(C \to C\)), an initialization \(c_s\) putting \([1, \ldots, n]\) in the buffer, and terminal configurations \(C_t\). The parse is the arc set of the terminal configuration.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §3, pp. 517–520
- What is an oracle, and how does it make parsing deterministic?A function \(o: C \to T\) choosing one transition in every configuration. The parser starts in \(c_s(x)\) and applies \(o(c)\) until a terminal configuration is reached. In data-driven parsing the oracle is approximated by a classifier trained on treebank data.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §3, pp. 517–520
- Why does Nivre separate the oracle from the transition system?To separate the abstract machine, which determines formal properties like correctness and complexity, from the search mechanism. If oracle and transitions take constant time, time complexity is bounded by the maximum length of a transition sequence, and space by the size of one configuration.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §3, pp. 517–520
- What does it mean for a transition system to be sound, complete and correct for a class of dependency graphs?Sound: every transition sequence yields a graph in the class. Complete: every graph in the class is the result of some transition sequence. Correct: both.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §3, pp. 517–520
4 Stack-Based Algorithms
- What is a stack-based parser configuration?A triple \((\sigma, \beta, A)\): a stack \(\sigma\) of partially processed tokens still candidates for arcs, a buffer \(\beta\) of remaining input tokens, and an arc set \(A\). Parsing starts with \(([0], [1, \ldots, n], \emptyset)\) and ends when the buffer is empty.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4, pp. 520–521
4.1 Arc-Standard Parsing
- Give the transitions of the arc-standard parser.LEFT-ARC\(_l\): \((\sigma|i, j|\beta, A) \Rightarrow (\sigma, j|\beta, A \cup \{(j, l, i)\})\), if \(i \ne 0\) and \(i\) has no head. RIGHT-ARC\(_l\): \((\sigma|i, j|\beta, A) \Rightarrow (\sigma, i|\beta, A \cup \{(i, l, j)\})\), if \(j\) has no head; the head \(i\) goes back to the buffer. SHIFT: \((\sigma, i|\beta, A) \Rightarrow (\sigma|i, \beta, A)\).
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.1, pp. 521–525
- How does arc-standard parsing relate to shift-reduce parsing, and when can a right dependent be attached?It is the closest analogue of shift-reduce parsing for CFGs: LEFT-ARC and RIGHT-ARC are reduce actions replacing a head–dependent structure with its head. A right dependent can be attached only after it has collected all its own dependents, because it is removed when attached.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.1, pp. 521–525
- Why are the stack-based algorithms linear time?Each SHIFT removes one node from the buffer, which never grows, so there are at most \(n\) shifts; each arc transition pops the stack, which only SHIFT pushes. So a transition sequence has at most \(2n\) transitions: \(O(n)\) time, and \(O(n)\) space for one configuration.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.1, pp. 521–525
- For which class of graphs are the stack-based algorithms correct?Projective dependency forests: every transition preserves ROOT, SINGLE-HEAD, ACYCLICITY and PROJECTIVITY (soundness), and every projective forest has a transition sequence that builds it (completeness).
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.1, pp. 521–525
4.2 Arc-Eager Parsing
- Give the transitions of the arc-eager parser.LEFT-ARC\(_l\): as in arc-standard (pop \(i\), add \((j, l, i)\)). RIGHT-ARC\(_l\): \((\sigma|i, j|\beta, A) \Rightarrow (\sigma|i|j, \beta, A \cup \{(i, l, j)\})\), pushing the dependent. REDUCE: pop the stack, if the top already has a head. SHIFT: push the first buffer node.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.2, pp. 525–529
- How does arc-eager differ from arc-standard parsing?Arc-eager attaches right dependents as soon as possible, before they have found their own right dependents, so both head and dependent stay on the stack; REDUCE pops the dependent later. It is more incremental: a word is attached as soon as its head is available.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.2, pp. 525–529
- Trace arc-eager parsing of “John saw Mary” (saw is the root; John and Mary depend on saw).SHIFT, LEFT-ARCSBJ, RIGHT-ARCROOT, RIGHT-ARCOBJ; the buffer is then empty, so parsing ends (LA/RA = LEFT-/RIGHT-ARC):
transition stack buffer arc – [0] [1,2,3] SHIFT [0, 1] [2, 3] LASBJ [0] [2, 3] 2 → 1 RAROOT [0, 2] [3] 0 → 2 RAOBJ [0,2,3] [ ] 2 → 3 - Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §4.2, pp. 525–529
5 List-Based Algorithms
- What is a list-based configuration, and what is it for?A quadruple \((\lambda_1, \lambda_2, \beta, A)\): two lists of partially processed tokens plus the buffer and arcs. Inspired by Covington (2001), it lets the parser consider pairs of non-adjacent tokens: nodes skipped over are moved from \(\lambda_1\) to \(\lambda_2\) and restored on the next shift, which allows non-projective arcs.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §5, pp. 529–530
5.1 Non-Projective Parsing
- Describe the transitions of the non-projective list-based parser.For \(i\) at the head of \(\lambda_1\) and \(j\) first in the buffer: LEFT-ARC adds \(j \to i\), RIGHT-ARC adds \(i \to j\), and NO-ARC adds nothing; each moves \(i\) to \(\lambda_2\). SHIFT\(_\lambda\) concatenates \(\lambda_1.\lambda_2\), appends \(j\), and empties \(\lambda_2\). Arcs require that the dependent has no head and no cycle results (\(\neg[i \to^* j]\) or \(\neg[j \to^* i]\)).
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §5.1, pp. 530–533
- What is the complexity of the non-projective list-based algorithm, and why?\(O(n^2)\) time: there are at most \(n\) shifts, and between the \((i-1)\)th and \(i\)th shift each other transition shrinks \(\lambda_1\), so at most \(i\) of them: \(\sum_i (i + 1)\) transitions. Space is \(O(n)\). The acyclicity check is near-constant with union-find (\(O(\alpha(n))\) amortized).
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §5.1, pp. 530–533
5.2 Projective Parsing
- How does the projective list-based parser differ from the non-projective one?It skips any pair that could create a non-projective arc: LEFT-ARC deletes the dependent and empties \(\lambda_2\); RIGHT-ARC moves \(j\) onto \(\lambda_1\) and empties \(\lambda_2\); NO-ARC requires that \(i\) already has a head, since an arc spanning a root would violate projectivity. Worst case \(O(n^2)\), but in practice it behaves linearly.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §5.2, pp. 533–537
6.1 Experimental Setup
- How did Nivre (2008) evaluate the four parsing algorithms?On the 13 CoNLL-X shared task languages, with MaltParser and SVM classifiers (quadratic kernel) trained on oracle transition sequences from gold trees, using the same simple feature model for all. Seven parsers per language: non-projective list-based, and the three projective algorithms in strictly projective and pseudo-projective versions. Metrics: LAS, UAS, label accuracy.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.1, pp. 537–541
- What is pseudo-projective parsing?Train a projective parser on projectivized data: non-projective arcs are lifted to the nearest permissible ancestor of the real head, with the real head’s label encoded in the arc label. After parsing, arcs with augmented labels are lowered by searching the head’s descendants for a node with that label (Nivre and Nilsson 2005).
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.1, pp. 537–541
- How does a classifier-based parser handle a predicted transition whose preconditions fail?It performs a default transition with no preconditions instead: SHIFT for the stack-based algorithms, NO-ARC for the list-based ones. Classifiers rarely predict illegal transitions.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.1, pp. 537–541
6.2 Parsing Accuracy
- What were the main accuracy results across 13 languages?Averages were very close, within 0.58 LAS points: 79.77 for non-projective list-based (best) down to 79.19 for strictly projective list-based. Non-projective and pseudo-projective parsers significantly beat strictly projective ones, and the non-projective parser’s gain grew with the proportion of non-projective arcs in the data (Pearson’s r = 0.815).
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.2, pp. 541–546
- How do non-projective and pseudo-projective parsing compare?Both help when non-projective arcs are common, but non-projective parsing is more stable: it seldom or never hurts, while pseudo-projective parsing can hurt when training data or non-projective arcs are scarce, partly because extra labels reduce label accuracy.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.2, pp. 541–546
- Why did arc-standard parsing do best on Arabic, Czech and Slovene?Their Prague-style annotation allows several root dependents with different labels (e.g. PRED), which must be attached by a RIGHT-ARC with the right label at the right time. Arc-eager attaches right dependents early and had much lower precision and recall on PRED than arc-standard.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.2, pp. 541–546
6.3 Efficiency
- What did Nivre find about learning and parsing times?Learning time is driven by the number of training instances, so the quadratic non-projective algorithm trained slowest. The projective list-based parser, though \(O(n^2)\) in the worst case, ran like the linear algorithms. Pseudo-projective parsers were always substantially slower to parse than their projective counterparts, sometimes slower than the non-projective parser.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.3, pp. 546–549
- Why can a quadratic non-projective parser be faster than a linear-time pseudo-projective parser?Pseudo-projective parsing enlarges the label set, hence the number of SVM classes and binary classifiers, making every classification slower. For typical sentence lengths, this larger constant can outweigh the better asymptotic complexity. The pseudo-projective parsers were faster than the non-projective one on every data set with average sentence length above 18.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §6.3, pp. 546–549
8 Conclusion
- What are Nivre’s main conclusions about deterministic dependency parsing algorithms?All four algorithms give competitive, near state-of-the-art accuracy. The ability to produce non-projective graphs improves accuracy unless all structures are projective, and the non-projective list-based algorithm does so more stably than pseudo-projective parsing, often just as fast. Arc-eager vs arc-standard shows language- and annotation-specific effects.
- Nivre, 2008, Algorithms for Deterministic Incremental Dependency Parsing (Computational Linguistics), §8, pp. 550–551
Source
- Joakim Nivre. 2008. Algorithms for Deterministic Incremental Dependency Parsing. In Computational Linguistics, pp. 513–553. doi:10.1162/coli.07-056-R1-07-027 https://aclanthology.org/J08-4003/