Dependency Parsing CMSC 723 / LING 723 / INST 725 M ARINE C ARPUAT - - PowerPoint PPT Presentation

dependency parsing
SMART_READER_LITE
LIVE PREVIEW

Dependency Parsing CMSC 723 / LING 723 / INST 725 M ARINE C ARPUAT - - PowerPoint PPT Presentation

Dependency Parsing CMSC 723 / LING 723 / INST 725 M ARINE C ARPUAT marine@cs.umd.edu Slides credit: Joakim Nivre & Ryan McDonald T odays Agenda Formalizing dependency graphs Formalizing transition-based parsing most material


slide-1
SLIDE 1

Dependency Parsing

CMSC 723 / LING 723 / INST 725 MARINE CARPUAT

marine@cs.umd.edu

Slides credit: Joakim Nivre & Ryan McDonald

slide-2
SLIDE 2

T

  • day’s Agenda
  • Formalizing dependency graphs
  • Formalizing transition-based parsing

most material based on Kubler, McDonald & Nivre

slide-3
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
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
SLIDE 5

INT NTUITIO TION: N: SHI HIFT-RED REDUCE UCE PAR ARSE SER + C + CLASS ASSIFIER IFIER

slide-6
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
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
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
SLIDE 9

FOR ORMA MALIZ IZING ING DE DEPE PENDENC NDENCY Y REPRE PRESENT SENTATIO TIONS NS

slide-10
SLIDE 10

Dependency Graphs

slide-11
SLIDE 11

Dependency Graph Notation

slide-12
SLIDE 12

Properties of Dependency Trees

slide-13
SLIDE 13
slide-14
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
SLIDE 15

TR TRAN ANSITIO ITION-BASED BASED DE DEPE PENDENC NDENCY Y PAR ARSER SER

slide-16
SLIDE 16

Dependency relations: Formal representation

slide-17
SLIDE 17

Transition-based parsing

slide-18
SLIDE 18

Transition-based parsing

slide-19
SLIDE 19

Deterministic parsing with an oracle

slide-20
SLIDE 20

Stack-based transition system

slide-21
SLIDE 21

Transitions & Preconditions

slide-22
SLIDE 22

Let’s try it out…

slide-23
SLIDE 23

A few steps illustrated…

slide-24
SLIDE 24

A few steps illustrated…

slide-25
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
SLIDE 26

Theoretical Results

  • Time & Space Complexity
  • O(n), where n = input sentence length!
  • Assuming oracle & transition functions can be

computed in constant time