SEMPRE: Semantic Parsing with Execution Percy Liang Stanford - - PowerPoint PPT Presentation

sempre semantic parsing with execution
SMART_READER_LITE
LIVE PREVIEW

SEMPRE: Semantic Parsing with Execution Percy Liang Stanford - - PowerPoint PPT Presentation

SEMPRE: Semantic Parsing with Execution Percy Liang Stanford University CS224U May 18, 2015 Goals Show how you can use SEMPRE for question answering on Free- base. Highlight the many applications of SEMPRE. 1 Outline Review of


slide-1
SLIDE 1

SEMPRE: Semantic Parsing with Execution

Percy Liang Stanford University CS224U May 18, 2015

slide-2
SLIDE 2

Goals

  • Show how you can use SEMPRE for question answering on Free-

base.

  • Highlight the many applications of SEMPRE.

1

slide-3
SLIDE 3

Outline

Review of semantic parsing Using SEMPRE for Freebase QA

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

Other applications

2

slide-4
SLIDE 4

Question answering via semantic parsing

Which states’ capitals are also their largest cities?

3

slide-5
SLIDE 5

Question answering via semantic parsing

Which states’ capitals are also their largest cities?

semantic parsing

µx.Type.USState ⊓ Capital.argmax(Type.City ⊓ ContainedBy.x, Area)

3

slide-6
SLIDE 6

Question answering via semantic parsing

Which states’ capitals are also their largest cities?

semantic parsing

µx.Type.USState ⊓ Capital.argmax(Type.City ⊓ ContainedBy.x, Area)

execute

Arizona,Hawaii,Idaho,Indiana,Iowa,Oklahoma,Utah

3

slide-7
SLIDE 7

Question answering via semantic parsing

Which states’ capitals are also their largest cities?

semantic parsing execute

Arizona,Hawaii,Idaho,Indiana,Iowa,Oklahoma,Utah

3

slide-8
SLIDE 8

General framework

[utterance: user input]

semantic parsing

[program]

execute

[behavior: user output]

4

slide-9
SLIDE 9

Semantics?

Percy teaches at Stanford. teachesAt(Percy, Stanford)

5

slide-10
SLIDE 10

Semantics?

Semantic parsing is fundamentally a translation task...

6

slide-11
SLIDE 11

Semantics?

Semantic parsing is fundamentally a translation task... How many people live in Seattle? count(Type.Person ⊓ LiveIn.Seattle)

6

slide-12
SLIDE 12

Semantics?

Semantic parsing is fundamentally a translation task... How many people live in Seattle? R[Population].Seattle

6

slide-13
SLIDE 13

Semantics?

Semantic parsing is fundamentally a translation task... How many people live in Seattle? R[Number].(R[Population].Seattle ⊓ Year.2015)

6

slide-14
SLIDE 14

Semantics?

Semantic parsing is fundamentally a translation task... How many people live in Seattle?

R[Number]. arg max(R[Population].Seattle ⊓ Year. ≤ .2015, Year)

...into a low-level language.

6

slide-15
SLIDE 15

Probabilistic framework

x θ z w y people who have lived in Chicago parameters

Type.Person ⊓ PlacesLived.Location.Chicago

context {BarackObama,MichelleObama,...}

7

slide-16
SLIDE 16

Freebase

100M entities (nodes) 1B assertions (edges)

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

[Bollacker, 2008; Google, 2013] 8

slide-17
SLIDE 17

Logical forms: lambda DCS

Type.Person ⊓ PlacesLived.Location.Chicago

[Liang, 2013] 9

slide-18
SLIDE 18

Logical forms: lambda DCS

Type.Person ⊓ PlacesLived.Location.Chicago

  • Person

Type

?

PlacesLived

Chicago

Location

[Liang, 2013] 9

slide-19
SLIDE 19

Logical forms: lambda DCS

Type.Person ⊓ PlacesLived.Location.Chicago

  • Person

Type

?

PlacesLived

Chicago

Location BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

[Liang, 2013] 9

slide-20
SLIDE 20

Logical forms: lambda DCS

Type.Person ⊓ PlacesLived.Location.Chicago

  • Person

