Combinatory Categorial Grammars Lexicalized Semantically Guided - - PowerPoint PPT Presentation

combinatory categorial grammars
SMART_READER_LITE
LIVE PREVIEW

Combinatory Categorial Grammars Lexicalized Semantically Guided - - PowerPoint PPT Presentation

Combinatory Categorial Grammars Lexicalized Semantically Guided Syntax Yonatan Bisk 1 The People (a very abridged version) Theory Data and Parsers Weakly Supervised Parsing Me! Dan Garrette (Google) Mark Steedman (Edinburgh) Jason


slide-1
SLIDE 1

Yonatan Bisk

Combinatory Categorial Grammars

Lexicalized Semantically Guided Syntax

1

slide-2
SLIDE 2

The People (a very abridged version)

Mark Steedman (Edinburgh) Jason Baldridge (Google)

Theory

Julia Hockenmaier (UIUC)

Data and Parsers

Stephen Clark (Cambridge)James Curran (Sydney) Mike Lewis (FAIR)

Efficient Parsing

Luke Zettlemoyer (UW) Yoav Artzi (Cornell) Siva Reddy (McGill)

Semantic Parsing

Me! Dan Garrette (Google)

Weakly Supervised Parsing

Mirella Lapata Adam Lopez Johan Boss Cem Bozsahin
 Michael White …

2

slide-3
SLIDE 3

Where is syntax?

Sally ate dinner Sally ate dinner VP S

  • Hierarchical syntactic labels
  • Where did the labels come from?
  • Are all VPs the same? …
  • Semantic labels
  • How do you represent long-distance effect?
  • Are all languages really tree-structured?

nsubj dobj

3

slide-4
SLIDE 4

Where is syntax?

Sally, who ran home, ate dinner VP ? VP VP S Sally, who ran home, ate dinner

nsubj dobj dobj ?

4

slide-5
SLIDE 5

Where is syntax?

Sally, who ran home, ate dinner

ran( ?, home) ate( ?, dinner) ran(Sally, home) ate(Sally, dinner) ^

Sentence Sentence Noun Noun Noun

5

slide-6
SLIDE 6

Syntax as Functions

Sally ate

ate( Sally ) \ Sentence Noun

N S\N S

ate( X ) Sally

Function Application

S\N is a function that if applied to a N on the left returns an S

Grammar:

Sally: N ate: S\N

Every word is a function

  • r an argument

6

slide-7
SLIDE 7

Syntax as Functions

Sally ate dinner (S\N)/N N S\N

Functions returning functions Grammar:

Sally: N dinner: N ate: S\N, (S\N)/N

N N ? S\N S

7

slide-8
SLIDE 8

Syntax as Functions

Sally ate the dinner

Grammar:

Sally: N dinner: N ate: S\N, (S\N)/N the: N/N

N N S\N S (S\N)/N N ?

?: Takes in N (on right) and returns N

N/N

N/N

8

slide-9
SLIDE 9

Syntax as Semantics

Sally ate the dinner

N N S\N S (S\N)/N N N/N the(dinner) ate(X, the(dinner)) ate(Sally, the(dinner)) the(x) ate(x,y)

9

slide-10
SLIDE 10

Function Composition

Sally quickly ate the dinner

N N S\N S (S\N)/N N N/N

quickly(ate(X, the(dinner))) quickly(ate(Sally, the(dinner)))

S/S (S\N)/N (S\N)/N

S/S (S\N)/N

the(dinner) quickly(ate(X,Y))

???

10

slide-11
SLIDE 11

Recap

Sally N dinner N the N/N ate S\N, (S\N)/N quickly S/S

Grammar Function Math

X/Y Y\Z X\Z Y/Z X\Y X/Z Y\Z X\Y X\Z X/Y Y X Y X\Y X

Application

X/Y Y/Z X/Z

Composition

11

slide-12
SLIDE 12

Puzzle Time

Sally who ran home ate dinner

(S\N)/N (S\N)/N N N N ??? (N\N)/(S\N) S\N S\N What is a relative clause?

A noun modifier

N\N N S ran(Sally, home) ate(Sally, dinner)

12

slide-13
SLIDE 13

Unification & Dependencies

Sally who ran home

(S\N)/N N N (N\N)/(S\N)

N N N N N N N

(S\N)/N Arg1 (S\N)/N Arg2

Note: These are more fine-grained labels than nsubj/dobj

ran(Sally, home)

13

slide-14
SLIDE 14

Coordination

Sally home ran ate and dinner

Dependency Grammar CCG Dependency Grammar

Sally home ran ate and dinner

14

slide-15
SLIDE 15

Coordination

Sally but heard heard John and

Dependency Grammar CCG Dependency Grammar

saw the explosion Sally but heard heard John and saw the explosion

15

slide-16
SLIDE 16

Coordination

apple and orange X conj conj X[conj] X[conj] X heard and saw

N conj N S\N conj S\N N[conj] N S\N[conj] S\N N N N

16

slide-17
SLIDE 17

Side note: Crossing Dependencies Are Real

I ate the red and yellow, apple and banana, respectively

ik Maria Hans zag helpen zwimmen NP NP NP (S\NP)/S ((S\NP)\NP)/(S\NP) S\NP

>

(S\NP)\NP

>B×

((S\NP)\NP)\NP

<

(S\NP)\NP

