74.793 nlp and speech 2004 semantics i general introduction types of semantics from syntax to...

33
74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based Semantics

Post on 18-Dec-2015

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

74.793 NLP and Speech 2004

Semantics I• General Introduction• Types of Semantics• From Syntax to Semantics

Semantics II• Desiderata for Representation• Logic-based Semantics

Page 2: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics I

Page 3: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics

Distinguish between

• surface structure (syntactic structure) and

• deep structure (semantic structure) of sentences.

Different forms of Semantic Representation

• logic formalisms

• ontology / semantic representation languages – Case Frame Structures (Filmore)– Conceptual Dependy Theory (Schank)– DL and similar KR languages – Ontologies

Page 4: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantic Representations

Semantic Representations based on some form of (formal) Representation Language.

– Semantics Networks– Conceptual Dependency Graphs– Case Frames– Ontologies– DL and similar KR languages

Page 5: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Constructing a Semantic Representation

General: Start with surface structure Derived from parser. Map surface structure to semantic structure

Use phrases as sub-structures. Find concepts and representations for

central phrases (e.g. VP, NP, then PP) Assign phrases to appropriate roles

around central concepts (e.g. bind PP into VP representation).

Page 6: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Ontology (Interlingua) approach

• Ontology: a language-independent classification of objects, events, relations

• A Semantic Lexicon, which connects lexical items to nodes (concepts) in the ontology

• An analyzer that constructs Interlingua representations and selects (an?) appropriate one

