Dependency Parsing
Introduction
Christopher Manning
Dependency Grammar and �Dependency Structure
Dependency syntax postulates that syntactic structure consists of lexical items linked by binary asymmetric relations (“arrows”) called dependencies
The arrows are commonly typed with the name of grammatical relations (subject, prepositional object, apposition, etc.)
submitted
Bills
were
Brownback
Senator
nsubjpass
auxpass
prep
nn
immigration
conj
by
cc
and
ports
pobj
prep
on
pobj
Republican
Kansas
pobj
prep
of
appos
Christopher Manning
Relation between phrase structure and dependency structure
Christopher Manning
Methods of Dependency Parsing
You can do it similarly to lexicalized PCFG parsing: an O(n5) algorithm
Eisner (1996) gives a clever algorithm that reduces the complexity to O(n3), by producing parse items with heads at the ends rather than in the middle
You create a Maximum Spanning Tree for a sentence
McDonald et al.’s (2005) MSTParser scores dependencies independently using a ML classifier (he uses MIRA, for online learning, but it could be MaxEnt)
Edges are eliminated that don’t satisfy hard constraints. Karlsson (1990), etc.
Greedy choice of attachments guided by machine learning classifiers
MaltParser (Nivre et al. 2008) – discussed in the next segment
Christopher Manning
Dependency Conditioning Preferences
What are the sources of information for dependency parsing?
Dependencies rarely span intervening verbs or punctuation
How many dependents on which side are usual for a head?
ROOT Discussion of the outstanding issues was completed .
Christopher Manning
Quiz question!
Retail sales drop in April cools afternoon market trading.
Christopher Manning
Dependency Parsing
Introduction
Christopher Manning
Greedy Transition-Based Parsing
MaltParser
Christopher Manning
MaltParser�[Nivre et al. 2008]
Christopher Manning
Basic transition-based dependency parser
Start: σ = [ROOT], β = w1, …, wn , A = ∅
Finish: β = ∅
Notes:
Christopher Manning
Actions (“arc-eager” dependency parser)
Start: σ = [ROOT], β = w1, …, wn , A = ∅
Precondition: r’ (wk, wi) ∉ A, wi ≠ ROOT
Precondition: r’ (wk, wi) ∈ A
Finish: β = ∅
This is the common “arc-eager” variant: a head can immediately take a right dependent, before its dependents are found
Christopher Manning
Example
Happy children like to play with their friends .
[ROOT] [Happy, children, …] ∅
Shift [ROOT, Happy] [children, like, …] ∅
LAamod [ROOT] [children, like, …] {amod(children, happy)} = A1
Shift [ROOT, children] [like, to, …] A1
LAnsubj [ROOT] [like, to, …] A1 ∪ {nsubj(like, children)} = A2
RAroot [ROOT, like] [to, play, …] A2 ∪{root(ROOT, like) = A3
Shift [ROOT, like, to] [play, with, …] A3
LAaux [ROOT, like] [play, with, …] A3∪{aux(play, to) = A4
RAxcomp [ROOT, like, play] [with their, …] A4∪{xcomp(like, play) = A5
Precondition: (wk, r’, wi) ∉ A, wi ≠ ROOT
Precondition: (wk, r’, wi) ∈ A
Christopher Manning
Example
Happy children like to play with their friends .
RAxcomp [ROOT, like, play] [with their, …] A4∪{xcomp(like, play) = A5
RAprep [ROOT, like, play, with] [their, friends, …] A5∪{prep(play, with) = A6
Shift [ROOT, like, play, with, their] [friends, .] A6
LAposs [ROOT, like, play, with] [friends, .] A6∪{poss(friends, their) = A7
RApobj [ROOT, like, play, with, friends] [.] A7∪{pobj(with, friends) = A8
Reduce [ROOT, like, play, with] [.] A8
Reduce [ROOT, like, play] [.] A8
Reduce [ROOT, like] [.] A8
RApunc [ROOT, like, .] [] A8∪{punc(like, .) = A9
You terminate as soon as the buffer is empty. Dependencies = A9
Precondition: (wk, r’, wi) ∉ A, wi ≠ ROOT
Precondition: (wk, r’, wi) ∈ A
Christopher Manning
MaltParser�[Nivre et al. 2008]
Christopher Manning
Evaluation of Dependency Parsing: �(labeled) dependency accuracy
ROOT She saw the video lecture
0 1 2 3 4 5
Gold
Parsed
Acc = # correct deps
# of deps
UAS = 4 / 5 = 80%
LAS = 2 / 5 = 40%
Christopher Manning
Representative performance numbers
Parser | UAS% |
Sagae and Lavie (2006) ensemble of dependency parsers | 92.7 |
Charniak (2000) generative, constituency | 92.2 |
Collins (1999) generative, constituency | 91.7 |
McDonald and Pereira (2005) – MST graph-based dependency | 91.5 |
Yamada and Matsumoto (2003) – transition-based dependency | 90.4 |
Christopher Manning
Projectivity
Who did Bill buy the coffee from yesterday ?
Christopher Manning
Handling non-projectivity
Christopher Manning
Greedy Transition-Based Parsing
MaltParser
Christopher Manning
Dependencies encode relational structure
Relation Extraction with Stanford Dependencies
Christopher Manning
Dependency paths identify �relations like protein interaction
[Erkan et al. EMNLP 07, Fundel et al. 2007]
KaiC 🡸nsubj interacts prep_with🡺 SasA
KaiC 🡸nsubj interacts prep_with🡺 SasA conj_and🡺 KaiA
KaiC 🡸nsubj interacts prep_with🡺 SasA conj_and🡺 KaiB
demonstrated
results
KaiC
interacts
rythmically
nsubj
The
compl
det
ccomp
that
nsubj
KaiB
KaiA
SasA
conj_and
conj_and
advmod
prep_with
Christopher Manning
Stanford Dependencies
[de Marneffe et al. LREC 2006]
jumped
boy
over
the
the
little
prep
nsubj
det
amod
pobj
fence
det
Christopher Manning
Graph modification to facilitate semantic analysis
Bell, based in LA, makes and distributes
electronic and computer products.
makes
and
nsubj
dobj
products
computer
conj
cc
and
electronic
amod
Bell
in
prep
partmod
based
pobj
LA
cc
conj
distributes
Christopher Manning
Graph modification to facilitate semantic analysis
Bell, based in LA, makes and distributes
electronic and computer products.
makes
nsubj
dobj
products
computer
conj_and
electronic
amod
Bell
prep_in
partmod
based
LA
conj_and
distributes
amod
nsubj
Christopher Manning
BioNLP 2009/2011 relation extraction shared tasks [Björne et al. 2009]
Christopher Manning
Dependencies encode relational structure
Relation Extraction with Stanford Dependencies
Christopher Manning