Computational Semantics Deep Processing for NLP Ling 571 February - - PowerPoint PPT Presentation

computational semantics
SMART_READER_LITE
LIVE PREVIEW

Computational Semantics Deep Processing for NLP Ling 571 February - - PowerPoint PPT Presentation

Computational Semantics Deep Processing for NLP Ling 571 February 6, 2017 Roadmap Motivation: Dialog Systems Key challenges Meaning representation Representational requirements First-order logic Syntax &


slide-1
SLIDE 1

Computational Semantics

Deep Processing for NLP Ling 571 February 6, 2017

slide-2
SLIDE 2

Roadmap

— Motivation: Dialog Systems — Key challenges — Meaning representation

— Representational requirements — First-order logic

— Syntax & Semantics

— Representing compositional meaning

slide-3
SLIDE 3

Dialogue Systems

— User: What do I have on Thursday? — Parse:

— (S — (Q-WH-Obj — (Whwd What) — (Aux do ) — (NP (Pron I)) — (VP/NP (V have) — (NP/NP *t*) — (PP (Prep

  • n)

— (NP (N Thursday))))))

slide-4
SLIDE 4

Dialogue Systems

— Parser:

— Yes, it’s grammatical! — Here’s the structure!

— System: Great, but what am I supposed to DO?! — Need to associate meaning with structure

slide-5
SLIDE 5

Dialogue Systems

— (S — (Q-WH-Obj Action: check; cal: USER; Date:Thursday — (Whwd What) — (Aux do ) — (NP (Pron I)) Cal: USER — (VP/NP (V have) — (NP/NP *t*) — (PP (Prep

  • n)

— (NP (N Thursday)))))) Date: Thursday

slide-6
SLIDE 6

Natural Language

— Syntax: Determine the structure of natural

language input

— Semantics: Determine the meaning of natural

language input

slide-7
SLIDE 7

Tasks for Semantics

— Semantic interpretation required for many tasks

— Answering questions — Following instructions in a software manual — Following a recipe

— Requires more than phonology, morphology, syntax — Must link linguistic elements to world knowledge

slide-8
SLIDE 8

Semantics is Complex

— Sentences have many entailments, presuppositions — Instead, the protests turned bloody, as anti-government

crowds were confronted by what appeared to be a coordinated group of Mubarak supporters.

slide-9
SLIDE 9

Semantics is Complex

— Sentences have many entailments, presuppositions — Instead, the protests turned bloody, as anti-government

crowds were confronted by what appeared to be a coordinated group of Mubarak supporters. — The protests became bloody.

slide-10
SLIDE 10

Semantics is Complex

— Sentences have many entailments, presuppositions — Instead, the protests turned bloody, as anti-government

crowds were confronted by what appeared to be a coordinated group of Mubarak supporters. — The protests became bloody. — The protests had been peaceful.

slide-11
SLIDE 11

Semantics is Complex

— Sentences have many entailments, presuppositions — Instead, the protests turned bloody, as anti-government

crowds were confronted by what appeared to be a coordinated group of Mubarak supporters. — The protests became bloody. — The protests had been peaceful. — Crowds oppose the government.

slide-12
SLIDE 12

Semantics is Complex

— Sentences have many entailments, presuppositions — Instead, the protests turned bloody, as anti-government

crowds were confronted by what appeared to be a coordinated group of Mubarak supporters. — The protests became bloody. — The protests had been peaceful. — Crowds oppose the government. — Some support Mubarak.

slide-13
SLIDE 13

Semantics is Complex

— Sentences have many entailments, presuppositions — Instead, the protests turned bloody, as anti-government

crowds were confronted by what appeared to be a coordinated group of Mubarak supporters. — The protests became bloody. — The protests had been peaceful. — Crowds oppose the government. — Some support Mubarak. — There was a confrontation between two groups. — Anti-government crowds are not Mubarak supporters. — Etc..

slide-14
SLIDE 14

Challenges in Semantics

— Semantic representation:

— What is the appropriate formal language to express

propositions in linguistic input?

slide-15
SLIDE 15

Challenges in Semantics

— Semantic representation:

— What is the appropriate formal language to express

propositions in linguistic input? — E.g. predicate calculus

— ∃x (dog(x) ∧ disappear(x))

slide-16
SLIDE 16

Challenges in Semantics

— Semantic representation:

— What is the appropriate formal language to express

propositions in linguistic input? — E.g. predicate calculus

— ∃x.(dog(x) ∧ disappear(x))

