Venue: NAACL 2019

# Discontinuous Constituency Parsing

with a Stack-Free Transition System and a Dynamic Oracle

Maximin Coavoux

Naver Labs Europe

maximin.coavoux@naverlabs.com &Shay B. Cohen

ILCC, School of Informatics

University of Edinburgh

sohen@inf.ed.ac.uk

Work done at the University of Edinburgh.

###### Abstract

We introduce a novel transition system for discontinuous constituency parsing. Instead of storing subtrees in a stack -i.e. a data structure with linear-time _sequential access_- the proposed system uses a _set_ of parsing items, with constant-time _random access_. This change makes it possible to construct any discontinuous constituency tree in exactly \(4n-2\) transitions for a sentence of length \(n\), whereas existing systems need a quadratic number of transitions to derive some structures. At each parsing step, the parser considers every item in the set to be combined with a _focus_ item and to construct a new constituent in a bottom-up fashion. The parsing strategy is based on the assumption that most syntactic structures can be parsed incrementally and that the set - the memory of the parser- remains reasonably small on average. Moreover, we introduce a dynamic oracle for the new transition system, and present the first experiments in discontinuous constituency parsing using a dynamic oracle. Our parser obtains state-of-the-art results on three English and German discontinuous treebanks.

## 1 Introduction

Discontinuous constituency trees extend standard constituency trees by allowing crossing branches to represent long distance dependencies, such as the _wh_-extraction in Figure 1. Discontinuous constituency trees can be seen as derivations of Linear Context-Free Rewriting Systems (LCFRS, Vijayakshanker et al., 1987), a class of formal grammars more expressive than context-free grammars, which makes them much harder to parse. In particular, exact CKY-style LCFRS parsing has an \({\cal O}(n^{3f})\) time complexity where \(f\) is the fan-out of the grammar (Kallmeyer, 2010).

A natural alternative to grammar-based chart parsing is transition-based parsing, that usually relies on fast approximate decoding methods such as greedy search or beam search. Transition-based discontinuous parsers construct discontinuous constituents by reordering terminals with the swap action (Versley, 2014a, b; Maier, 2015; Maier and Lichte, 2016; Stanojevic and Garrido Alhama, 2017), or by using a split stack and the gap action to combine two non-adjacent constituents (Coavoux and Crabbe, 2017; Coavoux et al., 2019). These proposals represent the memory of the parser (i.e. the tree fragments being constructed) with data structures with **linear-time sequential access** (either a stack, or a stack coupled with a double-ended queue). As a result, these systems need to perform at least \(n\) actions to construct a new constituent from two subtrees separated by \(n\) intervening subtrees. Our proposal aims at avoiding this cost when constructing discontinuous constituents.

We design a novel transition system in which a discontinuous constituent is constructed in a single step, without the use of reordering actions such as swap. The main innovation is that the memory of the parser is not represented by a stack,

Figure 1: Discontinuous constituency tree from the Discontinuous Penn treebank.



as is usual in shift-reduce systems, but by an unordered **random-access** set. The parser considers every constituent in the current memory to construct a new constituent in a bottom-up fashion, and thus instantly models interactions between parsing items that are not adjacent. As such, we describe a left-to-right parsing model that deviates from the standard stack-buffer setting, a legacy from pushdown automata and classical parsing algorithms for context-free grammars.

Our contributions are summarized as follows:

* We design a novel transition system for discontinuous constituency parsing, based on a memory represented by a _set_ of items, and that derives any tree in exactly steps for a sentence of length;
* we introduce the first dynamic oracle for discontinuous constituency parsing;
* we present an empirical evaluation of the transition system and dynamic oracle on two German and one English discontinuous treebanks.

