180 likes | 282 Views
Semantics Day 38. LING 681.02 Computational Linguistics Harry Howard Tulane University. Course organization. http://www.tulane.edu/~howard/NLP/. Analyzing the meaning of sentences. SLPP 10. The problem.
E N D
SemanticsDay 38 LING 681.02 Computational Linguistics Harry Howard Tulane University
Course organization • http://www.tulane.edu/~howard/NLP/ LING 681.02, Prof. Howard, Tulane University
The problem • Suppose we have a program that lets us type in a natural language question and gives us back the right answer: • Which country is Athens in? • Greece. • How hard is it to write such a program? LING 681.02, Prof. Howard, Tulane University
Querying a database LING 681.02, Prof. Howard, Tulane University
SQL • SQL (Structured Query Language) is a language designed for retrieving and managing data in relational databases. • For example, executing the query below will pull out the value 'greece': • SELECT Country FROM city_table WHERE City = 'athens' LING 681.02, Prof. Howard, Tulane University
Parsing into SQL • Can we get the same effect using English as our input to the query system? • The feature-based grammar formalism described in Chapter 9 makes it easy to translate from English to SQL. • Each phrase structure rule is supplemented with a recipe for constructing a value for the feature sem. • We use the string concatenation operation + to splice the values for the child constituents to make a value for the parent constituent. • S[SEM=(?np + WHERE + ?vp)] -> NP[SEM=?np] VP[SEM=?vp] LING 681.02, Prof. Howard, Tulane University
Philosophical problem • Understanding = looking up in a database? • What is a city? • What is a country? • What is a population? LING 681.02, Prof. Howard, Tulane University
Depiction of a situation in which Margrietje loves Brunoke LING 681.02, Prof. Howard, Tulane University
Conclusions • Two fundamental notions in semantics: • Declarative sentences are true or false in certain situations. • Definite noun phrases and proper nouns refer to things in the world. LING 681.02, Prof. Howard, Tulane University
Consistent vs. inconsistent 5a. Sylvania is to the north of Freedonia. 5b. Freedonia is a republic. 6a. The capital of Freedonia has a population of 9,000. 6b. No city in Freedonia has a population of 9,000. 7a. Sylvania is to the north of Freedonia. 7b. Freedonia is to the north of Sylvania. LING 681.02, Prof. Howard, Tulane University
Logic & NL • Broadly speaking, logic-based approaches to natural language semantics focus on those aspects of natural language which guide our judgments of consistency and inconsistency. • The syntax of a logical language is designed to make these features formally explicit. • As a result, determining properties like consistency can often be reduced to symbolic manipulation, that is, to a task that can be carried out by a computer. • In order to pursue this approach, we first want to develop a technique for representing a possible situation. LING 681.02, Prof. Howard, Tulane University
Model • We do this in terms of something that logicians call a model. • A model for a set W of sentences is a formal representation of a situation in which all the sentences in W are true. • The usual way of representing models involves set theory. • The domain D of discourse (all the entities we currently care about) is a set of individuals, while relations are treated as sets built up from D. LING 681.02, Prof. Howard, Tulane University
Example of a model • Our domain D will consist of three children, Stefan, Klaus and Evi = s, k and e. • D = {s, k, e}. • Expressions: • boy denotes the set consisting of Stefan and Klaus, • girl denotes the set consisting of Evi, • is running denotes the set consisting of Stefan and Evi. LING 681.02, Prof. Howard, Tulane University
Propositional logic LING 681.02, Prof. Howard, Tulane University
Quiz grades LING 681.02, Prof. Howard, Tulane University
Michael Hunter Leah Caitlin Alexander Parisa 0 P3 P1, P5 P1 P5 P6, P9, P10 Missing quiz grades LING 681.02, Prof. Howard, Tulane University
Next time No quiz NLPP §10 Analyzing the meaning of sentences