Natural Language Processing Lecture 2: Semantics.

Slides:



Advertisements
Similar presentations
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Advertisements

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
November 2008NLP1 Natural Language Processing Definite Clause Grammars.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Cs7120 (Prasad)L21-DCG1 Definite Clause Grammars
Semantics (Representing Meaning)
Conceptual Dependency and Natural Language Processing
Conceptual Dependency ATRANS – abstract transfer (give) PTRANS – physical transfer (move) PROPEL – application of force (push) MTRANS – mental transfer.
Knowledge Representation. Essential to artificial intelligence are methods of representing knowledge. A number of methods have been developed, including:
Knowledge Representation.  What is Knowledge Representation What is Knowledge Representation  Type of knowledge in AI Type of knowledge in AI  Declarative.
CPSC 322 Introduction to Artificial Intelligence November 5, 2004.
Statistical NLP: Lecture 3
DEFINITE CLAUSE GRAMMARS Ivan Bratko University of Ljubljana Faculty of Computer and Information Sc.
GRAMMAR & PARSING (Syntactic Analysis) NLP- WEEK 4.
LING NLP 1 Introduction to Computational Linguistics Martha Palmer April 19, 2006.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
Parsing: Features & ATN & Prolog By
Introduction to Semantics To be able to reason about the meanings of utterances, we need to have ways of representing the meanings of utterances. A formal.
A modern approach input sentence syntax analysis (parsing) semantic analysis pragmatic analysis target representation grammar lexicon semantic rules contextual.
PSY 369: Psycholinguistics Some basic linguistic theory part3.
Knowledge Representation
The syntax of language How do we form sentences? Processing syntax. Language and the brain.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
February 2009Introduction to Semantics1 Logic, Representation and Inference Introduction to Semantics What is semantics for? Role of FOL Montague Approach.
October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.
Lectures 5,6 MACHINE LEARNING EXPERT SYSTEMS. Contents Machine learning Knowledge representation Expert systems.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Lecture 12: 22/6/1435 Natural language processing Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
For Monday Read chapter 23, sections 1-2 FOIL exercise due.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
1 Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)
An Intelligent Analyzer and Understander of English Yorick Wilks 1975, ACM.
Natural Language Processing Artificial Intelligence CMSC February 28, 2002.
Early Work Masterman: 100 primitive concepts, 15,000 concepts Wilks: Natural Language system using semantic networks Shapiro: Propositional calculus based.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Transition Network Grammars for Natural Language Analysis - W. A. Woods In-Su Yoon Pusan National University School of Electrical and Computer Engineering.
Artificial Intelligence: Natural Language
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
1 Definite Clause Grammars for Language Analysis – A Survey of the Formalism and a Comparison with Augmented Transition Networks 인공지능 연구실 Hee keun Heo.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Rules, Movement, Ambiguity
Artificial Intelligence: Natural Language
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
Chapter 22 - Communication April 8, – Semantic Interpretation Uses First Order Logic as the representation language Compositional Semantics.
For Friday No reading Program 4 due. Program 4 Any questions?
Knowledge Representation
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 1 (03/01/06) Prof. Pushpak Bhattacharyya IIT Bombay Introduction to Natural.
Natural Language Processing Slides adapted from Pedro Domingos
NATURAL LANGUAGE PROCESSING
Artificial Intelligence Knowledge Representation.
Definition and Technologies Knowledge Representation.
Lec. 10.  In this section we explain which constituents of a sentence are minimally required, and why. We first provide an informal discussion and then.
Statistical NLP: Lecture 3
Semantics (Representing Meaning)
Natural Language Processing
Conceptual Dependency (CD)
Knowledge Representation
Strong Slot-and-Filler Structures
CSC 594 Topics in AI – Applied Natural Language Processing
Strong Slot-and-Filler Structures
Structured Knowledge Representation
CSA4050: Advanced Topics in NLP
Artificial Intelligence 2004 Speech & Natural Language Processing
Conceptual Dependency Theory
Presentation transcript:

Natural Language Processing Lecture 2: Semantics

Last Lecture n Motivation n Paradigms for studying language n Levels of NL analysis n Syntax –Parsing n Top-down n Bottom-up n Chart parsing

Today’s Lecture n DCGs and parsing in Prolog n Semantics –Logical representation schemes –Procedural representation schemes –Network representation schemes –Structured representation schemes

Parsing in PROLOG n How do you represent a grammar in PROLOG?

Writing a CFG in PROLOG Consider the rule S -> NP VP Consider the rule S -> NP VP n We can reformulate this as an axiom: –A sequence of words is a legal S if it begins with a legal NP that is followed by a legal VP n What about s(P1, P3):-np(P1, P2), vp(P2, P3)? –There is an S between position P1 and P3 if there is a position P2 such that there is an NP between P1 and P2 and a VP between P2 and P3

Inputs n John ate the cat can be described –word(john, 1, 2) –word(ate, 2, 3) –word(the, 3, 4) –word(cat, 4, 5) n Or (better) use a list representation: –[john, ate, the, cat]

Lexicon n First representation –isname(john), isverb(ate) –v(P1, P2):- word(Word, P1, P2), isverb(Word) n List representation –name([john|T], T).

A simple PROLOG grammar s(P1, P3):-np(P1, P2), vp(P2, P3). np(P1, P3):-art(P1, P2), n(P2, P3). np(P1, P3):-name(P1, P3). pp(P1, P3):-p(P1, P2), np(P2, P3). vp(P1, P2):-v(P1, P2). vp(P1, P3):-v(P1, P2), np(P2, P3). vp(P1, P3):-v(P1, P2), pp(P2, P3).