The code of our parser is released as an open-source project at [https://gitlab.com/mcoavoux/discoparset](https://gitlab.com/mcoavoux/discoparset).

## 2 Set-based Transition System

System overviewWe propose to represent the memory of the parser by (i) a set of parsing items and (ii) a single _focus item_. Figure 2 (lower part) illustrates a configuration in our system. The parser constructs a tree with two main actions: shift the next token to make it the new focus item (shift), or combine any item in the set with the focus item to make a new constituent bottom-up (combine action).

Since the memory is not an ordered data structure, the parser considers equally every pending parsing item, and thus constructs a discontinuous constituent in a single step, thereby making it able to construct any discontinuous tree in transitions.

The use of an unordered random-access data structure to represent the memory of the parser also leads to a major change for the scoring system (Figure 2). Stack-based systems use a _local view_ of a parsing configuration to extract features and score actions: features only rely on the few topmost elements on the stack and buffer. The score of each transition depends on the totality of this local view. In constrast, we consider equally every item in the set, and therefore rely on a _global

\begin{table}
\begin{tabular}{l l l l l} \hline Initial configuration & \multicolumn{1}{c}{\((0,~{}\texttt{null},~{}0,~{}\emptyset):0\)} \\ Goal configuration & \multicolumn{1}{c}{\((0,~{}\{0,1,\ldots,n-1\},~{}~{}n,~{}C):4n-2\)} \\ \hline Structural actions & \multicolumn{3}{c}{Input Output} & Precondition \\ \hline shift & \((S,~{}s_{f},~{}i,~{}C):j\) & \(\Rightarrow(S\cup\{s_{f}\},~{}\{i\},~{}i+1,~{}C):j+1\) & \(i<n,j\) is even \\ combine-s & \((S,~{}s_{f},~{}i,~{}C):j\) & \(\Rightarrow(S-s,~{}s_{f}\cup s,~{}i,~{}C):j+1\) & \(s\in S,j\) is even \\ \hline Labelling actions & & & \\ \hline label-X & \((S,~{}s_{f},~{}i,~{}C):j\) & \(\Rightarrow(S,~{}s_{f},~{}i,~{}C\cup\{(X,~{}s_{f})\}):j+1\) & \(j\) is odd \\ no-label & \((S,~{}s_{f},~{}i,~{}C):j\) & \(\Rightarrow(S,~{}s_{f},~{}i,~{}C):j+1\) & \(i\neq n\) or \(S\neq\emptyset\), \(j\) is odd \\ \hline \end{tabular}
\end{table}
Table 1: Set-based transition system description. Variable is the number of steps performed since the start of the derivation.

Figure 2: In a stack-based system like shift-reduce-swap (upper part), the parser extracts features from a _local_ region of the configuration (orange part), to predict the next action such as: construct a new tree with label X and children \(s_{0}\) and \(s_{1}\) (reduce-X). In our proposed set-based system (lower part), we consider every item in the set to be combined bottom-up with the focus item and score independently each possible transition.

 

view_ of the memory (Section 3). However, we score each possible combinations independently: the score of a single combination only depends on the two constituents that are combined, regardless of the rest of the set.

### System Description

DefinitionsWe first define an _instantiated (discontinuous) constituent_\((X,s)\) as a nonterminal label \(X\) associated with a set of token indexes \(s\). We call \(\min(s)\) the _left-index_ of \(c\) and \(\max(s)\) its _right-index_. For example in Figure 1, the two VPs are respectively represented by (VP, {1, 6}) and (VP, {1, 5, 6}), and they have the same right index (6) and left index (1).

A _parsing configuration_ is a quadruple \((S,s_{f},i,C)\) where:

* \(S\) is a set of sets of indexes and represents the memory of the parser;
* \(s_{f}\) is a set of indexes called the _focus item_, and satisfies \(\max(s_{f})=i-1\);
* \(i\) is the index of the next token in the buffer;
* \(C\) is a set of instantiated constituents.

Each new constituent is constructed bottom-up from the _focus_ item and another item in the set \(S\).

Transition setOur proposed transition system is based on the following types of actions:

* shift constructs a singleton containing the next token in the buffer and assigns it as the new focus item. The former focus item is added to \(S\).
* combine-\(s\) computes the union between the focus item \(s_{f}\) and another item \(s\) from the set \(S\), to form the new focus item \(s\cup s_{f}\).
* label-X instantiates a new constituent \((X,s_{f})\) whose yield is the set of indexes in the focus item \(s_{f}\).
* no-label has no effect; its semantics is that the current focus set is not a constituent.

Following Cross and Huang (2016b), transitions are divided into **structural** actions (shift, combine-\(s\)) and **labelling** actions (label-X, nobabel). The parser may only perform a structural action on an even step and a labelling action on an odd step. For our system, this distinction has the crucial advantage of keeping the number of possible actions low at each parsing step, compared to a system that would perform a combine action and a labelling action in a single reduce-\(s\)-X action.1

Footnote 1: In such a case, we would need to score \(|S|\times|N|+1\) actions, where \(N\) is the set of nonterminals, instead of \(|S|+1\) actions for our system.

Table 1 presents each action as a deduction rule associated with preconditions. In Table 2, we describe how to derive the tree from Figure 1.

### Oracles

Training a transition-based parser requires an oracle, i.e. a function that determines what the best action is in a specific parsing configuration to serve as a training signal. We first describe a static oracle that provides a canonical derivation for a given gold tree. We then introduce a dynamic oracle that determines what the best action is in any parsing configuration.

\begin{table}
\begin{tabular}{l r l l l} \hline \hline Even action & Set (\(S\)) & Focus (\(s_{f}\)) & Buffer & Odd action \\ \hline  & \{\} & none & So what ’s a parent to do ’? & \\ \(\Rightarrow\)SH\(\Rightarrow\) & \{\} & \{So\} & what ’s a parent to do ’? & \(\Rightarrow\)no-label \\ \(\Rightarrow\)SH\(\Rightarrow\) & \{\$[So]o & \{what\} & ’s a parent to do ’? & \(\Rightarrow\)Label\_WHNP \\ \(\Rightarrow\)SH\(\Rightarrow\) & \{\$[So]o, \{what\}\} & ‘s’ & a parent to do ’? & \(\Rightarrow\)No-label \\ \(\Rightarrow\)SH\(\Rightarrow\) & \{\$[So]o, \{what\}\}, \{‘s\}\({}_{2}\) & \{a\} & parent to do ’ & \(\Rightarrow\)No-label \\ \(\Rightarrow\)SM\(\Rightarrow\) & \{\$[So]o, \{what\}\}, \{‘s\}\({}_{2}\), \{a\}\({}_{3}\) & \{parent\} & to do ’ & \(\Rightarrow\)No-label \\ \(\Rightarrow\)COM\_3\(\Rightarrow\) & \{\$[So]o, \{what\}\}, \{‘s\}\({}_{2}\) & \{a\} & parent\} & to do ’ & \(\Rightarrow\)Label-NP \\ \(\Rightarrow\)COM\_2\(\Rightarrow\) & \{\$[So]o, \{what\}\}, \{‘s\}\({}_{2}\) & \{a\} & parent\} & to do ’ & \(\Rightarrow\)No-label \\ \(\Rightarrow\)SO\(\Rightarrow\) & \{\$[So]o, \{what\}, \{’s\}\({}_{2}\) & \{to\} & \{to\} & \{to\} & \(\Rightarrow\)No-label \\ \(\Rightarrow\)SM\(\Rightarrow\) & \{\$[So]o, \{what\}, \{’s\}\({}_{2}\) & \{to\} & \{do\} & ’ & \(\Rightarrow\)No-label \\ \(\Rightarrow\)COM\_1\(\Rightarrow\) & \{\$[So]o, \{’s\ arenat\}\}, \{‘t\}\({}_{3}\) & \{what do\} & ’ & \(\Rightarrow\)Label-VP \\ \(\Rightarrow\)COMP\_5\(\Rightarrow\) & \{\$[So]o, \{’sarent\}\}, \{‘s\}\({}_{2}\) & \{what to do\} & ’ & \(\Rightarrow\)Label-VP \\ \(\Rightarrow\)COM\_2\(\Rightarrow\) & \{\$[So]o, \{What\}, \{'s\}\({}_{2}\) & \{a\} & parent to do\} & ’ & \(\Rightarrow\)Label-SQ \\ \(\Rightarrow\)COM\_0\(\Rightarrow\) & \{\$[So]o, \{what\}, \{’s\}\({}_{2}\) & \{a\} & ’s parent to do\} & ’ & \(\Rightarrow\)No-label \\ \(\Rightarrow\)SM\(\Rightarrow\) & \{\$[So what ’s\({}_{2}\) & \{a\} & ’parent\({}_{3}\) & \{?\} & \(\Rightarrow\)No-label \\ \(\Rightarrow\)CMO\_0\(\Rightarrow\) & \{\$[So]o, \{what\}, \{’s\}\({}_{4}\) & \{?\} & \(\Rightarrow\)No-label \\ \hline \hline \end{tabular}
\end{table}
Table 2: Full derivation for the sentence in Figure 1. As a convention, we index elements in the set with their left-index and use comb-\(i\) to denote comb-\(s_{i}\). We also use tokens instead of their indexes for better legibility.

 



#### 2.2.1 Static Oracle

Our transition system exhibits a fair amount of _spurious ambiguity_, the ambiguity exhibited by the existence of many possible derivations for a single tree. Indeed, since we use an unordered memory, an \(n\)-ary constituent (and more generally a tree) can be constructed by many different transition sequences. For example, the set {0, 1, 2} might be constructed by combining

* [noitemsep]
* {0} and {1} first, and the result with {2}; or
* {1} and {2} first, and the result with {0}; or
* {0} and {2} first, and the result with {1}.

Following Cohen et al. (2012), we eliminate spurious ambiguity by selecting a canonical derivation for a gold tree. In particular, we design the static oracle (i) to apply combine as soon as possible in order to minimize the size of the memory (ii) to combine preferably with the most recent set in the memory when several combinations are possible. The first choice is motivated by properties of our system: when the memory is smaller, there are fewer choices, therefore decisions are simpler and less expensive to score.

#### 2.2.2 Dynamic Oracle

Parsers are usually trained to predict the gold sequence of actions, using a static oracle. The limitation of this method is that the parser only sees a tiny portion of the search space at train time and only trains on gold input (i.e. configurations obtained after performing gold actions). At test time, it is in a different situation due to error propagation: it must predict what the best actions are in configurations from which the gold tree is probably no longer reachable.

To alleviate this limitation, Goldberg and Nivre (2012) proposed to train a parser with a _dynamic oracle_, an oracle that is defined for any parsing configuration and outputs the set of best actions to perform. In contrast, a _static oracle_ is deterministic and is only defined for gold configurations.

Dynamic oracles were proposed for a wide range of dependency parsing transition systems Goldberg and Nivre (2013); Gomez-Rodriguez et al. (2014); Gomez-Rodriguez and Fernandez-Gonzalez (2015), and later adapted to constituency parsing Coavoux and Crabbe (2016); Cross and Huang (2016b); Fernandez-Gonzalez and Gomez-Rodriguez (2018b, a).

In the remainder of this section, we introduce a dynamic oracle for our proposed transition system. It can be seen as an extension of the oracle of Cross and Huang (2016b) to the case of discontinuous parsing.

Preliminary definitionsFor a parsing configuration \(c\), the relation \(c\vdash c^{\prime}\) holds iff \(c^{\prime}\) can be derived from \(c\) by a single transition. We note \(\vdash^{*}\) the reflexive and transitive closure of \(\vdash\). An instantiated constituent \((X,s)\) is **reachable** from a configuration \(c=(S,s_{f},i,C)\) iff there exists \(c^{\prime}=(S^{\prime},s^{\prime}_{f},i^{\prime},C^{\prime})\) such that \((X,s)\in C^{\prime}\) and \(c\vdash^{*}c^{\prime}\). Similarly, a set of constituents \(t\) (possibly a full discontinuous constituency tree) is reachable iff there exists a configuration \(c^{\prime}=(S^{\prime},s^{\prime}_{f},i^{\prime},C^{\prime})\) such that \(t\subseteq C^{\prime}\) and \(c\vdash^{*}c^{\prime}\). We note \(\text{reach}(c,t^{*})\) the set of constituents that are (i) in the gold set of constituents \(t^{*}\) (ii) reachable from \(c\).

We define a total order \(\preceq\) on index sets:

\[s\preceq s^{\prime}\Leftrightarrow\left\{\begin{array}{l}\max(s)<\max(s^{ \prime}),\\ \textbf{or}\\ \max(s)=\max(s^{\prime})\\ \text{and $s\subseteq s^{\prime}$}.\end{array}\right.\]

This order naturally extends to the constituents of a tree: \((X,s)\preceq(X^{\prime},s^{\prime})\) iff \(s\preceq s^{\prime}\). If \((X,s)\) precedes \((X^{\prime},s^{\prime})\), then \((X,s)\) must be constructed before \((X^{\prime},s^{\prime})\). Indeed, since the right-index of the focus item is non-decreasing during a derivation (as per the transition definitions), constituents are constructed in the order of their right-index (first condition). Moreover, since the algorithm is bottom-up, a constituent must be constructed before its parent (second condition).

From a configuration \(c=(S,s_{f},i,C)\) at an odd step, a constituent \((X,s_{g})\notin C\) is reachable iff both the following properties hold:

1. \(\max(s_{f})\leq\max(s_{g})\);
2. \(\forall s\in S\cup\{s_{f}\},(s\subseteq s_{g})\) or \((s\cap s_{g}=\emptyset)\).

Condition 1 is necessary because the parser can only construct new constituents \((X,s)\) such that \(s_{f}\preceq s\). Condition 2 makes sure that \(s_{g}\) can be constructed from a union of elements from \(S\cup\{s_{f}\}\), potentially augmented with terminals from the buffrer: \(\{i,i+1,\ldots,\max(s_{g})\}\).

Following Cross and Huang (2016b), we define \(\mathsf{next}(c,t^{*})\) as the smallest reachable gold constituent from a configuration \(c\). Formally:

\[\mathsf{next}(c,t^{*})=\operatornamewithlimits{argmin}_{\preceq}\mathsf{ reach}(c,t^{*}).\]

Oracle algorithmWe first define the oracle \({\mathsf{o}}\) for the odd step of a configuration \(c=(S,s_{f},i,C)\):

For even steps, assuming \(\textsf{next}(c,t^{*})=(X,s_{g})\), we define the oracle as follows:

\[{\mathsf{o}}_{\textsf{even}}(c,t^{*})=\left\{\begin{array}{ll}\{\textsc{ comb-}\textit{s}|(s_{f}\cup s)\subseteq s_{g}\}\\ &\text{if $\max(s_{g})=\max(s_{f})$},\\ \{\textsc{comb-}\textit{s}|(s_{f}\cup s)\subseteq s_{g}\}\cup\{\textsc{sh} \}\\ &\text{if $\max(s_{g})>\max(s_{f})$.}\end{array}\right.\]

We provide a proof of the correctness of the oracle in Appendix A.

## 3 A Neural Network based on Constituent Boundaries

We first present an encoder that computes context-aware representations of tokens (Section 3.1). We then discuss how to compute the representation of a set of tokens (Section 3.2). We describe the action scorer (Section 3.3), the POS tagging component (Section 3.4), and the objective function (Section 3.5).

### Token Representations

As in recent proposals in dependency and constituency parsing Cross and Huang (2016a); Kiperwasser and Goldberg (2016), our scoring system is based on a sentence transducer that constructs a context-aware representation for each token.

Given a sequence of tokens \(x_{1}^{n}=(x_{1},\ldots,x_{n})\), we first run a single-layer character bi-LSTM encoder \({\mathbf{c}}\) to obtain a character-aware embedding \({\mathbf{c}}(x_{i})\) for each token. We represent a token \(x_{i}\) as the concatenation of a standard word embedding \({\mathbf{e}}(x_{i})\) and the character-aware embedding: \({\mathbf{w}}_{x_{i}}=[{\mathbf{c}}(x_{i});{\mathbf{e}}(x_{i})]\).

Then, we run a 2-layer bi-LSTM transducer over the sequence of token representations:

\[({\mathbf{h}}_{1}^{(1)},\ldots,{\mathbf{h}}_{n}^{(1)}) =\mbox{bi-LSTM}({\mathbf{w}}_{x_{1}},\ldots,{\mathbf{w}}_{x_{n}}),\] \[({\mathbf{h}}_{1}^{(2)},\ldots,{\mathbf{h}}_{n}^{(2)}) =\mbox{bi-LSTM}({\mathbf{h}}_{1}^{(1)},\ldots,{\mathbf{h}}_{n}^{ (1)}).\]

The parser uses the context-aware token representations \({\mathbf{h}}_{i}^{(2)}\) to construct vector representations of sets or constituents.

### Set Representations

An open issue in neural discontinuous parsing is the representation of discontinuous constituents. In projective constituency parsing, it has become standard to use the boundaries of constituents Hall et al. (2014); Crabbe (2015); Durrett and Klein (2015), an approach that proved very successful with bi-LSTM token representations Cross and Huang (2016b); Stern et al. (2017).

Although constituent boundary features improves discontinuous parsing Coavoux and Crabbe (2017a), relying only on the left-index and the right-index of a constituent has the limitation of ignoring gaps inside a constituent. For example, since the two VPs in Figure 1 have the same right-index and left-index, they would have the same representations. It may also happen that constituents with identical right-index and left-index do not have the same labels.

We represent a (possibly partial) constituent with the yield \(s\), by computing 4 indexes from \(s\): \((\min(s),\max(s),\min(\overline{s}),\max(\overline{s}))\). The set \(\overline{s}\) represents the gap in \(s\), i.e. the tokens between \(\min(s)\) and \(\max(s)\) that are not in the yield of \(s\):

\[\overline{s}=\{i|\min(s)<i<\max(s)\text{ and }i\notin s\}.\]

Finally, we extract the corresponding token representations of the 4 indexes and concatenate them to form the vector representation \({\mathbf{r}}(s)\) of \(s\):

\[{\mathbf{r}}(s)=[{\mathbf{h}}_{\min(s)}^{(2)};{\mathbf{h}}_{\max(s)}^{(2)};{ \mathbf{h}}_{\min(\overline{s})}^{(2)};{\mathbf{h}}_{\max(\overline{s})}^{(2)}].\]

For an index set that does not contain a gap, we have \(\overline{s}=\emptyset\). To handle this case, we use a parameter vector \({\mathbf{h}}_{\mathsf{nil}}\), randomly initialized and learned jointly with the network, to embed \(\max(\emptyset)=\min(\emptyset)=\mathsf{nil}\).

For example, the constituents (VP, {1, 6}) and (VP, {1, 5, 6}) will be respectively vectorized as:

\[{\mathbf{r}}(\{1,6\}) =[{\mathbf{h}}_{1}^{(2)};{\mathbf{h}}_{6}^{(2)};{\mathbf{h}}_{2}^ {(2)};{\mathbf{h}}_{5}^{(2)}],\] \[{\mathbf{r}}(\{1,5,6\}) =[{\mathbf{h}}_{1}^{(2)};{\mathbf{h}}_{6}^{(2)};{\mathbf{h}}_{2}^ {(2)};{\mathbf{h}}_{4}^{(2)}].\]

This representation method makes sure that two distinct index sets have distinct representations, as long as they have at most one gap each. This property no longer holds if one index sets has more than one gap.

### Action Scorer

For each type of action -structural or labelling- we use a feedforward network with two hidden layers 

Structural actionsAt structural steps, for a configuration \(c=(S,s_{f},i,C)\), we need to compute the score of \(|S|\) combine actions and possibly a shift action. In our approach, the score of a combine-\(s\) action only depends on \(s\) and \(s_{f}\) and is independent of the rest of the configuration (i.e. other items in the set). We first construct input matrix \(M\) as follows:

\[M=\left(\begin{array}{ccc}\mathbf{r}(s_{1})&\cdots&\mathbf{r}(s_{n})& \mathbf{r}(\{i\})\\ \mathbf{r}(s_{f})&\cdots&\mathbf{r}(s_{f})&\mathbf{r}(s_{f})\end{array}\right).\]

Each of the first \(n\) columns of matrix \(M\) represents the input for a combine action, whereas the last column is the input for the shift action. We then compute the score of each structural action:

\[P(\cdot|c)=\text{Softmax}(\text{FF}_{s}(M)),\]

where FF\({}_{s}\) is a feedforward network with two hidden layers, a tanh activation and a single output unit. In other words, it outputs a single scalar for each column vector of matrix \(M\). This part of the network can be seen as an attention mechanism, where the focus item is the query, and the context is formed by the items in the set and the first element in the buffer.

Labelling actionsWe compute the probabilities of labelling actions as follows:

\[P(\cdot|s_{f})=\text{Softmax}(\text{FF}_{l}(\mathbf{r}(s_{f}))),\]

where FF\({}_{l}\) is a feedforward network with two hidden layers activated with the tanh function, and \(|N|+1\) output units, where \(N\) is the set of nonterminals.

### POS Tagger

Following Coavoux and Crabbe (2017b), we use the first layer of the bi-LSTM transducer as input to a Part-of-Speech (POS) tagger that is learned jointly with the parser. For a sentence \(x^{n}_{1}\), we compute the probability of a sequence of POS tags \(t^{n}_{1}=(t_{1},\dots,t_{n})\) as follows:

\[P(t^{n}_{1}|x^{n}_{1})=\prod_{i=1}^{n}\text{Softmax}(\mathbf{W}^{(t)}\cdot \mathbf{h}^{(1)}_{i}+\mathbf{b}^{(t)})_{t_{i}},\]

where \(\mathbf{W}^{(t)}\) and \(\mathbf{b}^{(t)}\) are parameters.

### Objective Function

In the static oracle setting, for a single sentence \(x^{n}_{1}\), we optimize the sum of the log-likelihood of gold POS-tags \(t^{n}_{1}\) and the log-likelihood of gold parsing actions \(a^{n}_{1}\):

\[\mathcal{L} =\mathcal{L}_{t}+\mathcal{L}_{p},\] \[\mathcal{L}_{t} =-\sum_{i=1}^{n}\log P(t_{i}|x^{n}_{1}),\] \[\mathcal{L}_{p} =-\sum_{i=1}^{4n-2}\log P(a_{i}|a^{i-1}_{1},x^{n}_{1}).\]

We optimize this objective by alternating a stochastic step for the tagging objective and a stochastic step for the parsing objective, as is standard in multitask learning Caruana (1997).

In the dynamic oracle setting, instead of optimizing the likelihood of the gold actions (assuming all previous actions were gold), we optimize the likelihood of the best actions, as computed by the dynamic oracle, from a configuration sampled from the space of all possible configurations. In practice, before each epoch, we sample each sentence from the training corpus with probability \(p\) and we use the current (non-averaged) parameters to parse the sentence and generate a sequence of configurations. Instead of selecting the highest-scoring action at each parsing step, as in a normal inference step, we sample an action using the softmax distribution computed by the parser, as done by Ballesteros et al. (2016). Then, we use the dynamic oracle to calculate the best action from each of these configurations. In case there are several best actions, we deterministically choose a single action by favoring a combine over a shift (to bias the model towards a small memory), and to combine with the item with the highest right-index (to avoid spurious discontinuity in partial constituents). We train the parser on these sequences of potentially non-gold configuration-action pairs.

## 4 Experiments

We carried out experiments to assess the adequacy of our system and the effect of training with the dynamic oracle. We present the three discontinuous constituency treebanks that we used (Section 4.1), our experimental protocol (Section 4.2), then we discuss the results (Section 4.3) and the efficiency of the parser (Section 4.4) 



### Datasets

We perform experiments on three discontinuous constituency corpora. The discontinuous Penn Treebank was introduced by evang2011using who converted the long distance dependencies encoded by indexed traces in the original Penn treebank Marcus et al. (1993) to discontinuous constituents. We used the standard split (sections 2-21 for training, 22 for development and 23 for test). The Tiger corpus Brants et al. (2004) and the Negra corpus Skut et al. (1997) are both German treebanks natively annotated with discontinuous constituents. We used the SPMRL split for the Tiger corpus Seddah et al. (2013), and the split of Dubey and Keller (2003) for the Negra corpus.

### Implementation and Protocol

We implemented our parser in Python using the Pytorch library Paszke et al. (2017). We trained each model with the ASGD algorithm Polyak and Juditsky (1992) for 100 epochs. Training a single model takes approximately a week with a GPU. We evaluate a model every 4 epochs on the validation set and select the best performing model according to the validation F-score. We refer the reader to Table 5 of Appendix B for the full list of hyperparameters.

We evaluate models with the dedicated module of discodop2van Cranenburg et al. (2016). We use the standard evaluation parameters (proper.prm), that ignore punctuations and root symbols. We report two evaluation metrics: a standard Fscore (F) and an Fscore computed only on discontinuous constituents (Disc. F), which provides a more qualitative evaluation of the ability of the parser to recover long distance dependencies.

\begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline  & \multicolumn{3}{c}{DPTB} & \multicolumn{3}{c}{Tiger} & \multicolumn{3}{c}{Negra} \\ \cline{2-8}  & F1 & Disc. F1 & POS & F1 & Disc. F1 & POS & F1 & Disc. F1 & POS \\ \hline static & 91.1 & 68.2 & 97.2 & 87.4 & 61.7 & 98.3 & 83.6 & 51.3 & 97.9 \\ dynamic & 91.4 & 70.9 & 97.2 & 87.6 & 62.5 & 98.4 & 84.0 & 54.0 & 98.0 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Results on development corpora. F1 is the Fscore on all constituents, Disc. F1 is an Fscore computed only on discontinuous constituents, POS is the accuracy on part-of-speech tags. Detailed results (including precision and recall) are given in Table 7 of Appendix C.





### Results

Effect of Dynamic OracleWe present parsing results on the development sets of each corpus in Table 3. The effect of the oracle is in line with other published results in projective constituency parsing Coavoux and Crabbe (2016); Cross and Huang (2016b) and dependency parsing Goldberg and Nivre (2012); Gomez-Rodriguez et al. (2014): the dynamic oracle improves the generalization capability of the parser.

External comparisonsIn Table 4, we compare our parser to other transition-based parsers Maier (2015); Coavoux and Crabbe (2017a); Stanojevic and Garrido Alhama (2017); Coavoux et al. (2019), the pseudo-projective parser of Versley (2016), grammar-based chart parsers Evang and Kallmeyer (2011); van Cranenburgh et al. (2016); Gephardt (2018) and parsers based on dependency parsing Fernandez-Gonzalez and Martins (2015); Corro et al. (2017). Note that some of them only report results in a gold POS tag setting (the parser has access to gold POS tags and use them as features), a setting that is much easier than ours.

Our parser matches the state of the art of coavoux et al. (2019). This promising result shows that it is feasible to design accurate transition systems without an ordered memory.

### Efficiency

Our transition system derives a tree for a sentence of \(n\) words in exactly \(4n-2\) transitions. Indeed, there must be \(n\) shift actions, and \(n-1\) combine actions. Each of these \(2n-1\) transitions must be followed by a single labelling action.

The statistical model responsible for choosing which action to perform at each parsing step needs to score \(|S|+1\) actions for a structural step and \(|N|+1\) actions for a labelling step (where \(N\) is the set of possible nonterminals). Since in the worst case, \(|S|\) contains \(n-1\) singletons, the parser has an \({\cal O}(n(|N|+n))\) time complexity.

In practice, the memory of the parser \(S\) remains relatively small on average. We report in Figure 3 the distribution of the size of \(S\) across configurations when parsing the development sets of three corpora. For the German treebanks, the memory contains 7 or fewer elements for more than 99 percents of configurations. For the Penn treebank, the memory is slightly larger, with 98 percents of configuration with 11 or fewer items.

We report empirical runtimes in Table 6 of Appendix C. Our parser compares decently with other transition-based parsers, despite being written in Python.

## 5 Related Work

Existing transition systems for discontinuous constituency parsing rely on three main strategies for constructing discontinuous constituents: a swap

Figure 3: Distribution of the size of the memory of the parser \(S\) across configurations derived when parsing the development set of the three corpora. In practice, we observe that the memory remains small.



based strategy, a split-stack strategy, and the use of non-local transitions.

Swap-based systemsSwap-based transition systems are based on the idea that any discontinuous constituency tree can be transformed into a projective tree by reordering terminals. They reorder terminals by swapping them with a dedicated action (swap), commonly used in dependency parsing Nivre (2009). The first proposals in transition-based discontinuous constituency parsing used the swap action on top of an easy-first parser Versley (2014a, b). Subsequent proposals relied on a shift-reduce system Maier (2015); Maier and Lichte (2016) or a shift-promote-adjoin system Stanojevic and Garrido Alhama (2017).

The main limitation of swap-based system is that they tend to require a large number of transitions to derive certain trees. The choice of an oracle that minimizes derivation lengths has a substantially positive effect on parsing Maier and Lichte (2016); Stanojevic and Garrido Alhama (2017).

Split-stack systemsThe second parsing strategy constructs discontinuous constituents by allowing the parser to reduce pairs of items that are not adjacent in the stack. In practice, Coavoux and Crabbe (2017a) split the usual stack of shift-reduce parsers into two data structures (a stack and a double-ended queue), in order to give the parser access to two focus items: the respective tops of the stack and the dequeue, that may or may not be adjacent. A dedicated action, gap, pushes the top of the stack onto the bottom of the queue to make the next item in the stack available for a reduction.

The split stack associated with the gap action can be interpreted as a linear-access memory: it is possible to access the \(i^{\text{th}}\) element in the stack, but it requires \(i\) operations.

Non-local transitionsNon-local transitions generalize standard parsing actions to non-adjacent elements in the parsing configurations. Maier and Lichte (2016) introduced a non-local transition SkipShift-\(i\) which applies shift to the \(i^{\text{th}}\) element in the buffer. Non-local transitions are also widely used in non-projective dependency parsing Attardi (2006); Qi and Manning (2017); Fernandez-Gonzalez and Gomez-Rodriguez (2018).

The key difference between these systems and ours is that we use an unordered memory. As a result, the semantics of the combine-\(s\) action we introduce in Section 2 is independent from a specific position in the stack or the buffer. A system with an action such as SkipShift-\(i\) needs to learn parameters with every possible \(i\), and will only learn parameters with the SkipShift-\(i\) actions that are required to derive the training set. In contrast, we use the same parameters to score each possible combine-\(s\) action.

## 6 Conclusion

We have presented a novel transition system that dispenses with the use of a stack, i.e. a memory with linear sequential access. Instead, the memory of the parser is represented by an unordered data structure with random-access: a set. We have designed a dynamic oracle for the resulting system and shown their empirical potential with state-of-the-art results on discontinuous constituency parsing of one English and two German treebanks. Finally, we plan to adapt our system to non-projective dependency parsing and semantic graph parsing.

## Acknowledgments

We thank Caio Corro, Giorgio Satta, Marco Damonte, as well as NAACL anonymous reviewers for feedback and suggestions. We gratefully acknowledge the support of Huawei Technologies.

## References

* Attardi (2006) Giuseppe Attardi. 2006. Experiments with a multilanguage non-projective dependency parser. In _Proceedings of the Tenth Conference on Computational Natural Language Learning (CoNLL-X)_, pages 166-170. Association for Computational Linguistics.
* Ballesteros et al. (2016) Miguel Ballesteros, Yoav Goldberg, Chris Dyer, and Noah A. Smith. 2016. Training with exploration improves a greedy stack lstm parser. In _Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing_, pages 2005-2010, Austin, Texas. Association for Computational Linguistics.
* Bottou (2010) Leon Bottou. 2010. Large-scale machine learning with stochastic gradient descent. In _Proceedings of the 19th International Conference on Computational Statistics (COMPSTAT'2010)_, pages 177-187, Paris, France. Springer 

Sabine Brants, Stefanie Dipper, Peter Eisenberg, Silvia Hansen-Schirra, Esther Konig, Wolfgang Lezius, Christian Rohrer, George Smith, and Hans Uszkoreit. 2004. Tiger: Linguistic interpretation of a german corpus. _Research on Language and Computation_, 2(4):597-620.
* Caruana [1997] Rich Caruana. 1997. Multitask learning. _Machine Learning_, 28(1):41-75.
* Coavoux and Crabbe [2016] Maximin Coavoux and Benoit Crabbe. 2016. Neural greedy constituent parsing with dynamic oracles. In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 172-182, Berlin, Germany. Association for Computational Linguistics.
* Coavoux and Crabbe [2017a] Maximin Coavoux and Benoit Crabbe. 2017a. Incremental discontinuous phrase structure parsing with the gap transition. In _Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers_, pages 1259-1270, Valencia, Spain. Association for Computational Linguistics.
* Coavoux and Crabbe [2017b] Maximin Coavoux and Benoit Crabbe. 2017b. Multilingual lexicalized constituency parsing with word-level auxiliary tasks. In _Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers_, pages 331-336, Valencia, Spain. Association for Computational Linguistics.
* Coavoux et al. [2019] Maximin Coavoux, Benoit Crabbe, and Shay B. Cohen. 2019. Unlexicalized transition-based discontinuous constituency parsing. _CoRR_, abs/1902.08912v1.
* Cohen et al. [2012] Shay B. Cohen, Carlos Gomez-Rodriguez, and Giorgio Satta. 2012. Elimination of spurious ambiguity in transition-based dependency parsing. _CoRR_, abs/1206.6735.
* Corro et al. [2017] Caio Corro, Joseph Le Roux, and Mathieu Lacroix. 2017. Efficient discontinuous phrase-structure parsing via the generalized maximum spanning arborescence. In _Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing_, pages 1645-1655, Copenhagen, Denmark. Association for Computational Linguistics.
* Crabo [2015] Benoit Crabbe. 2015. Multilingual discriminative lexicalized phrase structure parsing. In _Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing_, pages 1847-1856, Lisbon, Portugal. Association for Computational Linguistics.
* Cranenburgh et al. [2016] Andreas van Cranenburgh, Remko Scha, and Rens Bod. 2016. Data-oriented parsing with discontinuous constituents and function tags. _Journal of Language Modelling_, 4(1):57-111.
* Cross and Huang [2016a] James Cross and Liang Huang. 2016a. Incremental parsing with minimal features using bi-directional LSTM. In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)_, pages 32-37, Berlin, Germany. Association for Computational Linguistics.
* Cross and Huang [2016b] James Cross and Liang Huang. 2016b. Span-based constituency parsing with a structure-label system and provably optimal dynamic oracles. In _Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing_, pages 1-11, Austin, Texas. Association for Computational Linguistics.
* Dubey and Keller [2003] Amit Dubey and Frank Keller. 2003. Probabilistic parsing for german using sister-head dependencies. In _Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics_, pages 96-103, Sapporo, Japan. Association for Computational Linguistics.
* Durrett and Klein [2015] Greg Durrett and Dan Klein. 2015. Neural CRF parsing. In _Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)_, pages 302-312, Beijing, China. Association for Computational Linguistics.
* Evang and Kallmeyer [2011] Kilian Evang and Laura Kallmeyer. 2011. PLCFRS parsing of english discontinuous constituents. In _Proceedings of the 12th International Conference on Parsing Technologies_, pages 104-116, Dublin, Ireland. Association for Computational Linguistics.
* Fernandez-Gonzalez and Gomez-Rodriguez [2018] Daniel Fernandez-Gonzalez and Carlos Gomez-Rodriguez. 2018. Non-projective dependency parsing with non-local transitions. In _Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)_, pages 693-700. Association for Computational Linguistics.
* Fernandez-Gonzalez and Gomez-Rodriguez [2018a] Daniel Fernandez-Gonzalez and Carlos Gomez-Rodriguez. 2018a. Dynamic oracles for top-down and in-order shift-reduce constituent parsing. In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_, pages 1303-1313, Brussels, Belgium. Association for Computational Linguistics.
* Fernandez-Gonzalez and Gomez-Rodriguez [2018b] Daniel Fernandez-Gonzalez and Carlos Gomez-Rodriguez. 2018b. Faster shift-reduce constituent parsing with a non-binary, bottom-up strategy. _CoRR_, abs/1804.07961.
* Fernandez-Gonzalez and Martins [2015] Daniel Fernandez-Gonzalez and Andre F. T. Martins. 2015. Parsing as reduction. In _Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)_, pages 1523-1533, Beijing, China. Association for Computational Linguistics.

 

Kilian Gebhardt. 2018. Generic refinement of expressive grammar formalisms with an application to discontinuous constituent parsing. In _Proceedings of the 27th International Conference on Computational Linguistics_, pages 3049-3063, Santa Fe, New Mexico, USA. Association for Computational Linguistics.
* Glorot and Bengio (2010) Xavier Glorot and Yoshua Bengio. 2010. Understanding the difficulty of training deep feedforward neural networks. In _In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS'10). Society for Artificial Intelligence and Statistics_.
* Goldberg and Nivre (2012) Yoav Goldberg and Joakim Nivre. 2012. A dynamic oracle for arc-eager dependency parsing. In _Proceedings of COLING 2012_, pages 959-976, Mumbai, India. The COLING 2012 Organizing Committee.
* Goldberg and Nivre (2013) Yoav Goldberg and Joakim Nivre. 2013. Training deterministic parsers with non-deterministic oracles. _Transactions of the Association for Computational Linguistics_, 1:403-414.
* Gomez-Rodriguez et al. (2015) Carlos Gomez-Rodriguez and Daniel Fernandez-Gonzalez. 2015. An efficient dynamic oracle for unrestricted non-projective parsing. In _Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers)_, pages 256-261, Beijing, China. Association for Computational Linguistics.
* Gomez-Rodriguez et al. (2014) Carlos Gomez-Rodriguez, Francesco Sartorio, and Giorgio Satta. 2014. A polynomial-time dynamic oracle for non-projective dependency parsing. In _Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP)_, pages 917-927, Doha, Qatar. Association for Computational Linguistics.
* Hall et al. (2014) David Hall, Greg Durrett, and Dan Klein. 2014. Less grammar, more features. In _Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 228-237, Baltimore, Maryland. Association for Computational Linguistics.
* Kallmeyer (2010) Laura Kallmeyer. 2010. _Parsing Beyond Contexa-Free Grammars_, 1st edition. Springer Publishing Company, Incorporated.
* Kiperwasser and Goldberg (2016) Eliyahu Kiperwasser and Yoav Goldberg. 2016. Simple and accurate dependency parsing using bidirectional LSTM feature representations. _Transactions of the Association for Computational Linguistics_, 4:313-327.
* Maier (2015) Wolfgang Maier. 2015. Discontinuous incremental shift-reduce parsing. In _Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)_, pages 1202-1212, Beijing, China. Association for Computational Linguistics.
* Maier and Lichte (2016) Wolfgang Maier and Timm Lichte. 2016. Discontinuous parsing with continuous trees. In _Proceedings of the Workshop on Discontinuous Structures in Natural Language Processing_, pages 47-57, San Diego, California. Association for Computational Linguistics.
* Marcus et al. (1993) Mitchell Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. 1993. Building a large annotated corpus of english: The penn treebank. _Computational Linguistics, Volume 19, Number 2, June 1993, Special Issue on Using Large Corpora: II_.
* Neelakantan et al. (2015) Arvind Neelakantan, Luke Vilnis, Quoc V. Le, Ilya Sutskever, Lukasz Kaiser, Karol Kurach, and James Martens. 2015. Adding gradient noise improves learning for very deep networks. _CoRR_, abs/1511.06807.
* Nivre (2009) Joakim Nivre. 2009. Non-projective dependency parsing in expected linear time. In _Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP_, pages 351-359, Suntec, Singapore. Association for Computational Linguistics.
* Paszke et al. (2017) Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in pytorch. In _NIPS-W_.
* Polyak and Juditsky (1992) Boris T. Polyak and Anatoli B. Juditsky. 1992. Acceleration of stochastic approximation by averaging. _SIAM Journal on Control and Optimization_, 30(4):838-855.
* Qi and Manning (2017) Peng Qi and Christopher D. Manning. 2017. Arc-swift: A novel transition system for dependency parsing. In _Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)_, pages 110-117. Association for Computational Linguistics.
* Seddah et al. (2013) Djame Seddah, Reut Tsarfaty, Sandra Kubler, Marie Candito, Jinho D. Choi, Richard Farkas, Jennifer Foster, lakes Goenaga, Koldo Gojenolla Galletbeitia, Yoav Goldberg, Spence Green, Nizar Habash, Marco Kuhlmann, Wolfgang Maier, Joakim Nivre, Adam Przepiorkowski, Ryan Roth, Wolfgang Seeker, Yannick Versley, Veronika Vincze, Marcin Wolinski, Alina Wroblewska, and Eric Villemonde del Clegrei. 2013. Overview of the SPMRL 2013 shared task: A cross-framework evaluation of parsing morphologically rich languages. In _Proceedings of the Fourth Workshop on Statistical Parsing of Morphologically-Rich Languages_, pages 146-182, Seattle, Washington, USA. Association for Computational Linguistics 

