CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.

Slides:



Advertisements
Similar presentations
Problems of syntax-semantics interface ESSLLI 02 Trento.
Advertisements

Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Review of Homework 4 November 20, Exercise 1 (A) 1 pt Modify the DCG to accept the omission of the complementizer that for object relative clauses.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
November 2008NLP1 Natural Language Processing Definite Clause Grammars.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
Cs7120 (Prasad)L21-DCG1 Definite Clause Grammars
CSA2050: DCG IV1 CSA2050: Definite Clause Grammars IV Handling Gaps II Semantic Issues.
DEFINITE CLAUSE GRAMMARS Ivan Bratko University of Ljubljana Faculty of Computer and Information Sc.
Fall 2008Programming Development Techniques 1 Topic 9 Symbol Manipulation Generating English Sentences Section This is an additional example to symbolic.
Natural Language Processing DCG and Syntax NLP DCG A “translation” example: special case A DCG recogniser.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
LING 364: Introduction to Formal Semantics Lecture 10 February 14th.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/13.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 15 10/21/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 8.
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
The syntax of language How do we form sentences? Processing syntax. Language and the brain.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
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.
LING 388: Language and Computers Sandiway Fong Lecture 17.
October 2008csa3180: Setence Parsing Algorithms 1 1 CSA350: NLP Algorithms Sentence Parsing I The Parsing Problem Parsing as Search Top Down/Bottom Up.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
LING 388: Language and Computers Sandiway Fong Lecture 7.
October 2004CSA4050 Advanced Techniques in NLP 1 CSA4050: Advanced Topics in NLP Semantics 6 Semantics of Questions and Assertions involving Quantification.
Natural Language Processing Lecture 6 : Revision.
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
CSNB143 – Discrete Structure Topic 11 – Language.
NLP. Introduction to NLP Is language more than just a “bag of words”? Grammatical rules apply to categories and groups of words, not individual words.
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.
Music AI Lecture 3 More on Knowledge Representation (anaparastasi gnosis) Introduction to searching (anazitisi)
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.
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
NLP. Introduction to NLP Background –Developed by Jay Earley in 1970 –No need to convert the grammar to CNF –Left to right Complexity –Faster than O(n.
Dr. Rogelio Dávila Pérez Formal Semantics for Natural language.
November 2004csa3050: Sentence Parsing II1 CSA350: NLP Algorithms Sentence Parsing 2 Top Down Bottom-Up Left Corner BUP Implementation in Prolog.
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
October 2004CSA3050 NLP Algorithms1 CSA3050: Natural Language Algorithms Morphological Parsing.
April 2010Semantic Grammar1 A short guide to Blackburn’s Grammar of English.
October 2004csa4050: Semantics V1 CSA4050: Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters.
NATURAL LANGUAGE PROCESSING
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Syntax and Processing it: Definite Clause Grammars in Prolog (optional material) John Barnden School of Computer Science University of Birmingham Natural.
November 2008NL Semantics V1 Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters for Questions.
กำหนดการเรียนการสอนครั้งที่ ๙
Natural Language Processing
CS : Speech, NLP and the Web/Topics in AI
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Syntax.
LING 581: Advanced Computational Linguistics
CSA4050: Advanced Topics in NLP
CSA2050 Introduction to Computational Linguistics
csa3180: Setence Parsing Algorithms 1
Natural Language Processing
CSA4050: Advanced Topics in NLP
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective

Partial Execution Partial execution involves the replacing of certain runtime computations with changes to the source of the Prolog program itself. For example, we can replace the rule: s(S) --> np(NP), vp(VP) { reduce(NP,VP,S) }. with s(S) --> np(VP^S), vp(VP). This is because the computation of reduce involves only the mutual binding of several variables.

How it works s(S) --> np(NP), vp(VP) {reduce(NP,VP,S)}. 1. match reduce(A^F,A,F) 2. rewrite s(F) --> np(A^F), vp(A). 3. rename s(S) --> np(VP^S), vp(VP).

Exercise 1 What is the result of eliminating the reduce clause by partial execution in the following rule? np(NP) --> d(D), n(N), {reduce(D,N,NP)}.

Answer np(NP) --> d(D), n(N) { reduce(D,N,NP)}. 1. match reduce(A^F,A,F) 2. rewrite np(F) --> d(A^F), n(A). 3. rename np(NP) --> d(N^NP), n(N).

DCG with Quantification Program 4 % grammar s(S) --> np(VP^S), vp(VP). np(NP) --> d(N^NP), n(N). vp(VP) --> v(VP). % lexicon v(X^walk(X)) --> [walks]. n(X^man(X)) --> [man]. n(suzie)--> [‘Suzie’]. det(RL^SL^all(X,R,S) --> [every], {reduce(RL,X,R), reduce(SL,X,S) }.

Handling Proper Nouns The grammar handles every man walks X = all(_G, man(_G), walk(_G)) Will this grammar parse Suzie walks? Let’s try it! ?- s(X,['Suzie',walks],[ ]).

October ?- s(X,['Suzie',walks],[ ]). Call: (8) s(_G492, ['Suzie', walks], []) ? Call: (9) np(_L183, ['Suzie', walks], _L184) ? Call: (10) pn(_L183, ['Suzie', walks], _L184) ? Exit: (10) pn(suzie, ['Suzie', walks], [walks]) ? Exit: (9) np(suzie, ['Suzie', walks], [walks]) ? Call: (9) vp(_L185, [walks], _L186) ? Call: (10) iv(_L185, [walks], _L186) ? Exit: (10) iv(_G556^walk(_G556), [walks], []) ? Exit: (9) vp(_G556^walk(_G556), [walks], []) ? Call: (9) reduce(suzie, _G556^walk(_G556), _G492) ? Fail: (9) reduce(suzie, _G556^walk(_G556), _G492)? suzie is not a function

Handling Proper Nouns Problem is with the “type” of LF of Suzie. We require that LF of Suzie has the same type as any other NP - such as every man, i.e. –As a lambda expression it would be λp.p(suzie). –In Prolog we can regard this as a function from [VP] to [S] such that reduce(VP,suzie,S) holds.

DCG with Quantification Program 4 % grammar s(S) --> np(VP^S), vp(VP). np(NP) --> n(NP). np(NP) --> d(N^NP), n(N). vp(VP) --> v(VP). % lexicon v(X^walk(X)) --> [walks]. n(X^man(X)) --> [man]. n(VP^S) --> [suzie],{reduce(VP,suzie,S)}. d(RL^SL^all(X,R => S)) --> [every], {reduce(RL,X,R), reduce(SL,X,S) }.

Exercise 2 Using partial execution, eliminate the reduce clause in pn(VP^S) --> [‘Suzie’],{reduce(VP,suzie,S)}.

s(X, ['Suzie', walks], [ ]) ? Call: (7) s(_G292, ['Suzie', walks], []) ? ↓ Exit: (9) pn((suzie^_G357)^_G357, ['Suzie', walks], [walks]) ? ↓ Exit: (9) iv(_G362^walk(_G362), [walks], []) ? Exit: (8) vp(_G362^walk(_G362), [walks], []) ? : Call: (8) reduce((suzie^_G357)^_G357, _G362^walk(_G362), _G292) ? : Exit: (8) reduce((suzie^walk(suzie))^walk(suzie), suzie^walk(suzie), walk(suzie)) ? Exit: (7) s(walk(suzie), ['Suzie', walks], []) ? creep X = walk(suzie)

Adjectives In english, adjectives combine with nouns, e.g. big dog. We will call the an adjective/noun combination (without the article) N1. Here is a syntactic rule for a simplified version of N1: N1 → A N N1 NA big dog

Semantics of N1 Adjectives and common nouns translate to one-place predicates. big = x.big(x) dog = x.dog(x) To get the semantics of the N1 we need to join the predicates together with & (and), i.e. big dog = x.big(x) & dog(x)

N1 in Prolog %grammar n1(X^(P&Q)) --> a(X^P), n(X^Q). %lexicon n(X^dog(X)) --> [dog]. a(X^big(X)) --> [big]. Behaviour is as follows: ?- n1(X, [big,dog],[]). X = _G343^ (big(_G343)&dog(_G343))