NLP.

Slides:



Advertisements
Similar presentations
Knowledge Representation using First-Order Logic
Advertisements

First-Order Logic Chapter 8.
Inference in First-Order Logic
Some Prolog Prolog is a logic programming language
Inference in first-order logic
First-Order Logic.
Inference Rules Universal Instantiation Existential Generalization
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
Standard Logical Equivalences
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
10 주 강의 First-order Logic. Limitation of propositional logic A very limited ontology  to need to the representation power  first-order logic.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
First-Order Logic Chapter 8.
Predicate Calculus Russell and Norvig: Chapter 8,9.
GRAMMAR & PARSING (Syntactic Analysis) NLP- WEEK 4.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
First-Order Logic. Limitations of propositional logic Suppose you want to say “All humans are mortal” –In propositional logic, you would need ~6.7 billion.
Logic. Propositional Logic Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which.
Inference in First-Order Logic
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
Predicate Calculus.
CE An introduction to Artificial Intelligence CE Chapter 8: First Order Logic Ramin Halavati In which we notice that.
FIRST ORDER LOGIC Levent Tolga EREN.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
For Monday Read chapter 9 Homework: –Chapter 8, exercises 9 and 10.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Predicate Logic.
Limitation of propositional logic  Propositional logic has very limited expressive power –(unlike natural language) –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CS 666 AI P. T. Chung First-Order Logic First-Order Logic Chapter 8.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
1 Inference in First Order Logic CS 171/271 (Chapter 9) Some text and images in these slides were drawn from Russel & Norvig’s published material.
NLP. Introduction to NLP Shallow parsing Useful for information extraction –noun phrases, verb phrases, locations, etc. Example –FASTUS (Appelt and Israel,
First-Order Logic Chapter 8 (not 8.1). Outline Why FOL? Why FOL? Syntax and semantics of FOL Syntax and semantics of FOL Using FOL Using FOL Wumpus world.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
MB: 26 Feb 2001CS Lecture 11 Introduction Reading: Read Chapter 1 of Bratko Programming in Logic: Prolog.
First-Order Logic. Outline Why FOL? Syntax and semantics of FOL Using FOL Knowledge engineering in FOL.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
For Friday Finish chapter 9 Program 1 due. Program 1 Any questions?
First-Order Logic Chapter 8.
First-Order Logic.
Announcements No office hours today!
Logical Agents Chapter 7.
Logical Inference 1 introduction
First-Order Logic Chapter 8.
Semantic Parsing for Question Answering
Artificial Intelligence First Order Logic
Notes 8: Predicate logic and inference
Inference in first-order logic part 1
Artificial Intelligence
Knowledge Representation and Inference
First-Order Logic Chapter 8.
First Order Logic: Logical Inference
First-Order Logic Chapter 8.
Learning to Parse Database Queries Using Inductive Logic Programming
Inference in first-order logic part 1
First-Order Logic Chapter 8.
Inference in First Order Logic (1)
CS 188: Artificial Intelligence
Chapter 1: Propositional and First-Order Logic
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
NLP.
Presentation transcript:

NLP

Introduction to NLP Inference

Modus Ponens Modus ponens: Example:   ⇒   Cat(Martin)  x: Cat(x) ⇒ EatsFish(x) EatsFish(Martin)

Inference Forward chaining Backward chaining Prolog example as individual facts are added to the database, all derived inferences are generated Backward chaining starts from queries Example: the Prolog programming language Prolog example father(X, Y) :- parent(X, Y), male(X). parent(john, bill). parent(jane, bill). female(jane). male (john). ?- father(M, bill).

Examples Brothers are siblings One's mother is one's female parent The kinship domain: Brothers are siblings x,y Brother(x,y)  Sibling(x,y) One's mother is one's female parent m,c Mother(c) = m  (Female(m)  Parent(m,c)) “Sibling” is symmetric x,y Sibling(x,y)  Sibling(y,x)

Universal Instantiation Every instantiation of a universally quantified sentence is entailed by it: v α Subst({v/g}, α) for any variable v and ground term g E.g., x Cat(x)  Fish(y)  Eats(x,y) yields: Cat(Martin)  Fish(Blub)  Eats(Martin,Blub)

Existential Instantiation For any sentence α, variable v, and constant symbol k that does not appear elsewhere in the knowledge base: v α Subst({v/k}, α) E.g., x Cat(x)  EatsFish(x) yields: Cat(C1)  EatsFish(C1) provided C1 is a new constant symbol, called a Skolem constant

Unification If a substitution θ is available, unification is possible Examples: p=Eats(x,y), q=Eats(x,Blub), possible if θ = {y/Blub} p=Eats(Martin,y), q=Eats(x,Blub), possible if θ = {x/Martin,y/Blub} p=Eats(Martin,y), q=Eats(y,Blub), fails because Martin≠Blub Subsumption Unification works not only when two things are the same but also when one of them subsumes the other one Example: All cats eat fish, Martin is a cat, Blub is a fish

NLP

Introduction to NLP Semantic Parsing

Semantic Parsing Converting natural language to a logical form e.g., executable code for a specific application Example: Airline reservations Geographical query systems

Stages of Semantic Parsing Input Sentence Syntactic Analysis Syntactic structure Semantic Analysis Semantic representation

Compositional Semantics Add semantic attachments to CFG rules Compositional semantics Parse the sentence syntactically Associate some semantics to each word Combine the semantics of words and non-terminals recursively Until the root of the sentence

Example Input Javier likes pizza Output like(Javier, pizza)

Semantic Parsing Associate a semantic expression with each node S: likes(Javier, pizza) N: Javier VP: λx likes(x,pizza) Javier V: λ x,y likes(x,y) N: pizza likes pizza

Figure 18.4

Using CCG (Steedman 1996) CCG representations for semantics ADJ: λx.tall(x) (S\NP)/ADJ : λf.λx.f(x) NP: YaoMing YaoMing is tall NP (S\NP)/ADJ ADJ YaoMing λf.λx.f(x) λx.tall(x) > S\NP λx.tall(x) < S Tall (YaoMing)

CCG NACLO problem from 2014 Authors: Jonathan Kummerfeld, Aleka Blackwell, and Patrick Littell http://www.nacloweb.org/resources/problems/2014/N2014-O.pdf http://www.nacloweb.org/resources/problems/2014/N2014-OS.pdf http://www.nacloweb.org/resources/problems/2014/N2014-P.pdf http://www.nacloweb.org/resources/problems/2014/N2014-PS.pdf

CCG

CCG

CCG

CCG

Answer

CCG

CCG

CCG

CCG

CCG

CCG

GeoQuery (Zelle and Mooney 1996)

Zettlemoyer and Collins (2005)

Zettlemoyer and Collins (2005)

NLP