Direct clause grammars n PROLOG provides an operator that supports DCGs n Rules look like CFG notation n PROLOG automatically translates these

DCGs and Prolog s --> np, vp. np --> art, n. np --> name. pp --> p, np. vp --> v. vp --> v, np. vp --> v, pp. Lexicon name --> [john]. v --> [ate]. art --> [the]. n --> [cat]. Grammar s(P1, P3):-np(P1, P2), vp(P2, P3). np(P1, P3):-art(P1, P2), n(P2, P3). np(P1, P3):-name(P1, P3). pp(P1, P3):-p(P1, P2), np(P2, P3). vp(P1, P2):-v(P1, P2). vp(P1, P3):-v(P1, P2), np(P2, P3). vp(P1, P3):-v(P1, P2), pp(P2, P3). Lexicon name([john|P], P). v([ate|P],P). art([the|P],P). n([cat|P],P).

Building a tree with DCGs n We can add extra arguments to DCGs to represent a tree: –s --> np, vp. becomes –s(s(NP, VP)) -->np(NP), vp(VP).

An ambiguous DCG s(s(NP, VP)) --> np(NP), vp(VP). np(np(ART, N)) --> art(ART), n(N). np(np(NAME)) --> name(NAME). pp(pp(P,NP)) --> p(P), np(NP). vp(vp(V)) --> v(V). vp(vp(V,NP)) --> v(V), np(NP). vp(vp(V,PP)) --> v(V), pp(PP). vp(vp(V,NP,PP)) --> v(V), np(NP), pp(PP). np(np(ART, N, PP)) --> art(ART), n(N), pp(PP). %Lexicon art(art(the)) --> [the]. n(n(man)) --> [man]. n(n(boy)) --> [boy]. n(n(telescope)) --> [telescope]. v(v(saw)) --> [saw]. p(p(with)) --> [with].

Semantics n What does it mean?

Semantic ambiguity n A sentence may have a single syntactic structure, but multiple semantic structures –Every boy loves a dog n Vagueness – some senses are more specific than others –“Person” is more vague than “woman” –Quantifiers: Many people saw the accident

Logical forms n Most common is first-order predicate calculus (FOPC) n PROLOG is an ideal implementation language

Thematic roles n Consider the following sentences: –John broke the window with the hammer –The hammer broke the window –The window broke n The syntactic structure is different, but John, the hammer, and the window have the same semantic roles in each sentence

Themes/Cases n We can define a notion of theme or case –John broke the window with the hammer –The hammer broke the window –The window broke n John is the AGENT n The window is the THEME (syntactic OBJECT -- what was Xed) n The hammer is the INSTR(ument)

Case Frames fixSarah past chair glue AGENT TIME THEME INSTR Sarah fixed the chair with glue

Network Representations n Examples: –Semantic networks –Conceptual dependencies –Conceptual graphs

Semantic networks n General term encompassing graph representations for semantics n Good for capturing notions of inheritance n Think of OOP

Part of a type hierarchy ALL SITUATION PHYSOBJ EVENT ANIMATENON-ANIMATE PERSONDOGVEGETABLENON-LIVING

Strengths of semantic networks n Ease the development of lexicons through inheritance –Reasonable sized grammars can incorporate hundreds of features n Provide a richer set of semantic relationships between word senses to support disambiguation

Conceptual dependencies n Influential in early semantic representations n Base representation on a small set of primitives

Primitives for conceptual dependency n Transfer –ATRANS - abstract transfer (as in transfer of ownership) –PTRANS - physical transfer –MTRANS - mental transfer (as in speaking) n Bodily activity –PROPEL (applying force), MOVE (a body part), GRASP, INGEST, EXPEL n Mental action –CONC (conceptualize or think) –MBUILD (perform inference)

Problems with conceptual dependency n Very ambitious project –Tries to reduce all semantics to a single canonical form that is syntactically identical for all sentences with same meaning n Primitives turn out to be inadequate for inference –Must create larger structures out of primitives, compute on those structures

Structured representation schemes n Frames n Scripts

Frames n Much of the inference required for NLU involves making assumptions about what is typically true about a situation n Encode this stereotypical information in a frame n Looks like themes, but on a higher level of abstraction

Frames n For an (old) PC: Class PC(p): Roles: Keyb, Disk1, MainBox Constraints: Keyboard(Keyb) & PART_OF(Keyb, p) & CONNECTED_TO(Keyb,KeyboardPlug(MainBox)) & DiskDrive(Disk1) & PART-OF(Disk1, p) & CONNECTED_TO(Disk1, DiskPort(MainBox)) & CPU(MainBox) & PART_OF(MainBox, p)

Scripts n A means of identifying common situations in a particular domain n A means of generating expectations –We precompile information, rather than recomputing from first principles

Scripts n Travel by plane: –Roles: Actor, Clerk, Source, Dest, Airport, Ticket, Money, Airplane –Constraints: Person(Actor), Value(Money, Price(Ticket)),... –Preconditions: Owns(Actor, Money), At(Actor, Source) –Effects: not(Owns(Actor, Money)), not(At(Actor, Source)), At(Actor, Dest) –Decomposition: n GoTo(Actor, Airport) n BuyTicket(Actor, Clerk, Money, Ticket),...

Issues with Scripts n Script selection –How do we decide which script is relevant? n Where are we in the script?

NLP -- Where are we? n We’re five years away (??) n Call NUANCE9 (banking/airline ticket demo) n LSD-TALK (Weather information) n Google n Ask Jeeves n Office Assistant