— Entailment:

— What are all the valid conclusions that can be drawn

from an utterance?

slide-17
SLIDE 17

Challenges in Semantics

— Semantic representation:

— What is the appropriate formal language to express

propositions in linguistic input? — E.g. predicate calculus

— ∃x.(dog(x) ∧ disappear(x))

— Entailment:

— What are all the valid conclusions that can be drawn

from an utterance? — ‘Lincoln was assassinated’ entails

slide-18
SLIDE 18

Challenges in Semantics

— Semantic representation:

— What is the appropriate formal language to express

propositions in linguistic input? — E.g. predicate calculus

— ∃x.(dog(x) ∧ disappear(x))

— Entailment:

— What are all the valid conclusions that can be drawn

from an utterance? — ‘Lincoln was assassinated’ entails ‘Lincoln is dead.’

slide-19
SLIDE 19

Challenges in Semantics

— Reference: How do linguistic expressions link to

  • bjects/concepts in the real world?

— ‘the dog’ , ‘the evening star’, ‘the Superbowl’

slide-20
SLIDE 20

Challenges in Semantics

— Reference: How do linguistic expressions link to

  • bjects/concepts in the real world?

— ‘the dog’ , ‘the evening star’, ‘the Superbowl’

— Compositionality: How can we derive the meaning

  • f a unit from its parts?

— How do syntactic structure and semantic composition

relate? — ‘rubber duck’ vs ‘rubber chicken’

slide-21
SLIDE 21

Challenges in Semantics

— Reference: How do linguistic expressions link to

  • bjects/concepts in the real world?

— ‘the dog’ , ‘the evening star’, ‘the Superbowl’

— Compositionality: How can we derive the meaning

  • f a unit from its parts?

— How do syntactic structure and semantic composition

relate? — ‘rubber duck’ vs ‘rubber chicken’ — ‘kick the bucket’

slide-22
SLIDE 22

Tasks in Computational Semantics

— Computational semantics aims to extract, interpret,

and reason about the meaning of NL utterances, and includes: — Defining a meaning representation

slide-23
SLIDE 23

Tasks in Computational Semantics

— Computational semantics aims to extract, interpret,

and reason about the meaning of NL utterances, and includes: — Defining a meaning representation — Developing techniques for semantic analysis, to

convert NL strings to meaning representations

slide-24
SLIDE 24

Tasks in Computational Semantics

— Computational semantics aims to extract, interpret,

and reason about the meaning of NL utterances, and includes: — Defining a meaning representation — Developing techniques for semantic analysis, to

convert NL strings to meaning representations

— Developing methods for reasoning about these

representations and performing inference from them

slide-25
SLIDE 25

NLP Semantics Tasks

— Tasks:

— Semantic similarity: words, texts — Semantic role labeling — Semantic analysis — “Semantic parsing” — Recognizing textual entailment — Sentiment Analysis

slide-26
SLIDE 26

Complexity of Computational Semantics

— Requires:

slide-27
SLIDE 27

Complexity of Computational Semantics

— Requires:

— Knowledge of language: words, syntax, relationships

b/t structure and meaning, composition procedures

slide-28
SLIDE 28

Complexity of Computational Semantics

— Requires:

— Knowledge of language: words, syntax, relationships

b/t structure and meaning, composition procedures

— Knowledge of the world: what are the objects that we

refer to, how do they relate, what are their properties?

slide-29
SLIDE 29

Complexity of Computational Semantics

— Requires:

— Knowledge of language: words, syntax, relationships

b/t structure and meaning, composition procedures

— Knowledge of the world: what are the objects that we

refer to, how do they relate, what are their properties?

— Reasoning: Given a representation and a world, what

new conclusions – bits of meaning – can we infer?

slide-30
SLIDE 30

Complexity of Computational Semantics

— Requires:

— Knowledge of language: words, syntax, relationships b/t

structure and meaning, composition procedures

— Knowledge of the world: what are the objects that we refer

to, how do they relate, what are their properties?

— Reasoning: Given a representation and a world, what new

conclusions – bits of meaning – can we infer?

— Effectively AI-complete

— Need representation, reasoning, world model, etc

slide-31
SLIDE 31

Representing Meaning

First-order Logic Semantic Network Conceptual Dependency Frame-Based

slide-32
SLIDE 32

Meaning Representations

— All consist of structures from set of symbols

— Representational vocabulary

slide-33
SLIDE 33

Meaning Representations

— All consist of structures from set of symbols

