69
Combining Natural Logic and Shallow Reasoning for Question Answering Gabor Angeli, Neha Nayak, Chris Manning Stanford University August 8, 2016 Gabor Angeli, Neha Nayak, Chris Manning (Stanford) Natural Logic + Shallow Reasoning August 8, 2016 0 / 17

Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Combining Natural Logic and Shallow Reasoning forQuestion Answering

Gabor Angeli, Neha Nayak, Chris Manning

Stanford University

August 8, 2016

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 0 / 17

Page 2: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Old Problem: Logic + ML often at odds

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 1 / 17

Page 3: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Old Problem: Logic + ML often at odds

ML gives us practical, generalizable systems:P: Ovaries are the female part of the flower, which produces eggs

that are needed for making seeds.H: A flower produces the seeds.

...But struggles with logical subtletiesP: Eating candy for dinner is an example of a poor health habit.H: Eating candy is an example of a good health habit.

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 1 / 17

Page 4: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Make ML more first-order-logic-like

Markov Logic Networks[Richardson and Domingos, 2006][Niu et al., 2011]

Probabilistic Soft Logic[Kimmig et al., 2012][Beltagy et al., 2014]

Deep Learning + Logic[Rocktaschel et al., 2014][Bowman, 2014]

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 1 / 17

Page 5: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Find logics that are better for ML

Natural Logic!

[Sanchez Valencia, 1991, MacCartney and Manning, 2008,Icard III and Moss, 2014]

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 2 / 17

Page 6: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

The Persians are Invading Greece

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 3 / 17

Page 7: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

How Did You Solve This?

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 3 / 17

Page 8: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Show of Hands: First Order Logic?

1 ∀x God(x)⊃ LivesOnOlympus(x)

2 ∃x Hero(x)∧God(x)

3 ¬∃x LivesOnOlympus(x)∧Persian(x)

4 ∀x Hero(x)⊃ Persian(x)

5 a Hero(a)∧God(a) ∃E, 2

6 Hero(a) ∧E, 5

7 Hero(a)⊃ Persian(a) ∀E, 4

8 Persian(a) ⇒E, 6, 7

9 God(a) ∧E, 5

10 God(a)⊃ LivesOnOlympus(a) ∀E, 1

11 LivesOnOlympus(a) ⇒E, 9, 10

12 LivesOnOlympus(a)∧Persian(a) ∧I, 8, 11

13 ∃x LivesOnOlympus(x)∧Persian(x) ∃I, 12

14 ∃x LivesOnOlympus(x)∧Persian(x) R, 12

15 ⊥ ⊥ I, 3, 14

16 ¬ ∀x Hero(x)⊃ Persian(x) ¬ I, 4––15

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 3 / 17

Page 9: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Syllogisms: The First Natural Logic

1 All Gods live on Mount Olympus

2 Some heroes are Gods

3 Nobody who lives on Mount Olympus is Persian

4 Some heroes live on Mount Olympus AII (Darii), 1, 2

5 Some heroes are not Persian EIO (Ferio), 4, 3

6 ¬ All heroes are Persian SaP ⊥ SoP, 5

...But syllogisms are cripplingly unexpressive

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 4 / 17

Page 10: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Syllogisms: The First Natural Logic

1 All Gods live on Mount Olympus

2 Some heroes are Gods

3 Nobody who lives on Mount Olympus is Persian

4 Some heroes live on Mount Olympus AII (Darii), 1, 2

5 Some heroes are not Persian EIO (Ferio), 4, 3

6 ¬ All heroes are Persian SaP ⊥ SoP, 5

...But syllogisms are cripplingly unexpressive

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 4 / 17

Page 11: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Polarity

Not pictured: also handles negation

↑ All↓↑

carnivores

felines

↓ cats

house cats

consume

↑ eat

slurp

placentals

rodents

↑ mice

fieldmice

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 12: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Mutations must respect polarity.

Not pictured: also handles negation

↑ All↓↑

felines

cats

↓ house cats

kitties

consume

↑ eat

