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.