<

S\NP

<

S

S

17

slide-18
SLIDE 18

Puzzle Time

Sally heard and John saw the explosion

N N (S\N)/N N (S\N)/N conj

What should apply to what?

18

slide-19
SLIDE 19

Puzzle Time

Sally heard and John saw the explosion

N N (S\N)/N N (S\N)/N conj S/N S/N S/N

19

slide-20
SLIDE 20

Puzzle Time

Sally heard

N (S\N)/N S/N

Fill Arg 1 before Arg 2

Sally heard

N (S\N)/N S/(S\N) S/N

Type-Raising

N N N S S S S

20

slide-21
SLIDE 21

Lexicon & Rules

Sally N dinner N the N/N ate S\N, (S\N)/N quickly S/S and conj

Grammar

X/Y Y X Y X\Y X X/Y Y/Z X/Z X/Y Y\Z X\Z Y/Z X\Y X/Z Y\Z X\Y X\Z

Application Composition

X conj X[conj] X[conj] X X

Conjunction

N S/(S\N) N S\(S/N)

Type-Raising

21

slide-22
SLIDE 22

That’s it! Just make up categories

22

slide-23
SLIDE 23

Puzzle Time

Sally ate

N (S\N)/N

with tuna

N ??? (N\N)/N N\N N S\N S

sushi

N

23

slide-24
SLIDE 24

Puzzle Time

Sally ate

N S\N

with chopsticks

N ??? (S\S)/N S\S S\N S

24

slide-25
SLIDE 25

Sweeping things under the rug

  • It’s really just S, N, and conj? Well… no



 NP , PP

  • Ok, so 5 categories? Sorta…



 S[adj], S[dcl], S[b],… NP[nb], …

  • OK, but we did learn all the rules right? 



 Ugh,… “Yes” — ignore Type-Changing, it’s not really real…

  • Are you lying to make this formalism sound prettier then it really is?

🤬

25

slide-26
SLIDE 26

The dirty …

The man

N S\N

promoted yesterday was fired

S\S S/S S\N S\N N N\N

🪅

S\N S

As I said, everything is perfect, there are no questions, everyone is happy with this result. CCG is beautiful and perfect.

26

slide-27
SLIDE 27

Why CCG?

Sally, who ran home, ate dinner

ran(Sally, home) ate(Sally, dinner)

λy.λx.f(x, y)

ran (S\N)/N

λy.λx.run(x, y)

ate (S\N)/N

λy.λx.eat(x, y)

who (N\N)/(S\N)

λf.f

Could be SQL, SPARQL, python, etc

27

slide-28
SLIDE 28

Modeling

How should we define a probabilistic model?

S N S\N S\S S\N

Sally ate with chopsticks

N (S\S)/N

28

P( N, S\N | S ) P(S\N, S\S | S\N)
 P( (S\S)/N, N | S\S)

slide-29
SLIDE 29

Modeling

Supertagging

N S\N S S\N S\S

Sally ate with chopsticks

N (S\S)/N

Input: Labels:

S S\S S

Normal-form parsing for Combinatory Categorial Grammars with generalized composition and type-raising — Hockenmaier 2010 A* CCG Parsing with a Supertag-factored Model Lewis 2014 — http://4.easy-ccg.appspot.com/do_parse?sentence=Fruit+flies+like+a+banana&nbest=5

29

slide-30
SLIDE 30

Supertag LSTM Analysis

Supertagging with LSTMs Vaswani 2016

30

slide-31
SLIDE 31

Modeling the Arguments

S

N (S\N)/N S\N N S\N N/N N N (S\N)/N

Y = N Combinator = <B0 Y = N Combinator = >B0 Y = N Combinator = >B0

An HDP Model for Inducing Combinatory Categorial Grammars — Bisk 2013

31

slide-32
SLIDE 32

English Arabic Big Ball N/N N ةركةريبك N N\N (ball) (big)

Obj Adj

32

Obj Adj

Induced Lexicons: Adjectives

slide-33
SLIDE 33

Child Directed Speech Arabic

The man wrote a letter N (S\N)/N N

∅ write a letter S/N

N

بتكلاجرلاةلاسر (S/N)/N N N

(wrote) (the man) (a letter)

O V S

33

English

O V ∅ O V S

Induced Lexicons: Verbs

slide-34
SLIDE 34

English Japanese ran

  • n

beach S\N (S\S)/N N 浜 を ⾛った N (S/S)\N S\N

(beach) (on) (ran)

V O ADP V O ADP

34

Induced Lexicons: Adpositions

slide-35
SLIDE 35

Prepositions can be tricky

Go

S/N

to Boston

N ??? PP/N PP S

Is “to Boston” a modifier?

S/PP

35

slide-36
SLIDE 36

Stolen from Artzi ACL 2013

36

slide-37
SLIDE 37

You parse so you can do something

How does a robot check if it’s at the right location?

Weakly Supervised Learning of Semantic Parsers for Mapping Instructions to Actions — Artzi 2013

Query a knowledge base

Large-scale Semantic Parsing without Question-Answer Pairs — Reddy 2014

37

slide-38
SLIDE 38

Where to learn more?

https://yoavartzi.com/tutorial/ Semantic Parsing and Modeling Linguistics

Mark Steedman

http://jazzparser.granroth-wilding.co.uk/Parser.html

Jazz

38