Wojciech Skut, Brigitte Krenn, Thorsten Brants, and Hans Uszkoreit. 1997. An annotation scheme for free word order languages. In _Proceedings of the Fifth Conference on Applied Natural Language Processing_, pages 88-95, Washington, DC, USA. Association for Computational Linguistics.
* Stanojevic and Alhama (2017) Milos Stanojevic and Raquel Garrido Alhama. 2017. Neural discontinuous constituency parsing. In _Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing_, pages 1667-1677, Copenhagen, Denmark. Association for Computational Linguistics.
* Stern et al. (2017) Mitchell Stern, Jacob Andreas, and Dan Klein. 2017. A minimal span-based neural constituency parser. In _Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 818-827, Vancouver, Canada. Association for Computational Linguistics.
* Versley (2014a) Yannick Versley. 2014a. Experiments with easy-first nonprojective constituent parsing. In _Proceedings of the First Joint Workshop on Statistical Parsing of Morphologically Rich Languages and Syntactic Analysis of Non-Canonical Languages_, pages 39-53, Dublin, Ireland. Dublin City University.
* Versley (2014b) Yannick Versley. 2014b. Incorporating semi-supervised features into discontinuous easy-first constituent parsing. _CoRR_, abs/1409.3813.
* Versley (2016) Yannick Versley. 2016. Discontinuity re'2-visited: A minimalist approach to pseudoprojective constituent parsing. In _Proceedings of the Workshop on Discontinuous Structures in Natural Language Processing_, pages 58-69, San Diego, California. Association for Computational Linguistics.
* Vijay-Shanker et al. (1987) K. Vijay-Shanker, David J. Weir, and Aravind K. Joshi. 1987. Characterizing structural descriptions produced by various grammatical formalisms. In _25th Annual Meeting of the Association for Computational Linguistics_.

