Type-driven Incremental Semantic Parsing with Polymorphism Kai - - PowerPoint PPT Presentation

type driven incremental semantic parsing with polymorphism
SMART_READER_LITE
LIVE PREVIEW

Type-driven Incremental Semantic Parsing with Polymorphism Kai - - PowerPoint PPT Presentation

Type-driven Incremental Semantic Parsing with Polymorphism Kai Zhao and Liang Huang City University of New York The Problem weakly supervised semantic fully supervised semantic parsing parsing aka. parsing from Q/A pairs


slide-1
SLIDE 1

Type-driven Incremental Semantic Parsing with Polymorphism

Kai Zhao and Liang Huang City University of New York

slide-2
SLIDE 2

The Problem

  • fully supervised semantic

parsing

  • analogous to MT

Input

What states border Texas?

Output

λx.state(x) ∧ borders(x, texas)

  • weakly supervised semantic

parsing

  • aka. parsing from Q/A pairs

Input

What states border Texas?

Output

{LA,AR,OK,NM}

slide-3
SLIDE 3

The Problem

  • fully supervised semantic

parsing

  • analogous to MT

Input

What states border Texas?

Output

λx.state(x) ∧ borders(x, texas)

slide-4
SLIDE 4

The Problem

  • fully supervised semantic

parsing

  • analogous to MT

Input

What states border Texas?

Output

λx.state(x) ∧ borders(x, texas)

slide-5
SLIDE 5

Challenges

  • Unknown Derivation
  • Use Latent Variable
  • Unknown Grammar
  • i.e., English phrases <-> predicates
  • Learn both derivation & grammar
slide-6
SLIDE 6

Related Work

  • Kwiatkowski et al., 2013
  • learn from Q/A pairs
  • based on CCG
  • CKY parsing => underspecified semantics
  • Structural transform to match underspecified

semantics to known predicates

  • collapse/expand underspecified predicates
slide-7
SLIDE 7

Our Work

  • incremental parsing (aka shift-reduce)
  • abandon CCG, use type to guide parsing
  • subtyping hierarchy and polymorphic functions
  • simultaneous grounding
slide-8
SLIDE 8

Decoding

  • Type-driven Incremental Parsing
  • Stack + Queue
  • Actions:
  • SHIFT: pop a word from queue, push its grounded

semantic expr. onto stack

  • use templates triggered by POS tags/patterns
  • REDUCE: function application (type-driven)
  • SKIP
slide-9
SLIDE 9

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

Stack Type Constraints

φ

Queue:

slide-10
SLIDE 10

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SKIP

Stack Type Constraints

φ

Queue:

slide-11
SLIDE 11

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SKIP Stack Type Constraints

φ

Queue:

slide-12
SLIDE 12

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SKIP the Queue: capital …

Stack Type Constraints

φ

slide-13
SLIDE 13

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT capital Queue: of …

Stack Type Constraints

λP : ' b → ' c . (λx : ' b . (P x))

slide-14
SLIDE 14

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT capital Queue: of …

Stack Type Constraints

λP : ' b → ' c . (λx : ' b . (P x))

capital : st → ct

slide-15
SLIDE 15

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT capital Queue: of …

Stack Type Constraints

st → ct <: ' b → ' c

λx : ' b . (capital : st → ct x)

slide-16
SLIDE 16

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT capital Queue: of …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

slide-17
SLIDE 17

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SKIP of Queue: the …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

slide-18
SLIDE 18

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SKIP the Queue: largest …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

slide-19
SLIDE 19

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT largest Queue: state …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

λP : (' a → t) → (' a → i) → ' a . λx : ' a → t . λy : ' a → i . (P x y)

slide-20
SLIDE 20

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT largest Queue: state …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

λP : (' a → t) → (' a → i) → ' a . λx : ' a → t . λy : ' a → i . (P x y)

argmax : (' b → t) → (' b → i) → ' b

slide-21
SLIDE 21

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT largest Queue: state …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

λx : ' a → t . λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a x y)

(' b → t) → (' b → i) → ' b <: (' a → t) → (' a → i) → ' a

slide-22
SLIDE 22

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT largest Queue: state …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

λx : ' a → t . λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a x y)

slide-23
SLIDE 23

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT state Queue: by …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

λx : ' a → t . λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a x y)

λx : ' c . (state : st → t x)

' c <: st

slide-24
SLIDE 24

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT state Queue: by …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st

λx : ' a → t . λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a x y)

λx : ' c . (state : st → t x)

' c <: st

slide-25
SLIDE 25

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT state Queue: by …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st ' c <: st

' c → t <: ' a → t

λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a λx : ' c . (state : st → t x) y)

slide-26
SLIDE 26

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT state Queue: by …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st ' c <: st

λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a λx : ' c . (state : st → t x) y)

' a <: ' c

slide-27
SLIDE 27

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SKIP by Queue: area …

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st ' c <: st

λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a λx : ' c . (state : st → t x) y)

' a <: ' c

slide-28
SLIDE 28

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

SHIFT area Queue: φ

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st ' c <: st

λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a λx : ' c . (state : st → t x) y)

' a <: ' c

λx : ' d . (size : lo → i x)

' d <: lo

slide-29
SLIDE 29

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

REDUCE Queue: φ

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st ' c <: st

λy : ' a → i . (argmax : (' a → t) → (' a → i) → ' a λx : ' c . (state : st → t x) y)

' a <: ' c

λx : ' d . (size : lo → i x)

' d <: lo

slide-30
SLIDE 30

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

REDUCE Queue: φ

Stack Type Constraints

λx : ' b . (capital : st → ct x)

' b <: st ' c <: st

' a <: ' c

' d <: lo

(argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y)))