— Representational vocabulary

— Symbol structures correspond to:

— Objects — Properties of objects — Relations among objects

slide-34
SLIDE 34

Meaning Representations

— All consist of structures from set of symbols

— Representational vocabulary

— Symbol structures correspond to:

— Objects — Properties of objects — Relations among objects

— Can be viewed as:

slide-35
SLIDE 35

Meaning Representations

— All consist of structures from set of symbols

— Representational vocabulary

— Symbol structures correspond to:

— Objects — Properties of objects — Relations among objects

— Can be viewed as:

— Representation of meaning of linguistic input

slide-36
SLIDE 36

Meaning Representations

— All consist of structures from set of symbols

— Representational vocabulary

— Symbol structures correspond to:

— Objects — Properties of objects — Relations among objects

— Can be viewed as:

— Representation of meaning of linguistic input — Representation of state of world

— Here we focus on literal meaning

slide-37
SLIDE 37

Representational Requirements

— Verifiability — Unambiguous representations — Canonical Form — Inference and Variables — Expressiveness

slide-38
SLIDE 38

Representational Requirements

— Verifiability

— Can compare representation of sentence to KB model

— Unambiguous representations — Canonical Form — Inference and Variables — Expressiveness

slide-39
SLIDE 39

Representational Requirements

— Verifiability

— Can compare representation of sentence to KB model

— Unambiguous representations

— Semantic representation itself is unambiguous

— Canonical Form — Inference and Variables — Expressiveness

slide-40
SLIDE 40

Representational Requirements

— Verifiability

— Can compare representation of sentence to KB model

— Unambiguous representations

— Semantic representation itself is unambiguous

— Canonical Form

— Alternate expressions of same meaning map to same rep

— Inference and Variables — Expressiveness

slide-41
SLIDE 41

Representational Requirements

— Verifiability

— Can compare representation of sentence to KB model

— Unambiguous representations

— Semantic representation itself is unambiguous

— Canonical Form

— Alternate expressions of same meaning map to same rep

— Inference and Variables

— Way to draw valid conclusions from semantics and KB

— Expressiveness

slide-42
SLIDE 42

Representational Requirements

— Verifiability

— Can compare representation of sentence to KB model

— Unambiguous representations

— Semantic representation itself is unambiguous

— Canonical Form

— Alternate expressions of same meaning map to same rep

— Inference and Variables

— Way to draw valid conclusions from semantics and KB

— Expressiveness

— Represent any natural language utterance

slide-43
SLIDE 43

Meaning Structure of Language

— Human languages

— Display basic predicate-argument structure — Employ variables — Employ quantifiers — Exhibit a (partially) compositional semantics

slide-44
SLIDE 44

Predicate-Argument Structure

— Represent concepts and relationships — Words behave like predicates:

slide-45
SLIDE 45

Predicate-Argument Structure

— Represent concepts and relationships — Words behave like predicates:

— Verbs, Adj, Adv:

— Book(John,United); Non-stop(Flight)

— Some words behave like arguments:

slide-46
SLIDE 46

Predicate-Argument Structure

— Represent concepts and relationships — Words behave like predicates:

— Verbs, Adj, Adv:

— Book(John,United); Non-stop(Flight)

— Some words behave like arguments:

— Nouns: Book(John,United); Non-stop(Flight)

slide-47
SLIDE 47

Predicate-Argument Structure

— Represent concepts and relationships — Words behave like predicates:

— Verbs, Adj, Adv:

— Book(John,United); Non-stop(Flight)

— Some words behave like arguments:

— Nouns: Book(John,United); Non-stop(Flight)

— Subcategorization frames indicate:

— Number, Syntactic category, order of args

slide-48
SLIDE 48

First-Order Logic

— Meaning representation:

— Provides sound computational basis for verifiability,

inference, expressiveness

— Supports determination of propositional truth — Supports compositionality of meaning — Supports inference — Supports generalization through variables

slide-49
SLIDE 49

First-Order Logic

— FOL terms:

— Constants: specific objects in world;

— A, B, John — Refer to exactly one object; objects referred to by many

slide-50
SLIDE 50

First-Order Logic

— FOL terms:

— Constants: specific objects in world;

— A, B, John — Refer to exactly one object; objects referred to by many

— Functions: concepts refer to objects, e.g. SFO’s loc

— LocationOf(SFO) — Refer to objects, avoid using constants

slide-51
SLIDE 51

First-Order Logic

— FOL terms:

— Constants: specific objects in world;

