\author{Marie-Catherine de Marneffe and Christopher D. Manning}
\date{September 2008\\
%Revised for Stanford Parser v. 1.6.2 in February 2010
%Revised for Stanford Parser v.~1.6.5 in November 2010
%Revised for Stanford Parser v.\ 1.6.9 in September 2011
% Revised for Stanford Parser v.\ 2.0.4 in November 2012
% Revised for the Stanford Parser v.\ 2.0.5 in March 2013
% Revised for the Stanford Parser v.\ 3.2 in June 2013
% Revised for the Stanford Parser v.\ 3.3 in November 2013
% Revised for the Stanford Parser v.\ 3.3 in December 2013
%Revised for the Stanford Parser v.\ 3.5.1 in February 2015
%Revised for the Stanford Parser v.\ 3.5.2 in April 2015
Revised for the Stanford Parser v.\ 3.7.0+ in September 2016
}
\begin{document}
\maketitle
\textcolor{cardinal}{Please note that this manual describes the original Stanford
Dependencies representation. As of version 3.5.2, the default representation
output by the Stanford Parser and Stanford CoreNLP is the new Universal Dependencies (UD)
representation, and we no longer actively develop the original Stanford Dependencies representation. For a description of the UD
representation, take a look at the Universal Dependencies documentation at \textsf{http:/www.universaldependencies.org} and
the discussion of the \textit{enhanced} and \textit{enhanced++} UD representations by \citet{schuster2016enhanced}.}
\section{Introduction}
The Stanford typed dependencies representation was designed to provide
a simple description of the grammatical relationships in a sentence
that can easily be understood and effectively used by people without
linguistic expertise who want to extract textual relations. In
particular, rather than the phrase structure representations that have
long dominated in the computational linguistic community, it
represents all sentence relationships uniformly as typed dependency
relations. That is, as triples of a relation between pairs of words, such as ``the subject of
\emph{distributes} is \emph{Bell.}'' Our experience is that this simple,
uniform representation is quite accessible to non-linguists
thinking about tasks involving information extraction from text and is
effective in relation extraction applications.
Here is an example sentence:
\begin{quote}
\emph{Bell, based in Los Angeles, makes and distributes electronic, computer and building products.}
\end{quote}
For this sentence, the Stanford Dependencies (SD) representation is:
\begin{quote}
nsubj(makes-8, Bell-1) \\
nsubj(distributes-10, Bell-1) \\
vmod(Bell-1, based-3) \\
nn(Angeles-6, Los-5) \\
prep\_in(based-3, Angeles-6) \\
root(ROOT-0, makes-8)\\
conj\_and(makes-8, distributes-10) \\
amod(products-16, electronic-11) \\
conj\_and(electronic-11, computer-13) \\
amod(products-16, computer-13) \\
conj\_and(electronic-11, building-15) \\
amod(products-16, building-15) \\
dobj(makes-8, products-16) \\
dobj(distributes-10, products-16)
\end{quote}
These dependencies map straightforwardly onto a directed graph representation, in which words in the sentence are nodes in the graph and grammatical relations are edge labels. Figure~\ref{bell} gives the graph representation for the example sentence above.
\caption{\label{bell} Graphical representation of the Stanford Dependencies for the sentence: \emph{Bell, based in Los Angeles, makes and distributes electronic, computer and building products.}}
\end{figure}
\subparagraph{Document overview:} This manual provides documentation for the set of dependencies defined
for English. There is also a Stanford Dependency representation
available for Chinese, but it is not further discussed here. Starting
in 2014, there has been work to extend Stanford Dependencies to be
generally applicable cross-linguistically. Initial work appeared in
\citet{marneffe14universal}, and the current guidelines for Universal Dependencies (UD) can be found at
\url{http://www.universaldependencies.org}.
For SD, Section~\ref{def} of the manual defines the grammatical relations and the taxonomic hierarchy over
them appears in section~\ref{hierarchy}. This is then followed by a description of the several variant
dependency representations available, aimed at different use cases
(section~\ref{types}), some details of the software available for
generating Stanford Dependencies (section~\ref{in_practice}), and
references to further discussion and use of the SD representation (section~\ref{refs}).
\section{Definitions of the Stanford typed dependencies}\label{def}
The current representation contains approximately 50 grammatical
relations (depending slightly on the options discussed in section~\ref{types}). The dependencies are all binary relations: a grammatical relation holds between a \emph{governor} (also known as a \emph{regent} or a \emph{head}) and a \emph{dependent}. The grammatical relations are defined below, in alphabetical order according to the dependency's abbreviated name (which appears in the parser output). The definitions make use of the Penn Treebank part-of-speech tags and phrasal labels.
A coordination is the relation between an element of a conjunct and the coordinating conjunction word of the conjunct. (Note: different dependency grammars have different treatments of coordination. We take one conjunct of a conjunction (normally the first) as the head of the conjunction.)
A conjunction may also appear at the beginning of a sentence. This is also called a cc, and dependent on the root predicate of the sentence.
A clausal complement of a verb or adjective is a dependent clause with an internal subject which functions like an object of the verb, or adjective. Clausal complements for nouns are limited to complement clauses with a subset of nouns
like ``fact'' or ``report''. We analyze them the same (parallel to the
analysis of this class as ``content clauses'' in Huddleston and Pullum 2002). Such clausal complements are usually finite (though there are occasional remnant English subjunctives).
\> ``He says that you like to swim'' \>\>\emph{ccomp}(says, like)\\
\hspace{1cm}\> ``I am certain that he did it'' \>\>\emph{ccomp}(certain, did)\\
\hspace{1cm}\> ``I admire the fact that you are honest'' \>\>\emph{ccomp}(fact, honest)\\
\end{tabbing}
%% todo: put in a for-to infinitive example
%% Would it be best for me for my kids to finish college?
%1 Would _ MD MD _ 4 aux _ _
%2 it _ PRP PRP _ 4 nsubj 4 expl
%3 be _ VB VB _ 4 cop _ _
%4 best _ JJS JJS _ 0 root _ _
%5 for _ IN IN _ 8 mark 4 prep
%6 me _ PRP PRP _ 8 nsubj 5 pobj
%7 to _ TO TO _ 8 aux _ _
%8 finish _ VB VB _ 4 advcl 4 xcomp
%9 college _ NN NN _ 8 dobj _ _
%10 ? _ . . _ 4 punct _ _
\noindent\textbf{\emph{conj}: conjunct}\\
A conjunct is the relation between two elements connected by a coordinating conjunction, such as ``and'', ``or'', etc. We treat conjunctions asymmetrically: The head of the relation is the first conjunct and other conjunctions depend on it via the \emph{conj} relation.
\> ``Bill is big and honest'' \>\>\emph{conj}(big, honest)\\
\hspace{1cm}\> ``They either ski or snowboard'' \>\>\emph{conj}(ski, snowboard)\\
\end{tabbing}
\noindent\textbf{\emph{cop}: copula}\\
A copula is the relation between the complement of a copular verb and the copular verb. (We normally take a copula as a dependent of its complement; see the discussion in section~\ref{types}.)
\> ``Bill is big'' \hspace{1cm}\>\>\emph{cop}(big, is)\\
\hspace{1cm}\> ``Bill is an honest man'' \>\>\emph{cop}(man, is)\\
\end{tabbing}
\noindent\textbf{\emph{csubj}: clausal subject}\\
A clausal subject is a clausal syntactic subject of a clause, i.e., the subject is itself a clause. The governor of this relation might not always be a verb: when the verb is a copular verb, the root of the clause is the complement of the copular verb. In the two following examples, ``what she said'' is the subject.
\> ``That she lied was suspected by everyone'' \>\>\emph{csubjpass}(suspected, lied)\\
\end{tabbing}
\noindent\textbf{\emph{dep}: dependent}\\
A dependency is labeled as \emph{dep} when the system is unable to determine a more precise dependency relation between two words. This may be because of a weird grammatical construction, a limitation in the Stanford Dependency conversion software, a parser error, or because of an unresolved long distance dependency.
A noun compound modifier of an NP is any noun that serves to modify the head noun. (Note that in the current system for dependency extraction, all nouns modify the rightmost noun of the NP -- there is no intelligent noun compound analysis. This is likely to be fixed once the Penn Treebank represents the branching structure of NPs.)
\noindent\textbf{\emph{npadvmod}: noun phrase as adverbial modifier}\\
This relation captures various places where something syntactically a noun phrase (NP) is used as an adverbial modifier in a sentence. These usages include: (i)~a measure phrase, which is the relation between
the head of an ADJP/ADVP/PP and the head of a measure phrase modifying the ADJP/ADVP; (ii)~noun phrases giving an extent inside a VP which are not objects; (iii)~financial constructions involving an adverbial or PP-like NP, notably
the following construction \emph{\$5 a share}, where the second NP means ``per share''; (iv)~floating reflexives; and (v)~certain other absolutive NP constructions.
A temporal modifier (tmod) is a subclass of npadvmod which is distinguished as a separate relation.
\> ``Shares eased a fraction'' \>\>\emph{npadvmod}(eased, fraction)\\
\> ``IBM earned \$ 5 a share'' \>\>\emph{npadvmod}(\$, share)\\
\> ``The silence is itself significant'' \>\>\emph{npadvmod}(significant, itself) \\
\> ``90\% of Australians like him, the most of any country'' \>\>\emph{npadvmod}(like, most)
\end{tabbing}
\noindent\textbf{\emph{nsubj}: nominal subject}\\
A nominal subject is a noun phrase which is the syntactic subject of a clause. The governor of this relation might not always be a verb: when the verb is a copular verb, the root of the clause is the complement of the copular verb, which can be an adjective or noun.
\> ``I have four thousand sheep'' \>\>\emph{number}(thousand, four)\\
\> ``I lost \$ 3.2 billion'' \>\>\emph{number}(billion, 3.2)\\
\end{tabbing}
\noindent\textbf{\emph{parataxis}: parataxis}\\
The parataxis relation (from Greek for ``place side by side'') is a relation between the main verb of a clause and other sentential elements, such as a sentential parenthetical, a clause after a ``:'' or a ``;'', or two sentences placed side by side without any explicit coordination or subordination.
\> ``We have no information on whether users are at risk'' \>\>\emph{pcomp}(on, are)\\
\hspace{1cm}\> ``They heard about you missing classes'' \>\>\emph{pcomp}(about, missing)\\
%\> ``It is warmer in Greece than in Italy'' \>\> \emph{pcomp}(than, in)
\end{tabbing}
\noindent\textbf{\emph{pobj}: object of a preposition}\\
The object of a preposition is the head of a noun phrase following the preposition, or the adverbs ``here'' and ``there''. (The preposition in turn may be modifying a noun, verb, etc.) Unlike the Penn Treebank, we here define cases of VBG quasi-prepositions like ``including'', ``concerning'', etc.\ as instances of \emph{pobj}. (The preposition can be tagged a FW for ``pace'', ``versus'', etc. It can also be called a CC -- but we don't currently handle that and would need to distinguish from conjoined prepositions.) In the case of preposition stranding, the object can precede the preposition (e.g., ``What does CPR stand for?'').
A preconjunct is the relation between the head of an NP and a word that appears at the beginning bracketing a conjunction (and puts emphasis on it), such as ``either'', ``both'', ``neither'').
A prepositional modifier of a verb, adjective, or noun is any prepositional phrase that serves to modify the meaning of the verb, adjective, noun, or even another prepositon. In the collapsed representation, this is used only for prepositions with NP complements.
In the collapsed representation (see section \ref{types}), a prepositional clausal modifier of a verb, adjective, or noun is a clause introduced by a preposition which serves to modify the meaning of the verb, adjective, or noun.
\> ``They shut down the station'' \>\>\emph{prt}(shut, down)\\
\end{tabbing}
\noindent\textbf{\emph{punct}: punctuation}\\
This is used for any piece of punctuation in a clause, if punctuation is being retained in the typed dependencies. By default, punctuation is not retained in the output.
A quantifier modifier is an element modifying the head of a QP constituent. (These are modifiers in complex numeric quantifiers, not other types of ``quantification''. Quantifiers like ``all'' become det.)
A relative clause modifier of an NP is a relative clause modifying the NP. The relation points from the head noun of the NP to the head of the relative clause, normally a verb.
% \> ``I saw the man whose wife you love'' \> \> \emph{rel}(love, wife)
% \end{tabbing}
\noindent\textbf{\emph{root}: root}\\
The root grammatical relation points to the root of the sentence. A fake node ``ROOT'' is used as the governor. The ROOT node is indexed with ``0'', since the indexation of real words in the sentence starts at 1.
A temporal modifier (of a VP, NP, or an ADJP is a bare noun phrase constituent that serves to modify the meaning of the constituent by specifying a time. (Other temporal modifiers are prepositional phrases and are introduced as prep.)
\> ``Tom likes to eat fish'' \>\>\emph{xsubj}(eat, Tom)\\
\end{tabbing}
\section{Hierarchy of typed dependencies}\label{hierarchy}
The grammatical relations defined in the above section stand in a hierarchy. The most generic grammatical relation, dependent (\emph{dep}), will be used when a more precise relation in the hierarchy does not exist or cannot be retrieved by the system.
\begin{tabbing}
xxxxx\= xxxxx\= xxxxx\= xxxxx\= xxxxx \kill
\emph{root} - root\\
\emph{dep} - dependent \\
\>\emph{aux} - auxiliary \\
\>\>\emph{auxpass} - passive auxiliary\\
\>\>\emph{cop} - copula\\
\>\emph{arg} - argument \\
\>\>\emph{agent} - agent\\
\>\>\emph{comp} - complement \\
\>\>\>\emph{acomp} - adjectival complement \\
\>\>\>\emph{ccomp} - clausal complement with internal subject \\
\>\>\>\emph{xcomp} - clausal complement with external subject\\
\section{Different styles of dependency representation}\label{types}
Five variants of the typed dependency representation are available in the dependency extraction system provided with the Stanford parser. The representations follow the same format. In the plain text format, a dependency is written as \emph{abbreviated\_relation\_name}(governor, dependent) where the governor and the dependent are words in the sentence to which a number indicating the position of the word in the sentence is appended.\footnote{In some cases, an apostrophe is added after the word position number: see section \ref{alteration} for more details.} The parser also provides an XML format which captures the same information. The differences between the five formats are that they range from a more surface-oriented representation, where each token appears as a dependent in a tree, to a more semantically interpreted representation where certain word relationships, such as prepositions, are represented as dependencies, and the set of dependencies becomes a possibly cyclic graph.
\subsection{Basic}
The basic typed dependencies use the dependencies defined in section
\ref{def}, and form a tree structure. Each word in the sentence is the
dependent of exactly one thing, either another word in the sentence or
the distingushed ``ROOT-0'' token.
For the sentence, ``Bell, a company which is based in LA, makes and distributes computer products.'', the basic typed dependencies will be:
\begin{verbatim}
nsubj(makes-11, Bell-1)
det(company-4, a-3)
appos(Bell-1, company-4)
nsubjpass(based-7, which-5)
auxpass(based-7, is-6)
rcmod(company-4, based-7)
prep(based-7, in-8)
pobj(in-8, LA-9)
root(ROOT-0, makes-11)
cc(makes-11, and-12)
conj(makes-11, distributes-13)
nn(products-15, computer-14)
dobj(makes-11, products-15)
\end{verbatim}
\subsection{Collapsed dependencies}
In the collapsed representation,
dependencies involving prepositions, conjuncts, as well as information about the referent of relative clauses are collapsed to get direct dependencies between content words. This ``collapsing'' is often useful in simplifying patterns in relation extraction applications.
For instance, the dependencies involving the preposition ``in'' in the above example will be collapsed into one single relation:\\
\indent\texttt{prep(based-7, in-8)}\\
\indent\texttt{pobj(in-8, LA-9)}\\
will become\\
\indent\texttt{prep\_in(based-7, LA-9)}
\bigskip
\noindent Moreover, additional dependencies are considered, even ones that break the tree structure (turning the dependency structure into a \emph{directed graph}). So in the above example, the following relation will be added:\\
\indent\texttt{ref(company-4, which-5)}\\
That relation does not appear in the basic representation since it creates a cycle with the \texttt{rcmod} and \texttt{nsubjpass} relations. Relations that break the tree structure are the ones taking into account elements from relative clauses and their antecedents (as shown in this example), the controlling (\emph{xsubj}) relations, and the (\emph{pobj}) relation in the case of preposition stranding.
\bigskip
English has some very common multi-word constructions that function like prepositions. These are also collapsed as prepositional relations. At the moment, the system handles the multi-word prepositions listed in Tables \ref{2wp} and~\ref{3wp}.
\begin{table}
\begin{center}
\begin{tabular}{lllll}\hline
according to & as per & compared to & instead of & preparatory to \\
across from & as to & compared with & irrespective of & previous to \\
ahead of & aside from & due to & next to & prior to \\
along with & away from & depending on & near to & pursuant to \\
alongside of & based on & except for & off of & regardless of \\
apart from & because of & exclusive of & out of & subsequent to \\
as for & close by & contrary to & outside of & such as \\
as from & close to & followed by & owing to & thanks to \\
as of & contrary to & inside of & preliminary to & together with\\\hline
\end{tabular}
\caption{List of two-word prepositions that the system can collapse.}\label{2wp}
\end{center}
\end{table}
\bigskip
\noindent The same happens for dependencies involving conjunction:\\
A few variant conjunctions for ``and (not)'' are collapsed together in this representation as shown in Table~\ref{conjand}.
\bigskip
\noindent The information about the antecedent of the relative clause (\texttt{ref(company-4, which-5)}) will serve to expand the following dependency:\\
\indent\texttt{nsubjpass(based-7, which-5)}\\
becomes\\
\indent\texttt{nsubjpass(based-7, company-4)}
\bigskip
\noindent In the end the collapsed dependencies that the system gives you for the sentence are:
\begin{verbatim}
nsubj(makes-11, Bell-1)
det(company-4, a-3)
appos(Bell-1, company-4)
nsubjpass(based-7, company-4)
auxpass(based-7, is-6)
rcmod(company-4, based-7)
prep_in(based-7, LA-9)
root(ROOT-0, makes-11)
conj_and(makes-11, distributes-13)
nn(products-15, computer-14)
dobj(makes-11, products-15)
\end{verbatim}
\begin{table}
\begin{center}
\begin{tabular}{lllll}\hline
by means of & in case of & in place of & on behalf of & with respect to\\
in accordance with & in front of & in spite of & on top of &\\
in addition to & in lieu of & on account of & with regard to &\\
\hline
\end{tabular}
\caption{List of three-word prepositions that the system can collapse.}\label{3wp}
\end{center}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{lllll}\hline
\textbf{Mapped to}&\\
\emph{conj\_and}& as well as & not to mention & but also &\&\\
\emph{conj\_negcc}& but not & instead of & rather than & but rather \\
\hline
\end{tabular}
\caption{Mapping of select conjunct relations in the collapsed representation.}\label{conjand}
\end{center}
\end{table}
\subsection{Collapsed dependencies with propagation of conjunct dependencies}
When there is a conjunction, you can also get propagation of the dependencies involving the conjuncts. In the sentence here, this propagation should add two dependencies to the collapsed representation; due to the conjunction between the verbs ``makes'' and ``distributes'', the subject and object relations that exist on the first conjunct (``makes'') should be propagated to the second conjunct (``distributes''):\\
However, at present, our converter handles this imperfectly and only generates the first of these two dependencies (in general, it is hard to determine if object dependencies should be distributed or not in English).
Since this representation is an extension of the collapsed dependencies, it does not guarantee a tree structure.
\subsection{Collapsed dependencies preserving a tree structure}
In this representation, dependencies which do not preserve the tree structure are omitted. As explained above, this concerns relations between elements of a relative clause and its antecedent, as well as the controlling subject relation (\emph{xsubj}), and the object of preposition (\emph{pobj}) in the case of preposition stranding. This also does not allow propagation of conjunct dependencies. In our example, the dependencies in this representation are actually identical to the ones in the collapsed representation:
This representation gives the basic dependencies as well as the extra ones (which break the tree structure), without any collapsing or propagation of conjuncts. There are options to get the extra dependencies separated from the basic dependencies (see section \ref{in_practice}). At print time, the dependencies in this representation can thus look as follows:
\begin{verbatim}
nsubj(makes-11, Bell-1)
det(company-4, a-3)
appos(Bell-1, company-4)
nsubjpass(based-7, which-5)
auxpass(based-7, is-6)
rcmod(company-4, based-7)
prep(based-7, in-8)
pobj(in-8, LA-9)
root(ROOT-0, makes-11)
cc(makes-11, and-12)
conj(makes-11, distributes-13)
nn(products-15, computer-14)
dobj(makes-11, products-15)
======
ref(company-4, which-5)
\end{verbatim}
\subsection{Alteration of the sentence semantics}\label{alteration}
In some cases, collapsing relations introduces a slight alteration of the semantics of the sentence. In all the representation styles involving collapsing, the two following phenomena may appear.
\paragraph{Introduction of copy nodes marked with an apostrophe.}
A copy node will be introduced in the case of PP conjunction as in ``Bill went over the river and through the woods''. In this example, the two prepositions ``over'' and ``through'' are conjoined and governed by the verb ``went''. To avoid disjoint subgraphs when collapsing the relations (preposition and conjunction), sentences like this are transformed into VP coordination, which requires making a copy of the word ``went''. A copy node will be marked with one or more apostrophes in the plain text output or by a \texttt{copy} attribute in the XML output. This gives the following representation, which corresponds to a sentence like ``Bill went over the river and went through the woods'':\\
\indent prep\_over(went-2, river-5)\\
\indent prep\_through(went-2’, woods-10)\\
\indent conj\_and(went-2, went-2’)
\paragraph{Distortion in governors of preposition modifiers.}
Another instance where collapsing sacrifices some linguistic fidelity is the case of preposition modifiers. When turning the preposition into a relation, the preposition does not appear as a word of the sentence anymore. Therefore preposition modifiers become dependent on the head of the clause in which they appear, and not on the preposition itself. In \emph{He left his office just before lunch time}, \emph{just} will be an adverbial modifier of the verb \emph{left}. This induces some distortion in the exact semantics of the sentence.
\subsection{The treatment of copula verbs}
The design philosophy of SD has been to maximize dependencies between
content words, and so we normally regard a copula verb like \emph{be}
as an auxiliary modifier, even when its complement is an adjective or
predicative noun (see the references in section~\ref{refs} for more discussion and motivation). However, some people do not like this because then the head of some sentences is no longer a verb. In the dependency conversion software, you can ask for the copula to remain the head when its complement is an adjective or noun by giving the flag \texttt{-makeCopulaHead}. Uses of the verb \emph{be} as in auxiliary in passives and progressives will still be treated as a non-head auxiliary.
\subsection{Comparison of the representation styles}
\noindent To facilitate comparison, the table below shows the dependencies for the four variants for the example sentence ``Bell, a company which is based in LA, makes and distributes computer products''. The ``non-collapsed'' variant (see section \ref{non-collapsed}) contains all the relations in the ``basic'' variant plus one extra dependency: ref(company-4, which-5).
{The basic dependencies output by early versions of
the Stanford Dependencies converter \emph{did} only produce
projective trees. Starting with v.3.2, non-projective dependency
trees are produced in appropriate places for questions and relative clauses.}
However, most trees are projective: Non-projective trees only occur
occasionally in English, in structure such as questions and relative clauses.
The collapsed and CCprocessed dependencies are not a DAG\@.
The graphs can contain small cycles between two nodes (only).
These don't seem eliminable given the current
representational choices. They occur with relative clauses such as
\emph{the woman who introduced you}. The cycles occur once you wish to represent the
referent of \emph{who}. In the basic plus extras
representation, you get \emph{rcmod}(woman, introduced), \emph{nsubj}(introduced, who),
and \emph{ref}(woman, who).\footnote
{Arguably, that third dependency should already have been represented the
other way around as \emph{ref}(who, woman), giving a three node cycle, but
it wasn't.}
In the collapsing process, \emph{ref} arcs are collapsed, and so there is then
a two node cycle: \emph{rcmod}(woman, introduced) and \emph{nsubj}(introduced, woman).
These cycles can occur at the ``top'' of the graph when an NP is the head of the
sentence, given the treatment of copula verbs (as in \emph{She is the woman who introduced me.}). This used to
mean that the dependency graph didn't have a clear root. This was fixed after
version 1.6.8 by explicitly adding a \emph{root} arc to the representation.
There can be multiple arcs with the same label from a node. For instance, this
occurs when a noun has several adjective modifiers, each of which gets an
\emph{amod} relation, as in \emph{its third consecutive monthly decline}.
% CDM Jun 2013: The rel case shouldn't happen any more. Are there other cases?
% Yes, it does, but only due to converter bugs, I think.
% There can be multiple arcs between two nodes with different labels in the basic
% plus extras representation. A relative word can be labeled both as a \emph{rel}
% and as its effective grammatical relation. For example, for \emph{the company
% which you founded}, using the basic plus extras style, you get both the arcs
% \emph{dobj}(founded-7, which-5) and
% \emph{rel}(founded-7, which-5).
In the basic plus extras representation, a word can be the dependent
of two different words. For example, a relative word will be a
\emph{ref} of the head of the noun phrase it modifies and will have a
role in the relative clause. For example you might get both the arcs
\emph{ref}(researchers-5, who-6) and \emph{nsubj}(studied-7,
who-6). You can even get two arcs between the same pair of words,
though these normally result from bugs in the converter.
All graphs should be connected (if there are disconnected graphs, it's a bug!).
There are no self-loops in the graphs.
\section{In practice}\label{in_practice}
In practice, two classes can be used to get the typed dependencies of a sentence using the code in the Stanford parser (downloadable at \textsf{https://nlp.stanford.edu/software/lex-parser.html}).
If you need to parse texts and want to get different formatting options for the parse tree, you should use this class. To get the dependencies, add \texttt{typedDependencies} in the \texttt{-outputFormat} option. By default, this will give you collapsed dependencies with propagation of conjunct dependencies. If you want another representation, specify it in the \texttt{-outputFormatOptions} using the following commands according to the type of dependency representation you want:
If you already have Penn treebank-style trees (whether hand-annotated or as output from another parser), you can use this class to get the Stanford dependencies.
\paragraph{Command-line usage.} Use the \texttt{-treeFile} option as shown in the command line example below. The options to get the different types of representation are as follows:
\>\texttt{-collapsed}\>\> collapsed dependencies (not necessarily a tree structure)\\
\>\texttt{-CCprocessed}\>\> collapsed dependencies with propagation of conjunct \\
\>\>\> dependencies (not necessarily a tree structure)\\
\>\texttt{-collapsedTree}\>\> collapsed dependencies that preserve a tree structure\\
\>\texttt{-nonCollapsed}\>\> non-collapsed dependencies: basic dependencies as well as\\
\>\>\> the extra ones which do not preserve a tree structure\\
\>\texttt{-conllx}\>\> dependencies printed out in CoNLL X (CoNLL 2006) format \\
\>\texttt{-originalDependencies}\>\> output the original Stanford Dependencies instead of \\
\>\>\> the new Universal Dependencies.
\end{tabbing}
\noindent If you want the non-collapsed version of the dependencies where the basic ones are separated from the extra ones, add the flag \texttt{-extraSep}. This will print the basic dependencies, a separator (======) and the extra dependencies.
By default, punctuation dependencies are not printed. If you want
\noindent This class can read files that contain Stanford dependencies
in the CoNLL format (i.e., the basic Stanford dependencies), and
transform them into another representation (e.g., the CCprocessed
representation). To do this, you need to pass the input file using the
option \texttt{-conllxFile}.
\bigskip
\noindent You can also use this class to parse texts, but the input has to be formatted as strictly one sentence per line, and you will not be able to specify options for the parse tree output on the command line. You will only be able to specify the type of the dependencies. Use the option \texttt{-sentFile} instead of \texttt{-treeFile}. You will need to specify the parser file using the \texttt{-parserFile} option. You can print the parse tree by using the \texttt{-parseTree} option.
tree &\texttt{gs.typedDependenciesCollapsedTree()}\\
\end{tabular}
\end{quote}
\subsubsection*{$\star$\textbf{GrammarScope}}
Bernard Bou has written \textsf{GrammarScope}, a GUI interface to the Stanford
Dependencies representation, which allows not only viewing
dependencies, but altering their definitions. This is a separate download. It is available at:
\url{http://grammarscope.sourceforge.net/}.
\subsubsection*{$\star$\textbf{Other parsers}}
A number of dependency parsers have now been trained to parse directly
to the basic Stanford Dependencies, including MaltParser, DeSR,
MSTParser, and Stanford's Neural Network Dependency Parser. Several of these parsers distribute models trained for
Stanford Dependencies parsing, including MaltParser, the Easy First
Parser, and the Stanford Neural Network Dependency Parser. If desired, these parses can then be postprocessed to the collapsed or CCprocessed representation using the \texttt{-conllxFile} option of \texttt{EnglishGrammaticalStructure}, as discussed above.
Any Penn Treebank constituency parser can be used to produce Stanford
Dependencies by using our conversion tool to convert the output of other constituency parsers to the Stanford Dependencies representation. For more information on other parser options, see:
but the BioInfer corpus is the main source of gold-standard SD data which is currently available.
In the recent BioNLP 2009 Shared Task, many of the leading teams built their relation extraction systems over the Stanford Dependency representation \citep{kim09overview}. It was used by the teams that came 1st, 3rd, 4th, and 5th in Task 1, by the team who came first in Task 2, and by the teams who came 1st and 2nd in Task 3. In the BioNLP 2011 shared task, every team used it \citep{BioNLP11}.
\end{sloppypar}
The SD representation has also been used in other domains. It is a common representation for
extracting opinions, sentiment, and relations
\citep{Zhuang06cikm,Meena07sentiment,Banko07,Zouaq06tai,Zouaq07tel,chaumartin07knowledge,kessler08icwsm,Haghighi10,Hassan10,Joshi2010,Wu2010,Zouaq10}, as well as specific information (such as event, time or dialogue acts) \citep{Chambers11,McClosky12,Kluwer10}. The tool has been consistently used by several groups in the \textsc{Pascal}/NIST challenges targeting textual entailment \citep{adams-EtAl:2007:WTEP,blake:2007:WTEP,chambers-EtAl:2007:WTEP,harmeling:2007:WTEP,wang-neumann:2007:WTEP,Malakasiotis09,Mehdad09,Shivare2010,Glinos2010,Kouylekov2010,Pakray2011a}. It is also used for a variety of other tasks, such as unsupervised semantic parsing \citep{poon09unsupervised}, coreference resolution, disagreement detection and word sense induction \citep{Chen12,Abbott11,Lau12}, as well as being part of the preprocessing for machine translation systems by several groups \citep{xu09using,genzel10automatically,singh10statistical}.
The Stanford Dependencies representation
was also used to evaluate dependency parsers in the 2012 shared task on parsing the web \citep{Petrov12}.
The Stanford dependency representation has also served as a model for
developing dependency schemes for other languages. The Chinese Stanford