April 2010CSA50061 Logic, Representation and Inference Simple Question Answering NL Access to Databases Semantics of Questions and Answers Simple Interpreters.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Natural Language and Prolog
Advertisements

1© 2003 T. Abou-Assaleh, N. Cercone, & V. Keselj Expressing Probabilistic Context-Free Grammars in the Relaxed Unification Formalism Tony Abou-Assaleh.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
Natural Language Understanding Difficulties: Large amount of human knowledge assumed – Context is key. Language is pattern-based. Patterns can restrict.
Semantics (Representing Meaning)
1 CHAPTER 4 RELATIONAL ALGEBRA AND CALCULUS. 2 Introduction - We discuss here two mathematical formalisms which can be used as the basis for stating and.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
Proceedings of the Conference on Intelligent Text Processing and Computational Linguistics (CICLing-2007) Learning for Semantic Parsing Advisor: Hsin-His.
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.
Language Specfication and Implementation - PART II: Semantics of Procedural Programming Languages Lee McCluskey Department of Computing and Mathematical.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
2005Integration-intro1 Data Integration Systems overview The architecture of a data integration system:  Components and their interaction  Tasks  Concepts.
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.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Syntax Directed Translation. Syntax directed translation Yacc can do a simple kind of syntax directed translation from an input sentence to C code We.
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language (omit 14.4)
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.
Writing Effective Sentences Prof ADama. Objective To help the student write clear and effective sentences.
LDK R Logics for Data and Knowledge Representation Modeling First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia.
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.
Artificial Intelligence: Natural Language
October 2005CSA3180 NLP1 CSA3180 Natural Language Processing Introduction and Course Overview.
CSA2050 Introduction to Computational Linguistics Lecture 1 Overview.
Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.
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.
CSA2050 Introduction to Computational Linguistics Lecture 1 What is Computational Linguistics?
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.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
Logical and Functional Programming
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
CSA3050: NLP Algorithms Sentence Grammar NLP Algorithms.
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.
End of the beginning Let’s wrap up some details and be sure we are all on the same page Good way to make friends and be popular.
Semantics cCS 224n / Lx 237 Tuesday, May With slides borrowed from Jason Eisner.
Done By :- -Nesreen Basem -Sara nabil -Rawan Prolog Program.
Artificial Intelligence Knowledge Representation.
Context Free Grammars. Slide 1 Syntax Syntax = rules describing how words can connect to each other * that and after year last I saw you yesterday colorless.
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
Principles of Programming Languages
CSA4050: Advanced Topics in NLP
Database SQL.
Deniz Beser A Fundamental Tradeoff in Knowledge Representation and Reasoning Hector J. Levesque and Ronald J. Brachman.
Presentation transcript:

April 2010CSA50061 Logic, Representation and Inference Simple Question Answering NL Access to Databases Semantics of Questions and Answers Simple Interpreters for Questions

April 2010CSA50062 Access to Databases: 3 Possible Approaches Natural Language DB Query Language Form Interface

April 2010CSA50063 Natural Language How many countries are there in each continent? What is their average population?

April 2010CSA50064 SQL: 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))

April 2010CSA50065 Form Interface

April 2010CSA50066 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

April 2010CSA50067 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?

April 2010CSA50068 Different Types of Sentence Sentence TypeCommunicative Act Declarative SentenceAssertion Interrogative SentenceQuestion Imperative SentenceCommand

April 2010CSA50069 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.

April 2010CSA 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?

April 2010CSA 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. Representation of communicative act is in addition to representation of content.

April 2010CSA Representation of Communicative Acts Basic idea is to “wrap” the semantic content P in a special form  to yield  (P). In the following examples,  has the general form ca(,, ) The next two examples deal with –simple assertions and –yes-no queries.

April 2010CSA Assertions and Questions: Semantic Representation SentenceRepresentation of Semantic Content Representation of Communicative Act John sees Fido see(john,fido)ca(a1,_,see(john,fido)) Does John see Fido see(john,fido)ca(q1,_,see(john,fido))

April 2010CSA 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

April 2010CSA Defining the Interpreter interpret(ca(a1,_,A),Result) :- mk_assertion(A,Result). interpret(ca(q1,_,A),Result) :- yes_no_query(A,Result).

April 2010CSA Very Basic Intepretation mk_assertion(SEM,ok) :- assert(SEM). In the case of an assertion, just assert it. N.B. no check for previous assertion. yes_no_query(SEM,yes) :- call(SEM), !. yes_no_query (SEM,no). If it’s a yes-no question, see if it’s true

April 2010CSA 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

April 2010CSA Yes/No Questions: Grammar Rules for S % Declarative sentence s --> np, vp. Mia loves Vincent % Interrogative sentence s --> aux, np, vp. does Mia love Vincent ?

April 2010CSA Grammar Rules with Semantics (Blackburn) % Declarative sentence s(app(NP,VP)) --> np(NP), vp(VP). Mia loves Vincent np(app(DET,N)) --> det(NP), noun(N). this car

April 2010CSA Grammar Rules with Pragmatics % Declarative sentence s(ca(a1,_app(NP,VP))) --> np(NP), vp(VP). Mia loves Vincent np(app(DET,N)) --> det(NP), noun(N). this car

April 2010CSA Demo ?- process([does,vincent,love,mia],A). A=no ?- process([vincent,loves,mia],A). A=ok ?- process([does,vincent,love,mia],A). A=yes

April 2010CSA Improving the Interpreter dbq :- readLine(L), dbq1(L), !, dbq. dbq1([halt]) :- nl, write(bye), !, fail. dbq1(Sent) :- process(Sent,A).