Type

?

PlacesLived

Chicago

Location BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

[Liang, 2013] 9

slide-21
SLIDE 21

Lambda DCS

Entity Chicago

10

slide-22
SLIDE 22

Lambda DCS

Entity Chicago Join PlaceOfBirth.Chicago

10

slide-23
SLIDE 23

Lambda DCS

Entity Chicago Join PlaceOfBirth.Chicago Intersect Type.Person⊓PlaceOfBirth.Chicago

10

slide-24
SLIDE 24

Lambda DCS

Entity Chicago Join PlaceOfBirth.Chicago Intersect Type.Person⊓PlaceOfBirth.Chicago Aggregation count(Type.Person ⊓ PlaceOfBirth.Chicago)

10

slide-25
SLIDE 25

Lambda DCS

Entity Chicago Join PlaceOfBirth.Chicago Intersect Type.Person⊓PlaceOfBirth.Chicago Aggregation count(Type.Person ⊓ PlaceOfBirth.Chicago) Superlative argmin(Type.Person ⊓ PlaceOfBirth.Chicago, DateOfBirth)

10

slide-26
SLIDE 26

Lambda DCS

Entity Chicago Join PlaceOfBirth.Chicago Intersect Type.Person⊓PlaceOfBirth.Chicago Aggregation count(Type.Person ⊓ PlaceOfBirth.Chicago) Superlative argmin(Type.Person ⊓ PlaceOfBirth.Chicago, DateOfBirth) Anaphora µx.Type.Person ⊓ Children.Influence.x

10

slide-27
SLIDE 27

Lambda DCS

Entity Chicago Join PlaceOfBirth.Chicago Intersect Type.Person⊓PlaceOfBirth.Chicago Aggregation count(Type.Person ⊓ PlaceOfBirth.Chicago) Superlative argmin(Type.Person ⊓ PlaceOfBirth.Chicago, DateOfBirth) Anaphora µx.Type.Person ⊓ Children.Influence.x Variable argmax(Type.Person, R[λx.count(Parent.Parent.x)])

10

slide-28
SLIDE 28

Comparison to lambda calculus

Lambda calculus

λx.Type(x, Person) ∧ ∃e.PlacesLived(x, e) ∧ Location(e, Chicago)

11

slide-29
SLIDE 29

Comparison to lambda calculus

Lambda calculus

λx.Type(x, Person) ∧ ∃e.PlacesLived(x, e) ∧ Location(e, Chicago)

Lambda dependency-based compositional semantics (DCS)

Type.Person ⊓ PlacesLived.Location.Chicago

11

slide-30
SLIDE 30

Probabilistic framework

x θ z w y people who have lived in Chicago parameters

Type.Person ⊓ PlacesLived.Location.Chicago

context {BarackObama,MichelleObama,...}

12

slide-31
SLIDE 31

(Over)-generating derivations

utterance Grammar derivation 1 derivation 2 ...

13

slide-32
SLIDE 32

(Over)-generating derivations

utterance Grammar derivation 1 derivation 2 ...

A Real Dumb Grammar (lexicon) Chicago ⇒ E : Chicago (lexicon) people ⇒ E : Type.Person (lexicon) live ⇒ E × E : PlacesLived ... (join) E × E : b E : u ⇒ E : b.u (intersect) E : u E : v ⇒ E : u ⊓ v

13

slide-33
SLIDE 33

Derivations

Derivation: construction of logical form given utterance

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago

14

slide-34
SLIDE 34

Derivations

Derivation: construction of logical form given utterance

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon

14

slide-35
SLIDE 35

Derivations

Derivation: construction of logical form given utterance

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon join

14

slide-36
SLIDE 36

Derivations

Derivation: construction of logical form given utterance

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon join intersect

14

slide-37
SLIDE 37

Floating parsers

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon join intersect 15

slide-38
SLIDE 38

Floating parsers

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person PlaceLived.Location.Chicago PlaceLived.Location Chicago Chicago lexicon join intersect people who have lived in

Key idea: detach logical form from sentence

15

slide-39
SLIDE 39

