semantics and computational semantics
Post on 07-Jan-2017
Embed Size (px)
Seman&c Analysis in Language Technology http://stp.lingfil.uu.se/~santinim/sais/2016/sais_2016.htm
Marina San(ni email@example.com
Department of Linguis(cs and Philology Uppsala University, Uppsala, Sweden
Lecture 2: Computational Semantics 1
Acknowledgements The content of these slides is mostly based on the following chapter: Stone M. (In Press) Seman$cs and computa$onal seman$cs To appear in
Paul Dekker and Maria Aloni, eds., Cambridge Handbook of Formal Seman(cs. hJps://www.cs.rutgers.edu/~mdstone/pubs/compsem13.pdf
Blackburn P. and Bos J. (2003) Computa$onal Seman$cs hJp://www.let.rug.nl/bos/pubs/BlackburnBos2003Theoria.pdf
Some slides are borrowed from / inspired by: Manning C.: Computa(onal Seman(cs, CS224N Stanford University
Dragomir Radev: Introduc(on to NLP, Coursera
Lecture 2: Computational Semantics 2
Representa(on and Seman(cs Computa(on and Composi(onal Seman(cs Logic Unifica(on
Lecture 2: Computational Semantics 3
What is Seman(cs?
Lecture 2: Computational Semantics 4
Generally speaking seman(cs is the study of meaning that is used for understanding human expressions through
Seman&cs is the study of meaning: accounts for links between words and the world.
Seman(cs is the study of how meaning is conveyed through signs and language. Denota(ons are the literal or primary meanings of words. Connota(ons are ideas or feelings that a word invokes for a person in
addi(on to its literal or primary meaning. Seman(cs focuses on the rela(on between signifiers (like words,
phrases, signs, and symbols) and what they stand for, ie their denota(ons (concepts) and connota(ons (seman(c analysis).
Lecture 2: Computational Semantics 5
Seman$cs is the study of meaning in language. Computer science is the study of precise descrip(ons of finite processes;
Thus, computa(onal seman(cs embraces any project that approaches the phenomenon of meaning by way of tasks that can be performed by following definite sets of mechanical instruc(ons.
Lecture 2: Computational Semantics 6
We can start by saying that
The aim of computa(onal seman(cs is to find techniques for automa(cally construc&ng seman&c representa&ons for expressions of human language, representa(ons that be used to perform inference. Blackburn and Bos (2003).
Inference = reasoning
Lecture 2: Computational Semantics 7
Why do we need meaning in Language Technology?
The short answer is: because intelligent applica(ons must understand in order to act.
Lecture 2: Computational Semantics 8
Ex 1: Google - What is the capital of Sweden?
Lecture 2: Computational Semantics 9
Ex 2: Siri - Which countries does the Danube river flows through?
Lecture 2: Computational Semantics 10
Ex 3: Facebook Graph Search Facebook Graph Search was a seman$c search engine that was introduced by Facebook in March 2013. It was designed to give answers to user natural language queries rather than a list of links. Examples: "Friends who Like Star Wars and Harry Po@er "photos of my friends taken at Na&onal Parks" hJps://en.wikipedia.org/wiki/Facebook_Graph_Search
Lecture 2: Computational Semantics 11
If an agent (eg. a robot) hears a sentence and act accordingly, the agent is said to understand the sentence: Example: Leave the book on the table Understanding may involve inference: Which book? Which table? So, understanding may involve some kind of reasoning
Lecture 2: Computational Semantics 12
NLP/LT and Seman(cs Not all LT-based applica(ons require seman(cs. Ex: taggers, parsers, etc.
Much can be done with shallow seman(cs. Ex: word sense disambigua(on, etc.
For more complex tasks (more intelligent tasks) seman(c reasoning is needed. Ex: QAnswering, Info Extrac(on, Ontology Crea(on, etc.
Lecture 2: Computational Semantics 13
Tradi(onally reasoning is done by using some kind of logic A tradi(onal approach is to use FOL (first order logic) to formalize meaning (see Formal Seman(cs Theories). before start studying how seman(cs is used in Language Technology-based applica(ons, lets summarise how seman(cs has been brought into computer science and ar(ficial intelligence.
Lecture 2: Computational Semantics 14
REPRESENTATION AND SEMANTICS
Lecture 2: Computational Semantics 15
Proper(es of Meaning in Logic Verifiability
Can a statement be verified against a knowledge base (KB) Example: does my cat Mar(n have whiskers?
Unambiguousness Give me the book Which book?
Canonical form (standard/abstract form of an expression) Expressiveness
Can the formalism express temporal rela(ons, beliefs, ? Is it domain-independent?
Lecture 2: Computational Semantics 16
A tradi(onal approach to meaning is to use proposi(onal logic predicate/first order logic (FOL) use theorem proving (inference) to determine whether a statement entails another
Lecture 2: Computational Semantics 17
Proposi(onal Logic : proposi(ons are represented by leJers
In proposi(onal logic, we use leJers to symbolize en(re proposi(ons.
Proposi(ons are statements of the form "x is y" where x is a subject and y is a predicate.
For example, "Socrates is a Man" is a proposi(on and might be represented in proposi(onal logic as "S".
Lecture 2: Computational Semantics 18
True and False Proposi(onal Logic studies proposi(ons, whether they are true or false. A sentence might contain several proposi(ons that are linked together by
Logical connec(ves are found in natural languages. In English for example, some examples are "and" (conjunc(on), "or" (disjunc(on), "not (nega(on) and "if" (but only when used to denote material condi(onal).
Ex (wikipedia): simple inference within the scope of proposi(onal logic: Premise 1: If it's raining then it's cloudy. Premise 2: It's raining. Conclusion: It's cloudy.
Both premises and the conclusion are proposi(ons. The premises are taken for granted and then with the applica(on of modus ponens (an inference rule) the conclusion follows.
Lecture 2: Computational Semantics 19
Syntax of Proposi(onal Logic The simplest type of logic If S is a sentence, S is a sentence (nega(on) If S1 and S2 are sentences, S1 S2 is a sentence (conjunc(on) If S1 and S2 are sentences, S1 S2 is a sentence (disjunc(on) If S1 and S2 are sentences, S1 S2 is a sentence (implica(on) If S1 and S2 are sentences, S1 S2 is a sentence(bicondi(onal)
Lecture 2: Computational Semantics 20
Proposi(onal Logic and Natural Language
Operator Precedence (highest) = nega(on = conjunc(on = disjunc(on = implica(on (lowest) = bicondi(onal* *A bicondi(onal statement is defined to be true whenever both parts have the same truth value.
Logic and Language A = Today is a holiday. B = We are going to the park. A B A B A B B A B A
Lecture 2: Computational Semantics 21
Lecture 2: Computational Semantics 22
Proposi(onal Logic and Seman(cs
Transla$ng propos$ons to Eng Seman$cs of Proposi$onal Logic
Lecture 2: Computational Semantics 23
Proposi(onal logic vs FOL/Predicate Logic
Proposi(onal logic (also called senten(al logic) is logic that includes sentence leJers (A,B,C ) and logical connec(ves, but not quan(fiers. The seman(cs of proposi(onal logic uses truth assignments to the leJers to determine whether a compound proposi(onal sentence is true.
Predicate logic is usually used as a synonym for first-order logic. Syntac(cally, first-order logic has the same connec(ves as proposi(onal logic, but it also has variables for individual objects, quan(fiers, symbols for func(ons, and symbols for rela(ons.
Its seman(cs includes a domain of discourse for the variables and quan(fiers to range over, along with interpreta(ons of the rela(on and func(on symbols.
Lecture 2: Computational Semantics 24
Predicate Logic: more expressive than Proposi(onal Logic
In predicate logic, we symbolize subject and predicate separately.
The important difference is that you can use predicate logic to say something about a set of objects.
By introducing the universal quan(fier (""), the existen(al quan(fier ("") and variables ("x", "y" or "z"), we can use predicate logic to represent thing like: "Everything is green" as "Gx Something is blue" as "Bx
Lecture 2: Computational Semantics 25
Used to represent
Objects Mar(n the cat Rela(ons Mar(n and Moses are brothers Func(ons Mar(ns age
Lecture 2: Computational Semantics 26
FOL elements (short version)
Constant Variables Predicates Boolean connec(ves Quan(fiers Brackets and comma to group the symbols together
Ex: A woman crosses Sunset Boulevard
Lecture 2: Computational Semantics 27
FOL elements (long version)
Formula AtomicFormula or Formula Connec(ve Formula or Quan(fier Variable Formula or Formula (Formula):
Lecture 2: Computational Semantics 28