SLIDE 1 Dependency Parsing
CMSC 723 / LING 723 / INST 725 MARINE CARPUAT
marine@cs.umd.edu
Slides credit: Joakim Nivre & Ryan McDonald
SLIDE 2 T
- day’s Agenda
- Formalizing dependency graphs
- Formalizing transition-based parsing
most material based on Kubler, McDonald & Nivre
SLIDE 3 Dependencies
- Typed: Label indicating relationship between words
- Untyped: Only which words depend
I saw a girl with a telescope
nsubj prep dobj det det pobj
I saw a girl with a telescope
SLIDE 4 Data-driven dependency parsing
Goal: learn a good predictor of dependency graphs Input: x Output: dependency graph/tree G Can be framed as a structured prediction task
- very large output space
- with interdependent labels
SLIDE 5
INT NTUITIO TION: N: SHI HIFT-RED REDUCE UCE PAR ARSE SER + C + CLASS ASSIFIER IFIER
SLIDE 6 Shift-Reduce
- Process words one-by-one left-to-right
- Two data structures
- Queue of unprocessed words
- Stack of partially processed words
- At each point choose one action
- shift: move one word from queue to stack
- reduce left: top word on stack is head of second word
- reduce right: second word on stack is head of top word
- Learn how to choose each action with a classifier
SLIDE 7 Shift Reduce Example
I saw a girl
Queue Stack
shift saw a girl I shift a girl I saw r left a girl saw I girl saw I shift a shift girl saw I a r left
Queue Stack
girl saw I a r right girl saw I a
SLIDE 8 Classification for Shift-Reduce
- Given a state:
- Which action do we choose?
- Correct actions → correct tree
girl saw I a
shift
Queue Stack
?
girl saw I a
r left ?
girl saw I a
r right ?
girl saw I a
SLIDE 9
FOR ORMA MALIZ IZING ING DE DEPE PENDENC NDENCY Y REPRE PRESENT SENTATIO TIONS NS
SLIDE 10
Dependency Graphs
SLIDE 11
Dependency Graph Notation
SLIDE 12
Properties of Dependency Trees
SLIDE 13
SLIDE 14 Non-Projectivity
- Most theoretical frameworks do not assume projectivity
- Non-projective structures are needed to represent
– Long-distance dependencies – Free word order
SLIDE 15
TR TRAN ANSITIO ITION-BASED BASED DE DEPE PENDENC NDENCY Y PAR ARSER SER
SLIDE 16
Dependency relations: Formal representation
SLIDE 17
Transition-based parsing
SLIDE 18
Transition-based parsing
SLIDE 19
Deterministic parsing with an oracle
SLIDE 20
Stack-based transition system
SLIDE 21
Transitions & Preconditions
SLIDE 22
Let’s try it out…
SLIDE 23
A few steps illustrated…
SLIDE 24
A few steps illustrated…
SLIDE 25 Answer: Full sequence of transitions
- 1. Shift: economy1
- 2. Left-Arc: news2 -> economy1
- 3. Shift: news2
- 4. Left-arc: had3->news2
- 5. Shift: had3
- 6. Shift: little4
- 7. Left-arc: effect5->little4
- 8. Shift: effects5
9. Shift: on6
- 10. Shift: financial7
- 11. Left-Arc: markets8->financial7
- 12. Right-Arc: on6->markets8
- 13. Right-Arc: on6->effect5
- 14. Right-Arc: had3-> effect5
- 15. Right-Arc: root->add3
- 16. Left-arc: period->root
- 17. Shift
SLIDE 26 Theoretical Results
- Time & Space Complexity
- O(n), where n = input sentence length!
- Assuming oracle & transition functions can be
computed in constant time