Pawan Goyal
CSE, IIT Kharagpur
1 / 48
Basic Idea
Starting from all possible connections, find the maximum spanning tree.
2 / 48
3 / 48
3 / 48
w(G0 ) =
wij k
(i,j,k)G0
4 / 48
5 / 48
wij k
G0 T(G) (i,j,k)G0
Dependency Parsing - Part II
5 / 48
Finding MST
Directed Graph
For each sentence x, define the directed graph Gx = (Vx , Ex ) given by
Vx = {x0 = root, x1 , . . . , xn }
Ex = {(i, j) : i , j, (i, j) [0 : n] [1 : n]}
6 / 48
Finding MST
Directed Graph
For each sentence x, define the directed graph Gx = (Vx , Ex ) given by
Vx = {x0 = root, x1 , . . . , xn }
Ex = {(i, j) : i , j, (i, j) [0 : n] [1 : n]}
Gx is a graph with
the sentence words and the dummy root symbol as vertices and
a directed edge between every pair of distinct words and
a directed edge from the root symbol to every word
6 / 48
Theorem
Every valid dependency graph for sentence x is equivalent to a directed
spanning tree for Gx that originates out of vertex 0
7 / 48
Theorem
Every valid dependency graph for sentence x is equivalent to a directed
spanning tree for Gx that originates out of vertex 0
Three problems
Defining wij k corresponding to a feature space
Learning wij k from gold-standard data
At run-time, inferring the MST for a sentence x using the learnt weights
7 / 48
Theorem
Every valid dependency graph for sentence x is equivalent to a directed
spanning tree for Gx that originates out of vertex 0
Three problems
Defining wij k corresponding to a feature space
Learning wij k from gold-standard data
At run-time, inferring the MST for a sentence x using the learnt weights
7 / 48
Chu-Liu-Edmonds Algorithm
Chu-Liu-Edmonds Algorithm
Each vertex in the graph greedily selects the incoming edge with the
highest weight.
If a tree results, it must be a maximum spanning tree.
If not, there must be a cycle.
I
I
8 / 48
Chu-Liu-Edmonds Algorithm
x = John saw Mary
Build the directed graph
9 / 48
Chu-Liu-Edmonds Algorithm
10 / 48
Chu-Liu-Edmonds Algorithm
If not a tree, identify cycle and contract
Recalculate arc weights into and out-of cycle
11 / 48
Chu-Liu-Edmonds Algorithm
12 / 48
Chu-Liu-Edmonds Algorithm
13 / 48
Chu-Liu-Edmonds Algorithm
Calling the algorithm again on the contracted graph:
14 / 48
Chu-Liu-Edmonds Algorithm
15 / 48
16 / 48
16 / 48
Features
Identities of the words wi and wj for a label lk
head = saw & dependent=with
17 / 48
Features
Part-of-speech tags of the words wi and wj for a label lk
head-pos = Verb & dependent-pos=Preposition
18 / 48
Features
Part-of-speech of words surrounding and between wi and wj
inbetween-pos = Noun
inbetween-pos = Adverb
dependent-pos-right = Pronoun
head-pos-left=Noun
Pawan Goyal (IIT Kharagpur)
19 / 48
Features
Number of words between wi and wj , and their orientation
arc-distance = 3
arc-direction = right
20 / 48
Features
Combinations
head-pos=Verb & dependent-pos=Preposition & arc-label=PP
head-pos=Verb & dependent=with & arc-distance=3
No limit : any feature over arc (i, j, k) or input x
21 / 48
G = arg max
wij k
GT(Gx ) (i,j,k)G
= arg max w
GT(Gx )
f (i, j, k)
(i,j,k)G
22 / 48
G = arg max
wij k
GT(Gx ) (i,j,k)G
= arg max w
GT(Gx )
f (i, j, k)
(i,j,k)G
22 / 48
Inference-based Learning
|T|
w(0) = 0; i = 0
for n : 1..N
for t : 1..|T|
Let G0 = argmaxG0 w(i) .f (G0 )
if G0 , G
w(i+1) = w(i) + f (Gt ) f (G0 )
i = i+1
return wi
23 / 48
24 / 48
Constraint Satisfaction
25 / 48
Constraint Propagation
Three steps
Step 1. Form initial constraint network using a core grammar
Step 2. Remove local inconsistencies
Step 3. If ambiguity remains, add new constraints and repeat step 2.
26 / 48
Senence: Put the block on the floor on the table in the room
Simplified representation: V1 NP2 PP3 PP4 PP5
Correct analysis
27 / 48
Initial Constraints
28 / 48
Initial Constraints
29 / 48
Initial Constraints
30 / 48
Initial Constraints
31 / 48
32 / 48
Modified Tables
33 / 48
Modified Tables
34 / 48
Modified Tables
35 / 48
Modified Tables
36 / 48
Modified Tables
37 / 48
Modified Tables
38 / 48
Modified Tables
39 / 48
Modified Tables
Once every arc has been resolved, we get a unique dependency tree
39 / 48
ramah
. vanam
. gacchati
1.
2.
3.
4.
5.
6.
7.
ramah
{masc.} {sg.} {nom.}
. = rama
ramah
=
r
a
{pr.}
{1p} {pl.}
.
vanam
. = vana {neu.} {sg.} {nom.}
vanam
. = vana {neu.} {sg.} {acc.}
gacchati = gam {pr.} {3p.} {sg.}
gacchati = gam {pr. part.} {masc.} {sg.} {loc.}
gacchati = gam {pr. part.} {neu.} {sg.} {loc.}
40 / 48
1.
2.
3.
4.
5.
6.
7.
ramah
{masc.} {sg.} {nom.}
. = rama
ramah
=
r
a
{pr.}
{1p} {pl.}
.
vanam
. = vana {neu.} {sg.} {nom.}
vanam
. = vana {neu.} {sg.} {acc.}
gacchati = gam {pr.} {3p.} {sg.}
gacchati = gam {pr. part.} {masc.} {sg.} {loc.}
gacchati = gam {pr. part.} {neu.} {sg.} {loc.}
41 / 48
1.
2.
3.
4.
5.
6.
7.
ramah
{masc.} {sg.} {nom.}
. = rama
ramah
=
r
a
{pr.}
{1p} {pl.}
.
vanam
. = vana {neu.} {sg.} {nom.}
vanam
. = vana {neu.} {sg.} {acc.}
gacchati = gam {pr.} {3p.} {sg.}
gacchati = gam {pr. part.} {masc.} {sg.} {loc.}
gacchati = gam {pr. part.} {neu.} {sg.} {loc.}
paths
42 / 48
43 / 48
Figure: Relations
Figure: Adjacency and Possible paths
44 / 48
Figure: Relations
Figure: Adjacency and Possible paths
45 / 48
Figure: Relations
Figure: Adjacency and Possible paths
46 / 48
Figure: Relations
Figure: Adjacency and Possible paths
47 / 48
Figure: Relations
Figure: Adjacency and Possible paths
48 / 48