CS 544 Lecture 2 Syntax and Compositional Semantics

  • Slides: 32
Download presentation
CS 544: Lecture 2: Syntax and Compositional Semantics of the Clause February 4, 2010

CS 544: Lecture 2: Syntax and Compositional Semantics of the Clause February 4, 2010 Jerry R. Hobbs USC/ISI Marina del Rey, CA

Why Syntax? Lexical items (words) tell us the concepts; syntax tells how the concepts

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 bites man bites Man 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? Syntax is the solution to the problem of How do we get

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)

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)

Tree. Bank tags Parts of Speech Noun (NN, NNS): singular and plural; “The _____

Tree. Bank tags Parts of Speech Noun (NN, NNS): singular and plural; “The _____ is. . . ” “The ______ are …” Verb (VB, VBP, VBZ, VBD, VBN, VBG): 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, . .

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.

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]

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 x 1=x 2 S NP (S 1 (S (NP (NNP Pat) (VPZ likes) (NP (NNP Chris)))) (. . )) VP V likes y 2=y 3 V NP NP Pat(x 1) Pat NP Chris like(x 2, y 2) Chris(y 3)

Subjects must agree with the main verb in number and have the right case.

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

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

The Structure of the VP More than just VP --> V NP There are lots of possible complements: 1 st Compl 2 nd 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

The Structure of the VP More than just VP --> V NP There are lots of possible complements: 1 st Compl 2 nd 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

The Structure of the VP More than just VP --> V NP There are lots of possible complements: 1 st Compl 2 nd 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[comp 1=null] “arrive”: V[comp 1=null] She forgot his name.

Subcategorization He arrived. VP --> V[comp 1=null] “arrive”: V[comp 1=null] She forgot his name. VP --> V[comp 1=n] NP “forget”: V[comp 1=n] She gave John the book. VP --> V[comp 1=n, comp 2=n] NP NP “give”: V[comp 1=n, comp 2=n] They rely on the U. S. VP --> V[comp 1=p. x] PP[p=x] “rely”: V[comp 1=p. on] He gave up. VP --> V[comp 1=rp. x] RP[rp=x] “give”: V[comp 1=rp. up] Figure out the solution / Figure it out. VP --> V[comp 1=rp. x, comp 2=n] RP[rp=x] NP “figure”: V[comp 1=rp. out, comp 2=n] He shouted that he was right. VP --> V[comp 1=s] (“that”) S “shout”: V[comp 1=s] He tries to amuse us. VP --> V[comp 1=inf] VP[vform=inf] “try”: V[comp 1=inf]

Generalizing Subcategorization category of head S --> NP VP: Syn[f, -, -, -] -->

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 1 st compl cat and features of 2 nd 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,

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

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, e 1) & on’(e 1, 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, e 1) & right’(e 1, x) tell(x, y, e 1) & right’(e 1, x)

Logical Form for the VP He tries to amuse us. try(x, e 1) &

Logical Form for the VP He tries to amuse us. try(x, e 1) & amuse’(e 1, 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, e 1) & leave’(e 1, y) make(x, e 1) & leave’(e 1, y) point-out(x, e 1) & right’(e 1, y) He asked us to leave. NP VP[vform=inf] He asked us to leave. ask(x, y, e 1) & leave’(e 1, 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 is a property of the eventuality of the verb: He

Logical Form for 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’(e 1, x) & Progressive’(e 2, e 1) & Present(e 2) Unwinds a point-like event into a durational event.

Other Words Also Subcategorize Prepositions (and subordinate conjunctions): John went to the store; a

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, comp 1=np] If he arrives, tell me. “if”: Syn[in, v, v, -] OR IN[subj=s, comp 1=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, -] OR IN[subj=np/s, comp 1=np/s] Adjectives: He is responsible for the problem. “responsible”: Syn[jj, n, in. for, -] OR JJ[subj=np, comp 1=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?

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: Cal. PERS 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, vbg “be”: Syn[vb. be, n, pred, -] OR VB[subj=np, compl 1=pred]

Predicate Complements: Logical Form NP: Pat is boss. Pat(x) & be(x, y) & boss(y)

Predicate Complements: Logical Form NP: Pat is boss. Pat(x) & be(x, y) & boss(y) OR Pat(x) & boss(x) (Sometimes “be” means something other than identity. ) For the others, “be” is just a carrier of tense: Adjective Phrase: Cal. PERS is ready to implement it. Cal. PERS(x) & ready(x, e 1) & implement’(e 1, x, y) (Note subject control) PP: The algorithm is for making chunks. algorithm(x) & for(x, e) & make’(e, z, y) & chunk(y) Passive: The light was reflected. light(x) & reflect(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

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

Adjuncts Adverbs and adverbial phrases can be adjuncts: Adverb: Sometimes John ran slowly here.

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,

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[f 1, a, b, c] --> Syn[f 1, a, b, c] Syn[f 2, f 1, -, -] Syn[f 1, a, b, c] --> Syn[f 2, f 1, -, -] Syn[f 1, a, b, c]

Adjunct Placement Example S --> NP VP: 1. Syn[f, -, -, -] --> Syn[a,

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[f 1, a, b, c] --> Syn[f 2, f 1, -, -] Syn[f 1, a, b, c] Syn[vbz, -, -, -] 3 Syn[in, v, -, -] Syn[vbz, -, -, -] 2 Syn[in, v, v, -] If Syn[vbz, -, -, -] 1 Syn[n, -, -, -] Syn[vbz, n, -, -] he works 1 Syn[n, -, -, -] Syn[vbz, n, -, -] he sleeps

Adjunct or Complement? Adjuncts add detail without changing the meaning: John ran slowly. Or

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] ==>

Adverbs with Complements “too small to generate heat”: “too”: Syn[rb, jj, vp. inf] ==> too(e 1, e 2) & small’(e 1, x) & generate’(e 2, 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) &

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) & at. Time(e, z) & Sat(z) Manner NPs: Please do it the way I told you to. ==> way(e 2, e 1) & do’(e 1, x, y) & tell’(e 2, z, y, e 3) …

Three More Important Adjunct Constructions Purpose infinitives (not the same as infinitive complement): I

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’(e 1, x) & in-order-to(e 1, e 2) & give’(e 2, 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

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 we’ll see later. The eventuality appears in the logical form: drive’(e 1, x) & not(e 2) & easy’(e 2, e 1)

Auxiliaries I could have been being admired all this time. modal aux for perfect

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[compl 1=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[compl 1=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, -]