computing natural language semantics
play

Computing Natural Language Semantics Informatics 2A: Lecture 22 - PowerPoint PPT Presentation

Semantic Composition for NL Semantic (Scope) Ambiguity Underspecification Computing Natural Language Semantics Informatics 2A: Lecture 22 John Longley (slides by BW, KA, JL) School of Informatics University of Edinburgh 18 November 2010


  1. Semantic Composition for NL Semantic (Scope) Ambiguity Underspecification Computing Natural Language Semantics Informatics 2A: Lecture 22 John Longley (slides by BW, KA, JL) School of Informatics University of Edinburgh 18 November 2010 Informatics 2A: Lecture 22 Computing Natural Language Semantics 1

  2. Semantic Composition for NL Semantic (Scope) Ambiguity Underspecification 1 Semantic Composition for NL Syntax of FOPL Logical Form 2 Semantic (Scope) Ambiguity Definition Semantic Scope Approaches to Scope Ambiguity 3 Underspecification Motivation Underspecification: General Idea Informatics 2A: Lecture 22 Computing Natural Language Semantics 2

  3. Semantic Composition for NL Semantic (Scope) Ambiguity Underspecification Reading Required Reading: J&M, ch. 18 (Intro → 18.3) NLTK book ch. 10 (10.1 → 10.4) http://nltk.googlecode.com/svn/trunk/doc/book/ch10.html Recommended Reading: Alexander Koller & Joachim Nieren. Scope Underspecification and Processing . ESSLLI 1991 Lecture Notes (pp9–40: general intro to underspecification) http: //www.coli.uni-saarland.de/~koller/papers/esslli99.ps.gz Blackburn & Bos. Representation and Inference for Natural Language. A First Course in Computational Semantics . 2005 (ch.1–3) Informatics 2A: Lecture 22 Computing Natural Language Semantics 3

  4. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Syntax of first order predicate logic: summary This may itself be defined by a CFG (ignore bracketing for now): Term → Const | Var | · · · BasicFm → UnaryPred (Term) | BinaryPred (Term,Term) | · · · Fm → BasicFm | ¬ Fm | Fm ∧ Fm | Fm ∨ Fm | Fm ⇒ Fm | ∀ Var . Fm | ∃ Var . Fm A formula is called closed if every occurrence of any variable x appears within a quantified formula of the form ∀ x.Fm or ∃ x.Fm. Informatics 2A: Lecture 22 Computing Natural Language Semantics 4

  5. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Compositional Semantics: the key idea To build a compositional semantics for NL, we attach valuation functions to grammar rules (semantic attachments). The semantic attachments instruct us how to compute the interpretation of the LHS of the rule from the interpretations of its RHS components. Grammar I S → NP VP { VP.Sem(NP.Sem) } t VP → TV NP { TV.Sem(NP.Sem) } < e , t > NP → NPR { NPR.Sem } e TV → loves { λ y. λ x.love(x,y) } < e , < e , t >> NPR → Orr { orr } e NPR → Yossarian { yossarian } e VP.Sem(NP.Sem) means apply the interpretation of the VP to the interpretation of the NP. Types have been added to ease understanding. Informatics 2A: Lecture 22 Computing Natural Language Semantics 5

  6. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Compositional Semantics: example S[ λ x . love ( x , orr )( yossarian ) ⇒ β love ( yossarian , orr )] NP[ yossarian ] VP[ λ y .λ x . love ( x , y )( orr ) ⇒ β λ x . love ( x , orr )] NPR[ yossarian ] TV[ λ y .λ x . love ( x , y )] NP[ orr ] Yossarian loves NPR[ orr ] Orr Informatics 2A: Lecture 22 Computing Natural Language Semantics 6

  7. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Compositional Semantics, continued ◦ What about the interpretation of an NP other than a proper names – eg, John has access to a computer. Every student has access to a computer. whose FOPL interpretation contains an existential ( ∃ ) or a universal ( ∀ ) quantifier ∃ x ( computer ( x ) ∧ have access to ( john , x )) ∀ x ( student ( x ) → ∃ y ( computer ( y ) ∧ have access to ( x , y ))) ◦ Can we build such interpretations up from their component parts in the same way as with proper names? Informatics 2A: Lecture 22 Computing Natural Language Semantics 7

  8. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Suppose we try to get interpretations for a computer and every student from the following syntactic rules and semantic attachments: Grammar II S → NP VP { VP.Sem(NP.Sem) } VP → TV NP { TV.Sem(NP.Sem) } TV → has access to { λ y. λ x.have access to(x,y) } NP → a NOM {∃ x . NOM.Sem(x) } NP → every NOM {∀ x . NOM.Sem(x) } NPR → John { john } NOM → N { N.Sem } N → student { student } N → computer { computer } This is nonsensical as it stands: NOM.Sem has type e , but the expression ∃ x . NOM.Sem(x) requires it to have type < e , t > . In addition, the sentence ‘Every student has access to a computer’ is somewhat ambiguous (scoping ambiguity). Informatics 2A: Lecture 22 Computing Natural Language Semantics 8

  9. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Type raising (Cf. Tutorial Sheet 8, part 2) The first problem seems to arise from our decision that NP.Sem should have type e . Certainly ‘john’ is an entity — but which entity is ‘every student’? Idea: Since we wish to combine an NP.Sem with a VP.Sem (of type < e , t > ) to get an S.Sem (of type t ), let’s try again with NP.Sem having type << e , t >, t > . John λ P . P ( john ) every student λ P . ∀ x . student ( x ) ⇒ P ( x ) The appropriate semantic attachment for NP VP is then S → NP VP { NP.Sem (VP.Sem) } Informatics 2A: Lecture 22 Computing Natural Language Semantics 9

  10. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Semantics of determiners Using this approach, we can also derive the semantics of ‘every student’ from that of ’every’ and ’student’. Whereas proper nouns ( e.g. John) denote entities ( e ), common nouns ( e.g. student) should denote properties of entities ( < e , t > ). Determiners ( e.g. every, a, no, not every) should therefore have interpretations of type << e , t >, << e , t >, t >> . For example: student λ x . student(x) < e , t > every λ Q .λ P . ∀ x . Q ( x ) ⇒ P ( x ) << e , t >, << e , t >, t >> a λ Q .λ P . ∃ x . Q ( x ) ∧ P ( x ) << e , t >, << e , t >, t >> NP → Det N { Det.Sem (N.Sem) } << e , t >, t > We can now compute the semantics of ‘every student’ and check that it β -reduces to what we had before. Informatics 2A: Lecture 22 Computing Natural Language Semantics 10

  11. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification More on type raising Recall the grammar rule VP → TV NP Since the semantic type for NP has now been raised to << e , t >, t > , and we want VP to have semantic type < e , t > , what should the semantic type for TV be? It had better be <<< e , t >, t >, < e , t >> . (A 3rd order function type!) { λ R << e , t >, t > .λ z e . R ( λ w e . h a t ( z , w )) } TV → has access to VP → TV NP { TV.Sem(NP.Sem) } Informatics 2A: Lecture 22 Computing Natural Language Semantics 11

  12. Semantic Composition for NL Syntax of FOPL Semantic (Scope) Ambiguity Logical Form Underspecification Example We can now compositionally compute the semantics for every student has access to a computer. every student ( λ Q .λ P . ∀ x . Q ( x ) ⇒ P ( x ))( λ x . student ( x )) → β λ P . ∀ x . student ( x ) ⇒ P ( x ) a computer ( λ Q .λ P . ∃ x . Q ( x ) ∧ P ( x ))( λ x . computer ( x )) → β λ P . ∃ x . computer ( x ) ∧ P ( x ) · · · → β · · · h.a.t. a computer → β λ z . ∃ x . computer ( x ) ∧ h a t ( z , x ) · · · → β · · · (whole sentence) → β ∀ x . student ( x ) ⇒ ∃ y . computer ( y ) ∧ h a t ( x , y ) Note: In the last β -step, we’ve renamed ‘x’ to ‘y’ to avoid capture. Informatics 2A: Lecture 22 Computing Natural Language Semantics 12

  13. Semantic Composition for NL Definition Semantic (Scope) Ambiguity Semantic Scope Underspecification Approaches to Scope Ambiguity Ambiguities in NL The above approach is fine as far as it goes, but it doesn’t generally allow for ambiguities. Recall (L2,L11,L12) that NL ambiguities arise at many levels: PoS, syntax, lexicon. But even an utterance with a unique syntactic structure and words that are unambiguous with respect to PoS tags and senses can have multiple interpretations. Consider the sentence Every student has access to a laptop. Informatics 2A: Lecture 22 Computing Natural Language Semantics 13

  14. Semantic Composition for NL Definition Semantic (Scope) Ambiguity Semantic Scope Underspecification Approaches to Scope Ambiguity Semantic Ambiguity While the sentence is neither syntactically nor lexically ambiguous, it has two different interpretations because of its determiners: every: interpreted as ∀ (universal quantifier) a: interpreted as ∃ (existential quantifier) Meaning 1 Possibly a different laptop per student ∀ x ( student ( x ) → ∃ y ( laptop ( y ) ∧ have access to ( x , y ))) Meaning 2 Possibly the same laptop for all students ∃ y ( laptop ( y ) ∧ ∀ x ( student ( y ) → have access to ( x , y ))) Informatics 2A: Lecture 22 Computing Natural Language Semantics 14

Recommend


More recommend