Floating parsers

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person PlaceLived.Location.Chicago PlaceLived.Location Chicago Chicago lexicon join intersect people who have lived in

Key idea: detach logical form from sentence Pruning: use world knowledge / pragmatics — avoid empty sets, type errors, redundant operations

15

slide-40
SLIDE 40

Many possible derivations!

x = people who have lived in Chicago

16

slide-41
SLIDE 41

Many possible derivations!

x = people who have lived in Chicago

?

set of candidate derivations D(x)

16

slide-42
SLIDE 42

Many possible derivations!

x = people who have lived in Chicago

?

set of candidate derivations D(x)

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon join intersect 16

slide-43
SLIDE 43

Many possible derivations!

x = people who have lived in Chicago

?

set of candidate derivations D(x)

Type.Org ⊓ PresentIn.ChicagoMusical Type.Org people who PresentIn.ChicagoMusical have PresentIn lived in ChicagoMusical Chicago lexicon lexicon lexicon join intersect 16

slide-44
SLIDE 44

x: utterance d: derivation

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon join intersect

Feature vector φ(x, d) ∈ RF :

17

slide-45
SLIDE 45

x: utterance d: derivation

Type.Person ⊓ PlaceLived.Location.Chicago Type.Person people who PlaceLived.Location.Chicago have PlaceLived.Location lived in Chicago Chicago lexicon lexicon lexicon join intersect

Feature vector φ(x, d) ∈ RF :

apply join 1 apply intersect 1 apply lexicon 3 skipped IN 1 skipped NN lived maps to PlacesLived.Location 1 lived maps to PlaceOfBirth alignmentScore 1.52 denotation-size=1 1 ... ...

17

slide-46
SLIDE 46

Scoring derivations

Feature vector: φ(x, d) = [1.3, 2, 0, 1, 0, 0, . . . ] ∈ RF

18

slide-47
SLIDE 47

Scoring derivations

Feature vector: φ(x, d) = [1.3, 2, 0, 1, 0, 0, . . . ] ∈ RF Parameter vector: θ = [1.2, −2.7, 3.4, . . . ] ∈ RF

18

slide-48
SLIDE 48

Scoring derivations

Feature vector: φ(x, d) = [1.3, 2, 0, 1, 0, 0, . . . ] ∈ RF Parameter vector: θ = [1.2, −2.7, 3.4, . . . ] ∈ RF Scoring function: Scoreθ(x, d) = φ(x, d) · θ =

F

  • j=1

θjφj(x, d)

18

slide-49
SLIDE 49

Log-linear model

Candidate derivations (defined by grammar): D(x)

19

slide-50
SLIDE 50

Log-linear model

Candidate derivations (defined by grammar): D(x) Model: distribution over derivations d given utterance x p(d | x, θ) =

exp(Scoreθ(x,d))

  • d′∈D(x) exp(Scoreθ(x,d′))

19

slide-51
SLIDE 51

Probabilistic framework

x θ z w y people who have lived in Chicago parameters

Type.Person ⊓ PlacesLived.Location.Chicago

context {BarackObama,MichelleObama,...}

20

slide-52
SLIDE 52

Learning

Training data:

What’s Bulgaria’s capital? Sofia What movies has Tom Cruise been in? TopGun,VanillaSky,... ...

+grammar, +features

21

slide-53
SLIDE 53

Learning

Training data:

What’s Bulgaria’s capital? Sofia What movies has Tom Cruise been in? TopGun,VanillaSky,... ...

+grammar, +features Objective: Maximum likelihood arg maxθ n

i=1 log pθ(y(i) | x(i))

21

slide-54
SLIDE 54

Learning

Training data:

What’s Bulgaria’s capital? Sofia What movies has Tom Cruise been in? TopGun,VanillaSky,... ...

+grammar, +features Objective: Maximum likelihood arg maxθ n

i=1 log pθ(y(i) | x(i))

Algorithm: AdaGrad (stochastic gradient with per-feature step size)

21

slide-55
SLIDE 55

Training intuition

Where did Mozart tupress? Vienna

22

slide-56
SLIDE 56

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart PlaceOfDeath.WolfgangMozart PlaceOfMarriage.WolfgangMozart Vienna