— A, B, John — Refer to exactly one object; objects referred to by many

— Functions: concepts refer to objects, e.g. SFO’s loc

— LocationOf(SFO) — Refer to objects, avoid using constants

— Variables:

— x, e

slide-52
SLIDE 52

FOL Representation

— Predicates:

— Relations among objects

— United serves Chicago. è — Serves(United, Chicago) — United is an airline. è — Airline(United)

slide-53
SLIDE 53

FOL Representation

— Predicates:

— Relations among objects

— United serves Chicago. è — Serves(United, Chicago) — United is an airline. è — Airline(United)

— Logical connectives:

— Allow compositionality of meaning

— Maharani serves vegetarian food and is cheap.

slide-54
SLIDE 54

FOL Representation

— Predicates:

— Relations among objects

— United serves Chicago. è — Serves(United, Chicago) — United is an airline. è — Airline(United)

— Logical connectives:

— Allow compositionality of meaning

— Frontier serves Seattle and is cheap. — Serves(Frontier,Seattle) ∧ Cheap(Frontier)

slide-55
SLIDE 55

Variables & Quantifiers

— Variables refer to:

slide-56
SLIDE 56

Variables & Quantifiers

— Variables refer to:

— Anonymous objects

slide-57
SLIDE 57

Variables & Quantifiers

— Variables refer to:

— Anonymous objects — All objects in some collection

— Quantifiers:

slide-58
SLIDE 58

Variables & Quantifiers

— Variables refer to:

— Anonymous objects — All objects in some collection

— Quantifiers:

— : existential quantifier: “there exists”

— Indefinite NP

, one such object for truth

— A non-stop flight that serves Pittsburgh

∃xFlight(x)∧Serves(x,Pittsburgh)∧Non−stop(x)

slide-59
SLIDE 59

Variables & Quantifiers

— Variables refer to:

— Anonymous objects — All objects in some collection

— Quantifiers:

— : existential quantifier: “there exists”

— Indefinite NP

, one such object for truth

— A non-stop flight that serves Pittsburgh

— : universal quantifier: “for all”

— All flights include beverages.

∃xFlight(x)∧Serves(x,Pittsburgh)∧Non−stop(x)

∀xFlight(x) ⇒ Includes(x,beverages)

slide-60
SLIDE 60

FOL Syntax Summary

slide-61
SLIDE 61

Compositionality

— Compositionality: The meaning of a complex

expression is a function of the meaning of its parts and the rules for their combination. — Formal languages are compositional. — Natural language meaning is largely, though not fully,

compositional, but much more complex. — How can we derive things like loves(John, Mary) from

John, loves(x,y), and Mary?

slide-62
SLIDE 62

Lambda Expressions

— Lambda (λ) notation: (Church, 1940)

— Just like lambda in Python, Scheme, etc — Allows abstraction over FOL formulas

— Supports compositionality

slide-63
SLIDE 63

Lambda Expressions

— Lambda (λ) notation: (Church, 1940)

— Just like lambda in Python, Scheme, etc — Allows abstraction over FOL formulas

— Supports compositionality

— Form: λ + variable + FOL expression

— E.g. λx.P(x) “Function taking x to P(x)”

slide-64
SLIDE 64

Lambda Expressions

— Lambda (λ) notation: (Church, 1940)

— Just like lambda in Python, Scheme, etc — Allows abstraction over FOL formulas

— Supports compositionality

— Form: λ + variable + FOL expression

— E.g. λx.P(x) “Function taking x to P(x)” — λx.P(x) (A) à P(A)

slide-65
SLIDE 65

λ-Reduction

— λ-reduction: Apply λ-expression to logical term

— Binds formal parameter to term

λx.P(x)

slide-66
SLIDE 66

λ-Reduction

— λ-reduction: Apply λ-expression to logical term

— Binds formal parameter to term

λx.P(x) λx.P(x)(A)

slide-67
SLIDE 67

λ-Reduction

— λ-reduction: Apply λ-expression to logical term

— Binds formal parameter to term

— Equivalent to function application

λx.P(x) λx.P(x)(A) P(A)

slide-68
SLIDE 68

Nested λ-Reduction

— Lambda expression as body of another

λx.λy.Near(x, y)

slide-69
SLIDE 69

Nested λ-Reduction

— Lambda expression as body of another

λx.λy.Near(x, y) λx.λy.Near(x, y)(Midway)

slide-70
SLIDE 70

Nested λ-Reduction

— Lambda expression as body of another