(based on Steve Helmreich's 419 Class, Nov 2003)

Page 7: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantic Lexicon

• Provides a syntactic context for the appearance of the lexical item

• Provides a mapping for the lexical item to a node in the ontology (or more complex associations)

• Provides connections from the syntactic context to semantic roles and constraints on these roles

Page 8: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Deriving Basic Semantic Dependency (a toy example)

Input: John makes tools

Syntactic Analysis:cat verbtense presentsubject  

root johncat noun-proper

object  root     toolcat nounnumber plural

Deriving Basic Semantic Dependency

Page 9: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

John-n1syn-struc

root johncat noun-proper

sem-struchuman

name john

gender maletool-n1

syn-strucroot toolcat n

sem-structool

Lexicon Entries for John and tool

Page 10: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Relevant Extract from the Specification of the Ontological Concept Used to Describe the Appropriate Meaning of make:

manufacturing-activity...

agent humantheme artifact

Meaning Representation - Example make

Page 11: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

John-n1syn-struc

root johncat noun-proper

sem-struchuman

name johngender male

tool-n1syn-struc

root toolcat n

sem-structool

Relevant parts of the (appropriate senses of the)lexicon entries for John and tool

Page 12: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

The basic semantic dependency component of the TMR for

John makes tools

manufacturing-activity-7

agent uman-3theme set-1

element toolcardinality > 1

Semantic Dependency Component

Page 13: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

try-v3syn-struc

root trycat vsubj root $var1

cat nxcomp root $var2

cat vform OR infinitive gerund

sem-strucset-1 element-type refsem-1

cardinality >=1refsem-1 sem event

agent ^$var1effect refsem-2

modalitymodality-type epiteucticmodality-scope refsem-2modality-value < 1

refsem-2 value ^$var2sem event

Page 14: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Constructing an IL representation

For each syntactic analysis: Access all semantic mappings and contexts

for each lexical item. Create all possible semantic

representations. Test them for coherency of structure and

content.

Page 15: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

REQUEST-INFO-130 THEME DEVELOP-2601.PURPOSE DEVELOP-2601.REASON TEXT-POINTER why INSTANCE-OF REQUEST-INFO

DEVELOP-2601THEME SET-2555AGENT NATION-97PHASE CONTINUOUS

TIME FIND-ANCHOR-TIME INSTANCE-OF DEVELOP

TEXT-POINTER developing

NATION-97HAS-NAME Iraq

INSTANCE-OF NATIONTEXT-POINTER Iraq

SET-2555 ELEMENT-TYPE WEAPONCARDINALITY > 1

INSTRUMENT-OF KILL-1864 THEME-OF DEVELOP-2601 INSTANCE-OF WEAPON

TEXT-POINTER weapons

KILL-1864 THEME SET-2556 INSTRUMENT SET-2555 INSTANCE-OF KILL

TEXT-POINTER destruction

SET-2556 THEME-OF KILL-1225 ELEMENT-TYPE HUMAN

CARDINALITY > 100 INSTANCE-OF HUMAN

TEXT-POINTER mass

“Why is Iraq developing weapons of mass destruction?”

Page 16: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Word sense disambiguation

Constraint checking – making sure the constraints imposed on context are met

Graph traversal – is-a links are inexpensive

Other links are more expensive The “cheapest” structure is the most

coherent Hunter-gatherer processing

Page 17: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics II

Page 18: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Representation of Meaning

Representation of meaning for natural language sentences:

– Semantic Representation Language (in most cases) = some kind of formal language + semantic primitives

– For example: First Order Predicate Logic with specific set of predicates and functions

Page 19: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantic Representations

Semantic Representation based on some form of (formal) Representation Language.

– Semantics Networks– Conceptual Dependency Graphs– Case Frames– Ontologies– DL and similar KR languages– First-Order Predicate Logic

Page 20: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics - Connecting Words and Worlds

Semantic Representation

NL Input

NL Output World State (KB: T-Box, A-Box)

Knowledge Representation

Page 21: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Desiderata for a Semantic Representation

• Verifiability – semantic representation must be compatible with knowledge (base) of the system.

• Canonical Form - assign same representation to different surface expressions which have essentially the same meaning

• Ambiguity and Vagueness – representation should (in relation to knowledge base or information system access etc.) be unambiguous and precise

Page 22: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Example - NL Database Access

Imagine a database access using natural language, i.e. questions to the DB posed in natural language.

Example: DB of courses in the CS department

Pose questions like: • Who is teaching Advanced AI in Fall 2004?• Is John Anderson teaching this term?• What is John Anderson teaching this term?• Who is teaching AI at the University of Winnipeg?• Who is teaching an AI related course this term?

Page 23: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Example

Story:

My car was stolen two weeks ago.

They found it last week.

• direct representation of meaning

• knowledge

• inference

Page 24: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Example

car (my_car)

stolen (my_car, t1),

found (police, my-car, t2)

t1<t2

-------------------------------------------------------------------

stolen (x, t1) and

found (police, x, t2) implies

has (owner (x), x, t3) with t3>t2

What can you infer if you instantiate x with my_car?

Page 25: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Example

stolen (x, t1) and

found (police, x, t2) implies

has (owner (x), x, t3) with t3>t2

Express that if something is stolen, the owner does not have it!

Page 26: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Predicate-Argument StructureVerb-centered approach

Thematic roles, case roles Describe semantic structure based on verb and associated

roles filled by other parts of the sentence (phrases).

Representation using e.g. logic: • Transform structured input sentence (syntax!) into

expression in predicate logic.

• Usually based on central predicate, the verb, or equivalent, like ‘be’+ adjective etc.

• Other parts of the sentence directly related to the verb go into the central predicate.

Page 27: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Verb Subcategorization

Consider possible subcat frames of verbs.

Example: 3 different kinds of want:

1. NP want NP I want money.

want1(Speaker, money) or want1(I, money)

2. NP want Inf-VP He wants to go home.

want2(he, go home)

2. NP want NP Inf-VP I want him to go away.

want3(I, him, go_away)

Page 28: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Example - Restaurant 'Maharani'

Example: Restaurant 'Maharani'• Maharani serves vegetarian food.• Maharani is a vegetarian restaurant.• Maharani is close to ICSI.

Write down logical formulas representing the three different sentences.

Page 29: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Logic Formalisms

Lambda Calculus

Page 30: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics - Lambda Calculus 1

Logic representations often involve Lambda-Calculus:• represent central phrases (e.g. verb) as -

expressions -expression is like a function which can be applied

to terms• insert semantic representation of complement or

modifier phrases etc. in place of variables

x, y: loves (x, y) FOPL sentence

xy loves (x, y) -expression, function

xy loves (x, y) (John) y loves (John, y)

Page 31: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics - Lambda Calculus 2

Transform sentence into lambda-expression:

“AI Caramba is close to ICSI.”

specific: close-to (AI Caramba, ICSI)

general: x,y: close-to (x, y) x=AI Caramba y=ICSI

Lambda Conversion:

-expr: xy: close-to (x, y) (AI Caramba)

Lambda Reduction:

y: close-to (AI Caramba, y)

close-to (AI Caramba, ICSI)

Page 32: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

Semantics - Lambda Calculus 3

Lambda Expressions can be constructed from central expression, inserting semantic representations for complement phrases

Verb serves

{xy e IS-A(e, Serving) Server(e,y) Served(e,x)}

represents general semantics for the verb 'serve

Fill in appropriate expressions for x, y, for example 'meat' for y derived from Noun in NP as complement to Verb.

Page 33: 74.793 NLP and Speech 2004 Semantics I General Introduction Types of Semantics From Syntax to Semantics Semantics II Desiderata for Representation Logic-based

References

Jurafsky, D. & J. H. Martin, Speech and Language Processing, Prentice-Hall, 2000. (Chapters 9 and 10)

Helmreich, S., From Syntax to Semantics, Presentation in the 74.419 Course, November 2003.