October 2004csa4050: Semantics V1 CSA4050: Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Natural Language and Prolog
Advertisements

October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Natural Language Processing Lecture 2: Semantics.
November 2008NLP1 Natural Language Processing Definite Clause Grammars.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
Semantics (Representing Meaning)
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
Semantic Analysis Read J & M Chapter 15.. The Principle of Compositionality There’s an infinite number of possible sentences and an infinite number of.
April 2010CSA50061 Logic, Representation and Inference Simple Question Answering NL Access to Databases Semantics of Questions and Answers Simple Interpreters.
DEFINITE CLAUSE GRAMMARS Ivan Bratko University of Ljubljana Faculty of Computer and Information Sc.
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
Parsing: Features & ATN & Prolog By
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
Natural Language Query Interface Mostafa Karkache & Bryce Wenninger.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
Statistical Natural Language Processing. What is NLP?  Natural Language Processing (NLP), or Computational Linguistics, is concerned with theoretical.
LING 388: Language and Computers Sandiway Fong Lecture 11.
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.
Syntax Directed Translation. Syntax directed translation Yacc can do a simple kind of syntax directed translation from an input sentence to C code We.
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.
Learning to Transform Natural to Formal Language Presented by Ping Zhang Rohit J. Kate, Yuk Wah Wong, and Raymond J. Mooney.
Chapter 13 Query Processing Melissa Jamili CS 157B November 11, 2004.
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
A Procedural Model of Language Understanding Terry Winograd in Schank and Colby, eds., Computer Models of Thought and Language, Freeman, 1973 발표자 : 소길자.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations.
October 2005CSA3180 NLP1 CSA3180 Natural Language Processing Introduction and Course Overview.
CSA2050 Introduction to Computational Linguistics Lecture 1 Overview.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
November 2004csa3050: Sentence Parsing II1 CSA350: NLP Algorithms Sentence Parsing 2 Top Down Bottom-Up Left Corner BUP Implementation in Prolog.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
Logical and Functional Programming
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
Natural Language Processing Chapter 1 : Introduction.
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
CSE573 Autumn /02/98 Natural Language Processing Administrative –PS4 support code now in the NT course area Truckworld interface (stop, start,
October 2005CSA3180: Parsing Algorithms 21 CSA3050: NLP Algorithms Parsing Algorithms 2 Problems with DFTD Parser Earley Parsing Algorithm.
October 2004CSA3050 NLP Algorithms1 CSA3050: Natural Language Algorithms Morphological Parsing.
CSA3050: NLP Algorithms Sentence Grammar NLP Algorithms.
October 10, 2003BLTS Kickoff Meeting1 Transfer with Strong Decoding Learning Module Transfer Rules {PP,4894} ;;Score: PP::PP [NP POSTP] -> [PREP.
For Monday Read chapter 26 Homework: –Chapter 23, exercises 8 and 9.
NATURAL LANGUAGE PROCESSING
Artificial Intelligence Knowledge Representation.
November 2008NL Semantics V1 Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters for Questions.
1 Sections 3.1 – 3.2a Basic Syntax and Semantics Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Grammar Journeys Lesson 2 Kinds of Sentences
Natural Language Processing
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING 581: Advanced Computational Linguistics
CSA4050: Advanced Topics in NLP
csa3180: Setence Parsing Algorithms 1
Natural Language Processing
CSA4050: Advanced Topics in NLP
Database SQL.
Presentation transcript:

October 2004csa4050: Semantics V1 CSA4050: Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters for Questions

October 2004csa4050: Semantics V2 Access to Databases: 3 approaches DB Query Language Form Interface Natural Language

October 2004csa4050: Semantics V3 DB Query Language range of C is countries range of Cont is continents range of I is inclusions retrieve( Cont.name, count(C.name where C.name = I.inside and I.outside = Cont.name))

October 2004csa4050: Semantics V4 Form Interface

October 2004csa4050: Semantics V5 Natural Language How many countries are there in each continent?

October 2004csa4050: Semantics V6 Issues Accessibility –Type of query language –What needs to be learned to make a query? –Data input vs. data output Flexibility –Can types of question be predicted? –Can types of question be easily changed? Expressivity –Limitations on kinds of information present –What types of query is possible

October 2004csa4050: Semantics V7 Chat 80 Pereira and Warren (1983) General Architecture ENGLISH LOGICAL FORM PROLOG ANSWER Translation: what does the question mean Planning: how shall I answer it Execution: what is the answer?

October 2004csa4050: Semantics V8 Different Types of Sentence Sentence TypeCommunicative Act Declarative SentenceAssertion Interrogative SentenceQuestion Imperative SentenceCommand

October 2004csa4050: Semantics V9 Sentences and Assertions Assertions are usually expressed by declarative sentences. Our grammar/lexicon deals with very simple examples, e.g. John saw Fido More complex declarative sentences include All candidates for CSA4050 failed. Candidates who fail more than four credits shall not be allowed to take resits.

October 2004csa4050: Semantics V10 Sentences and Questions Questions are usually expressed by interrogative sentences. Our simple grammar/lexicon does not yet deal with interrogative sentences. To handle them we must modify the grammar Issue: how do we recognise interrogative sentences?

October 2004csa4050: Semantics V11 Execution of Communicative Acts Assertions add information to the database. The meaning of a declarative sentence involves execution an appropriate assert operation Questions query information in the database. The meaning of an interrogative sentence involves execution of an appropriate query operation Commands identify actions to be carried out.

October 2004csa4050: Semantics V12 Assertions and Questions: Semantic Representation SentenceRepresentation of Semantic Content Representation of Communicative Act John sees Fido see(john,fido)a1(see(john,fido)) Does John see Fido see(john,fido)q1(see(john,fido))

October 2004csa4050: Semantics V13 Basic Processing process(Sent,Result) :- s(SEM,Sent,[]), interpret(SEM,Result). In other words: to process the sentence: Parse it to produce semantic representation SEM Interpret SEM and give back RESULT Next we must define the interpret predicate

October 2004csa4050: Semantics V14 Defining the Interpreter interpret(a1(X),A) :- a1(X,A). interpret(q1(Q),A) :- q1(Q,A).

October 2004csa4050: Semantics V15 Very Basic Intepretation a1(SEM,ok) :- asserta(SEM). In the case of an assertion, just assert it. N.B. no check for previous assertion. q1(SEM,yes) :- call(SEM), !. q1(SEM,no). If it’s a yes-no question, see if it’s true

October 2004csa4050: Semantics V16 Dealing with Syntax We now have a primitive interpretation mechanism in place. It remains to modify the grammar/lexicon to handle the syntax of these very simple questions. To begin with, we will limit ourselves to yes/no questions

October 2004csa4050: Semantics V17 Yes/No Questions: Grammar Rules for S % Declarative sentence s --> np, vp. John sees Fido % interrogative sentence s --> aux, np, vp. does John see Fido ?

October 2004csa4050: Semantics V18 S Rule with Arguments :- [process]. s(a1(S)) --> np(VP^S), vp(VP). s(q1(S)) --> aux, np(VP^S), vp(VP).

October 2004csa4050: Semantics V19 Complete Grammar s(a1(S)) --> np(VP^S), vp(VP). s(q1(S)) --> aux, np(VP^S), vp(VP). np(NP) --> n(NP). np(NP) --> d(N^NP), n(N). vp(VP) --> v(VP). vp(Z^P) --> v(V2), np(NP), {reduce(V2,Z,V1), reduce(NP,V1,P)}. % lexicon aux --> [does]. aux --> [did]. v(X^walk(X)) --> [walk]. v(X^walk(X)) --> [walked]. v(X^Y^chased(X,Y)) --> [chase]. v(X^Y^chased(X,Y)) --> [chased]. n(X^cat(X)) --> [cat]. n(VP^S) --> [suzie], {reduce(VP,suzie,S)}. n(VP^S) --> [felix], {reduce(VP,felix,S)}. d(RL^SL^some(X,R,S)) --> [a], {reduce(RL,X,R),reduce(SL,X,S) }.

October 2004csa4050: Semantics V20 Demo ?- process([does,john,see,fido],A). A=no ?- process([john,sees,fido],A). A=ok ?- process([does,john,sees,fido],A). A=yes

October 2004csa4050: Semantics V21 Improving the Interpreter dbq :- readLine(L), dbq1(L), !, dbq. dbq1([halt]) :- nl, write(bye), !, fail. dbq1(Sent) :- process(Sent,A).