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

Algorithms for Natural Language Processingrafea/CSCE569/slides/ch.8-a.pdfTitle No Slide Title Created Date 3/11/2012 3:06:04 PM

  • Upload
    vucong

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

1Semantic Processing [ 1[

Algorithms for Natural Language Processing

Semantic Processing [1]

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

2Semantic Processing [ 1[

Outline

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

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

3Semantic Processing [ 1[

Logical Form

• Context-independent meaning–Produced directly from the syntax– 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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

4Semantic Processing [ 1[

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 <THE b1 BALL>) vs.

(OR b1 b4 b12 b45 …)

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

5Semantic Processing [ 1[

Situations

• To retrieve an exact meaning, we must combine LF with a particular context or situation

• A situation might be represented as a set of objects and relations:{(BALL B0005), (PERSON P86), (OWNS P86 B0005)}

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

6Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

7Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

8Semantic Processing [ 1[

Word Senses [2]

• Ontology–Example: Aristotle’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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

9Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

10Semantic Processing [ 1[

Semantic Ambiguity

• Parallel to syntactic ambiguity–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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

11Semantic Processing [ 1[

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• Propositions: predicate + terms

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

12Semantic Processing [ 1[

Predicates

• Fido is a dog(DOG1 FIDO1)unary predicate

• Sue loves Jack(LOVES1 SUE1 JACK1)binary predicate

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

13Semantic Processing [ 1[

Word Senses

• Proper names: termsJACK1

• Common nouns: unary predicates(DOG1 <>)

• Verbs: n-ary predicates(BREAK1 <> <>)

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

14Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

15Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

16Semantic Processing [ 1[

Quantifiers

• FOPC: only universal and existential quantifiers: ∀, ∃

• English: much larger range:–all, some, most, many, a few, the, …

• Generalized Quantifiers(<quantifier> <variable> : <restriction-proposition><body-proposition>)

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

17Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

18Semantic Processing [ 1[

Quantifiers [3]

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

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

19Semantic Processing [ 1[

Plural Forms

• The dogs bark(THE x:((PLUR DOG1) x)(BARKS1 x))

• PLUR is a predicate which takes another predicate as its argument and creates a new predicate which is true of a set of individuals

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

20Semantic Processing [ 1[

Plural Forms [2]

• Distributive readingThe dogs bark“There is a set of dogs, and each one barks”

• Collective readingThe 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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

21Semantic Processing [ 1[

Ambiguous Plurals

• Some sentences allow bothcollective 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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

22Semantic Processing [ 1[

Modal Operators

• Modal verbs: believe, want, …Sue believes Jack is happy(BELIEVE SUE1 (HAPPY JACK1))

• Tense operators: PAST, PRES, FUTJohn sees Fido(PRES (SEES1 JOHN1 FIDO1))John saw Fido(PAST (SEES1 JOHN1 FIDO1))etc.

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

23Semantic Processing [ 1[

Encoding Ambiguity in LF

• Enumerating all possible logical forms is not practical

• Instead, collapse common ambiguities and represent them locally

• Develop techniques to incrementally resolve ambiguities from further information

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

24Semantic Processing [ 1[

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

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

25Semantic Processing [ 1[

Ambiguity [3]

• Quantifier Scoping–Generalized quantifiers treated

syntactically, appear in the position indicated by syntactic structure

–Angle brackets used to represent scopeEvery boy loves a dog(LOVES1 <EVERY b1 (BOY1 b1)><A d1 (DOG1 d1)>)

11-711: Algorithms for Natural Language Processing

Copyright © 1999, Carnegie Mellon. All Rights Reserved.

26Semantic Processing [ 1[

Ambiguity [4]

• Quantifier Scoping (cont.)– If the restriction in a generalized

quantifier is a unary predicate, the variable is dropped;<EVERY b1 (BOY b1)> becomes<EVERY b1 BOY>

• Scope of negationEvery boy didn’t run(<NOT RUN1><EVERY b1 BOY1>)