## Appendix A Oracle Correctness

The oracle o leads to the reachable tree with the highest F-score with respect to the gold tree. The F-score of a predicted tree \(\hat{t}\) (represented as a set of instantiated constituents) with respect to a gold tree \(t^{*}\) is defined as:

\[\mathsf{precision}(\hat{t},t^{*})=p=\frac{|\hat{t}\cap t^{*}|}{|\hat{t}|},\]

\[\mathsf{recall}(\hat{t},t^{*})=r=\frac{|\hat{t}\cap t^{*}|}{|t^{*}|},\]

\[F_{1}(\hat{t},t^{*})=\frac{2pr}{p+r}.\]

By definition, \(\mathsf{o_{odd}}\) is optimal for precision because it constructs a constituent only if it is gold, and optimal for recall because it will construct a gold constituent if it is possible to do so.

Moreover, \(\mathsf{o_{even}}\) is optimal for recall because any gold constituent reachable from \(c\) will still be reachable after any transition in \(\mathsf{o_{even}}(c,t^{*})\). Assuming a configuration \(c=(S,s_{f},i,C)\) and \(\mathsf{next}(c,t^{*})=s_{g}\), we consider separately the shift case and the combine-\(s\) case:

* shift case (\(\max(s_{g})>\max(s_{f})\)): constituents \((X,s)\) reachable from \(c\) and not reachable from shift(\(c\)) satisfy \(\max(s)=i\). If a gold constituent satisfies this property, we have \(s\preceq s_{g}\), which contradicts the assumption that \(s_{g}=\mathsf{next}(c,t^{*})\) (see definition of oracle in Section 2.2.2).
* combine-\(s\) case: Let \((X,s^{\prime})\) be a reachable gold constituent. Since it is compatible with \(s_{g}\), there are three possible cases:
* if \((X,s^{\prime})\) is an ascendant of \(s_{g}\), then \((s\cup s_{f})\subseteq s_{g}\subset s^{\prime}\), therefore \((X,s^{\prime})\) is still reachable from combine-\(s\)(\(c\)).
* if \((X,s^{\prime})\) is a descendant of \(s_{g}\) then \(s^{\prime}\preceq s_{g}\), which contradicts the definition of \(s_{g}\).
* if \(s^{\prime}\) and \(s_{g}\) are completely disjoint, we have \(s^{\prime}\cap s=s^{\prime}\cap s_{f}=\emptyset\), therefore \(s^{\prime}\cap(s\cup s_{f})=\emptyset\), and \(s^{\prime}\) is still reachable from combine-\(s\)(\(c\)).

