NaturalLI: Natural Logic Inference for Common Sense Reasoning

46
NaturalLI: Natural Logic Inference for Common Sense Reasoning Angeli & Manning (2014) (MacCartney 2007)

Transcript of NaturalLI: Natural Logic Inference for Common Sense Reasoning

Page 1: NaturalLI: Natural Logic Inference for Common Sense Reasoning

NaturalLI: Natural Logic Inference for Common Sense Reasoning Angeli & Manning (2014) (MacCartney 2007)

Page 2: NaturalLI: Natural Logic Inference for Common Sense Reasoning

● Introduction: Motivation examples● Natural Logic:

○ Lexical Relations○ Monotonicity and Polarity○ Proof by alignment

● Inference as Search● Results● Discussion

Page 3: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Natural Language Inference (NLI) :

Recognizing textual entailmentDoes premise P justify an inference to hypothesis H?

P Every firm polled saw costs grow more than expected, even after adjusting inflation. H Every big company in the poll reported cost increases.

YES What if we change the quantifiers to Some?

Page 4: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Does premise P justify an inference to hypothesis H?

P The cat ate a mouseH No carnivores eat animalsNO

Natural Language Inference is necessary to the ultimate goal of full Natural Language understanding. (also enable semantic search, questions answering,)

Page 5: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Approached solutions:

NLP on textSurface form of the

text.We need logical

subtlety

First-order logic Theorem proving.

Intractable unnatural language!

Natural LogicIntermediate

representation

Page 6: NaturalLI: Natural Logic Inference for Common Sense Reasoning

What is Natural Logic? If I mutate a sentence in this specified way, do I preserve its truth?

A logic whose vehicle of inference is natural language (Lakoff, 1970)

Instantaneous semantic parsing!

Characterizes valid patterns of inference in terms of surface forms, it enables to do precise reasoning avoiding the difficulties of fuel semantic interpretation.

● Influenced in traditional logic: Aristotle’s syllogisms. Syllogistic reasoning.

● Monotonicity calculus. (Sanchez, Valencia 1986-91)● McCartney's Natural Logic. Extends monotonicity calculus

to account for negation and exclusion

Page 7: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Basic entailment lexical relations

#

couch sofa crow bird utahn americanhuman nonhuman(exhaustive exclusion)

(non-exhaustive exclusion)

cat dog

(exhaustive non-exclusion)animal nonhuman

(independence)Cat # friendly

Page 8: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Relations are defined for all semantic types:

tiny small dance move this morning today this morning today

in Beijing in China everyone someone all most some

Page 9: NaturalLI: Natural Logic Inference for Common Sense Reasoning

eat apple

eat fruit

apple fruit

Small example

Page 10: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Entailment and semantic composition

How the entailments of a compound expression depend on the entailments of its parts?

● Typically, semantic composition preserves entailment relations:

eat apple eat fruit, big bird big fish,

● But many semantic functions behave differently: tango dance

european african

refuse to tango refuse to dance

not european not african

some cats some animals

Page 11: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Polarity Hypernym as a partial order

Polarity is the direction a lexical item can move in the ordering

Page 12: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 13: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 14: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 15: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 16: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 17: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 18: NaturalLI: Natural Logic Inference for Common Sense Reasoning

PolarityQuantifiers determines the polarity of words

Page 19: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Projecting relations induced by lexical mutations

Projection function. Two sentences differing only by a single lexical relation (downward)

Join table. Two projected relations for composition

Page 20: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Projection examples

cat dog no cat no dog

animal nonhuman failed to be animal failed to be nonhuman

cat animal no cats eat mice no animal eat mice

fish humanhuman nonhuman

fish nonhuman

feline catcat

feline # dogdog

cat felinefeline

cat dogdog

Page 21: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Proof by alignment

1. Find sequence of edits connecting P and H.Insertions, deletions, substitution

2. Determine lexical entailment relation for each edit● Substitutions: depends on meaning of substituends:● Deletions: by default: dark chocolate chocolate● But some deletions are special: not ill ill, refuse to go go● Insertion are symmetric to deletions: by default

3. Project up to find entailment relation across each edit

4. Join entailment relations across sequence of edits

cat dog

Page 22: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example:P Stimpy is a cat

H Stimpy is not a poodle

i Mutation r s

Stimpy is a cat Stimpy is not a poodle

Page 23: NaturalLI: Natural Logic Inference for Common Sense Reasoning

A more complex example

Page 24: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Common Sense Reasoning with Natural LogicTask: Given an utterance, and a large knowledge base of supporting facts. We want to know if the utterance is true or false.

Page 25: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Common Sense Reasoning for NLP

Page 26: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Common Sense Reasoning for Vision

Page 27: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Start with a (large) Knowledge Base >> Infer new facts

Page 28: NaturalLI: Natural Logic Inference for Common Sense Reasoning
Page 29: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Infer new facts, on demand from a query

Page 30: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Using text as the meaning representation

Page 31: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Without aligning to any particular premise

Page 32: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Natural Logic inference is search

Page 33: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example search as graph search

Page 34: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example search as graph search

Page 35: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example search as graph search

Page 36: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example search as graph search

Page 37: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example search as graph search

Page 38: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Example search as graph search

Page 39: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Edges of the graph

Page 40: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Edge templates

Page 41: NaturalLI: Natural Logic Inference for Common Sense Reasoning

“Soft” Natural Logic

Likely (but not certain) inferences ● Each edge has a cost >=0

Detail: Variation among edge instances of a template.● WordNet: ● Nearest neighbors distance.● Most other cases distance is 1.● Let us call this edge distance f.

Page 42: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Experiments

● Knowledge base: 270 millions unique lemmatized premises as database (Ollie extractions: short canonical utterances. Wikipedia)

● Evaluation set: Semi-curated collection of common-sense (true) facts.

● Negatives: Mechanical Turk● Size: 1378 Train, 1080 Test

Page 43: NaturalLI: Natural Logic Inference for Common Sense Reasoning

Results

Page 44: NaturalLI: Natural Logic Inference for Common Sense Reasoning

References

Some of the material for these slides was also extracted from the following links:

Modeling Semantic Containment and Exclusion in Natural Language Inference. Bill MacCartney 2008: https://slideplayer.com/slide/5095504/

NatutalLI. G. Agneli 2014: https://cs.stanford.edu/~angeli/talks/2014-emnlp-naturalli.pdf

Page 45: NaturalLI: Natural Logic Inference for Common Sense Reasoning
Page 46: NaturalLI: Natural Logic Inference for Common Sense Reasoning

EquationsSurface form and validity to a new fact

is the normalized frequency a word in Google N-gram corpus

Neural Network embeddings Huang et al.

Log likelihood of data D, subject to cost, Objective function, negative log likelihood, with L2 regularization,