<<

Algorithms for Natural Processing

Semantic Processing [1]

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 1 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Outline

• Allen, Chapter 8 – and – Word Senses & – The Logical Form Language – Encoding Ambiguity – Verbs and States – Thematic Roles – Speech Acts & Embedded Sentences

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 2 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Logical Form

• Context-independent – Produced directly from the – Ignores the utterance context • Example: The ball is red – Assigning an exact (contextual) meaning requires knowing which ball – Logical form an intermediate step in full meaning representation (Fig 8.1)

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 3 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Logical Form [2]

• Includes indexical terms – Pronouns (e.g., I, you) – Generic NP (e.g., a ball, the ball) – Any term whose exact denotation can only be determined from context • Logical form allows compact representation of indexical terms – e.g. (RED1 ) vs. (OR b1 b4 b12 b45 …) 11-711: Algorithms for Natural Language Processing Semantic Processing [[1 4 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Situations

• To retrieve an exact meaning, we must combine LF with a particular context or situation • A situation might be represented as a of objects and relations: {(BALL B0005), (PERSON P86), (OWNS P86 B0005)}

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 5 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Situations [2]

• The logical form can be thought of as a function which maps one situation onto another by adding additional information • Example: Figure 8.2

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 6 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Word Senses & Ambiguity

• Q: Can the basic unit of LF be a word? • A: No, words have different senses • Example: go has many senses (to move, depart, pass, vanish, reach, extend, …) • Senses are organized into an ontology

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 7 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Word Senses [2]

• Ontology – Example: ’s classes • substance (physical objects) • quantity (e.g., numbers) • quality (e.g., being red) • Others: relation, place, time, position, state, action, affection – Important: actions, events • Provide a structure for organizing the interpretation of sentences 11-711: Algorithms for Natural Language Processing Semantic Processing [[1 8 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Actions and Events

• We lifted the box. It was hard work. – The pronoun it refers to the whole action (not just the box) • We lifted the box. It was heavy. – The pronoun it refers to the box

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 9 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Semantic Ambiguity

• Parallel to – Happy [cats and dogs] live on the farm – [Happy cats] and dogs live on the farm • Independent of syntactic structure – Every boy loves a dog – “all boys love a single dog” – “foreach boy, there is a dog he loves” 11-711: Algorithms for Natural Language Processing Semantic Processing [[1 10 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Logical Form Language

• Similar to first-order predicate calculus (FOPC) • Constants: word senses • Terms: constants that describe objects in the world • Predicates: constants that describe relations or properties • : predicate + terms

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 11 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Predicates

• Fido is a dog (DOG1 FIDO1) unary predicate • Sue loves Jack (LOVES1 SUE1 JACK1) binary predicate

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 12 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Word Senses

• Proper : terms JACK1 • Common nouns: unary predicates (DOG1 <>) • Verbs: n-ary predicates (BREAK1 <> <>)

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 13 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Operators

• Logical Operators – not, or, and, if, only if, … • Logical form supports two kinds of operators: – as word senses (if the operator is part of the utterance) – as logical operators (if the operator isn’t part of the utterance)

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 14 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Operators [2]

• Examples – Jack loves Sue or Jack loves Mary (OR1 (LOVES1 JACK1 SUE1)(LOVES1 JACK1 MARY1)) – Jack loves Sue, Bill loves Mary (& (LOVES1 JACK1 SUE1)(LOVES1 BILL1 MARY1))

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 15 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Quantifiers

• FOPC: only universal and existential quantifiers: ∀, ∃ • English: much larger range: – all, some, most, many, a few, the, … • Generalized Quantifiers ( : )

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 16 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Quantifiers [2]

• Most dogs bark (MOST1 d1:(DOG1 d1)(BARKS1 d1)) • Most barking things are dogs (MOST1 d2:(BARKS d1)(DOG1 d1)) • The dog barks (THE x:(DOG1 x)(BARKS1 x))

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 17 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Quantifiers [3]

• The happy dog barks (THE x:(&(DOG1 x)(HAPPY x))(BARKS1 x))

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 18 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Plural Forms

• The dogs bark (THE x:((PLUR DOG1) x)(BARKS1 x)) • PLUR is a predicate which takes another predicate as its and creates a new predicate which is true of a set of individuals

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 19 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Plural Forms [2]

• Distributive reading The dogs bark “There is a set of dogs, and each one barks” • Collective reading The dogs met at the corner “*There is a set of dogs, and each one met at the corner”

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 20 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Ambiguous Plurals

• Some sentences allow both collective and distributive readings

Two men bought a stereo “Each man bought a stereo” “The two men bought a stereo together”

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 21 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Modal Operators

• Modal verbs: believe, want, … Sue believes Jack is happy (BELIEVE SUE1 (HAPPY JACK1)) • Tense operators: PAST, PRES, FUT John sees Fido (PRES (SEES1 JOHN1 FIDO1)) John saw Fido (PAST (SEES1 JOHN1 FIDO1)) etc. 11-711: Algorithms for Natural Language Processing Semantic Processing [[1 22 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Encoding Ambiguity in LF

• Enumerating all possible logical forms is not practical • Instead, collapse common and represent them locally • Develop techniques to incrementally resolve ambiguities from further information

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 23 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Ambiguity [2]

• LF with ambiguity encoding is referred to as quasi-logical form • Word sense ambiguity – anywhere a term can appear, a set of terms can be used • Sue watched the ball (THE b1:({BALL1 BALL2} b1)(PAST (WATCH1 SUE1 b1)))

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 24 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Ambiguity [3]

• Quantifier Scoping – Generalized quantifiers treated syntactically, appear in the position indicated by syntactic structure – Angle brackets used to represent scope Every boy loves a dog (LOVES1 )

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 25 Copyright © 1999, Carnegie Mellon. All Rights Reserved. Ambiguity [4]

• Quantifier Scoping (cont.) – If the restriction in a generalized quantifier is a unary predicate, the variable is dropped; becomes • Scope of negation Every boy didn’t run ()

11-711: Algorithms for Natural Language Processing Semantic Processing [[1 26 Copyright © 1999, Carnegie Mellon. All Rights Reserved.