Semantic Parsing with Combinatory Categorial Grammars Yoav Artzi ! - - PowerPoint PPT Presentation

semantic parsing with combinatory categorial grammars
SMART_READER_LITE
LIVE PREVIEW

Semantic Parsing with Combinatory Categorial Grammars Yoav Artzi ! - - PowerPoint PPT Presentation

A b r i d g e d Semantic Parsing with Combinatory Categorial Grammars Yoav Artzi ! University of Washington Based on ACL 2013 Tutorial ! With Nicholas FitzGerald and Luke Zettlemyer ! Original tutorial slides available at


slide-1
SLIDE 1

Semantic Parsing with Combinatory Categorial Grammars

Yoav Artzi! University of Washington

Based on ACL 2013 Tutorial! With Nicholas FitzGerald and Luke Zettlemyer! Original tutorial slides available at http://yoavartzi.com/

A b r i d g e d

slide-2
SLIDE 2

Language to Meaning

More informative

slide-3
SLIDE 3

Language to Meaning

More informative

Information Extraction

Recover information about pre-specified relations and entities

Relation Extraction

Example Task

is a(OBAMA, PRESIDENT)

slide-4
SLIDE 4

Language to Meaning

More informative

Broad-coverage Semantics

Summarization

Example Task

Obama wins

  • election. Big party

in Chicago. Romney a bit down, asks for some tea.

Focus on specific phenomena (e.g., verb- argument matching)

slide-5
SLIDE 5

Language to Meaning

More informative

Semantic Parsing

Recover complete meaning representation

Database Query

Example Task

What states border Texas?

Oklahoma! New Mexico! Arkansas! Louisiana

slide-6
SLIDE 6

Language to Meaning

More informative

Semantic Parsing

Recover complete meaning representation

Instructing a Robot

Example Task

at the chair, turn right

slide-7
SLIDE 7

Language to Meaning

More informative

Semantic Parsing

Recover complete meaning representation

  • Convert to database query to get the answer!
  • Allow a robot to do planning

Complete meaning is sufficient to complete the task

slide-8
SLIDE 8

Language to Meaning

More informative

Semantic Parsing

Recover complete meaning representation

at the chair, move forward three steps past the sofa

λa.pre(a, ιx.chair(x)) ∧ move(a) ∧ len(a, 3)∧ dir(a, forward) ∧ past(a, ιy.sofa(y))

slide-9
SLIDE 9

Language to Meaning

More informative

Semantic Parsing

Recover complete meaning representation

at the chair, move forward three steps past the sofa

λa.pre(a, ιx.chair(x)) ∧ move(a) ∧ len(a, 3)∧ dir(a, forward) ∧ past(a, ιy.sofa(y))

slide-10
SLIDE 10

Language to Meaning

at the chair, move forward three steps past the sofa

Learn

f : sentence → logical form

λa.pre(a, ιx.chair(x)) ∧ move(a) ∧ len(a, 3)∧ dir(a, forward) ∧ past(a, ιy.sofa(y))

slide-11
SLIDE 11

Language to Meaning

at the chair, move forward three steps past the sofa

Learn

f : sentence → logical form

slide-12
SLIDE 12

Central Problems

Modeling Learning Parsing

slide-13
SLIDE 13

Parsing Choices

  • Grammar formalism!
  • Inference procedure

Inductive Logic Programming [Zelle and Mooney 1996]! SCFG [Wong and Mooney 2006]! CCG + CKY [Zettlemoyer and Collins 2005]! Constrained Optimization + ILP [Clarke et al. 2010]! DCS + Projective dependency parsing [Liang et al. 2011]! LWFG [Muresan 2011]

slide-14
SLIDE 14

Learning

  • What kind of supervision is available?!
  • Mostly using latent variable methods

Annotated parse trees [Miller et al. 1994]! Sentence-LF pairs [Zettlemoyer and Collins 2005]! Question-answer pairs [Clarke et al. 2010]! Instruction-demonstration pairs [Chen and Mooney 2011]! Conversation logs [Artzi and Zettlemoyer 2011]! Visual sensors [Matuszek et al. 2012a]

slide-15
SLIDE 15

Semantic Modeling

  • What logical language to use?!
  • How to model meaning?

Variable free logic [Zelle and Mooney 1996; Wong and Mooney 2006]! High-order logic [Zettlemoyer and Collins 2005]! Relational algebra [Liang et al. 2011]! Graphical models [Tellex et al. 2011]

slide-16
SLIDE 16

Today

Modeling Best practices for semantics design Parsing Combinatory Categorial Grammars Learning Unified learning algorithm

slide-17
SLIDE 17

Modeling Learning Parsing

slide-18
SLIDE 18

Modeling Learning

!

  • Lambda calculus!
  • Parsing with Combinatory Categorial

Grammars !

  • Linear CCGs!
  • Factored lexicons

Parsing

Online

slide-19
SLIDE 19

Modeling Parsing

!

  • Structured perceptron!
  • A unified learning algorithm!
  • Supervised learning!
  • Weak supervision

Learning

Online

slide-20
SLIDE 20

Learning Parsing

!

  • Semantic modeling for:!
  • Querying databases!
  • Referring to physical objects!
  • Executing instructions!

Online

Modeling

slide-21
SLIDE 21

UW SPF

Open source semantic parsing framework! http://yoavartzi.com/spf

Semantic Parser Flexible High-Order Logic Representation Learning Algorithms

Includes ready-to-run examples

[Artzi and Zettlemoyer 2013a]

slide-22
SLIDE 22

Modeling Learning

!

  • Lambda calculus!
  • Parsing with Combinatory Categorial

Grammars !

  • Linear CCGs!
  • Factored lexicons

Parsing

Online

slide-23
SLIDE 23

Lambda Calculus

  • Formal system to express computation!
  • Allows high-order functions

λa.move(a) ∧ dir(a, LEFT) ∧ to(a, ιy.chair(y))∧ pass(a, Ay.sofa(y) ∧ intersect(Az.intersection(z), y))

[Church 1932]

slide-24
SLIDE 24

Lambda Calculus

Base Cases

  • Logical constant!
  • Variable!
  • Literal!
  • Lambda term
slide-25
SLIDE 25

Lambda Calculus

Logical Constants

NY C, CA, RAINIER, LEFT, . . . located in, depart date, . . .

  • Represent objects in the world
slide-26
SLIDE 26

Lambda Calculus

Variables

  • Abstract over objects in the world!
  • Exact value not pre-determined

x, y, z, . . .

slide-27
SLIDE 27

Lambda Calculus

Literals

  • Represent function application

located in(AUSTIN, TEXAS) city(AUSTIN)

slide-28
SLIDE 28

Arguments Predicate

