# CS544: Lecture 2: Syntax and Compositional Semantics of the Clause Jerry R. Hobbs USC/ISI Marina del Rey, CA February 24, 2011.

## Presentation on theme: "CS544: Lecture 2: Syntax and Compositional Semantics of the Clause Jerry R. Hobbs USC/ISI Marina del Rey, CA February 24, 2011."— Presentation transcript:

CS544: Lecture 2: Syntax and Compositional Semantics of the Clause Jerry R. Hobbs USC/ISI Marina del Rey, CA February 24, 2011

Why Syntax? Lexical items (words) tell us the concepts; syntax tells how the concepts fit together to form more complex concepts. manbites dog man(m)bite(x,y) dog(d) Man bites dog. man(m) & bite(m,d) & dog(d) Syntax tells us the predicate-argument relations 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 man dog bites man bites dog dog bites man Bag of Words

Why Syntax? The tall man who fell won. X tallmanfallwin 1-D representation 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.Division of words into parts of speech, and finer categories (features) 2.Placement of predicates and arguments in adjacent positions in the string 3.Constraints on interpretation of adjacency in terms of parts of speech and finer-grained features

Logical Form man bites dog xy 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)

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” 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,... OPEN CLASS TreeBank tags

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,... 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 CLOSED CLASS

Parts of Speech 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). See Tables 4.5 and 4.6 in Manning & Schuetze.

Basic Clause Structure S --> NP VP Pat [likes Chris] VP --> V NP likes Chris Subject Object / Complement Abstract these rules: Add argument on left. Add argument on right. PP --> P NP (in California) S NPVP NPV Pat likes Chris (S1 (S (NP (NNP Pat) (VP (VPZ likes) (NP (NNP Chris)))) (..)) Head y2=y3 NPV Pat(x1) like(x2,y2) Chris(y3) x1=x2 NP

Subjects Subjects must agree with the main verb in number and have the right case. Only relevant to pronouns: I sleep. * Me sleep. Singular or plural We could expand the grammar: 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] These must unify, i.e., be equal already or be able to be made equal “goes”: V[nbr=Sing] “went”: V[nbr=x] A variable that can take on either value, Sing or Plur “man”: N[nbr=Sing] “men”: N[nbr=Plur] Information can be passed up to parent Pollard and Sag, Head-driven Phrase Structure Grammar, 1994

The Structure of the VP There are lots of possible complements: 1st Compl 2nd Compl He arrived. --- --- Intransitive He forgot his friend’s name. NP --- Transitive She gave John the book. NP NP Ditransitive They rely on the U.S. PP[p=on] --- Note that “on” is required: *“They relied.” He gave up. RP[p=up] --- Note that “give up” =/= “give” + “up” More than just VP --> V NP

The Structure of the VP There are lots of possible complements: 1st Compl 2nd Compl Figure out the solution / Figure it out. RP[p=out] NP “Figure out” =/= “Figure” + “out” Particle can be before or after complement; separable She put the book on the table. NP PP Prepositional phrases can be complements He shouted that he was right. (that) S --- Sentential complement She told me that she was right. NP (that) S Sentential complement with an indirect object More than just VP --> V NP

The Structure of the VP There are lots of possible complements: 1st Compl 2nd Compl He tries to amuse us. VP[vform=inf] --- Infinitive complement 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. PP[p=if] --- Subcategorizing for a subordinate clause They point out that she was right. RP[p=out] (that) S We consider parsing as chunking. NP[case=acc] PP[p=as] More than just VP --> V NP 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 He arrived. “arrive”: Syn[vbd,n,-,-] She forgets his name. “forget”: Syn[vbz,n.sing,n,-] She gave John the book. “give”: Syn[vbd,n,n,n] They rely on the U.S. “rely”: Syn[vbp,n.plur,p.on,-] He gave up. “give”: Syn[vbd,n,rp.up,-] Figure out the solution / Figure it out. “figure”: Syn[vb,n,rp.out,n] He shouted that he was right. “shout”: Syn[vbd,n,thats] “that”: Syn[thats,-,v,-] He tends to amuse us. “tend”: Syn[vbz,n,inf] “to”: Syn[inf,-,vb,-] S --> NP VP: Syn[f,-,-,-] --> Syn[a,-,-,-] Syn[f,a,-,-] VP --> V NP: Syn[f,a,c,-] --> Syn[f,a,b,c] Syn[b,-,-,-] Syn[f,a,b,c] category of headcategory and features of subject cat and features of 1st compl cat and features of 2nd compl root or stem

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,-,-,-] Syn[vbd,-,-,-] Syn[n,-,-,-] Syn[vbd,n,-,-] Syn[vbd,n,thats,-] Syn[vbd,n,n,thats]Syn[n,-,-,-] Syn[thats,-,v,-] Syn[vbz,n,-,-]Syn[n,-,-,-] Syn[vbz,-,-,-] Syn[thats,-,-,-] John toldMarythathe works 1 1 2 2 2 The feature v is a superfeature of vbz and vbd, and so it unifies with them.

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. shout(x,e1) & right’(e1,x) She told me that she was right. 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. want(x,e1) & leave’(e1,y) He made us leave. make(x,e1) & leave’(e1,y) They point out that she was right. 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. I became tired / sick / a professor / *at USC We dismissed him as odd. We used the documents as data. The complements describe the subject. In “John likes Mary”, “Mary” doesn’t describe the subject “as” subcategorizes for predicate complements Some verbs take only some kinds of 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. 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] S --> (Adjunct) NP (Adjunct) VP VP --> V (Adjunct) NP (Adjunct)

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,-,-,-] Syn[vbz,n,-,-] Syn[vbz,-,-,-] Syn[vbz,n,-,-] Syn[n,-,-,-] Syn[in,v,v,-] Syn[in,v,-,-] Ifhe workssleeps 3 2 1 1

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) We’ve seen Passive and Progressive already. “do” for emphasis or negation or “do so”: “to” for infinitives: “do”: Syn[vb/vbp,n,vb,-] “to”: Syn[inf,n,vb,-] Relevant to some reference time

Next Class... We’ll look inside noun phrases.

Download ppt "CS544: Lecture 2: Syntax and Compositional Semantics of the Clause Jerry R. Hobbs USC/ISI Marina del Rey, CA February 24, 2011."

Similar presentations