Yonatan Bisk
Combinatory Categorial Grammars
Lexicalized Semantically Guided Syntax
1
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
Yonatan Bisk
Lexicalized Semantically Guided Syntax
1
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
Sally ate dinner Sally ate dinner VP S
nsubj dobj
3
Sally, who ran home, ate dinner VP ? VP VP S Sally, who ran home, ate dinner
nsubj dobj dobj ?
4
Sally, who ran home, ate dinner
ran( ?, home) ate( ?, dinner) ran(Sally, home) ate(Sally, dinner) ^
…
Sentence Sentence Noun Noun Noun
5
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
6
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
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
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
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
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
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
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
Sally home ran ate and dinner
Dependency Grammar CCG Dependency Grammar
Sally home ran ate and dinner
14
Sally but heard heard John and
Dependency Grammar CCG Dependency Grammar
saw the explosion Sally but heard heard John and saw the explosion
15
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
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
Sally heard and John saw the explosion
N N (S\N)/N N (S\N)/N conj
What should apply to what?
18
Sally heard and John saw the explosion
N N (S\N)/N N (S\N)/N conj S/N S/N S/N
19
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
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
22
Sally ate
N (S\N)/N
with tuna
N ??? (N\N)/N N\N N S\N S
sushi
N
23
Sally ate
N S\N
with chopsticks
N ??? (S\S)/N S\S S\N S
24
NP , PP
S[adj], S[dcl], S[b],… NP[nb], …
Ugh,… “Yes” — ignore Type-Changing, it’s not really real…
25
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
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
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)
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
Supertagging with LSTMs Vaswani 2016
30
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
English Arabic Big Ball N/N N ةركةريبك N N\N (ball) (big)
Obj Adj
32
Obj Adj
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
English Japanese ran
beach S\N (S\S)/N N 浜 を ⾛った N (S/S)\N S\N
(beach) (on) (ran)
V O ADP V O ADP
34
Go
S/N
to Boston
N ??? PP/N PP S
Is “to Boston” a modifier?
S/PP
35
36
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
https://yoavartzi.com/tutorial/ Semantic Parsing and Modeling Linguistics
Mark Steedman
http://jazzparser.granroth-wilding.co.uk/Parser.html
Jazz
38