Presentation is loading. Please wait.

Presentation is loading. Please wait.

NLP.

Similar presentations


Presentation on theme: "NLP."— Presentation transcript:

1 NLP

2 Introduction to NLP Inference

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

4 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).

5 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)

6 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)

7 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

8 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

9 NLP

10 Introduction to NLP Semantic Parsing

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

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

13 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

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

15 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

16 Figure 18.4

17 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)

18 CCG NACLO problem from 2014 Authors: Jonathan Kummerfeld, Aleka Blackwell, and Patrick Littell

19 CCG

20 CCG

21 CCG

22 CCG

23 Answer

24 CCG

25 CCG

26 CCG

27 CCG

28 CCG

29 CCG

30 GeoQuery (Zelle and Mooney 1996)

31 Zettlemoyer and Collins (2005)

32 Zettlemoyer and Collins (2005)

33 NLP


Download ppt "NLP."

Similar presentations


Ads by Google