190 likes | 351 Views
COMP 4060 Natural Language Processing. Semantics. Semantics – What do we need?. Distinguish between surface structure (syntactic structure) and deep structure (semantic structure) of sentences. Different forms of semantic representation: logic formalisms
E N D
COMP 4060 Natural Language Processing Semantics
Semantics – What do we need? 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) • Description Logic (DL) and similar KR languages • Ontologies
Constructing a Semantic Representation General approach: • 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).
Semantic Representation Semantic Representationsarebased on some form of (formal) Representation Language. • Semantics Networks • Conceptual Dependency Graphs • Case Frames • Ontologies • DL and similar KR languages
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
Semantic Lexicon • Provides a syntactic context for the appearance of the lexical item • Provides a mapping for the lexical itemto a node in the ontology (or more complex associations) • Provides connections from the syntactic context to semantic roles and constraints on these roles
Constructing an InterLingua Representation For each syntactic analysis: • Access all semantic mappings and contextsfor each lexical item. • Create all possible semantic representations. • Test them for coherency of structure and content.
Basic Semantic Dependency - Example Input:John makes tools Syntactic Analysis: cat verb root make tense present subject root john cat noun-proper object root tool cat noun number plural
Lexicon Entries for Johnand tool John-n1 syn-struc root john cat noun-proper sem-struchuman name john gender male tool-n1 syn-struc root tool cat n sem-structool
who what Ontological Representation - Example Relevant extract from the specification of the ontological concept used to describe the appropriate meaning ofmake: manufacturing-activity... agent human theme artifact …
Semantic Dependency Component The basic semantic dependency component of the “Text Meaning Representation” (TMR) for: John makes tools manufacturing-activity-7 agent human-3 theme set-1 element tool cardinality > 1 …
semantic representation of “try-v3” try-v3 syn-struc root try cat v subj root $var1 cat n xcomp root $var2 cat v form OR infinitive gerund sem-struc set-1 element-type refsem-1 cardinality >=1 refsem-1 sem event agent ^$var1 effect refsem-2 modality modality-type epiteuctic modality-scope refsem-2 modality-value < 1 refsem-2 value ^$var2 sem event Means “non finished action; outcome unclear”
Wordsense Disambiguation Methods • Constraint checking • make 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 one • Hunter-gatherer processing • find (hunt) and eliminate (kill) unlikely interpretations • collect (gather) remaining interpretations
Logic Formalisms Lambda Calculus
Semantics - Lambda Calculus 1 Logic representations often involve Lambda()-Calculus: • -expressions represent central phrases (e.g. VP) • They are like functions which can be applied to terms • We replace variables in -expression with semantic representations of complements or modifier phrases x,y: loves (x, y) FOPL sentence xy loves (x, y) -expression xy loves (x, y) (John) y loves (John, y) function
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: xy: close-to (x, y) (AI Caramba) Lambda Reduction: y: close-to (AI Caramba, y) close-to (AI Caramba, ICSI)
Semantics - Lambda Calculus 3 • Lambda-expressions can be constructed from central expression (VP), 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. Sentence represents concrete event e. • Fill in appropriate expressions for x, y derived from the complements / syntactic features of verb serve in sentence. • For example,“AI Caramba serves meat.” - object-NPmeatfor x and - subject-NPAl Carambafor y.
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. Nirenburg, S. & V. Raskin, Ontological Semantics, MIT Press, 2004. Wordnet, http://wordnet.princeton.edu/ Suggested Upper Merged Ontology (SUMO), http://www.ontologyportal.org/