The syntax and compositional semantics of clauses

advertisement
CS544: Lecture 2:
Syntax and Compositional
Semantics of the Clause
February 24, 2011
Jerry R. Hobbs
USC/ISI
Marina del Rey, CA
Why Syntax?
Lexical items (words) tell us the concepts; syntax tells how the concepts
fit together to form more complex concepts.
man
bites
dog
man(m)
bite(x,y)
dog(d)
man bites dog
dog bites man
man
Man bites dog.
bites
dog
man(m) & bite(m,d) & dog(d)
Syntax tells us the
predicate-argument
relations
Bag of Words
A simple canonical representation of the information conveyed by a sentence
Syntax: the structure of the sentence that reveals pred-arg relations
Compositional semantics: rules for generating logical form from syntax
Why Syntax?
The tall man who fell won.
tall
man
fall
X
1-D representation
win
2-D representation
How do we get a 2-D representation out of a 1-D representation?
Syntax.
Why Syntax?
Syntax is the solution to the problem of
How do we get predicate-argument relations
out of concatenation?
1.
2.
3.
Division of words into parts of speech, and finer
categories (features)
Placement of predicates and arguments in adjacent
positions in the string
Constraints on interpretation of adjacency in terms
of parts of speech and finer-grained features
Logical Form
man bites dog
x
y
bite(x,y)
But also, man(x) and dog(y)
man bites dog hard
The biting is hard, so we need a variable to attach to (or represent) the biting.
E.g., label the proposition: e: bite(x,y)
Or to stay in first-order logic: bite’(e,x,y)
Then: hard(e)
TreeBank tags
Parts of Speech
Noun (NN, NNS): singular and plural; “The _____ is ...”
“The ______ are …”
Verb (VB, VBP, VBZ, VBD, VBN, VBG):
go, go, goes, went, gone, going; “_____-ing”
OPEN CLASS
Adjective (JJ, JJR, JJS): good, better, best; “The ____ thing is ...”
“The thing is _____”
red glass vs. wine glass
but not forms of verbs: broken, running
Adverb (RB, RBR, RBS): rapidly, faster, fastest; often “____-ly”
“It does it ______”
Plus some special words: very, not, ...
Parts of Speech
Pronoun (PP): I, you, he, she, it, we, they, ...
Predeterminers (PDT): all the ..., such a ...
Determiner and Quantifiers (DT): a, the, some, all, ...
Numbers (CD or NUM): one, twenty, 58, ...
Auxiliaries (AUX): is, have, did, ...
CLOSED CLASS
Modals (MD): can, must, should, ...
Preposition, subordinate conjunction (IN): of, in, to, during, if, before, ...
Particles (RT): out, up, ...
Coordinating conjunction (CC): and, or, but, so
Parts of Speech
See Tables 4.5 and 4.6 in Manning & Schuetze.
The (DT) nation’s (NN$) biggest (JJS) public (JJ) pension (NN) fund (NN) ,
which (WP) has (VBP) lost (VBN) more (JJ) than (IN) a (DT) quarter (NN)
of (IN) its (PR$) value (NN) in (IN) the (DT) last (JJ) seven (CD) months (NNS),
is (VBP) planning (VBG) to (TO) rally (VB) big (JJ) investors (NNS) nationwide (JJ).
In (IN) May (NNP) 2006 (CD) a (DT) unit (NN) of (IN) American (JJ) soldiers (NNS)
in (IN) Afghanistan’s (NNP$) Uruzgan (NNP) Valley (NNP) were (VBD)
engulfed (VBN) in (IN) a (DT) ferocious (JJ) fire (NN) fight (NN) with (IN) the (DT)
Taliban (NNP).
Winter (NN) came (VBD) and (CC) the (DT) city (NN) turned (VBD)
monochrome (JJ) – black (JJ) trees (NNS) against (IN) gray (JJ) sky (NN)
above (IN) white (JJ) earth (NN) .
The (DT) practice (NN) of (IN) parsing (VBG) can (MD) be (VB) considered (VBN)
as (IN) a (DT) straightforward (JJ) implementation (NN) of (IN) the (DT) idea (NN)
of (IN) chunking (VBG).
Basic Clause Structure
Subject
Abstract these rules:
S --> NP VP
Pat [likes Chris]
VP --> V NP
likes Chris
Object / Complement
Add argument on left.
Add argument on right.
PP --> P NP (in California)
Head
x1=x2
S
NP
(S1 (S (NP (NNP Pat)
(VP (VPZ likes)
(NP (NNP Chris))))
(. .))
VP
V
likes
y2=y3
V
NP
NP
Pat(x1)
Pat
NP
Chris
like(x2,y2)
Chris(y3)
Subjects
Subjects must agree with the main verb in number and
have the right case.
Singular or plural
We could expand the grammar:
Only relevant to pronouns:
I sleep.
* Me sleep.
S --> NPSing VPSing
S --> NPPlur VPPlur
Note: This makes every past tense verb ambiguous
OR ...
Unification Grammar
Associate a set of features with each symbol in the grammar
and condition rules on the values of these features.
S[nbr=x] --> NP[nbr=x] VP[nbr=x]
Information can be
passed up to parent
These must unify, i.e., be equal already
or be able to be made equal
“man”: N[nbr=Sing]
“goes”: V[nbr=Sing]
“men”: N[nbr=Plur]
“went”: V[nbr=x]
A variable that can take on either value,
Sing or Plur
Pollard and Sag, Head-driven Phrase Structure Grammar, 1994
The Structure of the VP
More than just VP --> V NP
There are lots of possible complements:
1st Compl
2nd Compl
He arrived.
Intransitive
---
---
He forgot his friend’s name.
Transitive
NP
---
She gave John the book.
Ditransitive
NP
NP
They rely on the U.S.
Note that “on” is required: *“They relied.”
PP[p=on]
---
He gave up.
Note that “give up” =/= “give” + “up”
RP[p=up]
---
The Structure of the VP
More than just VP --> V NP
There are lots of possible complements:
1st Compl
2nd Compl
Figure out the solution / Figure it out.
RP[p=out]
“Figure out” =/= “Figure” + “out”
Particle can be before or after complement; separable
NP
She put the book on the table.
Prepositional phrases can be complements
NP
PP
He shouted that he was right.
Sentential complement
(that) S
---
She told me that she was right.
NP
Sentential complement with an indirect object
(that) S
The Structure of the VP
More than just VP --> V NP
There are lots of possible complements:
1st Compl
2nd Compl
He tries to amuse us.
Infinitive complement
VP[vform=inf] ---
He wants us to leave.
NP[case=acc] VP[vform=inf]
One complement: the situation is wanted (small clause)
---
He made us leave.
NP[case=acc] VP[vform=base] --One complement: the situation is caused/made.
Let us know if you need it.
Subcategorizing for a subordinate clause
PP[p=if]
They point out that she was right.
RP[p=out]
(that) S
We consider parsing as chunking.
NP[case=acc]
PP[p=as]
Different verbs subcategorize for different complements.
---
Subcategorization
He arrived.
VP --> V[comp1=null]
“arrive”: V[comp1=null]
She forgot his name.
VP --> V[comp1=n] NP
“forget”: V[comp1=n]
She gave John the book.
VP --> V[comp1=n,comp2=n] NP NP
“give”: V[comp1=n,comp2=n]
They rely on the U.S.
VP --> V[comp1=p.x] PP[p=x]
“rely”: V[comp1=p.on]
He gave up.
VP --> V[comp1=rp.x] RP[rp=x]
“give”: V[comp1=rp.up]
Figure out the solution / Figure it out. VP --> V[comp1=rp.x,comp2=n] RP[rp=x] NP
“figure”: V[comp1=rp.out,comp2=n]
He shouted that he was right.
VP --> V[comp1=s] (“that”) S
“shout”: V[comp1=s]
He tries to amuse us.
VP --> V[comp1=inf] VP[vform=inf]
“try”: V[comp1=inf]
Generalizing Subcategorization
category of head
S --> NP VP:
Syn[f,-,-,-] --> Syn[a,-,-,-] Syn[f,a,-,-]
VP --> V NP:
Syn[f,a,c,-] --> Syn[f,a,b,c] Syn[b,-,-,-]
category and features
of subject
Syn[f,a,b,c]
cat and features
of 1st compl
cat and features
of 2nd compl
root or stem
He arrived.
She forgets his name.
She gave John the book.
They rely on the U.S.
He gave up.
Figure out the solution / Figure it out.
He shouted that he was right.
He tends to amuse us.
“arrive”: Syn[vbd,n,-,-]
“forget”: Syn[vbz,n.sing,n,-]
“give”: Syn[vbd,n,n,n]
“rely”: Syn[vbp,n.plur,p.on,-]
“give”: Syn[vbd,n,rp.up,-]
“figure”: Syn[vb,n,rp.out,n]
“shout”: Syn[vbd,n,thats]
“that”: Syn[thats,-,v,-]
“tend”: Syn[vbz,n,inf]
“to”: Syn[inf,-,vb,-]
Generalizing Subcategorization:
Example
S --> NP VP:
1. Syn[f,-,-,-] --> Syn[a,-,-,-] Syn[f,a,-,-]
VP --> V NP:
2. Syn[f,a,c,-] --> Syn[f,a,b,c] Syn[b,-,-,-]
The feature v is a superfeature
of vbz and vbd, and so it
unifies with them.
Syn[vbd,-,-,-]
1
Syn[vbd,n,-,-]
Syn[n,-,-,-]
2
Syn[thats,-,-,-]
2
Syn[vbd,n,thats,-]
2
Syn[thats,-,v,-]
Syn[vbz,-,-,-]
1
Syn[vbd,n,n,thats]
John
told
Syn[n,-,-,-]
Mary
Syn[n,-,-,-]
that
he
Syn[vbz,n,-,-]
works
Logical Form for the VP
He arrived.
arrive(x) or arrive’(e,x)
He forgot his friend’s name.
forget(x,y)
She gave John the book.
give(x,y,z)
They rely on the U.S.
rely(x,y)
He gave up.
give-up(x)
The predicate “give-up” is not the same as “give”
Figure out the solution / Figure it out.
figure-out(x,y)
She put the book on the table.
put(x,y,e1) & on’(e1,y,z)
The second complement describes a condition of the first complement.
Can’t just have the table as the arg; in the cupboard, above the TV, ...
He shouted that he was right.
She told me that she was right.
shout(x,e1) & right’(e1,x)
tell(x,y,e1) & right’(e1,x)
Logical Form for the VP
He tries to amuse us.
try(x,e1) & amuse’(e1,x,y)
Subject control: The subject of the sentence is also the subject of the
complement clause.
He wants us to leave.
He made us leave.
They point out that she was right.
want(x,e1) & leave’(e1,y)
make(x,e1) & leave’(e1,y)
point-out(x,e1) & right’(e1,y)
He asked us to leave.
NP
VP[vform=inf]
He asked us to leave.
ask(x,y,e1) & leave’(e1,y)
Two complements because the recipient of the asking needs to be
an argument of “ask”
He wants the problem to go away.
He made the problem go away.
* He asked the problem to go away.
Object control: The first complement is the subject of the second complement.
Also in “She put the book on the table.”
Logical Form for Tense
Tense is a property of the eventuality of the verb:
He arrives. ==> arrive’(e,x) & Present(e)
He saw her. ==> see’(e,x,y) & Past(e)
He is arriving. ==> arrive’(e1,x) & Progressive’(e2,e1) & Present(e2)
Unwinds a point-like event
into a durational event.
Other Words Also Subcategorize
Prepositions (and subordinate conjunctions):
John went to the store; a trip to the store
“to”: Syn[in,n/v,n,-] OR IN[subj=np/s, comp1=np]
If he arrives, tell me.
“if”: Syn[in,v,v,-]
OR
IN[subj=s, comp1=s]
(but “if anything,…”)
Before he arrived, he was drunk.
the party before I arrived.
Before his arrival, he was drunk.
the party before graduation
“before”: Syn[in,n/v,n/v,-] OR IN[subj=np/s, comp1=np/s]
Adjectives:
He is responsible for the problem.
“responsible”: Syn[jj,n,in.for,-]
OR
JJ[subj=np,comp1=in.for]
Heads of phrases subcategorize for the subjects and complements
they can take.
Predicate Complements
What does “be” (“am”, “is”, “are”, “was”, “were”, “been”, “being”)
subcategorize for?
What can follow a form of the verb “be”?
NP: Anne Stausboll is a 10-year fund veteran.
Adjective Phrase: CalPERS is ready to impement it.
PP: The algorithm is for making chunks.
Passive: The lights were reflected against the clouds.
Progressive: The wind was blowing off the lake.
Not really a
predicate complement
but it can appear
anywhere an adjective
phrase can appear
More restricted than
adjective phrases
Define pred as superfeature of n, jj, in, vbn, vbg
“be”: Syn[vb.be, n, pred, -]
OR
VB[subj=np,compl1=pred]
Predicate Complements:
Logical Form
NP: Pat is boss.
Pat(x) & be(x,y) & boss(y) OR Pat(x) & boss(x)
(plus tense)
(Sometimes “be” means something other than identity.)
For the others, “be” is just a carrier of tense:
Adjective Phrase: CalPERS is ready to implement it.
CalPERS(x) & Present(e0) & ready’(e0,x,e1) & implement’(e1,x,y)
(Note subject control)
PP: The algorithm is for making chunks.
algorithm(x) & Present(e0) & for’(e0,x,e) & make’(e,z,y) & chunk(y)
Passive: The light was reflected.
light(x) & Past(e) & reflect’(e,y,x)
Note that subject appears as second argument.
Progressive: The wind was blowing.
Other Verbs Take Predicate
Complements
He ranks high in my book.
The complements describe the subject.
In “John likes Mary”,
“Mary” doesn’t describe the subject
I became tired / sick / a professor / *at USC
We dismissed him as odd.
Some verbs take only some
kinds of predicate complements
We used the documents as data.
“as” subcategorizes for
predicate complements
When is a phrase a predicate complement?
When it describes its subject (incl the subject of “as”).
Logical form: eventuality as second argument + subject control
become(x,e) & sick’(e,x)
Adjuncts
Adverbs and adverbial phrases can be adjuncts:
Adverb: Sometimes John ran slowly here.
Adverbial phrase: I can see it better than you can.
Anything that can be a predicate complement can be an adjunct too.
NP: Investors put $67 billion into mutual funds, a 186% increase over 2003.
Adjective phrase: Incapable of driving, he called a taxi.
PP: I watched the whales with binoculars.
Before midnight, he left the party.
Before he left the party, he said goodbye.
Passive: Snapped in two by the wind, the tree had to be replaced.
-ing: Whistling as he walked, he seemed very happy.
Logical form: eventuality of the main clause is the subject argument:
John(x) & run’(e,x) & sometimes(e) & slow(e) & here(e,u)
Often an initial adverbial modifies the subject, rather than the whole clause.
Adjunct Placement
Where can adjuncts go?
Roughly, anywhere but inside NPs and PPs.
Suddenly, the tall man left.
* The suddenly tall man left.
* The tall suddenly man left.
The tall man suddenly left.
The tall man left suddenly.
S --> (Adjunct) NP (Adjunct) VP
VP --> V (Adjunct) NP (Adjunct)
Syn[f1,a,b,c] --> Syn[f1,a,b,c] Syn[f2,f1,-,-]
Syn[f1,a,b,c] --> Syn[f2,f1,-,-] Syn[f1,a,b,c]
Adjunct Placement Example
S --> NP VP:
1. Syn[f,-,-,-] --> Syn[a,-,-,-] Syn[f,a,-,-]
VP --> V NP:
2. Syn[f,a,c,-] --> Syn[f,a,b,c] Syn[b,-,-,-]
Adjunct on left:
3. Syn[f1,a,b,c] --> Syn[f2,f1,-,-] Syn[f1,a,b,c]
Syn[vbz,-,-,-]
3
Syn[in,v,-,-]
Syn[vbz,-,-,-]
2
1
Syn[in,v,v,-]
If
Syn[vbz,-,-,-]
1
Syn[n,-,-,-]
Syn[vbz,n,-,-]
he
works
Syn[n,-,-,-]
Syn[vbz,n,-,-]
he
sleeps
Adjunct or Complement?
Adjuncts add detail without changing the meaning:
John ran slowly.
Or they shade the meaning:
John almost ran. Mary did not run.
Adjunct or complement?
John flew from Los Angeles to Tokyo.
They can be deleted without changing the meaning.
Generally PPs like this can be treated as adjuncts, but it will generally be
easier to get the right final representation treating them as complements.
If obligatory, it’s a complement:
John relies on Mary. =/=> * John relies.
Adverbs with Complements
“too small to generate heat”:
“too”: Syn[rb, jj, vp.inf]
==> too(e1, e2) & small’(e1,x) & generate’(e2,x,y) & heat(y)
“enough time to thaw”:
“enough”: Syn[rb, nn, vp.inf]
==> enough(x,e) & time(x) & thaw’(e,y)
Three Important Adjunct
Constructions
Measure NPs:
John ran three miles. ==> run’(e,x) & measure(e,3 miles)
Global funds rose 18.5% last year.
Time NPs:
I’ll meet you Saturday. ==> meet’(e,x,y) & atTime(e,z) & Sat(z)
Manner NPs:
Please do it the way I told you to.
==> way(e2,e1) & do’(e1,x,y) & tell’(e2,z,y,e3) …
Three More Important Adjunct
Constructions
Purpose infinitives (not the same as infinitive complement):
I flew to Tokyo to give a talk. (= in order to give a talk)
==> fly’(e1,x) & in-order-to(e1,e2) & give’(e2,x,y,z) & talk(y)
vs. I want to leave =/= I want in order to leave.
Quotations:
“Let’s, you know, leave now,” said John.
Small clauses as adjuncts:
“The snowstorms rolled in, the city lights reflected against the clouds.”
“I would forget where I was, my thoughts a numbed reflection of
the silence.”
Ss and VPs as NPs
Weak nominalizations: ways of treating Ss and VPs as NPs.
Driving in LA traffic isn’t easy.
Any algorithm for making chunks will produce something.
That you left early surprised me.
To leave early would be rude.
For you to leave early would be rude.
Plus a few others.
The eventuality appears in the logical form:
drive’(e1,x) & not(e2) & easy’(e2,e1)
Auxiliaries
I could have been being admired all this time.
modal
aux for perfect tense aux for progressive
aux for passive
We can treat auxiliaries as verbs that subcategorize for special VP complements:
“could”: Syn[md,n,vb,-] OR MD[compl1=vb]
I could go.
Other modals: can, will, would, shall, should, may, might
==> could(x,e) & go’(e,x)
Perfect tense: “have”: Syn[vb/vbp,n,vbn,-] OR VB[compl1=vbn]
I have gone. ==> Perfect(e) & go’(e,x)
Relevant to some reference time
We’ve seen Passive and Progressive already.
“do” for emphasis or negation or “do so”:
“do”: Syn[vb/vbp,n,vb,-]
“to” for infinitives:
“to”: Syn[inf,n,vb,-]
Next Class ...
We’ll look inside noun phrases.
Download