slurp

placentals

rodents

↑ mice

fieldmice

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 13: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Mutations must respect polarity.

Not pictured: also handles negation

↑ All↓↑

felines

cats

↓ house cats

kitties

↑ consume

eat

placentals

rodents

↑ mice

fieldmice

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 14: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Mutations must respect polarity.

Not pictured: also handles negation

↑ All↓↑

felines

cats

↓ house cats

kitties

↑ consume

eat

rodents

mice

↑ fieldmice

pine vole

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 15: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Mutations must respect polarity.

Not pictured: also handles negation

↑ All↓↑

felines

cats

↓ house cats

kitties

↑ consume

eat

placentals

rodents

↑ mice

fieldmice

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 16: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Mutations must respect polarity.

Not pictured: also handles negation

↑ All↓↑

felines

cats

↓ house cats

kitties

↑ consume

eat

mammals

placentals

↑ rodents

mice

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 17: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Modern Natural Logic

Quantifiers determines the polarity (↑ or ↓) of words.

Mutations must respect polarity.

Not pictured: also handles negation

↑ All↓↑

felines

cats

↓ house cats

kitties

↑ consume

eat

mammals

placentals

↑ rodents

mice

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 5 / 17

Page 18: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

Shorthand for a node:

↑ No↓↓

organism

animal

↓ carnivores

felines

consume

↓ eat

slurp

living thing

organism

↓ animals

chordate

No carnivoreseat animals?

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 19: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

No carnivoreseat animals?

The carnivoreseat animals

The cateats animals

The catate an animal

The catate a mouse

. . .

. . . . . .

. . .

All catshave tails

All kittensare cute

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 20: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

ROOT

No carnivoreseat animals?

The carnivoreseat animals

No animalseat animals

. . .ϕ ⇒ ψ

ϕ ; ψ

ϕ ⇒¬ψ

f��

w`

≡v

f`

��v

≡w

any

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 21: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

No carnivoreseat animals

The carnivoreseat animals?

The felineeats animals

All carnivoreseat animals

. . .ϕ ⇒ ψ

ϕ ; ψ

ϕ ⇒¬ψ

f��

w`

≡v

f`

��v

≡w

any

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 22: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

The carnivoreseat animals

The felineeats animals?

The cat eatsanimals

The cat eatschordate

. . .ϕ ⇒ ψ

ϕ ; ψ

ϕ ⇒¬ψ

f��

w`

≡v

f`

��v

≡w

any

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 23: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

The felineeats animals

The cat eatsanimals?

The cat eatschordates

The kittyeats animals

. . .ϕ ⇒ ψ

ϕ ; ψ

ϕ ⇒¬ψ

f��

w`

≡v

f`

��v

≡w

any

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 24: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

The cat eatsanimals

The cat eatschordates?

The cateats mice

The cateats dogs

. . .ϕ ⇒ ψ

ϕ ; ψ

ϕ ⇒¬ψ

f��

w`

≡v

f`

��v

≡w

any

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 25: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Natural Logic Q/A as Search

The cat eatschordates

The cateats mice?

The cat atea mouse

The kittyeats mice

. . .ϕ ⇒ ψ

ϕ ; ψ

ϕ ⇒¬ψ

f��

w`

≡v

f`

��v

≡w

any

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 6 / 17

Page 26: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Three Contributions for Generalizable Inference

1. Partial order over meronymy + relations

Earth

EU

↑ Germany

Berlin

have

↑ own

sell

2. Natural Logic over dependency trees

Some↑ truly↑ notorious↑ villains↑ have↑ lairs↑.

operator

nsubjamodadvmod dobj

3. Hybrid statistical / logical solver

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 7 / 17

Page 27: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Three Contributions for Generalizable Inference

1. Partial order over meronymy + relations

Earth

EU

↑ Germany

Berlin

have

↑ own

sell

2. Natural Logic over dependency trees

Some↑ truly↑ notorious↑ villains↑ have↑ lairs↑.

operator

nsubjamodadvmod dobj