22

slide-57
SLIDE 57

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna

22

slide-58
SLIDE 58

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna

22

slide-59
SLIDE 59

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna Where did Hogarth tupress?

22

slide-60
SLIDE 60

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna Where did Hogarth tupress? PlaceOfBirth.WilliamHogarth PlaceOfDeath.WilliamHogarth PlaceOfMarriage.WilliamHogarth London

22

slide-61
SLIDE 61

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna Where did Hogarth tupress? PlaceOfBirth.WilliamHogarth ⇒ London PlaceOfDeath.WilliamHogarth ⇒ London PlaceOfMarriage.WilliamHogarth ⇒ Paddington London

22

slide-62
SLIDE 62

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna Where did Hogarth tupress? PlaceOfBirth.WilliamHogarth ⇒ London PlaceOfDeath.WilliamHogarth ⇒ London PlaceOfMarriage.WilliamHogarth ⇒ Paddington London

22

slide-63
SLIDE 63

Training intuition

Where did Mozart tupress? PlaceOfBirth.WolfgangMozart ⇒ Salzburg PlaceOfDeath.WolfgangMozart ⇒ Vienna PlaceOfMarriage.WolfgangMozart ⇒ Vienna Vienna Where did Hogarth tupress? PlaceOfBirth.WilliamHogarth ⇒ London PlaceOfDeath.WilliamHogarth ⇒ London PlaceOfMarriage.WilliamHogarth ⇒ Paddington London

22

slide-64
SLIDE 64

Two types of errors

Correct Ranking Errors (features) Coverage Errors (grammar)

23

slide-65
SLIDE 65

Outline

Review of semantic parsing Using SEMPRE for Freebase QA

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

Other applications

24

slide-66
SLIDE 66

Setting up SEMPRE

git clone https://github.com/percyliang/sempre cd sempre ./pull-dependencies core corenlp freebase make module-classes freebase

25

slide-67
SLIDE 67

Freebase players

Entities: fb:en.barack obama Types: fb:people.person Properties: fb:people.person.place of birth

26

slide-68
SLIDE 68

Freebase players

Entities: fb:en.barack obama : (union fb:people.person fb:biology.animal owner ...) Types: fb:people.person : fb:type.type Properties: fb:people.person.place of birth : (-¿ fb:location.location fb:people.person)

26

slide-69
SLIDE 69

Running SEMPRE

Browse Freebase:

freebase/scripts/fbshell.rb

Interactive prompt:

./run @mode=simple-freebase -Grammar.inPaths cs224u.grammar

27

slide-70
SLIDE 70

Grammar rules

three plus four hundred (rule $Number ($PHRASE) (NumberFn)) (rule $Number ($Number plus $Number) (lambda x (lambda y (call + (var x) (var y))))) How a rule works:

  • Match RHS to produce input derivations
  • Call semantic function (SemanticFn) on input derivations to pro-

duce zero or more output derivations

28

slide-71
SLIDE 71

SEMPRE components

  • Formula: logical form (Java program or lambda DCS)
  • Value: denotation (Java object)

29

slide-72
SLIDE 72

SEMPRE components

  • Formula: logical form (Java program or lambda DCS)
  • Value: denotation (Java object)
  • Executor: maps logical forms to denotations (JavaExecutor or

SparqlExecutor)

  • Parser:

maps utterances to logical forms (BeamParser or FloatingParser)

  • Learner: maps examples to parameters

29

slide-73
SLIDE 73

Creating a simple grammar

[demo]

30

slide-74
SLIDE 74

SEMPRE highlights

  • Integrates rule-based and statistical methods
  • Agnostic to grammar (CFG, CCG, loose or tight)
  • Agnostic to logical form (lambda DCS, lambda calculus, Java,

AMR)

  • Agnostic to answer (any Java object)
  • Grammar: SemanticFn, built on CoreNLP
  • Learning: online feature-rich discriminative training with embed-

ded execution

31

slide-75
SLIDE 75

Pointers

Issues/questions: https://github.com/percyliang/sempre/issues

32

slide-76
SLIDE 76

Pointers