λx.λy.Near(x, y) λx.λy.Near(x, y)(Midway) λy.Near(Midway, y)

slide-71
SLIDE 71

Nested λ-Reduction

— Lambda expression as body of another

λx.λy.Near(x, y) λx.λy.Near(x, y)(Midway) λy.Near(Midway, y) λy.Near(Midway, y)(Chicago)

slide-72
SLIDE 72

Nested λ-Reduction

— Lambda expression as body of another

λx.λy.Near(x, y) λx.λy.Near(x, y)(Midway) λy.Near(Midway, y) λy.Near(Midway, y)(Chicago) Near(Midway,Chicago)

slide-73
SLIDE 73

Lambda Expressions

— Currying;

— Converting multi-argument predicates to sequence of

single argument predicates

— Why?

slide-74
SLIDE 74

Lambda Expressions

— Currying;

— Converting multi-argument predicates to sequence of

single argument predicates

— Why?

— Incrementally accumulates multiple arguments spread

  • ver different parts of parse tree
slide-75
SLIDE 75

Semantics of Meaning Rep.

— Model-theoretic approach:

— FOL terms (objects): denote elements in a domain — Atomic formulas are:

— If properties, sets of domain elements — If relations, sets of tuples of elements

— Formulas based on logical operators: — Compositionality provided by lambda expressions

slide-76
SLIDE 76

Inference

— Standard AI-type logical inference procedures

— Modus Ponens — Forward-chaining, Backward Chaining — Abduction — Resolution — Etc,..

— We’ll assume we have a prover

slide-77
SLIDE 77

Representing Events

— Initially, single predicate with some arguments

— Serves(United,Houston) — Assume # ags = # elements in subcategorization frame

slide-78
SLIDE 78

Representing Events

— Initially, single predicate with some arguments

— Serves(United,Houston) — Assume # ags = # elements in subcategorization frame

— Example:

— The flight arrived. — The flight arrived in Seattle — The flight arrived in Seattle on Saturday. — The flight arrived on Saturday. — The flight arrived in Seattle from SFO. — The flight arrived in Seattle from SFO on Saturday.

slide-79
SLIDE 79

Events

— Issues?

slide-80
SLIDE 80

Events

— Issues?

— Arity – how can we deal with different #s of arguments?

slide-81
SLIDE 81

Neo-Davidsonian Events

— Neo-Davidsonian representation:

— Distill event to single argument for event itself — Everything else is additional predication

— Pros:

∃eArriving(e)∧ Arrived(e, Flight)∧Location(e,SEA)∧ ArrivalDay(e,Saturday)

slide-82
SLIDE 82

Neo-Davidsonian Events

— Neo-Davidsonian representation:

— Distill event to single argument for event itself — Everything else is additional predication

— Pros:

— No fixed argument structure

— Dynamically add predicates as necessary

∃eArriving(e)∧ Arrived(e, Flight)∧Location(e,SEA)∧ ArrivalDay(e,Saturday)

slide-83
SLIDE 83

Neo-Davidsonian Events

— Neo-Davidsonian representation:

— Distill event to single argument for event itself — Everything else is additional predication

— Pros:

— No fixed argument structure

— Dynamically add predicates as necessary

— No extra roles

∃eArriving(e)∧ Arrived(e, Flight)∧Location(e,SEA)∧ ArrivalDay(e,Saturday)

slide-84
SLIDE 84

Neo-Davidsonian Events

— Neo-Davidsonian representation:

— Distill event to single argument for event itself — Everything else is additional predication

— Pros:

— No fixed argument structure

— Dynamically add predicates as necessary

— No extra roles — Logical connections can be derived

∃eArriving(e)∧ Arrived(e, Flight)∧Location(e,SEA)∧ ArrivalDay(e,Saturday)

slide-85
SLIDE 85

Meaning Representation for Computational Semantics

— Requirements:

— Verifiability, Unambiguous representation, Canonical

Form, Inference, Variables, Expressiveness

— Solution:

— First-Order Logic

— Structure — Semantics — Event Representation

— Next: Semantic Analysis

— Deriving a meaning representation for an input

slide-86
SLIDE 86

Summary

— First-order logic can be used as a meaning

representation language for natural language

— Principle of compositionality: the meaning of a

complex expression is a function of the meaning of its parts

— λ-expressions can be used to compute meaning

representations from syntactic trees based on the principle of compositionality

— In the next section, we will look at a syntax-driven

approach to semantic analysis in more detail