3. Hybrid statistical / logical solver

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 7 / 17

Page 28: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Three Contributions for Generalizable Inference

1. Partial order over meronymy + relations

Earth

EU

↑ Germany

Berlin

have

↑ own

sell

2. Natural Logic over dependency trees

Some↑ truly↑ notorious↑ villains↑ have↑ lairs↑.

operator

nsubjamodadvmod dobj

3. Hybrid statistical / logical solver

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 7 / 17

Page 29: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

An Example Search

ROOT

Rain and snow aretypes of precipitation?

Rain and snoware forms ofprecipitation

Heavy rain and snoware types of precipitation

. . .

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 8 / 17

Page 30: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

An Example Search

ROOT

Rain and snow aretypes of precipitation?

Rain and snoware forms ofprecipitation

Heavy rain and snoware types of precipitation

. . .

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 9 / 17

Page 31: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

An Example SearchRain and snow are

types of precipitation

Rain and snow areforms of precipitation?

Rain and snoware formsof weather

Heavy rain and snoware forms of precipitation

. . .

Forms of precipitationinclude rain and sleet

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 9 / 17

Page 32: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

An Example SearchRain and snow are

types of precipitation

Rain and snow areforms of precipitation?

Rain and snoware formsof weather

Heavy rain and snoware forms of precipitation

. . .

Forms of precipitationinclude rain and sleet

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 9 / 17

Page 33: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

An Example SearchRain and snow are

types of precipitation

Rain and snow areforms of precipitation?

Rain and snoware formsof weather

Heavy rain and snoware forms of precipitation

. . .

Forms of precipitationinclude rain and sleet

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 9 / 17

Page 34: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsxx of precipitationxx includexx rainxx and sleetxx

Rainxx and snowxx are formsxx of precipitationxx

Features1. Matching words2. Mismatched words3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 35: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Features1. Matching words2. Mismatched words3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 36: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Features1. Matching words2. Mismatched words3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 37: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Features1. Matching words

2. Mismatched words3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 38: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Features1. Matching words2. Mismatched words

3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 39: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Features1. Matching words2. Mismatched words3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 40: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Lexical Alignment Classifier

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Features1. Matching words2. Mismatched words3. Unmatched words in premise/consequent

Competitive with Stanford RTE system (63% on RTE3)

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 10 / 17

Page 41: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Old Problem: Logic + Lexical Classifiers

FOL and lexical classifiers don’t speak the same language

...but natural logic does!

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 11 / 17

Page 42: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Old Problem: Logic + Lexical Classifiers

FOL and lexical classifiers don’t speak the same language...but natural logic does!

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 11 / 17

Page 43: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Big Picture

Run our usual search1. If we find a premise, great!

2. If not, use lexical classifier as an evaluation function

Visit 1M nodes / second: We have to be fast!

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 12 / 17

Page 44: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Big Picture

Run our usual search1. If we find a premise, great!2. If not, use lexical classifier as an evaluation function

Visit 1M nodes / second: We have to be fast!

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 12 / 17

Page 45: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Big Picture

Run our usual search1. If we find a premise, great!2. If not, use lexical classifier as an evaluation function

Visit 1M nodes / second: We have to be fast!

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 12 / 17

Page 46: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Dissecting Our Classifier

Anatomy of a ClassifierFeatures f (matching / mismatched / unmatched words)Weights wEntailment pair x

p(entail | x) = 11+exp(−wTf (x))

p(entail | x) monotone w.r.t.(wTf (x)

)Only need wTf (x) during search to compute maxp(entail | x)wTf (x) is our evaluation function

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 13 / 17

Page 47: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Dissecting Our Classifier

Anatomy of a ClassifierFeatures f (matching / mismatched / unmatched words)Weights wEntailment pair x

p(entail | x) = 11+exp(−wTf (x))

p(entail | x) monotone w.r.t.(wTf (x)

)

Only need wTf (x) during search to compute maxp(entail | x)wTf (x) is our evaluation function

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 13 / 17

