Title: Semantic Analysis
1Semantic Analysis
Read J M Chapter 15.
2The Principle of Compositionality
- Theres an infinite number of possible sentences
and an infinite number of possible meanings. - But we need to specify the relationship between
the two with a finite number of rules. - What finite classes can we work with
- Words
- Grammar rules
- So we need to find a way to define the meaning of
an entire sentence as a function of the meaning
of the words it contains and the rules that are
used to put those words together.
3Deriving the Meaning of Sentences
John saw Bill.
?e Isa(e, Seeing) ? Agent(e, John) ? AE(e, Bill)
S NP VP PN V NP John
saw PN Bill
4Attaching Semantic Rules to Grammar Rules
John saw Bill. ?e Isa(e, Seeing) ? Agent(e,
John) ? AE(e, Bill)
S NP VP PN V NP John saw PN
Bill
A ? ? ? f(?.sem, ?.sem ) PN ?
John John ?e Isa(o,Person) ? Name(o,
John) NP ? PN PN.sem
5Handling the Verb
S NP VP PN V NP John saw PN
Bill
S ? NP VP VP.sem(NP.sem) NP ? PN PN.sem PN ?
John John PN ? Bill Bill VP ? V
NP V.sem(NP.sem) V ? saw ?x ?y ?e Isa(e,
Seeing) ? Agent(e,y) ? AE(e,x)
6Common NPs
John has a cat.
?e,x Isa(e, Owning) ? Agent(e, John) ? AE(e, x) ?
Isa(x, Cat)
S NP VP PN V NP John has
DET Nom a N
cat
7When Arguments Are Quantified
?e,x Isa(e, Owning) ? Agent(e, John) ? AE(e, x)
? Isa(x, Cat)
S ? NP VP VP.sem(NP.sem) NP ? PN PN.sem NP ?
DET Nom DET.sem x Nom.sem PN ? John John DET
? a ? Nom ? N Isa(x N.sem) N ? cat cat VP ?
V NP V.sem(NP.sem) V ? has ?x ?y ?e Isa(e,
Owning) ? Agent(e,y) ? AE(e,x)
8We Get the Wrong Answer
The answer we want ?e,x Isa(e, Owning) ?
Agent(e, John) ? AE(e, x) ? Isa(x, Cat) The
answer were going to get as things stand now ?e
Isa(e, Owning) ? Agent(e, John) ? AE(e, ?x Isa(x,
Cat)) This isnt even a valid formula.
9Complex Terms
A complex term has the following
structure ltQuantifier variable bodygt Using
one in our example, we get ?e Isa(e, Owning) ?
Agent(e, John) ? AE(e, lt? x Isa(x, Cat)gt) Now we
add the following rewrite rule for converting
complex terms to ordinary FOPC expressions P(ltQua
ntifier variable bodygt) ? Quantifer
variable body Connective P(variable) In this
case AE(e, lt? x Isa(x, Cat)gt) ? ? x Isa(x, Cat)
? AE(e, x) Note If Quantifier is ? then
Connective is ?. If ?, then its ?.
10The Revised Grammar
S ? NP VP VP.sem(NP.sem) NP ? PN PN.sem NP ?
DET Nom ltDET.sem x Nom.sem(x)gt PN ?
John John DET ? a ? Nom ? N ?z Isa(z,
N.sem) N ? cat cat VP ? V NP V.sem(NP.sem) V
? has ?x ?y ?e Isa(e, Owning) ? Agent(e,y) ?
AE(e,x)
11Do We Yet Have the Right Answer?
The answer weve got now ?e,x Isa(e, Owning) ?
Agent(e, John) ? AE(e, x) ? Isa(x, Cat) But
suppose we want something like ?x Isa (x, Cat) ?
Owner-of(x, John) In this case, we can view our
initial answer as an intermediate representation
and use it to form whatever other answer we like
by applying inference rules.
12Or Suppose We Want a Completely Different Kind of
Representation
13More on Quantifiers
Everyone ate a cookie.
S ? NP VP VP.sem(NP.sem) NP ? Pro Pro.sem NP
? DET Nom ltDET.sem x Nom.sem(x)gt DET ?
a ? Nom ? N ?z Isa(z, N.sem) Pro ?
everyone lt ? x person(x)gt N ?
cookie cookie VP ? V NP V.sem(NP.sem) V ?
ate ?x ?y ?e Isa(e, Eating) ? Agent(e,y) ?
AE(e,x)
?e ?x ?x' Isa(e, Eating) ? (person(x') ? Agent(e,
x')) ? Isa(x, cookie) ? AE(e,x)
14Different Argument Structures
John served Bill. John served steak.
S ? NP VP VP.sem(NP.sem) NP ? PN PN.sem NP ?
MassN MassN.sem MassN ? steak steak PN ?
John John PN ? Bill Bill VP ? V
NP V.sem(NP.sem) VP ? V NP1 NP2
V.sem(NP1.sem)(NP2.sem) V ? served ?x ?y ?e
Isa(e, Serving) ? Agent(e,y) ? AE(e,x) V ?
served ?x ?y ?e Isa(e, Serving) ? Agent(e,y) ?
Ben(e,x) V ? served ?x ?y ?z ?e Isa(e,
Serving) ? Agent(e,z) ? AE(e,y) ? Ben(e,
x)
15Sentences that Arent Declarative
Close the window.
S ? VP IMP(VP.sem(DummyYou))
Do you sell pretzels?
S ? Aux NP VP YNQ(VP.sem(NP.sem))
Who sells pretzels?
S ? WhPro VP WHQ(x, VP.sem(x)
WHQ(x, ?e Isa(e, Selling) ? Agent(e,x) ? AE(e,
pretzels)
16Compound Noun Phrases
leather jacket ?x Isa(x, jacket) ? NN(x,
leather) riding jacket winter jacket letter
jacket
Nom ? N ?x Isa(x, N.sem) Nom ? N Nom ?x
Nom.sem(x) ? NN(x, N.sem) N ?
jacket jacket N ? leather leather
17Compound NPs, an Alternative
leather jacket ?x Isa(x, jacket) ? madeof(x,
leather) riding jacket ?x Isa(x, jacket) ?
usedfor(x,riding) winter jacket letter jacket
Nom ? N ?x Isa(x, N.sem) Nom ? N Nom ?x
Nom.sem(x) ? madeof(x, N.sem) Nom ? N Nom ?x
Nom.sem(x) ? usedfor(x, N.sem) N ?
jacket jacket N ? leather leather N ?
winter winter
18Infinitive Verb Phrases
I told Mary to eat.
S NP VP Pro V NP VPto I
told PN infTo VP
Mary
to V eat
?e, f Isa(e, telling) ? Isa(f, eating) ?
Agent(e, Speaker) ? Ben(e, Mary) ? AE(e, f) ?
Agent(f, Mary)
19Noncompositional Semantics
Coupons are just the tip of the iceberg.
Thats just the tip of Mrs. Fords iceberg.
John kicked the bucket. John would have kicked
the bucket. The bucket was kicked by John.
She turned up her toes. She turned up his
toes. Mary threw in the towel. Mary thought
about throwing in the towel. Mary threw in the
white towel. willy nilly pell mell
helter skelter
20Semantic Grammars
If we know we have a limited semantic
representation, then build a grammar that is less
general and that maps more directly to the
semantic interpretation we want.
21Example Eating Italian Food
22An Alternative
InfoRequest ? I want to go (to) eat (some)
FoodType Time Retrieve (x, isa(x, Restaurant)
? nationality(x, FoodType.sem)) FoodT
ype ? Nationality (food) Nationality.sem Retrie
ve(x, isa(x, Restaurant) ? nationality(x,
Italian))