slide-31
SLIDE 31

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

REDUCE Queue: φ

Stack Type Constraints (capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

' c <: st

' a <: ' c

' d <: lo

slide-32
SLIDE 32

A Running Example

What is the capital of the largest state by area ? WP VBZ DT NN IN DT JJS NN IN NN

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

' c <: st

' a <: ' c

' d <: lo

slide-33
SLIDE 33

Learning

  • Both derivation/Grammar are Unknown
  • Spurious Ambiguity
  • Various derivations/groundings lead to the same

logical form

  • Latent Variable
  • Structured Perceptron =>

Latent Variable Structured Perceptron

slide-34
SLIDE 34

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

slide-35
SLIDE 35

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

slide-36
SLIDE 36

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

slide-37
SLIDE 37

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

(size : st → i (argmin : (' a → t) → (' a → i) → ' a (λx : ' c . (city : ct → t x)) (λy : ' d . (population : au → i y))))

slide-38
SLIDE 38

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

full search space

(size : st → i (argmin : (' a → t) → (' a → i) → ' a (λx : ' c . (city : ct → t x)) (λy : ' d . (population : au → i y))))

slide-39
SLIDE 39

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

full search space b e a m

highest-scoring derivation

ˆ d

(size : st → i (argmin : (' a → t) → (' a → i) → ' a (λx : ' c . (city : ct → t x)) (λy : ' d . (population : au → i y))))

slide-40
SLIDE 40

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

full search space b e a m

highest-scoring derivation

ˆ d

(size : st → i (argmin : (' a → t) → (' a → i) → ' a (λx : ' c . (city : ct → t x)) (λy : ' d . (population : au → i y))))

REWARD

slide-41
SLIDE 41

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

full search space b e a m

highest-scoring derivation

ˆ d

(size : st → i (argmin : (' a → t) → (' a → i) → ' a (λx : ' c . (city : ct → t x)) (λy : ' d . (population : au → i y))))

REWARD PENALIZE

slide-42
SLIDE 42

Learning

What is the capital of the largest state by area ?

(capital : st → ct (argmax : (' a → t) → (' a → i) → ' a (λx : ' c . (state : st → t x)) (λy : ' d . (size : lo → i y))))

forced decoding space

highest-scoring gold derivation

d∗

full search space b e a m

highest-scoring derivation

ˆ d

(size : st → i (argmin : (' a → t) → (' a → i) → ' a (λx : ' c . (city : ct → t x)) (λy : ' d . (population : au → i y))))

REWARD PENALIZE

penalize wrong

w ← w + Φ(x, d∗) − Φ(x, ˆ d)

reward correct

slide-43
SLIDE 43

Experiments

  • High decoding speed; Linear in theory & practice
  • 0.5 sec/sentence
  • GeoQuery

Type Hierarchy

79 81.25 83.5 85.75 88 Recall

Z&C '05 Z&C '07 UBL

  • ur work
slide-44
SLIDE 44

Conclusion

  • Polymorphic typing guides the parsing
  • Linear time incremental parsing
  • Simultaneous grounding
  • Learning w/ Latent Variable Structured Perceptron