Professional Documents
Culture Documents
CLEdependencyparsing
CLEdependencyparsing
(Chu-Liu-Edmonds algorithm)
I Dependency trees
I Three main approaches to parsing
I Chu-Liu-Edmonds algorithm
I Arc scoring / Learning
Dependency Parsing - Output
Dependency Parsing
and Czech:
Examples from Non-projective Dependency Parsing using Spanning Tree Algorithms McDonald et al., EMNLP ’05
Dependency Parsing - Approaches
Dependency Parsing Approaches
G = hV , E i =
(O(n2 ) edges)
Example from Non-projective Dependency Parsing using Spanning Tree Algorithms McDonald et al., EMNLP ’05
Arc-Factored Model
etc. . .
The Chu-Liu-Edmonds algorithm finds this argmax.
Example from Non-projective Dependency Parsing using Spanning Tree Algorithms McDonald et al., EMNLP ’05
Arc-Factored Model
etc. . .
The Chu-Liu-Edmonds algorithm finds this argmax.
Example from Non-projective Dependency Parsing using Spanning Tree Algorithms McDonald et al., EMNLP ’05
Arc-Factored Model
etc. . .
The Chu-Liu-Edmonds algorithm finds this argmax.
Example from Non-projective Dependency Parsing using Spanning Tree Algorithms McDonald et al., EMNLP ’05
Chu-Liu-Edmonds
Chu and Liu ’65, On the Shortest Arborescence of a Directed Graph, Science
Sinica
def adjust(e):
e 0 ← copy(e)
e 0 .original ← e
if e.dest ∈ C :
e 0 .dest ← vC
e 0 .kicksOut ← bestInEdge[e.dest]
e 0 .score ← e.score − e 0 .kicksOut.score
elif e.src ∈ C :
e 0 .src ← vC
return e 0
Chu-Liu-Edmonds
bestInEdge
V1
ROOT
V2
V3
a:5 b:1 c :1
kicksOut
a
V1 d : 11 V2 f :5 V3 b
g : 10 i :8
c
d
e :4 e
f
h:9
g
h
i
An Example - Contracting Stage
bestInEdge
V1 g
ROOT
V2
V3
a:5 b:1 c :1
kicksOut
a
V1 d : 11 V2 f :5 V3 b
g : 10 i :8
c
d
e :4 e
f
h:9
g
h
i
An Example - Contracting Stage
bestInEdge
V1 g
ROOT
V2 d
V3
a:5 b:1 c :1
kicksOut
a
V1 d : 11 V2 f :5 V3 b
g : 10 i :8
c
d
e :4 e
f
h:9
g
h
i
An Example - Contracting Stage
bestInEdge
V1 g
ROOT
V2 d
V3
a : 5 − 10 b : 1 − 11 c :1
kicksOut
V4 a g
V1 d : 11 V2 f :5 V3 b d
g : 10 i : 8 − 11
c
d
e :4 e
f
h : 9 − 10 g
h g
i d
An Example - Contracting Stage
bestInEdge
V1 g
ROOT
V2 d
a : −5
V3
V4
b : −10 c :1
kicksOut
a g
V4 f :5 V3 b d
c
d
i : −3
e
e :4 f
h : −1
g
h g
i d
An Example - Contracting Stage
bestInEdge
V1 g
ROOT
V2 d
a : −5
V3 f
V4
b : −10 c :1
kicksOut
a g
V4 f :5 V3 b d
c
d
i : −3
e
e :4 f
h : −1
g
h g
i d
An Example - Contracting Stage
bestInEdge
V1 g
ROOT
V2 d
a : −5
V3 f
V4 h
b : −10 c :1
kicksOut
a g
V4 f :5 V3 b d
c
d
i : −3
e
e :4 f
h : −1
g
h g
i d
An Example - Contracting Stage
bestInEdge
V1 g
ROOT V2 d
V3 f
a : −5 − −1 V4 h
V5
b : −10 − −1 c :1−5
kicksOut
a g, h
V5 b d, h
V4 f :5 V3 c f
d
i : −3 e
f
e :4 g
h : −1 h g
i d
An Example - Contracting Stage
bestInEdge
V1 g
V2 d
V3 f
V4 h
ROOT V5
kicksOut
a g, h
b d, h
b : −9
c f
a : −4 c : −4 d
e f
V5 f
g
h g
i d
An Example - Contracting Stage
bestInEdge
V1 g
V2 d
V3 f
V4 h
ROOT V5 a
kicksOut
a g, h
b d, h
b : −9
c f
a : −4 c : −4 d
e f
V5 f
g
h g
i d
Chu-Liu-Edmonds - Expanding Stage
bestInEdge
V1 g
V2 d
V3 f
V4 h
ROOT V5 a
kicksOut
a g, h
b : −9 b d, h
a : −4 c : −4
c f
d
e f
V5
f
g
h g
i d
An Example - Expanding Stage
bestInEdge
V1 ag
V2 d
V3 f
V4 ah
ROOT V5 a
kicksOut
a g, h
b : −9 b d, h
a : −4 c : −4 c f
d
e f
V5
f
g
h g
i d
An Example - Expanding Stage
bestInEdge
V1 ag
V2 d
ROOT
V3 f
a : −5 V4 ah
V5 a
b : −10 c :1
kicksOut
a g, h
b d, h
V4 f :5 V3 c f
d
i : −3
e f
f
e :4 g
h : −1 h g
i d
An Example - Expanding Stage
bestInEdge
V1 ag
V2 d
ROOT
V3 f
a : −5 V4 ah
V5 a
b : −10 c :1
kicksOut
a g, h
b d, h
V4 f :5 V3 c f
d
i : −3
e f
f
e :4 g
h : −1 h g
i d
An Example - Expanding Stage
bestInEdge
V1 ag
V2 d
ROOT
V3 f
V4 ah
V5 a
a:5 b:1 c :1
kicksOut
a g, h
b d, h
V1 d : 11 V2 f :5 V3 c f
g : 10 i :8
d
e f
e :4 f
g
h:9 h g
i d
An Example - Expanding Stage
bestInEdge
V1 ag
V2 d
ROOT
V3 f
V4 ah
V5 a
a:5 b:1 c :1
kicksOut
a g, h
b d, h
V1 d : 11 V2 f :5 V3 c f
g : 10 i :8
d
e f
e :4 f
g
h:9 h g
i d
Chu-Liu-Edmonds - Notes
I Efficient implementation:
Tarjan ’77, Finding Optimum Branchings, Networks
Not recursive. Uses a union-find (a.k.a. disjoint-set) data
structure to keep track of collapsed nodes.
Chu-Liu-Edmonds - Notes
Features
can look at source (head), destination (child), and arc label.
For example:
I number of words between head and child,
I sequence of POS tags between head and child,
I is head to the left or right of child?
I vector state of a recurrent neural net at head and child,
I vector embedding of label,
I etc.
Learning