Issues/questions: https://github.com/percyliang/sempre/issues Internal repository on NLP machines (ask Percy for permissions): git clone jamie:/user/psl/git/semparse.git Internal mailing list: stanford-sempre@googlegroups.com

32

slide-77
SLIDE 77

Outline

Review of semantic parsing Using SEMPRE for Freebase QA

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

Other applications

33

slide-78
SLIDE 78

Text-to-scene generation

There is a room with a chair and a computer.

[Angel Chang, Will Monroe, Chris Potts, Chris Manning] 34

slide-79
SLIDE 79

Solving LSAT logic puzzles

Exactly six of seven jugglers–G, H, K, L, N, P, and Q–are each assigned to exactly one of three positions–front, middle, and rear–on one of two teams–team 1 and team 2. For each team, exactly one juggler must be assigned to each position according to the following conditions:

  • If either G or H or both are assigned to teams, they are assigned

to front positions.

  • ...

[with Robin Jia (Lev/MacCartney/Manning/Levy’s dataset)] 35

slide-80
SLIDE 80

Solving LSAT logic puzzles

Exactly six of seven jugglers–G, H, K, L, N, P, and Q–are each assigned to exactly one of three positions–front, middle, and rear–on one of two teams–team 1 and team 2. For each team, exactly one juggler must be assigned to each position according to the following conditions:

  • If either G or H or both are assigned to teams, they are assigned

to front positions.

  • ...

Which one of the following is an acceptable list of assignments of jugglers to team 2?

  • front: Q; middle: K; rear: N
  • ...

[with Robin Jia (Lev/MacCartney/Manning/Levy’s dataset)] 35

slide-81
SLIDE 81

Compositionality on web tables

In what city did Piotr’s last 1st place finish occur?

[with Ice Pasupat; ACL 2015] 36

slide-82
SLIDE 82

Compositionality on web tables

How many times has this competitor placed 5th or better in competition?

[with Ice Pasupat; ACL 2015] 36

slide-83
SLIDE 83

Context-dependent semantic parsing

abc ijk xyz add an ”s” to the end of the first group abcs ijk xyz add another to the end of the second abcs ijks xyz and the third abcs ijks xyzs

[with Reggy Long and Ice Pasupat] 37

slide-84
SLIDE 84

Interpreting high-level instructions

[with Dipendra Misra, Kejia Tao, Ashutosh Saxena, ACL 2015] 38

slide-85
SLIDE 85

Agenda-based semantic parsing

what city was abraham lincoln born in 20

AbeLincoln LincolnTown . . .

362

Type.City Type.Loc . . .

20

AbrahamProphet AbeLincoln . . .

391 508

PlaceOfBirthOf PlacesLived . . . ContainedBy StarredIn . . .

>1M

Type.City ⊓ PlaceOfBirthOf.AbeLincoln Type.Loc ⊓ ContainedBy.LincolnTown . . .

s1

[with Jonathan Berant, in submission] 39

slide-86
SLIDE 86

Agenda-based semantic parsing

what city was abraham lincoln born in 20

AbeLincoln LincolnTown . . .

362

Type.City Type.Loc . . .

20

AbrahamProphet AbeLincoln . . .

391 508

PlaceOfBirthOf PlacesLived . . . ContainedBy StarredIn . . .

>1M

Type.City ⊓ PlaceOfBirthOf.AbeLincoln Type.Loc ⊓ ContainedBy.LincolnTown . . .

s1 s2

a1

[with Jonathan Berant, in submission] 39

slide-87
SLIDE 87

Agenda-based semantic parsing

what city was abraham lincoln born in 20

AbeLincoln LincolnTown . . .

362

Type.City Type.Loc . . .

20

AbrahamProphet AbeLincoln . . .

391 508

PlaceOfBirthOf PlacesLived . . . ContainedBy StarredIn . . .

>1M

Type.City ⊓ PlaceOfBirthOf.AbeLincoln Type.Loc ⊓ ContainedBy.LincolnTown . . .

s1 s2

a1

s3

a2

. . .

a3

sT +1

aT

[with Jonathan Berant, in submission] 39

slide-88
SLIDE 88

Agenda-based semantic parsing