Lambda Calculus

Literals

  • Represent function application

located in(AUSTIN, TEXAS) city(AUSTIN)

Logical expression List of logical expressions

slide-29
SLIDE 29

Lambda Calculus

Lambda Terms

  • Bind/scope a variable!
  • Repeat to bind multiple variables

λx.λy.located in(x, y) λx.city(x)

slide-30
SLIDE 30

Body Lambda

  • perator

Variable

Lambda Calculus

Lambda Terms

  • Bind/scope a variable!
  • Repeat to bind multiple variables

λx.λy.located in(x, y) λx.city(x)

slide-31
SLIDE 31

Lambda Calculus

Quantifiers?

  • Higher order constants!
  • No need for any special mechanics!
  • Can represent all of first order logic

∀(λx.big(x) ∧ apple(x)) ¬(∃(λx.lovely(x)) ι(λx.beautiful(x) ∧ grammar(x))

slide-32
SLIDE 32

Lambda Calculus

Syntactic Sugar

∧ (A, ∧(B, C)) ⇔ A ∧ B ∧ C ∨ (A, ∨(B, C)) ⇔ A ∨ B ∨ C ¬(A) ⇔ ¬A Q(λx.f(x)) ⇔ Qx.f(x) for Q ∈ {ι, A, ∃, ∀}

slide-33
SLIDE 33

λx.flight(x) ∧ to(x, move) λx.flight(x) ∧ to(x, NY C) λx.NY C(x) ∧ x(to, move)

slide-34
SLIDE 34

λx.flight(x) ∧ to(x, move) λx.flight(x) ∧ to(x, NY C) λx.NY C(x) ∧ x(to, move)

slide-35
SLIDE 35

Simply Typed Lambda Calculus

  • Like lambda calculus!
  • But, typed

[Church 1940]

λx.flight(x) ∧ to(x, move) λx.flight(x) ∧ to(x, NY C) λx.NY C(x) ∧ x(to, move)

slide-36
SLIDE 36

Lambda Calculus

Typing

e

t

Truth- value Entity

  • Simple types!
  • Complex types

< e, t > << e, t >, e >

slide-37
SLIDE 37

Lambda Calculus

Typing

e

t

Truth- value Entity

  • Simple types!
  • Complex types

Range Domain

< e, t > << e, t >, e >

Type constructor

slide-38
SLIDE 38

Lambda Calculus

Typing

e tr t loc

  • Hierarchical typing system
  • Simple types!
  • Complex types

Range Domain

< e, t > << e, t >, e >

Type constructor

slide-39
SLIDE 39

Lambda Calculus

Typing

e fla fl tr gt t loc ap ci i ti

  • Hierarchical typing system

Range Domain

  • Simple types!
  • Complex types

Type constructor

< e, t > << e, t >, e >

slide-40
SLIDE 40

Simply Typed Lambda Calculus

λa.move(a) ∧ dir(a, LEFT) ∧ to(a, ιy.chair(y))∧ pass(a, Ay.sofa(y) ∧ intersect(Az.intersection(z), y))

Type information usually omitted

slide-41
SLIDE 41

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Capturing Meaning with Lambda Calculus

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Show me mountains in states bordering Texas

[Zettlemoyer and Collins 2005]

slide-42
SLIDE 42

Capturing Meaning with Lambda Calculus

SYSTEM

how can I help you ?

USER

i ‘ d like to fly to new york

SYSTEM

flying to new york . leaving what city ?

USER

from boston on june seven with american airlines

SYSTEM

flying to new york . what date would you like to depart boston ?

USER

june seventh

SYSTEM

do you have a preferred airline ?

USER

american airlines

SYSTEM

  • . k . leaving boston to new york on june seventh flying with

american airlines . where would you like to go to next ?

USER

back to boston on june tenth

[CONVERSATION CONTINUES]

[Artzi and Zettlemoyer 2011]

slide-43
SLIDE 43

Capturing Meaning with Lambda Calculus

go to the chair and turn right

λa.move(a) ∧ to(a, . . .

[Artzi and Zettlemoyer 2013b]

slide-44
SLIDE 44

Capturing Meaning with Lambda Calculus

  • Flexible representation!
  • Can capture full complexity of natural

language

More on modeling meaning online and later today

slide-45
SLIDE 45

Constructing Lambda Calculus Expressions

at the chair, move forward three steps past the sofa

λa.pre(a, ιx.chair(x)) ∧ move(a) ∧ len(a, 3)∧ dir(a, forward) ∧ past(a, ιy.sofa(y))

?

slide-46
SLIDE 46

Combinatory Categorial Grammars

CCG is fun NP S\NP/ADJ ADJ CCG λf.λx.f(x) λx.fun(x)

>

S\NP λx.fun(x)

<

S fun(CCG)

[Steedman 1996, 2000]

slide-47
SLIDE 47

Combinatory Categorial Grammars

  • Categorial formalism!
  • Transparent interface between syntax and

semantics!

  • Designed with computation in mind!
  • Part of a class of mildly context sensitive

formalisms (e.g., TAG, HG, LIG) [Joshi et al. 1990]

slide-48
SLIDE 48

CCG Categories

ADJ : λx.fun(x)

  • Basic building block!
  • Capture syntactic and semantic information

jointly

slide-49
SLIDE 49

CCG Categories

Syntax Semantics

ADJ : λx.fun(x)

  • Basic building block!
  • Capture syntactic and semantic information

jointly

slide-50
SLIDE 50

CCG Categories

  • Primitive symbols: N, S, NP

, ADJ and PP!

  • Syntactic combination operator (/,\)!
  • Slashes specify argument order and direction

Syntax

ADJ : λx.fun(x)

NP : CCG

(S\NP)/ADJ : λf.λx.f(x)

slide-51
SLIDE 51

Semantics

CCG Categories

  • λ-calculus expression!
  • Syntactic type maps to semantic type

ADJ : λx.fun(x)

NP : CCG

(S\NP)/ADJ : λf.λx.f(x)

slide-52
SLIDE 52

CCG Lexical Entries

fun ` ADJ : λx.fun(x)

  • Pair words and phrases with meaning!
  • Meaning captured by a CCG category
slide-53
SLIDE 53

CCG Category Natural! Language

CCG Lexical Entries

fun ` ADJ : λx.fun(x)

  • Pair words and phrases with meaning!
  • Meaning captured by a CCG category
slide-54
SLIDE 54

CCG Lexicons

fun ` ADJ : λx.fun(x)

CCG ` NP : CCG

is ` (S\NP)/ADJ : λf.λx.f(x)

  • Pair words and phrases with meaning!
  • Meaning captured by a CCG category
slide-55
SLIDE 55

Between CCGs and CFGs

CFGs CCGs Combination operations Many Few Parse tree nodes Non-terminals Categories Syntactic symbols Few dozen Handful, but can combine Paired with words POS tags Categories

slide-56
SLIDE 56

Parsing with CCGs

CCG is fun NP S\NP/ADJ ADJ CCG λf.λx.f(x) λx.fun(x)

>

S\NP λx.fun(x)

<

S fun(CCG) Use lexicon to match words and phrases with their categories

slide-57
SLIDE 57

CCG Operations

  • Small set of operators!
  • Input: 1-2 CCG categories!
  • Output: A single CCG category!
  • Operate on syntax semantics together!
  • Mirror natural logic operations
slide-58
SLIDE 58

CCG Operations

Application

A/B : f B : g ⇒ A : f(g) (>) B : g A\B : f ⇒ A : f(g) (<)

  • Equivalent to function application!
  • Two directions: forward and backward!
  • Determined by slash direction
slide-59
SLIDE 59

Argument Result Function

CCG Operations

Application

A/B : f B : g ⇒ A : f(g) (>) B : g A\B : f ⇒ A : f(g) (<)

  • Equivalent to function application!
  • Two directions: forward and backward!
  • Determined by slash direction
slide-60
SLIDE 60

Parsing with CCGs

CCG is fun NP S\NP/ADJ ADJ CCG λf.λx.f(x) λx.fun(x)

>

S\NP λx.fun(x)

<

S fun(CCG) Use lexicon to match words and phrases with their categories

slide-61
SLIDE 61

Parsing with CCGs

A/B : f B : g ⇒ A : f(g) (>)

CCG is fun NP S\NP/ADJ ADJ CCG λf.λx.f(x) λx.fun(x)

>

S\NP λx.fun(x)

<

S fun(CCG) Combine categories using operators

slide-62
SLIDE 62

Parsing with CCGs

Combine categories using operators

B : g A\B : f ⇒ A : f(g) (<)

CCG is fun NP S\NP/ADJ ADJ CCG λf.λx.f(x) λx.fun(x)

>

S\NP λx.fun(x)

<

S fun(CCG)

slide-63
SLIDE 63

Parsing with CCGs

square blue or round yellow pillow

Non-standard coordination Composed adjectives

slide-64
SLIDE 64

CCG Operations

Composition

  • Equivalent to function composition*!
  • Two directions: forward and backward

B\C : g A\B : f ⇒ A\C : λx.f(g(x)) (< B) A/B : f B/C : g ⇒ A/C : λx.f(g(x)) (> B)

* Formal definition of logical composition in supplementary slides

slide-65
SLIDE 65

f◦g g f

CCG Operations

Composition

  • Equivalent to function composition*!
  • Two directions: forward and backward

B\C : g A\B : f ⇒ A\C : λx.f(g(x)) (< B) A/B : f B/C : g ⇒ A/C : λx.f(g(x)) (> B)

* Formal definition of logical composition in supplementary slides

slide-66
SLIDE 66

CCG Operations

Type Shifting

ADJ : λx.g(x) ⇒ N/N : λf.λx.f(x) ∧ g(x) AP : λe.g(e) ⇒ S/S : λf.λe.f(e) ∧ g(e) AP : λe.g(e) ⇒ S\S : λf.λe.f(e) ∧ g(e) PP : λx.g(x) ⇒ N\N : λf.λx.f(x) ∧ g(x)

  • Category-specific unary operations!
  • Modify category type to take an argument!
  • Helps in keeping a compact lexicon
slide-67
SLIDE 67

Output Input

CCG Operations

Type Shifting

ADJ : λx.g(x) ⇒ N/N : λf.λx.f(x) ∧ g(x) AP : λe.g(e) ⇒ S/S : λf.λe.f(e) ∧ g(e) AP : λe.g(e) ⇒ S\S : λf.λe.f(e) ∧ g(e) PP : λx.g(x) ⇒ N\N : λf.λx.f(x) ∧ g(x)

  • Category-specific unary operations!
  • Modify category type to take an argument!
  • Helps in keeping a compact lexicon
slide-68
SLIDE 68

Topicalization

Output Input

CCG Operations

Type Shifting

ADJ : λx.g(x) ⇒ N/N : λf.λx.f(x) ∧ g(x) AP : λe.g(e) ⇒ S/S : λf.λe.f(e) ∧ g(e) AP : λe.g(e) ⇒ S\S : λf.λe.f(e) ∧ g(e) PP : λx.g(x) ⇒ N\N : λf.λx.f(x) ∧ g(x)

  • Category-specific unary operations!
  • Modify category type to take an argument!
  • Helps in keeping a compact lexicon
slide-69
SLIDE 69

CCG Operations

Coordination

  • Coordination is special cased!
  • Specific rules perform coordination!
  • Coordinating operators are marked with

special lexical entries

and ` C : conj

  • r ` C : disj
slide-70
SLIDE 70

Parsing with CCGs

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

<

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

slide-71
SLIDE 71

Parsing with CCGs

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

<

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

Use lexicon to match words and phrases with their categories

slide-72
SLIDE 72

Parsing with CCGs

Shift adjectives to combine

ADJ : λx.g(x) ⇒ N/N : λf.λx.f(x) ∧ g(x)

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

<

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

slide-73
SLIDE 73

Parsing with CCGs

Shift adjectives to combine

ADJ : λx.g(x) ⇒ N/N : λf.λx.f(x) ∧ g(x)

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

<

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

slide-74
SLIDE 74

Parsing with CCGs

Compose pairs of adjectives

A/B : f B/C : g ⇒ A/C : λx.f(g(x)) (> B)

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

>

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

slide-75
SLIDE 75

Parsing with CCGs

Coordinate composed adjectives

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

>

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

slide-76
SLIDE 76

Parsing with CCGs

Apply coordinated adjectives to noun

square blue

  • r

round yellow pillow ADJ ADJ C ADJ ADJ N λx.square(x) λx.blue(x) disj λx.round(x) λx.yellow(x) λx.pillow(x) N/N N/N N/N N/N λf.λx.f(x) ∧ square(x) λf.λx.f(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) λf.λx.f(x) ∧ yellow(x)

>B >B

N/N N/N λf.λx.f(x) ∧ square(x) ∧ blue(x) λf.λx.f(x) ∧ round(x) ∧ yellow(x)

<Φ>

N/N λf.λx.f(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

>

N λx.pillow(x) ∧ ((square(x) ∧ blue(x)) ∨ (round(x) ∧ yellow(x)))

A/B : f B : g ⇒ A : f(g) (>)

slide-77
SLIDE 77

Parsing with CCGs

CCG is fun NP S\NP/ADJ ADJ CCG λf.λx.f(x) λx.fun(x)

>

S\NP λx.fun(x)

<

S fun(CCG)

Lexical Ambiguity Many parsing decisions Many potential trees and LFs

+

x z y

slide-78
SLIDE 78

Weighted Linear CCGs

  • Given a weighted linear model:!
  • CCG lexicon Λ!
  • Feature function !
  • Weights !
  • The best parse is:!

!

  • We consider all possible parses y for sentence x given

the lexicon Λ

y∗ = arg max

y

w · f(x, y)

f : X × Y → Rm w ∈ Rm

slide-79
SLIDE 79

Parsing Algorithms

  • Syntax-only CCG parsing has polynomial

time CKY-style algorithms!

  • Parsing with semantics requires entire

category as chart signature!

  • e.g., !
  • In practice, prune to top-N for each span!
  • Approximate, but polynomial time

ADJ : λx.fun(x)

slide-80
SLIDE 80

More on CCGs

  • Generalized type-raising operations!
  • Cross composition operations for cross

serial dependencies!

  • Compositional approaches to English

intonation!

  • and a lot more ... even Jazz

[Steedman 1996; 2000; 2011; Granroth and Steedman 2012]

slide-81
SLIDE 81

Modeling Learning

!

  • Lambda calculus!
  • Parsing with Combinatory Categorial

Grammars !

  • Linear CCGs!
  • Factored lexicons

Parsing

Online

slide-82
SLIDE 82

Learning

Data CCG

Learning Algorithm

  • What kind of data/supervision we can use?!
  • What do we need to learn?
slide-83
SLIDE 83

Parsing as Structure Prediction

show me flights to Boston S/N N PP/NP NP λf.f λx.flight(x) λy.λx.to(x, y) BOSTON

>

PP λx.to(x, BOSTON) N\N λf.λx.f(x) ∧ to(x, BOSTON)

<

N λx.flight(x) ∧ to(x, BOSTON)

>

S λx.flight(x) ∧ to(x, BOSTON)

slide-84
SLIDE 84

Learning CCG

w

Lexicon Combinators

Predefined

show me flights to Boston S/N N PP/NP NP λf.f λx.flight(x) λy.λx.to(x, y) BOSTON

>

PP λx.to(x, BOSTON) N\N λf.λx.f(x) ∧ to(x, BOSTON)

<

N λx.flight(x) ∧ to(x, BOSTON)

>

S λx.flight(x) ∧ to(x, BOSTON)

slide-85
SLIDE 85

Supervised Data

show me flights to Boston S/N N PP/NP NP λf.f λx.flight(x) λy.λx.to(x, y) BOSTON

>

PP λx.to(x, BOSTON) N\N λf.λx.f(x) ∧ to(x, BOSTON)

<

N λx.flight(x) ∧ to(x, BOSTON)

>

S λx.flight(x) ∧ to(x, BOSTON)

slide-86
SLIDE 86

show me flights to Boston S/N N PP/NP NP λf.f λx.flight(x) λy.λx.to(x, y) BOSTON

>

PP λx.to(x, BOSTON) N\N λf.λx.f(x) ∧ to(x, BOSTON)

<

N λx.flight(x) ∧ to(x, BOSTON)

>

S λx.flight(x) ∧ to(x, BOSTON)

Supervised Data

L a t e n t

slide-87
SLIDE 87

Supervised Data

Supervised learning is done from pairs

  • f sentences and logical forms

Show me flights to Boston I need a flight from baltimore to seattle

λx.flight(x) ∧ from(x, BALTIMORE) ∧ to(x, SEATTLE) λx.flight(x) ∧ to(x, BOSTON)

what ground transportation is available in san francisco

λx.ground transport(x) ∧ to city(x, SF)

[Zettlemoyer and Collins 2005; 2007]

slide-88
SLIDE 88

Weak Supervision

  • Logical form is latent!
  • “Labeling” requires less expertise!
  • Labels don’t uniquely determine correct

logical forms!

  • Learning requires executing logical forms

within a system and evaluating the result

slide-89
SLIDE 89

Weak Supervision

Learning from Query Answers

What is the largest state that borders Texas?

New Mexico

[Clarke et al. 2010; Liang et al. 2011]

slide-90
SLIDE 90

Weak Supervision

Learning from Query Answers

What is the largest state that borders Texas?

New Mexico

argmax(λx.state(x) ∧ border(x, TX), λy.size(y)) argmax(λx.river(x) ∧ in(x, TX), λy.size(y))

[Clarke et al. 2010; Liang et al. 2011]

slide-91
SLIDE 91

Weak Supervision

Learning from Query Answers

What is the largest state that borders Texas?

New Mexico

argmax(λx.state(x) ∧ border(x, TX), λy.size(y)) argmax(λx.river(x) ∧ in(x, TX), λy.size(y))

New Mexico Rio Grande

[Clarke et al. 2010; Liang et al. 2011]

slide-92
SLIDE 92

Weak Supervision

Learning from Query Answers

What is the largest state that borders Texas?

New Mexico

argmax(λx.state(x) ∧ border(x, TX), λy.size(y)) argmax(λx.river(x) ∧ in(x, TX), λy.size(y))

New Mexico Rio Grande

[Clarke et al. 2010; Liang et al. 2011]

slide-93
SLIDE 93

Weak Supervision

Learning from Demonstrations

[Chen and Mooney 2011; Kim and Mooney 2012; Artzi and Zettlemoyer 2013b]

at the chair, move forward three steps past the sofa

slide-94
SLIDE 94

Weak Supervision

Learning from Demonstrations

[Chen and Mooney 2011; Kim and Mooney 2012; Artzi and Zettlemoyer 2013b]

at the chair, move forward three steps past the sofa

Some examples from other domains:!

  • Sentences and labeled game states [Goldwasser and Roth 2011]!
  • Sentences and sets of physical objects [Matuszek et al. 2012]
slide-95
SLIDE 95

Weak Supervision

Learning from Conversation Logs

SYSTEM

how can I help you ? (OPEN_TASK)

USER

i ‘ d like to fly to new york

SYSTEM

flying to new york . (CONFIRM: from(fl, ATL)) leaving what city ?

(ASK: λx.from(fl,x))

USER

from boston on june seven with american airlines

SYSTEM

flying to new york . (CONFIRM: to(fl, NYC)) what date would you like to depart boston ? (ASK: λx.date(fl,x)∧to(fl, BOS))

USER

june seventh

[CONVERSATION CONTINUES]

[Artzi and Zettlemoyer 2011]

slide-96
SLIDE 96

Modeling Parsing

!

  • Structured perceptron!
  • A unified learning algorithm!
  • Supervised learning!
  • Weak supervision

Learning

Online

slide-97
SLIDE 97

Structured Perceptron

  • Simple additive updates !
  • Only requires efficient decoding (argmax)!
  • Closely related to MaxEnt and other

feature rich models!

  • Provably finds linear separator in finite

updates, if one exists!

  • Challenge: learning with hidden variables
slide-98
SLIDE 98

Structured Perceptron

  • Simple additive updates !
  • Only requires efficient decoding (argmax)!
  • Closely related to MaxEnt and other

feature rich models!

  • Provably finds linear separator in finite

updates, if one exists!

  • Challenge: learning with hidden variables

Derivations in the complete tutorial

slide-99
SLIDE 99

Hidden Variable Perceptron

  • No known convergence guarantees!
  • Log-linear version is non-convex!
  • Simple and easy to implement!
  • Works well with careful initialization!
  • Modifications for semantic parsing!
  • Lots of different hidden information!
  • Can add a margin constraint, do

probabilistic version, etc.

slide-100
SLIDE 100

Unified Learning Algorithm

  • Handle various learning signals!
  • Estimate parsing parameters!
  • Induce lexicon structure!
  • Related to loss-sensitive structured

perceptron [Singh-Miller and Collins 2007]

slide-101
SLIDE 101

Learning Choices

Validation Function Lexical Generation Procedure

  • Indicates correctness
  • f a parse y!
  • Varying allows for

differing forms of supervision!

  • Given:!

sentence! validation function! lexicon ! parameters!

  • Produce a overly general

set of lexical entries

V : Y → {t, f}

GENLEX(x, V; Λ, θ) V V

θ

Λ

x

slide-102
SLIDE 102

Unified Learning Algorithm

  • Online!
  • 2 steps:!
  • Lexical generation!
  • Parameter update

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

slide-103
SLIDE 103

Initialize parameters and lexicon

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters) Output: Parameters θ and lexicon Λ θ weights Λ0 initial lexicon

slide-104
SLIDE 104

Iterate over data

T # iterations n # samples Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

slide-105
SLIDE 105

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

slide-106
SLIDE 106

Generate a large set of potential lexical entries

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ θ weights x sentence V validation function GENLEX(x, V; λ, θ) lexical generation function

slide-107
SLIDE 107

Generate a large set of potential lexical entries

V : Y → {t, f}

Y all parses

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ θ weights x sentence V validation function GENLEX(x, V; λ, θ) lexical generation function

slide-108
SLIDE 108

Generate a large set of potential lexical entries Procedure to propose potential new lexical entries for a sentence

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ θ weights x sentence V validation function GENLEX(x, V; λ, θ) lexical generation function

slide-109
SLIDE 109

x sentence k beam size GEN(x; λ) set of all parses Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

Get top parses

slide-110
SLIDE 110

Get lexical entries from highest scoring valid parses

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

θ weights V validation function LEX(y) set of lexical entries φi(y) = φ(xi, y) MAXVi(Y ; θ) = {y|8y0 2 Y, hθ, Φi(y0)i  hθ, Φi(y)i ^ Vi(y)}

slide-111
SLIDE 111

Update model’s lexicon

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation)

  • a. Set λG ← GENLEX(xi, Vi; Λ, θ),

λ ← Λ ∪ λG

  • b. Let Y be the k highest scoring parses from

GEN(xi; λ)

  • c. Select lexical entries from the highest scor-

ing valid parses: λi ← S

y∈MAXVi(Y ;θ) LEX(y)

  • d. Update lexicon: Λ ← Λ ∪ λi

Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

slide-112
SLIDE 112

Initialize θ using Λ0 , Λ Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters)

  • a. Set Gi MAXVi(GEN(xi; Λ); θ)

and Bi {e|e 2 GEN(xi; Λ) ^ ¬Vi(y)}

  • b. Construct sets of margin violating good and

bad parses: Ri {g|g 2 Gi ^ 9b 2 Bi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)} Ei {b|b 2 Bi ^ 9g 2 Gi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)}

  • c. Apply the additive update:

θ θ +

1 |Ri|

P

r∈Ri Φi(r)

1

|Ei|

P

e∈Ei Φi(e)

Output: Parameters θ and lexicon Λ

slide-113
SLIDE 113

Re-parse and group all parses into ‘good’ and ‘bad’ sets

Initialize θ using Λ0 , Λ Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters)

  • a. Set Gi MAXVi(GEN(xi; Λ); θ)

and Bi {e|e 2 GEN(xi; Λ) ^ ¬Vi(y)}

  • b. Construct sets of margin violating good and

bad parses: Ri {g|g 2 Gi ^ 9b 2 Bi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)} Ei {b|b 2 Bi ^ 9g 2 Gi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)}

  • c. Apply the additive update:

θ θ +

1 |Ri|

P

r∈Ri Φi(r)

1

|Ei|

P

e∈Ei Φi(e)

Output: Parameters θ and lexicon Λ

θ weights x sentence V validation function GEN(x; λ) set of all parses MAXVi(Y ; θ) = {y|8y0 2 Y, hθ, Φi(y0)i  hθ, Φi(y)i^ Vi(y) = 1}

slide-114
SLIDE 114

For all pairs of ‘good’ and ‘bad’ parses, if their scores violate the margin, add each to ‘right’ and ‘error’ sets respectively

Initialize θ using Λ0 , Λ Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters)

  • a. Set Gi MAXVi(GEN(xi; Λ); θ)

and Bi {e|e 2 GEN(xi; Λ) ^ ¬Vi(y)}

  • b. Construct sets of margin violating good and

bad parses: Ri {g|g 2 Gi ^ 9b 2 Bi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)} Ei {b|b 2 Bi ^ 9g 2 Gi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)}

  • c. Apply the additive update:

θ θ +

1 |Ri|

P

r∈Ri Φi(r)

1

|Ei|

P

e∈Ei Φi(e)

Output: Parameters θ and lexicon Λ θ weights γ margin φi(y) = φ(xi, y) ∆i(y, y0) = |Φi(y) − Φi(y0)|1

slide-115
SLIDE 115

Update towards violating ‘good’ parses and against violating ‘bad’ parses

Initialize θ using Λ0 , Λ Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters)

  • a. Set Gi MAXVi(GEN(xi; Λ); θ)

and Bi {e|e 2 GEN(xi; Λ) ^ ¬Vi(y)}

  • b. Construct sets of margin violating good and

bad parses: Ri {g|g 2 Gi ^ 9b 2 Bi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)} Ei {b|b 2 Bi ^ 9g 2 Gi s.t. hθ, Φi(g)Φi(b)i < γ∆i(g, b)}

  • c. Apply the additive update:

θ θ +

1 |Ri|

P

r∈Ri Φi(r)

1

|Ei|

P

e∈Ei Φi(e)

Output: Parameters θ and lexicon Λ θ weights φi(y) = φ(xi, y)

slide-116
SLIDE 116

Return grammar

Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) Step 2: (Update parameters) Output: Parameters θ and lexicon Λ

θ weights Λ lexicon

slide-117
SLIDE 117

Features and Initialization

Feature Classes Lexicon Initialization Initial Weights

  • Parse: indicate lexical entry and combinator use!
  • Logical form: indicate local properties of logical

forms, such as constant co-occurrence

  • Often use an NP list!
  • Sometimes include additional, domain

independent entries for function words

  • Positive weight for initial lexical indicator

features

slide-118
SLIDE 118

Unified Learning Algorithm Extensions

  • Loss-sensitive learning!
  • Applied to learning from conversations!
  • Stochastic gradient descent!
  • Approximate expectation computation

[Artzi and Zettlemoyer 2011; Zettlemoyer and Collins 2005]

slide-119
SLIDE 119

Unified Learning Algorithm

  • Two parts of the algorithm we still need to define!
  • Depend on the task and supervision signal

V validation function GENLEX(x, V; λ, θ) lexical generation function V V

slide-120
SLIDE 120

Unified Learning Algorithm

Supervised

Supervised V GENLEX GENLEX

Template-based Unification-based

Weakly Supervised V GENLEX

Template-based

slide-121
SLIDE 121

Supervised Learning

show me the afternoon flights from LA to boston

λx.flight(x) ∧ during(x, AFTERNOON) ∧ from(x, LA) ∧ to(x, BOS)

slide-122
SLIDE 122

Supervised Learning

show me the afternoon flights from LA to boston

λx.flight(x) ∧ during(x, AFTERNOON) ∧ from(x, LA) ∧ to(x, BOS)

Parse structure is latent

slide-123
SLIDE 123

Supervised Validation Function

  • Validate logical form against gold label

Vi(y) = ( true if LF(y) = zi false else

y parse zi labeled logical form LF(y) logical form at the root of y

slide-124
SLIDE 124

Supervised Template-based

GENLEX(x, z; Λ, θ)

Sentence Logical form Lexicon Weights

Small notation abuse: take labeled logical form instead of validation function

slide-125
SLIDE 125

Supervised Template-based

I want a flight to new york

λx.flight(x) ∧ to(x, NY C)

GENLEX(x, z; Λ, θ)

slide-126
SLIDE 126

Supervised Template-based GENLEX

  • Use templates to constrain lexical entries

structure!

  • For example: from a small annotated dataset

λ(ω, {vi}n

1).[ω ` ADJ : λx.v1(x)]

λ(ω, {vi}n

1).[ω ` PP : λx.λy.v1(y, x)]

λ(ω, {vi}n

1).[ω ` N : λx.v1(x)]

λ(ω, {vi}n

1).[ω ` S\NP/NP : λx.λy.v1(x, y)]

. . .

[Zettlemoyer and Collins 2005]

slide-127
SLIDE 127

Supervised Template-based GENLEX

λ(ω, {vi}n

1).[ω ` ADJ : λx.v1(x)]

λ(ω, {vi}n

1).[ω ` PP : λx.λy.v1(y, x)]

λ(ω, {vi}n

1).[ω ` N : λx.v1(x)]

λ(ω, {vi}n

1).[ω ` S\NP/NP : λx.λy.v1(x, y)]

. . .

Need lexemes to instantiate templates

slide-128
SLIDE 128

Supervised Template-based

I want a flight to new york

λx.flight(x) ∧ to(x, NY C)

I want a flight flight flight to new . . .

All possible sub-strings

GENLEX(x, z; Λ, θ)

slide-129
SLIDE 129

Supervised Template-based

I want a flight to new york

λx.flight(x) ∧ to(x, NY C)

flight to NY C

I want a flight flight flight to new . . .

All logical constants from labeled logical form

GENLEX(x, z; Λ, θ)

slide-130
SLIDE 130

Supervised Template-based

I want a flight to new york

λx.flight(x) ∧ to(x, NY C)

flight to NY C

(flight, {flight}) (I want, {}) (flight to new, {to, NY C}) . . .

I want a flight flight flight to new . . .

Create lexemes

GENLEX(x, z; Λ, θ)

slide-131
SLIDE 131

Supervised Template-based

I want a flight to new york

λx.flight(x) ∧ to(x, NY C)

flight to NY C

(flight, {flight}) (I want, {}) (flight to new, {to, NY C}) . . .

I want a flight flight flight to new . . .

flight ` N : λx.flight(x) I want ` S/NP : λx.x flight to new : S\NP/NP : λx.λy.to(x, y) . . .

Initialize templates

GENLEX(x, z; Λ, θ)

slide-132
SLIDE 132

Fast Parsing with Pruning

  • GENLEX outputs a large number of entries!
  • For fast parsing: use the labeled logical form

to prune!

  • Prune partial logical forms that can’t lead to

labeled form I want a flight from New York to Boston on Delta

λx.from(x, NY C) ∧ to(x, BOS) ∧ carrier(x, DL)

slide-133
SLIDE 133

Fast Parsing with Pruning

. . . form New York to Boston . . . PP/NP NP PP/NP NP λx.λy.to(y, x) NY C λx.λy.to(y, x) BOS

> >

PP PP λy.to(y, NY C) λy.to(y, BOS) N\N λf.λy.f(y) ∧ to(y, BOS)

I want a flight from New York to Boston on Delta

λx.from(x, NY C) ∧ to(x, BOS) ∧ carrier(x, DL)

slide-134
SLIDE 134

Fast Parsing with Pruning

. . . form New York to Boston . . . PP/NP NP PP/NP NP λx.λy.to(y, x) NY C λx.λy.to(y, x) BOS

> >

PP PP λy.to(y, NY C) λy.to(y, BOS) N\N λf.λy.f(y) ∧ to(y, BOS)

I want a flight from New York to Boston on Delta

λx.from(x, NY C) ∧ to(x, BOS) ∧ carrier(x, DL)

slide-135
SLIDE 135

Fast Parsing with Pruning

. . . form New York to Boston . . . PP/NP NP PP/NP NP λx.λy.to(y, x) NY C λx.λy.to(y, x) BOS

> >

PP PP λy.to(y, NY C) λy.to(y, BOS) N\N λf.λy.f(y) ∧ to(y, BOS)

I want a flight from New York to Boston on Delta

λx.from(x, NY C) ∧ to(x, BOS) ∧ carrier(x, DL)

slide-136
SLIDE 136

Fast Parsing with Pruning

. . . form New York to Boston . . . PP/NP NP PP/NP NP λx.λy.to(y, x) NY C λx.λy.to(y, x) BOS

> >

PP PP λy.to(y, NY C) λy.to(y, BOS) N\N λf.λy.f(y) ∧ to(y, BOS)

I want a flight from New York to Boston on Delta

λx.from(x, NY C) ∧ to(x, BOS) ∧ carrier(x, DL)

slide-137
SLIDE 137

No initial expert knowledge Creates compact lexicons ✓ Language independent Representation independent Easily inject linguistic knowledge ✓ Weakly supervised learning ✓

Supervised Template-based GENLEX

Summary

slide-138
SLIDE 138

Unification-based GENLEX

[Kwiatkowski et al. 2010]

  • Automatically learns the templates!
  • Can be applied to any language and many different

approaches for semantic modeling!

  • Two step process!
  • Initialize lexicon with labeled logical forms!
  • “Reverse” parsing operations to split lexical

entries

slide-139
SLIDE 139

Unification-based GENLEX

For every labeled training example: Initialize the lexicon with: λx.flight(x) ∧ to(x, BOS)

I want a flight to Boston

  • Initialize lexicon with labeled logical forms

I want a flight to Boston ` S : λx.flight(x) ^ to(x, BOS)

slide-140
SLIDE 140

Unification-based GENLEX

  • Splitting lexical entries

I want a flight to Boston ` S : λx.flight(x) ^ to(x, BOS) I want a flight ` S/(S|NP) : λf.λx.flight(x) ^ f(x) to Boston ` S|NP : λx.to(x, BOS)

slide-141
SLIDE 141

Unification-based GENLEX

  • Splitting lexical entries

I want a flight to Boston ` S : λx.flight(x) ^ to(x, BOS) I want a flight ` S/(S|NP) : λf.λx.flight(x) ^ f(x) to Boston ` S|NP : λx.to(x, BOS)

Many possible category pairs Many possible phrase pairs

slide-142
SLIDE 142

Unification-based GENLEX

  • Splitting lexical entries

I want a flight to Boston ` S : λx.flight(x) ^ to(x, BOS) I want a flight ` S/(S|NP) : λf.λx.flight(x) ^ f(x) to Boston ` S|NP : λx.to(x, BOS)

Many possible category pairs Many possible phrase pairs

More details in the complete tutorial

slide-143
SLIDE 143

Experiments

  • Two database corpora:!
  • Geo880/Geo250 [Zelle and Mooney 1996; Tang and Mooney 2001]!
  • ATIS [Dahl et al. 1994]!
  • Learning from sentences paired with logical

forms!

  • Comparing template-based and unification-

based GENLEX methods

[Zettlemoyer and Collins 2007; Kwiatkowski et al. 2010; 2011]

slide-144
SLIDE 144

Results

22.5 45 67.5 90 Geo880 ATIS Geo250 English Geo250 Spanish Geo250 Japanese Geo250 Turkish

Template-based Unification-based Unification-based + Factored Lexicon

[Zettlemoyer and Collins 2007; Kwiatkowski et al. 2010; 2011]

slide-145
SLIDE 145

Templates Unification No initial expert knowledge ✓ Creates compact lexicons ✓ Language independent ✓ Representation independent ✓ Easily inject linguistic knowledge ✓ Weakly supervised learning ✓

GENLEX Comparison

slide-146
SLIDE 146

Templates Unification No initial expert knowledge ✓ Creates compact lexicons ✓ Language independent ✓ Representation independent ✓ Easily inject linguistic knowledge ✓ Weakly supervised learning ✓ ?

GENLEX Comparison

slide-147
SLIDE 147

Modeling Parsing

!

  • Structured perceptron!
  • A unified learning algorithm!
  • Supervised learning!
  • Weak supervision

Learning

Online

slide-148
SLIDE 148

Show me all papers about semantic parsing

λx.paper(x) ∧ topic(x, SEMPAR)

Parsing with CCG

Modeling

slide-149
SLIDE 149

Modeling

Show me all papers about semantic parsing

λx.paper(x) ∧ topic(x, SEMPAR)

Parsing with CCG

What should these logical forms look like? But why should we care?

slide-150
SLIDE 150

Modeling Considerations

  • Capture language complexity!
  • Satisfy system requirements!
  • Align with language units of meaning

Modeling is key to learning compact lexicons and high performing models

slide-151
SLIDE 151

Learning Parsing

!

  • Semantic modeling for:!
  • Querying databases!
  • Referring to physical objects!
  • Executing instructions!

Online

Modeling

slide-152
SLIDE 152

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

[Zettlemoyer and Collins 2005]

slide-153
SLIDE 153

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-154
SLIDE 154

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Noun Phrases

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-155
SLIDE 155

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Verbs

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-156
SLIDE 156

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Nouns

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-157
SLIDE 157

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Prepositions

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-158
SLIDE 158

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Superlatives

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-159
SLIDE 159

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Determiners

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-160
SLIDE 160

Border State

Querying Databases

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Questions

What is the capital of Arizona?! How many states border California?! What is the largest state?

slide-161
SLIDE 161

Referring to DB Entities

Nouns Noun phrases Superlatives Prepositions! Verbs

Typing (i.e., column headers) Select single DB entities Ordering queries Relations between entities

slide-162
SLIDE 162

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Noun Phrases

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

WA

Washington Florida The Sunshine State

Noun phrases name specific entities

FL

slide-163
SLIDE 163

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Noun Phrases

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

WA

Washington Florida The Sunshine State

Noun phrases name specific entities

FL

WA FL

e-typed entities

slide-164
SLIDE 164

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Noun Phrases

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Washington

Noun phrases name specific entities

NP WA

The Sunshine State

NP FL

slide-165
SLIDE 165

Verb Relations

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Nevada borders California

border(NV, CA)

Verbs express relations between entities

slide-166
SLIDE 166

Verb Relations

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Nevada borders California

border(NV, CA)

true

Verbs express relations between entities

slide-167
SLIDE 167

Verb Relations

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Nevada borders California NP S\NP/NP NP NV λx.λy.border(y, x) CA

>

S\NP λy.border(y, CA)

<

S border(NV, CA)

slide-168
SLIDE 168

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Nouns

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

state mountain

λx.state(x) λx.mountain(x)

Nouns are functions that define entity type

slide-169
SLIDE 169

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Nouns

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

state mountain

λx.state(x) λx.mountain(x)

Nouns are functions that define entity type

{ }

WA AL AK

, , ,...

ANTERO BIANCA

{

,

}

,...

!

functions define sets

e → t

slide-170
SLIDE 170

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Nouns

state mountain

Nouns are functions that define entity type

N λx.state(x) N λx.mountain(x)

slide-171
SLIDE 171

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Prepositions

mountain in Colorado

Prepositional phrases are conjunctive modifiers

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

slide-172
SLIDE 172

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Prepositions

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Prepositional phrases are conjunctive modifiers

mountain

λx.mountain(x)

ANTERO BIANCA

{

,

}

, ... ,

RAINIER

slide-173
SLIDE 173

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Prepositions

mountain in Colorado

Prepositional phrases are conjunctive modifiers

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

λx.mountain(x)∧ in(x, CO)

ANTERO BIANCA

{

,

}

slide-174
SLIDE 174

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Prepositions

mountain in Colorado N PP/NP NP λx.mountain(x) λy.λx.in(x, y) CO

>

PP λx.in(x, CO) N\N λf.λx.f(x) ∧ in(x, CO)

<

N λx.mountain(x) ∧ in(x, CO)

slide-175
SLIDE 175

Function Words

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZ

state that borders California

λx.state(x) ∧ border(x, CA)

{ }

OR NV AZ

, ,

Certain words are used to modify syntactic roles

slide-176
SLIDE 176

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Function Words

state that borders California N PP/(S\NP) S\NP/NP NP NV λf.f λx.λy.border(y, x) CA

>

S\NP λy.border(y, CA)

>

PP λy.border(y, CA) N\N λf.λy.f(y) ∧ border(y, CA)

<

N λx.state(x) ∧ (x, CA)

slide-177
SLIDE 177

Function Words

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Certain words are used to modify syntactic roles

Other common function words: which, of, for, are, is, does, please

  • May have other senses

with semantic meaning!

  • May carry content in
  • ther domains
slide-178
SLIDE 178

Definite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Definite determiner selects the single members

  • f a set when such exists

the mountain in Washington

ι : (e → t) → e

slide-179
SLIDE 179

Definite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

RAINIER

{ }

Definite determiner selects the single members

  • f a set when such exists

mountain in Washington

λx.mountain(x) ∧ in(x, WA)

ι : (e → t) → e

slide-180
SLIDE 180

Definite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

RAINIER

Definite determiner selects the single members

  • f a set when such exists

the mountain in Washington

ι : (e → t) → e

ιx.mountain(x) ∧ in(x, WA)

{ }

RAINIER

slide-181
SLIDE 181

Definite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Definite determiner selects the single members

  • f a set when such exists

the mountain in Colorado

ι : (e → t) → e

{

ιx.mountain(x) ∧ in(x, CO)

ANTERO BIANCA

{

,

}

?

slide-182
SLIDE 182

Definite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Definite determiner selects the single members

  • f a set when such exists

the mountain in Colorado

ι : (e → t) → e

{

ιx.mountain(x) ∧ in(x, CO)

ANTERO BIANCA

{

,

}

No information to disambiguate

slide-183
SLIDE 183

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Definite Determiners

the mountain in Colorado · NP/N · λf.ιx.f(x) · N λx.mountain(x) ∧ in(x, CO)

>

NP ιx.mountain(x) ∧ in(x, CO)

slide-184
SLIDE 184

Indefinite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Indefinite determiners are select any entity from a set without a preference

state with a mountain

A : (e → t) → e

[Steedman 2011; Artzi and Zettlemoyer 2013b]

λx.state(x) ∧ in(Ay.mountain(y), x)

slide-185
SLIDE 185

Indefinite Determiners

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

Indefinite determiners are select any entity from a set without a preference

A : (e → t) → e

m

Exists

[Steedman 2011; Artzi and Zettlemoyer 2013b]

λx.state(x) ∧ in(Ay.mountain(y), x) λx.state(x) ∧ ∃y.mountain(y) ∧ in(y, x)

state with a mountain

slide-186
SLIDE 186

Indefinite Determiners

state with a mountain N PP/NP NP/N N λx.state(x) λx.λy.in(x, y) λf.Ax.f(x) λx.mountain(x)

>

NP Ax.mountain(x)

>

PP λy.(Ax.mountain(x), y) N\N λf.λy.f(y) ∧ (Ax.mountain(x), y)

<

N λy.state(y) ∧ (Ax.mountain(x), y)

slide-187
SLIDE 187

Superlatives

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Superlatives select optimal entities according to a measure

the largest state

argmax(λx.state(x), λy.pop(y))

AL 3.9 AK 0.4 Seattle 2.7 San Francisco 4.1 NY 17.5 IL 11.4

Min or max ... over this set ... according to this measure

{ }

WA,

...

AL AK

, ,

slide-188
SLIDE 188

Superlatives

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Superlatives select optimal entities according to a measure

the largest state

argmax(λx.state(x), λy.pop(y))

CA

AL 3.9 AK 0.4 Seattle 2.7 San Francisco 4.1 NY 17.5 IL 11.4

Min or max ... over this set ... according to this measure

slide-189
SLIDE 189

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Superlatives

the largest state NP/N N λf.argmax(λx.f(x), λy.pop(y)) λx.state(x)

>

NP argmax(λx.state(x), λy.pop(y))

slide-190
SLIDE 190

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Superlatives

the most populated state NP/N/N N N λg.λf.argmax(λx.f(x), λy.g(y)) λx.pop(x) λx.state(x)

>

NP/N λf.argmax(λx.f(x), λy.pop(y))

>

NP argmax(λx.state(x), λy.pop(y))

slide-191
SLIDE 191

Representing Questions

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZRepresent questions as

the queries that generate their answers

Which mountains are in Arizona?

slide-192
SLIDE 192

Representing Questions

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZ

Which mountains are in Arizona?

Represent questions as the queries that generate their answers Reflects the query SQL

SELECT Name FROM Mountains WHERE State == AZ

slide-193
SLIDE 193

Representing Questions

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZRepresent questions as

the queries that generate their answers Reflects the query SQL

Which mountains are in Arizona?

λx.mountain(x) ∧ in(x, AZ)

slide-194
SLIDE 194

Representing Questions

Mountains

Name State

Bianca CO Antero CO Rainier WA Shasta CA Wrangel AK Sill CA Bona AK Elbert CO

State

Abbr. Capital Pop.

AL Montgomery 3.9 AK Juneau 0.4 AZ Phoenix 2.7 WA Olympia 4.1 NY Albany 17.5 IL Springfield 11.4

Border

State1 State2

WA OR WA ID CA OR CA NV CA AZRepresent questions as

the queries that generate their answers Reflects the query SQL

How many states border California?

count(λx.state(x) ∧ border(x, CA))

slide-195
SLIDE 195

More Reading about Modeling

Type-Logical Semantics! by Bob Carpenter

[Carpenter 1997]

slide-196
SLIDE 196

Today

Modeling Best practices for semantics design Parsing Combinatory Categorial Grammars Learning Unified learning algorithm

slide-197
SLIDE 197

[fin]