text
stringlengths
1
7.76k
source
stringlengths
17
81
Chapter 12 Logical semantics The previous few chapters have focused on building systems that reconstruct the syntax of natural language — its structural organization — through tagging and parsing. But some of the most exciting and promising potential applications of language technology involve going beyond syntax to se...
nlp_Page_303_Chunk301
286 CHAPTER 12. LOGICAL SEMANTICS Much more than this can be said about the question of how best to represent knowledge for computation (e.g., Sowa, 2000), but this chapter will focus on these four criteria. 12.1 Meaning and denotation The first criterion for a meaning representation is that statements in the representa...
nlp_Page_304_Chunk302
12.2. LOGICAL REPRESENTATIONS OF MEANING 287 12.2 Logical representations of meaning Criterion c3 requires that the meaning representation support inference — for example, automatically deducing new facts from known premises. While many representations have been proposed that meet these criteria, the most mature is the...
nlp_Page_305_Chunk303
288 CHAPTER 12. LOGICAL SEMANTICS These laws can be combined to derive further equivalences, which can support logical inferences. For example, suppose φ = The music is loud and ψ = Max can’t sleep. Then if we are given, φ ⇒ψ If the music is loud, Max can’t sleep. φ The music is loud. we can derive ψ (Max can’t sleep) ...
nlp_Page_306_Chunk304
12.2. LOGICAL REPRESENTATIONS OF MEANING 289 Using constants and relations, it is possible to express statements like Max can’t sleep and Max is Abigail’s brother: ¬CAN-SLEEP(MAX) BROTHER(MAX,ABIGAIL). These statements can also be combined using Boolean operators, such as, (BROTHER(MAX,ABIGAIL) ∨BROTHER(MAX,STEVE)) ⇒¬C...
nlp_Page_307_Chunk305
290 CHAPTER 12. LOGICAL SEMANTICS Note that MOTHER-OF is a functional analogue of the relation MOTHER, so that MOTHER-OF(x) = y if MOTHER(x, y). Any logical formula that uses functions can be rewritten using only relations and quantification. For example, MAKES-NOISE(MOTHER-OF(ABIGAIL)) [12.5] can be rewritten as ∃xMAKE...
nlp_Page_308_Chunk306
12.3. SEMANTIC PARSING AND THE LAMBDA CALCULUS 291 or inconsistent. A model checker is a program that determines whether a sentence φ is satisfied in M. A model builder is a program that constructs a model in which φ is satisfied. The problems of checking for consistency and validity in first-order logic are undecidable, ...
nlp_Page_309_Chunk307
292 CHAPTER 12. LOGICAL SEMANTICS S : likes(alex, brit) VP : ? NP : brit Brit V : ? likes NP : alex Alex Figure 12.1: The principle of compositionality requires that we identify meanings for the constituents likes and likes Brit that will make it possible to compute the meaning for the entire sentence. constituents, y....
nlp_Page_310_Chunk308
12.3. SEMANTIC PARSING AND THE LAMBDA CALCULUS 293 LIKES(x, BRIT). We write this substitution as, (λx.LIKES(x, BRIT))@ALEX = LIKES(ALEX,BRIT), [12.11] with the symbol “@” indicating function application. Function application in the lambda calculus is sometimes called β-reduction or β-conversion. The expression φ@ψ indi...
nlp_Page_311_Chunk309
294 CHAPTER 12. LOGICAL SEMANTICS S : likes(alex, brit) VP : λx.likes(x, brit) NP : brit Brit Vt : λy.λx.likes(x, y) likes NP : alex Alex Figure 12.2: Derivation of the semantic representation for Alex likes Brit in the grammar G1. S →NP VP VP.sem@NP.sem VP →Vt NP Vt.sem@NP.sem VP →Vi Vi.sem Vt →likes λy.λx.LIKES(x, y)...
nlp_Page_312_Chunk310
12.3. SEMANTIC PARSING AND THE LAMBDA CALCULUS 295 S : ∃xdog(x) ∧sleeps(x) VP : λx.sleeps(x) Vi : λx.sleeps(x) sleeps NP : λP.∃xP(x) ∧dog(x) NN : dog dog DT : λQ.λP.∃x.P(x) ∧Q(x) A Figure 12.3: Derivation of the semantic representation for A dog sleeps, in grammar G2 start with the indefinite article a, to which we assi...
nlp_Page_313_Chunk311
296 CHAPTER 12. LOGICAL SEMANTICS S : ∃xdog(x) ∧likes(x, alex) VP : λx.likes(x, alex) NP : λP.P(alex) NNP : alex Alex Vt : λP.λx.P(λy.likes(x, y)) likes NP : λQ.∃xdog(x) ∧Q(x) NN : dog dog DT : λP.λQ.∃xP(x) ∧Q(x) A Figure 12.4: Derivation of the semantic representation for A dog likes Alex. Direct objects are handled b...
nlp_Page_314_Chunk312
12.4. LEARNING SEMANTIC PARSERS 297 S →NP VP NP.sem@VP.sem VP →Vt NP Vt.sem@NP.sem VP →Vi Vi.sem NP →DET NN DET.sem@NN.sem NP →NNP λP.P(NNP.sem) DET →a λP.λQ.∃xP(x) ∧Q(x) DET →every λP.λQ.∀x(P(x) ⇒Q(x)) Vt →likes λP.λx.P(λy.LIKES(x, y)) Vi →sleeps λx.SLEEPS(x) NN →dog DOG NNP →Alex ALEX NNP →Brit BRIT Table 12.2: G2, a...
nlp_Page_315_Chunk313
298 CHAPTER 12. LOGICAL SEMANTICS S : eats(alex, shoots) ∧eats(alex, leavesn) VP : λx.eats(x, shoots) ∧eats(x, leavesn) NP : λP.P(shoots) ∧P(leavesn) NP : λP.P(leavesn) leaves CC : λP.λQ.λx.P(x) ∧Q(x) and NP : λP.P(shoots) shoots Vt : λP.λx.P(λy.eats(x, y)) eats NP : λP.P(alex) Alex Figure 12.5: Derivation for gold sem...
nlp_Page_316_Chunk314
12.4. LEARNING SEMANTIC PARSERS 299 S : eats(alex, shoots) ∧leavesv(alex) VP : λx.eats(x, shoots) ∧leavesv(x) VP : λx.leavesv(x) Vi : λx.leavesv(x) leaves CC : λP.λQ.λx.P(x) ∧Q(x) and VP : λx.eats(x, shoots) NP : λP.P(shoots) shoots Vt : λP.λx.P(λy.eats(x, y)) eats NP : λP.P(alex) Alex Figure 12.6: Derivation for incor...
nlp_Page_317_Chunk315
300 CHAPTER 12. LOGICAL SEMANTICS The semantic parser can then select the logical form with the maximum log marginal probability, log X z p(y, z | w) = log X z exp(θ · f(w, z, y)) P y′, z′ exp(θ · f(w, z′, y′)) [12.22] ∝log X z exp(θ · f(w, z′, y′)) [12.23] ≥max z θ · f(w, z, y). [12.24] It is impossible to push the lo...
nlp_Page_318_Chunk316
12.4. LEARNING SEMANTIC PARSERS 301 Algorithm 16 Latent variable perceptron 1: procedure LATENTVARIABLEPERCEPTRON(w(1:N), y(1:N)) 2: θ ←0 3: repeat 4: Select an instance i 5: z(i) ←argmaxz θ · f(w(i), z, y(i)) 6: ˆy, ˆz ←argmaxy′,z′ θ · f(w(i), z′, y′) 7: θ ←θ + f(w(i), z(i), y(i)) −f(w(i), ˆz, ˆy) 8: until tired 9: re...
nlp_Page_319_Chunk317
302 CHAPTER 12. LOGICAL SEMANTICS binary score indicating whether the denotation JyK for the text w(i) is correct. We can then learn by maximizing a conditional-likelihood objective, ℓ(i)(θ) = log X y vi(y) × p(y | w; θ) [12.29] = log X y vi(y) × X z p(y, z | w; θ), [12.30] which sums over all derivations z of all vali...
nlp_Page_320_Chunk318
12.4. LEARNING SEMANTIC PARSERS 303 article by Liang and Potts (2015), tutorial slides and videos by Artzi and Zettlemoyer (2013),12 and the source code by Yoav Artzi13 and Percy Liang.14 Exercises 1. The modus ponens inference rule states that if we know φ ⇒ψ and φ, then ψ must be true. Justify this rule, using the de...
nlp_Page_321_Chunk319
304 CHAPTER 12. LOGICAL SEMANTICS 8. Statements like every student eats a pizza have two possible interpretations, depend- ing on quantifier scope: ∀x∃yPIZZA(y) ∧(STUDENT(x) ⇒EATS(x, y)) [12.32] ∃y∀xPIZZA(y) ∧(STUDENT(x) ⇒EATS(x, y)) [12.33] a) Explain why these interpretations really are different. b) Which is generate...
nlp_Page_322_Chunk320
Chapter 13 Predicate-argument semantics This chapter considers more “lightweight” semantic representations, which discard some aspects of first-order logic, but focus on predicate-argument structures. Let’s begin by thinking about the semantics of events, with a simple example: (13.1) Asha gives Boyang a book. A first-or...
nlp_Page_323_Chunk321
306 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS In this way, each argument of the event — the giver, the recipient, the gift — can be rep- resented with a relation of its own, linking the argument to the event e. The expression GIVER(e, ASHA) says that ASHA plays the role of GIVER in the event. This reformulation handles ...
nlp_Page_324_Chunk322
13.1. SEMANTIC ROLES 307 In this example, there are two predicates, expressed by the verbs want and give. Thus, a semantic role labeler might return the following output: • (PREDICATE : wants, WANTER : Boyang, DESIRE : Asha to give him a linguistics book) • (PREDICATE : give, GIVER : Asha, RECIPIENT : him, GIFT : a lin...
nlp_Page_325_Chunk323
308 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS Asha gave Boyang a book VerbNet AGENT RECIPIENT THEME PropBank ARG0: giver ARG2: entity given to ARG1: thing given FrameNet DONOR RECIPIENT THEME Asha taught Boyang algebra VerbNet AGENT RECIPIENT TOPIC PropBank ARG0: teacher ARG2: student ARG1: subject FrameNet TEACHER STUD...
nlp_Page_326_Chunk324
13.1. SEMANTIC ROLES 309 VerbNet roles are organized in a hierarchy, so that a TOPIC is a type of THEME, which in turn is a type of UNDERGOER, which is a type of PARTICIPANT, the top-level category. In addition, VerbNet organizes verb senses into a class hierarchy, in which verb senses that have similar meanings are gr...
nlp_Page_327_Chunk325
310 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS In the examples in Figure 13.1, Asha has most of the proto-agent properties: in giving the book to Boyang, she is acting volitionally (as opposed to Boyang got a book from Asha, in which it is not clear whether Asha gave up the book willingly); she is sentient; she causes a ...
nlp_Page_328_Chunk326
13.1. SEMANTIC ROLES 311 TMP time Boyang ate a bagel [AM-TMP yesterday]. LOC location Asha studies in [AM-LOC Stuttgart] MOD modal verb Asha [AM-MOD will] study in Stuttgart ADV general purpose [AM-ADV Luckily], Asha knew algebra. MNR manner Asha ate [AM-MNR aggressively]. DIS discourse connective [AM-DIS However], Ash...
nlp_Page_329_Chunk327
312 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS 13.2 Semantic role labeling The task of semantic role labeling is to identify the parts of the sentence comprising the semantic roles. In English, this task is typically performed on the PropBank corpus, with the goal of producing outputs in the following form: (13.10) [ARG0...
nlp_Page_330_Chunk328
13.2. SEMANTIC ROLE LABELING 313 Predicate lemma and POS tag The lemma of the predicate verb and its part-of-speech tag Voice Whether the predicate is in active or passive voice, as deter- mined by a set of syntactic patterns for identifying passive voice constructions Phrase type The constituent phrase type for the pr...
nlp_Page_331_Chunk329
314 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS S VP PP(Arg1) Nn algebra In about NP(Arg2) Nn class Det the Vbd taught NP Nnp(Arg0) Asha Figure 13.2: Semantic role labeling on the phrase-structure parse tree for a sentence. The dashed line indicates the syntactic path from Asha to the predicate verb taught. the S constitu...
nlp_Page_332_Chunk330
13.2. SEMANTIC ROLE LABELING 315 13.2.2 Semantic role labeling as constrained optimization A potential problem with treating SRL as a classification problem is that there are a num- ber of sentence-level constraints, which a classifier might violate. • For a given verb, there can be only one argument of each type (ARG0, ...
nlp_Page_333_Chunk331
316 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS where r ∈R is a label in the set {ARG0, ARG1, . . . , AM-LOC, . . . , ∅}. Thus, the variables z are a binarized version of the semantic role labeling y. The objective can then be formulated as a linear function of z. X (i,j)∈τ ψ(w, yi,j, i, j, ρ, τ) = X i,j,r ψ(w, r, i, j, ρ...
nlp_Page_334_Chunk332
13.2. SEMANTIC ROLE LABELING 317 Learning with constraints Learning can be performed in the context of constrained op- timization using the usual perceptron or large-margin classification updates. Because constrained inference is generally more time-consuming, a key question is whether it is necessary to apply the const...
nlp_Page_335_Chunk333
318 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS B-ARG1; all remaining tokens in the span are inside, and are therefore labeled I-ARG1. Tokens outside any argument are labeled O. For example: (13.12) Asha B-ARG0 taught PRED Boyang B-ARG2 ’s I-ARG2 mom I-ARG2 about B-ARG1 algebra I-ARG1 Recurrent neural networks (§ 7.6) are...
nlp_Page_336_Chunk334
13.3. ABSTRACT MEANING REPRESENTATION 319 (w / want-01 :ARG0 (h / whale) :ARG1 (p / pursue-02 :ARG0 (c / captain) :ARG1 h)) w / wants-01 h / whale p / pursue-02 c / captain Arg0 Arg1 Arg1 Arg0 Figure 13.3: Two views of the AMR representation for the sentence The whale wants the captain to pursue him. (13.13) The whale ...
nlp_Page_337_Chunk335
320 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS :ARG1 (b2 / book :topic (a / algebra))) This indicates that the variable p is a person, whose name is the variable n; that name has one token, the string Asha. Similarly, the variable b2 is a book, and the topic of b2 is a variable a whose type is algebra. The relations name...
nlp_Page_338_Chunk336
13.3. ABSTRACT MEANING REPRESENTATION 321 13.3.1 AMR Parsing Abstract Meaning Representation is not a labeling of the original text — unlike PropBank semantic role labeling, and most of the other tagging and parsing tasks that we have encountered thus far. The AMR for a given sentence may include multiple concepts for ...
nlp_Page_339_Chunk337
322 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS Exercises 1. Write out an event semantic representation for the following sentences. You may make up your own predicates. (13.15) Abigail shares with Max. (13.16) Abigail reluctantly shares a toy with Max. (13.17) Abigail hates to share with Max. 2. Find the PropBank framese...
nlp_Page_340_Chunk338
13.3. ABSTRACT MEANING REPRESENTATION 323 b. The girl was liked by the boy. c. Abigail likes Maxwell Aristotle. d. The spy likes the attractive boy. e. The girl doesn’t like the boy. f. The girl likes her dog. For (13.19c), recall that multi-token names are created using op1, op2, etc. You will need to consult Banaresc...
nlp_Page_341_Chunk339
324 CHAPTER 13. PREDICATE-ARGUMENT SEMANTICS c) Try to identify ARG0 and ARG1 for each predicate. You should again use the BiLSTM and BIO notation, but you may want to include the BiLSTM hidden state at the location of the predicate in your prediction model, e.g., ψ(ym) = βy·[hm; hˆr], where ˆr is the predicted locatio...
nlp_Page_342_Chunk340
Chapter 14 Distributional and distributed semantics A recurring theme in natural language processing is the complexity of the mapping from words to meaning. In chapter 4, we saw that a single word form, like bank, can have mul- tiple meanings; conversely, a single meaning may be created by multiple surface forms, a lex...
nlp_Page_343_Chunk341
326 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS (14.1) (14.2) (14.3) (14.4) ... tezg¨uino 1 1 1 1 loud 0 0 0 0 motor oil 1 0 0 1 tortillas 0 1 0 1 choices 0 1 0 0 wine 1 1 1 0 Table 14.1: Distributional statistics for tezg¨uino and five related terms 4 3 2 1 0 1 2 3 4 4 3 2 1 0 1 2 3 4 sister brother niece neph...
nlp_Page_344_Chunk342
14.2. DESIGN DECISIONS FOR WORD REPRESENTATIONS 327 such as analogies. Figure 14.1 shows two examples, based on two-dimensional projections of distributional word embeddings, discussed later in this chapter. In each case, word- pair relationships correspond to regular linear patterns in this two dimensional space. No l...
nlp_Page_345_Chunk343
328 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS The moment one learns English, complications set in (Alfau, 1999) Brown Clusters {one} WORD2VEC, h = 2 {moment, one, English, complications} Structured WORD2VEC, h = 2 {(moment, −2), (one, −1), (English, +1), (complications, +2)} Dependency contexts, {(one, NSUBJ...
nlp_Page_346_Chunk344
14.3. LATENT SEMANTIC ANALYSIS 329 • (h = 30): kennel, puppy, pet, bitch, terrier, rottweiler, canine, cat, to bark, Alsatian Which word list is better? Each word in the h = 2 list is an animal, reflecting the fact that locally, the word dog tends to appear in the same contexts as other animal types (e.g., pet the dog, ...
nlp_Page_347_Chunk345
330 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS factoring a matrix of word and context counts, using truncated singular value decompo- sition (SVD), min U∈RV ×K,S∈RK×K,V∈R|C|×K ||C −USV⊤||F [14.2] s.t. U⊤U = I [14.3] V⊤V = I [14.4] ∀i ̸= j, Si,j = 0, [14.5] where V is the size of the vocabulary, |C| is the num...
nlp_Page_348_Chunk346
14.4. BROWN CLUSTERS 331 evaluation assessment analysis understanding opinion conversation discussion reps representatives representative rep day year week month quarter half accounts people customers individuals employees students Figure 14.2: Subtrees produced by bottom-up Brown clustering on news text (Miller et al....
nlp_Page_349_Chunk347
332 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS bitstring ten most frequent words 011110100111 excited thankful grateful stoked pumped anxious hyped psyched exited geeked 01111010100 talking talkin complaining talkn bitching tlkn tlkin bragging rav- ing +k 011110101010 thinking thinkin dreaming worrying thinkn...
nlp_Page_350_Chunk348
14.4. BROWN CLUSTERS 333 latent variable ki ∈{1, 2, . . . , K} to represent the cluster of word i: log p(w; k) ≈ M X m=1 log p(wm | wm−1; k) [14.11] ≜ M X m=1 log p(wm | kwm) + log p(kwm | kwm−1). [14.12] This is similar to a hidden Markov model, with the crucial difference that each word can be emitted from only a sin...
nlp_Page_351_Chunk349
334 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS vwm−2 vwm−1 vwm vwm+1 vwm+2 wm−2 wm−1 wm wm+1 wm+2 U (a) Continuous bag-of-words (CBOW) vwm wm wm−1 wm−2 wm+1 wm+2 U (b) Skipgram Figure 14.3: The CBOW and skipgram variants of WORD2VEC. The parameter U is the matrix of word embeddings, and each vm is the context...
nlp_Page_352_Chunk350
14.5. NEURAL WORD EMBEDDINGS 335 The CBOW model optimizes an approximation to the corpus log-likelihood, log p(w) ≈ M X m=1 log p(wm | wm−h, wm−h+1, . . . , wm+h−1, wm+h) [14.15] = M X m=1 log exp (uwm · vm) PV j=1 exp (uj · vm) [14.16] = M X m=1 uwm · vm −log V X j=1 exp (uj · vm) . [14.17] 14.5.2 Skipgrams In the CBO...
nlp_Page_353_Chunk351
336 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS 0 1 2 3 4 Ahab σ(u0 · vc) whale σ(−u0 · vc) × σ(u2 · vc) blubber σ(−u0 · vc) × σ(−u2 · vc) Figure 14.4: A fragment of a hierarchical softmax tree. The probability of each word is computed as a product of probabilities of local branching decisions in the tree. voc...
nlp_Page_354_Chunk352
14.5. NEURAL WORD EMBEDDINGS 337 and Hinton, 2008), or by using the Huffman (1952) encoding algorithm for lossless com- pression. Negative sampling Likelihood-based methods are computationally intensive because each probability must be normalized over the vocabulary. These probabilities are based on scores for each wor...
nlp_Page_355_Chunk353
338 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS word 1 word 2 similarity love sex 6.77 stock jaguar 0.92 money cash 9.15 development issue 3.97 lad brother 4.46 Table 14.4: Subset of the WS-353 (Finkelstein et al., 2002) dataset of word similarity ratings (examples from Faruqui et al. (2016)). GloVe (“global v...
nlp_Page_356_Chunk354
14.6. EVALUATING WORD EMBEDDINGS 339 14.6.1 Intrinsic evaluations A basic question for word embeddings is whether the similarity of words i and j is re- flected in the similarity of the vectors ui and uj. Cosine similarity is typically used to compare two word embeddings, cos(ui, uj) = ui · uj ||ui||2 × ||uj||2 . [14.26...
nlp_Page_357_Chunk355
340 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS layer in a neural network, such as a Bi-LSTM tagging model (§ 7.6). Word representations can be evaluated by the performance of the downstream systems that consume them: for example, GloVe embeddings are convincingly better than Latent Semantic Analysis as featur...
nlp_Page_358_Chunk356
14.7. DISTRIBUTED REPRESENTATIONS BEYOND DISTRIBUTIONAL STATISTICS341 cessing systems, these findings highlight the risk that natural language processing will replicate and amplify biases in the world, as well as in text. If, for example, word em- beddings encode the belief that women are as unlikely to be programmers a...
nlp_Page_359_Chunk357
342 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS umillicuries ˜umillicuries u(M) milli+ u(M) curie u(M) +s umillicuries umillicurie u(M) milli+ u(M) curie u(M) +s Figure 14.5: Two architectures for building word embeddings from subword units. On the left, morpheme embeddings u(m) are combined by addition with t...
nlp_Page_360_Chunk358
14.7. DISTRIBUTED REPRESENTATIONS BEYOND DISTRIBUTIONAL STATISTICS343 data, the embedding can be constructed directly from the morphemes, assuming that each morpheme appears in some other word in the training data. The free parameter ˜u adds flexibility: words with similar morphemes are encouraged to have similar embedd...
nlp_Page_361_Chunk359
344 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS where ˆui is the pretrained embedding of word i, and L = {(i, j)} is a lexicon of word relations. The hyperparameter βij controls the importance of adjacent words having similar embeddings; Faruqui et al. (2015) set it to the inverse of the degree of word i, βij ...
nlp_Page_362_Chunk360
14.8. DISTRIBUTED REPRESENTATIONS OF MULTIWORD UNITS 345 this was the only way it was the only way it was her turn to blink it was hard to tell it was time to move on he had to do it again they all looked at each other they all turned to look back they both turned to face him they both turned and walked away Figure 14....
nlp_Page_363_Chunk361
346 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS the input is a corrupted version of the original sentence, and the auto-encoder must re- construct the uncorrupted original (Vincent et al., 2010; Hill et al., 2016). By interpolating between distributed representations of two sentences, αui+(1−α)uj, it is possib...
nlp_Page_364_Chunk362
14.8. DISTRIBUTED REPRESENTATIONS OF MULTIWORD UNITS 347 (14.5) a. Donald thanked Vlad profusely. b. Donald conveyed to Vlad his profound appreciation. c. Vlad was showered with gratitude by Donald. Symbolic representations are relatively brittle to this sort of variation, but are better suited to describe individual e...
nlp_Page_365_Chunk363
348 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS processing models across languages (T¨ackstr¨om et al., 2012), and make monolingual word embeddings more accurate (Faruqui and Dyer, 2014). A typical approach is to learn a pro- jection that maximizes the correlation of the distributed representations of each ele...
nlp_Page_366_Chunk364
14.8. DISTRIBUTED REPRESENTATIONS OF MULTIWORD UNITS 349 inequalities cannot both hold: ψ(good) >ψ(not good) [14.30] ψ(bad) <ψ(not bad). [14.31] Then construct a similar example pair for the case in which phrase representations are the average of the word representations. 5. Now let’s consider a slight modification to t...
nlp_Page_367_Chunk365
350 CHAPTER 14. DISTRIBUTIONAL AND DISTRIBUTED SEMANTICS 9. Now modify your model from the previous problem to fine-tune the word embed- dings. Report F -MEASURE, accuracy, and training time. 10. Try a simpler approach, in which word embeddings in the document are averaged, and then this average is passed through a feed...
nlp_Page_368_Chunk366
Chapter 15 Reference Resolution References are one of the most noticeable forms of linguistic ambiguity, afflicting not just automated natural language processing systems, but also fluent human readers. Warn- ings to avoid “ambiguous pronouns” are ubiquitous in manuals and tutorials on writing style. But referential ambi...
nlp_Page_369_Chunk367
352 CHAPTER 15. REFERENCE RESOLUTION (15.1) [[Apple Inc] Chief Executive Tim Cook] has jetted into [China] for talks with government officials as [he] seeks to clear up a pile of problems in [[the firm] ’s biggest growth market] ... [Cook] is on [his] first trip to [the country] since taking over... Figure 15.1: Running e...
nlp_Page_370_Chunk368
15.1. FORMS OF REFERRING EXPRESSIONS 353 parsing the text to identify all such noun phrases.3 Filtering heuristics can help to prune the search space to noun phrases that are likely to be coreferent (Lee et al., 2013; Durrett and Klein, 2013). In nested noun phrases, mentions are generally considered to be the largest ...
nlp_Page_371_Chunk369
354 CHAPTER 15. REFERENCE RESOLUTION S VP PP her with speaks NP Abigail (a) S VP PP her with speaks NP mom ’s Abigail (b) S VP S VP her with speaks NP she V hopes NP Abigail (c) Figure 15.2: In (a), Abigail c-commands her; in (b), Abigail does not c-command her, but Abigail’s mom does; in (c), the scope of Abigail is l...
nlp_Page_372_Chunk370
15.1. FORMS OF REFERRING EXPRESSIONS 355 S VP PP NP SBAR S VP PP NP NNP London TO to NP1 PRP it VBD moved NP PRP he WHP when CD 536 IN until NP NP PP NP NN king DET the IN of NN residence DET the VBD remained NP PP NP NNP Camelot IN in NN castle DET The Figure 15.3: Left-to-right breadth-first tree traversal (Hobbs, 197...
nlp_Page_373_Chunk371
356 CHAPTER 15. REFERENCE RESOLUTION Non-referential pronouns While pronouns are generally used for reference, they need not refer to entities. The fol- lowing examples show how pronouns can refer to propositions, events, and speech acts. (15.7) a. They told me that I was too ugly for show business, but I didn’t believ...
nlp_Page_374_Chunk372
15.1. FORMS OF REFERRING EXPRESSIONS 357 15.1.2 Proper Nouns If a proper noun is used as a referring expression, it often corefers with another proper noun, so that the coreference problem is simply to determine whether the two names match. Subsequent proper noun references often use a shortened form, as in the running...
nlp_Page_375_Chunk373
358 CHAPTER 15. REFERENCE RESOLUTION Nominals are especially difficult to resolve (Denis and Baldridge, 2007; Durrett and Klein, 2013), and the examples above suggest why this may be the case: world knowledge is required to identify Apple Inc as a firm, and China as a growth market. Other difficult examples include the us...
nlp_Page_376_Chunk374
15.2. ALGORITHMS FOR COREFERENCE RESOLUTION 359 Mention clustering The subtask of mention clustering will be the focus of the remainder of this chapter. There are two main classes of models. In mention-based models, the scoring function for a coreference clustering decomposes over pairs of mentions. These pairwise deci...
nlp_Page_377_Chunk375
360 CHAPTER 15. REFERENCE RESOLUTION 15.2.2 Mention-ranking models In mention ranking (Denis and Baldridge, 2007), the classifier learns to identify a single antecedent ai ∈{ϵ, 1, 2, . . . , i −1} for each referring expression i, ˆai = argmax a∈{ϵ,1,2,...,i−1} ψM(a, i), [15.4] where ψM(a, i) is a score for the mention p...
nlp_Page_378_Chunk376
15.2. ALGORITHMS FOR COREFERENCE RESOLUTION 361 where A(c) is the set of antecedent structures that is compatible with the ground truth coreference clustering c. Another alternative is to sum over all the conditional probabili- ties of antecedent structures that are compatible with the ground truth clustering (Durrett ...
nlp_Page_379_Chunk377
362 CHAPTER 15. REFERENCE RESOLUTION lem, max y∈{0,1}M M X j=1 j X i=1 ψM(i, j) × yi,j s.t. yi,j + yj,k −1 ≤yi,k, ∀i < j < k, with the constraint enforcing transitive closure. This constrained optimization problem is equivalent to graph partitioning with positive and negative edge weights: construct a graph where the n...
nlp_Page_380_Chunk378
15.2. ALGORITHMS FOR COREFERENCE RESOLUTION 363 {Abigail} {Abigail, she} {Abigail}, {she} {Abigail, she, her} {Abigail, she}, {her} {Abigail}, {she, her} {Abigail, her}, {she} {Abigail}, {she}, {her} Figure 15.4: The Bell Tree for the sentence Abigail hopes she speaks with her. Which paths are excluded by the syntactic...
nlp_Page_381_Chunk379
364 CHAPTER 15. REFERENCE RESOLUTION Incremental cluster ranking can be made more accurate by performing multiple passes over the document, applying rules (or “sieves”) with increasing recall and decreasing precision at each pass (Lee et al., 2013). In the early passes, coreference links are pro- posed only between men...
nlp_Page_382_Chunk380
15.2. ALGORITHMS FOR COREFERENCE RESOLUTION 365 This style of incremental update can also be applied to a margin loss between the gold clustering and the top clustering on the beam. By backpropagating from this loss, it is also possible to train a more complicated scoring function, such as a neural network in which the...
nlp_Page_383_Chunk381
366 CHAPTER 15. REFERENCE RESOLUTION the current policy. Each action zi corresponds to a step in the Bell tree: adding mention mi to an existing cluster, or forming a new cluster. Each trajectory z corresponds to a single clustering c, and so we can write the loss of an action sequence as ℓ(c(z)). The policy gradient a...
nlp_Page_384_Chunk382
15.3. REPRESENTATIONS FOR COREFERENCE RESOLUTION 367 Algorithm 17 Learning to search for entity-based coreference resolution 1: procedure COMPUTE-GRADIENT(mentions m, loss function ℓ, parameters θ) 2: L(θ) ←0 3: z ∼p(z | m; θ) ▷Sample a trajectory from the current policy 4: for i ∈{1, 2, . . . M} do 5: for action z ∈Z(...
nlp_Page_385_Chunk383
368 CHAPTER 15. REFERENCE RESOLUTION Mention features Features of individual mentions can help to predict anaphoricity. In systems where men- tion detection is performed jointly with coreference resolution, these features can also predict whether a span of text is likely to be a mention. For mention i, typical features...
nlp_Page_386_Chunk384
15.3. REPRESENTATIONS FOR COREFERENCE RESOLUTION 369 String match. A variety of string match features can be employed: exact match, suffix match, head match, and more complex matching rules that disregard irrelevant modifiers (Soon et al., 2001). Compatibility. Building on the model, features can measure the anaphor and ...
nlp_Page_387_Chunk385
370 CHAPTER 15. REFERENCE RESOLUTION relatively simple classification-based systems, they have proven less useful when added to the current generation of techniques.8 For example, Durrett and Klein (2013) employ a range of semantics-based features — WordNet synonymy and hypernymy relations on head words, named entity ty...
nlp_Page_388_Chunk386
15.3. REPRESENTATIONS FOR COREFERENCE RESOLUTION 371 ufirst uhead ulast · · · · · · in the firm ’s biggest growth market . Figure 15.5: A bidirectional recurrent model of mention embeddings. The mention is represented by its first word, its last word, and an estimate of its head word, which is computed from a weighted ave...
nlp_Page_389_Chunk387
372 CHAPTER 15. REFERENCE RESOLUTION Using mention embeddings Given a set of mention embeddings, each mention i and candidate antecedent a is scored as, ψ(a, i) =ψS(a) + ψS(i) + ψM(a, i) [15.29] ψS(a) =FeedForwardS(u(a)) [15.30] ψS(i) =FeedForwardS(u(i)) [15.31] ψM(a, i) =FeedForwardM([u(a); u(i); u(a) ⊙u(i); f(a, i, w...
nlp_Page_390_Chunk388
15.4. EVALUATING COREFERENCE RESOLUTION 373 network, ψE(i, e) = Feedforward([ve; ui]). If i is added to entity e, then its representa- tion is updated recurrently, ve ←f(ve, ui), using a recurrent neural network such as a long short-term memory (LSTM; chapter 6). Alternatively, we can apply a pooling oper- ation, such ...
nlp_Page_391_Chunk389
374 CHAPTER 15. REFERENCE RESOLUTION • The number of times new entities are introduced by each of the three types of referring expressions: pronouns, proper nouns, and nominals. Include “single- ton” entities that are mentioned only once. • For each type of referring expression, compute the fraction of mentions that ar...
nlp_Page_392_Chunk390
15.4. EVALUATING COREFERENCE RESOLUTION 375 b) To make inference more efficient, Lee et al. (2017) restrict consideration to spans of maximum length L ≪M. Under this restriction, how many mention pairs must be evaluated? c) To further improve inference, one might evaluate coreference only between pairs of mentions whose...
nlp_Page_393_Chunk391
376 CHAPTER 15. REFERENCE RESOLUTION • Drawing a single sequence of actions (K = 1) from the current policy, you obtain the following incremental clusterings: c(a1) ={Abigail} c(a1:2) ={Abigail, she} c(a1:3) ={Abigail, she}, {her}. • At each mention t, the space of actions At includes merging the mention with each exis...
nlp_Page_394_Chunk392
15.4. EVALUATING COREFERENCE RESOLUTION 377 Compare the ratio of the counts of the original 5-gram to the summed counts of the 5-grams created by substitution. Is this ratio a good predictor of whether it is referential? Under contract with MIT Press, shared under CC-BY-NC-ND license.
nlp_Page_395_Chunk393
Chapter 16 Discourse Applications of natural language processing often concern multi-sentence documents: from paragraph-long restaurant reviews, to 500-word newspaper articles, to 500-page novels. Yet most of the methods that we have discussed thus far are concerned with individual sentences. This chapter discusses the...
nlp_Page_397_Chunk394
380 CHAPTER 16. DISCOURSE 0 5 10 15 20 25 30 35 sentence 0.0 0.1 0.2 0.3 0.4 0.5 0.6 cosine similarity original smoothing L=1 smoothing L=3 Figure 16.1: Smoothed cosine similarity among adjacent sentences in a news article. Local minima at m = 10 and m = 29 indicate likely segmentation points. 16.1.1 Topic segmentation...
nlp_Page_398_Chunk395
16.2. ENTITIES AND REFERENCE 381 segmentation achieves high likelihood by grouping segments with similar word distribu- tions. This probabilistic approach can be extended to hierarchical topic segmentation, in which each topic segment is divided into subsegments (Eisenstein, 2009). All of these ap- proaches are unsuper...
nlp_Page_399_Chunk396
382 CHAPTER 16. DISCOURSE (16.1) a. John went to his favorite music store to buy a piano. b. He had frequented the store for many years. c. He was excited that he could fi- nally buy a piano. d. He arrived just as the store was closing for the day (16.2) a. John went to his favorite music store to buy a piano. b. It was...
nlp_Page_400_Chunk397
16.2. ENTITIES AND REFERENCE 383 SKYLER WALTER DANGER A GUY THE DOOR You don’t know who you’re talk- ing to, S - - - - so let me clue you in. O O - - - I am not in danger, Skyler. X S X - - I am the danger. - S O - - A guy opens his door and gets shot, - - - S O and you think that of me? S X - - - No. I am the one who ...
nlp_Page_401_Chunk398
384 CHAPTER 16. DISCOURSE estimated from labeled data, and an entity grid can then be scored by the sum of the log- probabilities across all columns and all transitions, PNe i=1 PM m=1 log p(c(m, i) | c(m −1, i)). The resulting probability can be used as a proxy for the coherence of a text. This has been shown to be us...
nlp_Page_402_Chunk399
16.3. RELATIONS 385 16.3 Relations In dependency grammar, sentences are characterized by a graph (usually a tree) of syntac- tic relations between words, such as NSUBJ and DET. A similar idea can be applied at the document level, identifying relations between discourse units, such as clauses, sentences, or paragraphs. ...
nlp_Page_403_Chunk400