Page 48: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Dissecting Our Classifier

Anatomy of a ClassifierFeatures f (matching / mismatched / unmatched words)Weights wEntailment pair x

p(entail | x) = 11+exp(−wTf (x))

p(entail | x) monotone w.r.t.(wTf (x)

)Only need wTf (x) during search to compute maxp(entail | x)wTf (x) is our evaluation function

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 13 / 17

Page 49: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Incorporating our Evaluation Function

Anatomy of a Search Step1. Mutate a word, or2. Delete a word, or3. Insert a word.

Each step updates a small number of features

wT f (x) = v xi

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 14 / 17

Page 50: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Incorporating our Evaluation Function

Anatomy of a Search Step1. Mutate a word, or2. Delete a word, or3. Insert a word.

Each step updates a small number of features

wT f (x) = v xi

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 14 / 17

Page 51: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Incorporating our Evaluation Function

Anatomy of a Search Step1. Mutate a word, or2. Delete a word, or3. Insert a word.

Each step updates a small number of features

v ′ = v - wi · fi + wi · fi

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 14 / 17

Page 52: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Why is this Important?

Faster Search⇒ Deeper ReasoningSpeed: Around 1M search states visited per secondMemory: 32 byte search states

Speed: Don’t re-featurize at every timestep.

Memory: Never store intermediate fact as String.

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 15 / 17

Page 53: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Another Example Search

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are typesc of precipitationc

Score wTf (x): -0.5

Feature w f (x)Matching words 2.0 2Mismatched words -1.0 2Unmatched premise -0.5 1Unmatched consequent -0.75 0Bias -2.0 1

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 54: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Another Example Search

ROOT

Rain and snow aretypes of precipitation?

Rain and snoware forms ofprecipitation

Rain and snow aretypes of weather

. . .

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 55: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Another Example Search

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Score wTf (x): -0.5 + 2 − -1

Feature w f (x)Matching words 2.0 3Mismatched words -1.0 1Unmatched premise -0.5 1Unmatched consequent -0.75 0Bias -2.0 1

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 15 / 17

Page 56: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Another Example Search

Formsp of precipitationp includep rainp and sleetp

Rainc and snowc are formsc of precipitationc

Score wTf (x): 2.5

Feature w f (x)Matching words 2.0 3Mismatched words -1.0 1Unmatched premise -0.5 1Unmatched consequent -0.75 0Bias -2.0 1

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 15 / 17

Page 57: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

Which activity is an example of a good health habit?(A) Watching television(B) Smoking cigarettes(C) Eating candy(D) Exercising every day

In our corpus:Plasma TV’s can display up to 16 million colors . . . great forwatching TV . . . also make a good screen.Not smoking or drinking alcohol is good for health, regardless ofwhether clothing is worn or not.Eating candy for diner is an example of a poor health habit.Healthy is exercising

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 58: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

Which activity is an example of a good health habit?(A) Watching television(B) Smoking cigarettes(C) Eating candy(D) Exercising every day

In our corpus:Plasma TV’s can display up to 16 million colors . . . great forwatching TV . . . also make a good screen.Not smoking or drinking alcohol is good for health, regardless ofwhether clothing is worn or not.Eating candy for diner is an example of a poor health habit.Healthy is exercising

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 59: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

Which activity is an example of a good health habit?(A) Watching television(B) Smoking cigarettes(C) Eating candy(D) Exercising every day

In our corpus:Plasma TV’s can display up to 16 million colors . . . great forwatching TV . . . also make a good screen.Not smoking or drinking alcohol is good for health, regardless ofwhether clothing is worn or not.Eating candy for diner is an example of a poor health habit.Healthy is exercising

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 60: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

System Train TestKNOWBOT 45KNOWBOT (ORACLE) 57

IR Baseline 49This Work 52More Data + IR Baseline 62More Data + This Work 65This Work + + 74 67

We’re able to pass 4th grade science!(Though AI2’s recent systems outperform this)

[Hixon et al., 2015]Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 61: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