what city was abraham lincoln born in 20

AbeLincoln LincolnTown . . .

362

Type.City Type.Loc . . .

20

AbrahamProphet AbeLincoln . . .

391 508

PlaceOfBirthOf PlacesLived . . . ContainedBy StarredIn . . .

>1M

Type.City ⊓ PlaceOfBirthOf.AbeLincoln Type.Loc ⊓ ContainedBy.LincolnTown . . .

s1 s2

a1

s3

a2

. . .

a3

sT +1

aT

[with Jonathan Berant, in submission] 39

slide-89
SLIDE 89

Agenda-based semantic parsing

what city was abraham lincoln born in 20

AbeLincoln LincolnTown . . .

362

Type.City Type.Loc . . .

20

AbrahamProphet AbeLincoln . . .

391 508

PlaceOfBirthOf PlacesLived . . . ContainedBy StarredIn . . .

>1M

Type.City ⊓ PlaceOfBirthOf.AbeLincoln Type.Loc ⊓ ContainedBy.LincolnTown . . .

s1 s2

a1

s3

a2

. . .

a3

sT +1

aT

Learn which derivations to try first ⇒ 8x speedup

[with Jonathan Berant, in submission] 39

slide-90
SLIDE 90

Overnight semantic parsing

Domain [with Yushi Wang, Jonathan Berant, ACL 2015] 40

slide-91
SLIDE 91

Overnight semantic parsing

Domain Seed lexicon article → TypeNP[article] publication date → RelNP[publicationDate] cites → VP/NP[cites] ... (1) by builder (∼30 minutes) [with Yushi Wang, Jonathan Berant, ACL 2015] 40

slide-92
SLIDE 92

Overnight semantic parsing

Domain Seed lexicon article → TypeNP[article] publication date → RelNP[publicationDate] cites → VP/NP[cites] ... Logical forms and canonical utterances article with the largest publication date arg max(type.article, publicationDate) person that is author of the most number of article arg max(type.person, R[λx.Count(type.article ⊓ author.x)]) ... (1) by builder (∼30 minutes) (2) via domain-general grammar [with Yushi Wang, Jonathan Berant, ACL 2015] 40

slide-93
SLIDE 93

Overnight semantic parsing

Domain Seed lexicon article → TypeNP[article] publication date → RelNP[publicationDate] cites → VP/NP[cites] ... Logical forms and canonical utterances article with the largest publication date arg max(type.article, publicationDate) person that is author of the most number of article arg max(type.person, R[λx.Count(type.article ⊓ author.x)]) ... Paraphrases what is the newest published article? who has published the most articles? ... (1) by builder (∼30 minutes) (2) via domain-general grammar (3) via crowdsourcing (∼5 hours) [with Yushi Wang, Jonathan Berant, ACL 2015] 40

slide-94
SLIDE 94

Overnight semantic parsing

Domain Seed lexicon article → TypeNP[article] publication date → RelNP[publicationDate] cites → VP/NP[cites] ... Logical forms and canonical utterances article with the largest publication date arg max(type.article, publicationDate) person that is author of the most number of article arg max(type.person, R[λx.Count(type.article ⊓ author.x)]) ... Paraphrases what is the newest published article? who has published the most articles? ... Semantic parser (1) by builder (∼30 minutes) (2) via domain-general grammar (3) via crowdsourcing (∼5 hours) (4) via domain-general paraphrasing model [with Yushi Wang, Jonathan Berant, ACL 2015] 40

slide-95
SLIDE 95

Answering macro questions

Which country has the highest CO2 emissions? Which had the highest increase since last year? What fraction is from the five countries with highest GDP?

41

slide-96
SLIDE 96

Natural language interfaces

Which restaurants have my friends been to in the last week? Which restaurants will still be open Sunday at 10pm? On Friday night, leave the front light on.

42

slide-97
SLIDE 97

Code and data

http://www-nlp.stanford.edu/software/sempre/ http://www.codalab.org

Collaborators

Jonathan Berant Andrew Chou Roy Frostig Ice Pasupat Yushi Wang Robin Jia Reggy Long

Funding

Google Microsoft DARPA

Thank you!

43