Finally, since \(\mathsf{o_{even}}\) does not construct new constituents (it is the role of labelling actions), it is optimal for precision.

## Appendix B Hyperparameters

The list of hyperparameters is presented in Table 5.

* We use learning rate warm-up (linear increase from 0 to \(t_{1000}\) during the first 1000 steps).
* Before the \(t^{th}\) update, we add Gaussian noise to the gradient of every parameter with mean 0 and variance \(\dfrac{0.01}{(1+t)^{0.55}}\)Neelakantan et al. (2015).
* All experiments use greedy search decoding (we did not experiment with beam search) 

* Before each training step, we replace a word embedding by an 'UNK' pseudo-word embedding with probability \(0.3\). We only do this replacement for the least frequent word-types (\(\frac{2}{3}\) least frequent word-types). The 'UNK' embedding is then used to represent unknown words.
* We apply dropout at the input of the tagger and the input of action scorers: each single prediction has its own dropout mask.

## Appendix C Detailed Results

We report indicative parsing times in Table 6. Detailed parsing results --including precision, recall, F-score and part-of-speech tag accuracy-- are presented in Table 7.

 



\begin{table}
\begin{tabular}{l l|c c c|c c c|c} \hline  & & \multicolumn{4}{c|}{All const.} & \multicolumn{3}{c|}{Disc. const.} & POS \\ Development sets & & F & P & R & F & P & R & Acc. \\ \hline English (DPTB) & static & 91.1 & 91.1 & 91.2 & 68.2 & 75.3 & 62.3 & 97.2 \\ dynamic & 91.4 & 91.5 & 91.3 & 70.9 & 76.1 & 66.4 & 97.2 \\ \hline German (Tiger) & static & 87.4 & 87.8 & 87.0 & 61.7 & 64.4 & 59.2 & 98.3 \\ dynamic & 87.6 & 88.2 & 87.0 & 62.5 & 68.6 & 57.3 & 98.4 \\ \hline German (Negra) & static & 83.6 & 83.8 & 83.4 & 51.3 & 53.3 & 49.5 & 97.9 \\ dynamic & 84.0 & 84.7 & 83.4 & 54.0 & 58.1 & 50.5 & 98.0 \\ \hline Test sets & & F & P & R & F & P & R & Acc. \\ \hline English (DPTB) & dynamic & 90.9 & 91.3 & 90.6 & 67.3 & 73.3 & 62.1 & 97.6 \\ German (Tiger) & dynamic & 82.5 & 83.5 & 81.5 & 55.9 & 62.4 & 50.6 & 98.0 \\ German (Negra) & dynamic & 83.2 & 83.8 & 82.6 & 56.3 & 64.9 & 49.8 & 98.0 \\ \hline \end{tabular}
\end{table}
Table 7: Detailed results. Overall, the positive effect of the dynamic oracle on F-score is explained by its effect on precision.