System Train TestKNOWBOT 45KNOWBOT (ORACLE) 57IR Baseline 49This Work 52

More Data + IR Baseline 62More Data + This Work 65This Work + + 74 67

We’re able to pass 4th grade science!(Though AI2’s recent systems outperform this)

[Hixon et al., 2015]Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 62: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

System Train TestKNOWBOT 45KNOWBOT (ORACLE) 57IR Baseline 49This Work 52More Data + IR Baseline 62More Data + This Work 65

This Work + + 74 67

We’re able to pass 4th grade science!(Though AI2’s recent systems outperform this)

[Hixon et al., 2015]Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 63: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

System Train TestKNOWBOT 45 −KNOWBOT (ORACLE) 57 −IR Baseline 49 42This Work 52 51More Data + IR Baseline 62 58More Data + This Work 65 61

This Work + + 74 67

We’re able to pass 4th grade science!(Though AI2’s recent systems outperform this)

[Hixon et al., 2015]Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 64: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

System Train TestKNOWBOT 45 −KNOWBOT (ORACLE) 57 −IR Baseline 49 42This Work 52 51More Data + IR Baseline 62 58More Data + This Work 65 61This Work + + 74 67

We’re able to pass 4th grade science!(Though AI2’s recent systems outperform this)

[Hixon et al., 2015]Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 65: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Solving 4th Grade Science

Multiple choice questions from real 4th grade science exams

System Train TestKNOWBOT 45 −KNOWBOT (ORACLE) 57 −IR Baseline 49 42This Work 52 51More Data + IR Baseline 62 58More Data + This Work 65 61This Work + + 74 67

We’re able to pass 4th grade science!(Though AI2’s recent systems outperform this)

[Hixon et al., 2015]Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 16 / 17

Page 66: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

Conclusions

Natural LogicA logic over the syntax of natural languageExpressive but efficient

Natural Logic “plays nice” with statistical (/deep?) methodsBoth operate directly over textUse lexical classifier as evaluation function

NaturalLI + Evaluation FunctionAlso detects likely entailment / contradictions3% improvement on science exam questions

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 17 / 17

Page 67: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

References I

Beltagy, I., Erk, K., and Mooney, R. (2014).Semantic parsing using distributional semantics and probabilistic logic.In Association for Computational Linguistics (ACL), page 7.

Bowman, S. (2014).Can recursive neural tensor networks learn logical reasoning?ICLR (arXiv:1312.6192).

Hixon, B., Clark, P., and Hajishirzi, H. (2015).Learning knowledge graphs for question answering throughconversational dialog.NAACL.

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 18 / 17

Page 68: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

References II

Icard III, T. and Moss, L. (2014).Recent progress on monotonicity.Linguistic Issues in Language Technology.

Kimmig, A., Bach, S., Broecheler, M., Huang, B., and Getoor, L. (2012).A short introduction to probabilistic soft logic.In Proceedings of the NIPS Workshop on Probabilistic Programming:Foundations and Applications, pages 1–4.

MacCartney, B. and Manning, C. D. (2008).Modeling semantic containment and exclusion in natural languageinference.In Coling.

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 19 / 17

Page 69: Combining Natural Logic and Shallow Reasoning for Question ...angeli/talks/2016-acl-naturalli.pdfGabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning

References III

Niu, F., Re, C., Doan, A., and Shavlik, J. (2011).Tuffy: Scaling up statistical inference in markov logic networks using anrdbms.VLDB.

Richardson, M. and Domingos, P. (2006).Markov logic networks.Machine learning, 62(1-2):107–136.

Rocktaschel, T., Bosnjak, M., Singh, S., and Riedel, S. (2014).Low-dimensional embeddings of logic.In Proceedings of the ACL 2014 Workshop on Semantic Parsing.

Sanchez Valencia, V. M. (1991).Studies on natural logic and categorial grammar.PhD thesis, University of Amsterdam.

Gabor Angeli, Neha Nayak, Chris Manning (Stanford)Natural Logic + Shallow Reasoning August 8, 2016 20 / 17