Compositional Semantics Jacob Andreas Problem 1 Each of the three - - PowerPoint PPT Presentation

compositional semantics
SMART_READER_LITE
LIVE PREVIEW

Compositional Semantics Jacob Andreas Problem 1 Each of the three - - PowerPoint PPT Presentation

Compositional Semantics Jacob Andreas Problem 1 Each of the three girls has a platypus. Each of the three girls climbed the mountain. How many platypuses? How many mountains? 2 Problem 1 Each of the three girls has a


slide-1
SLIDE 1

Compositional Semantics

Jacob Andreas

slide-2
SLIDE 2

Problem 1

2

Each of the three girls has a platypus. Each of the three girls climbed the mountain. How many platypuses? How many mountains?

slide-3
SLIDE 3

Problem 1

3

Each of the three girls has a platypus.

slide-4
SLIDE 4

Problem 1

4

Each of the three girls climbed the mountain.

slide-5
SLIDE 5

Problem 2

5

name type coastal Columbia city no Cooper river yes Charleston city yes

There are 128 cities
 in South Carolina.

slide-6
SLIDE 6

Problem 3

6

Is Barack Obama from the United States?

Barack Obama was the 44th President of the United

  • States. Obama was born on August 4 in Honolulu,
  • Hawaii. In late August 1961, Obama's mother moved with

him to the University of Washington in Seattle for a year…

slide-7
SLIDE 7

Compositional semantics

7

It’s not enough to have structured representations of syntax: We also need structured representations of meaning.

slide-8
SLIDE 8

Compositional semantics

8

It’s not enough to have structured representations of syntax: We also need structured representations of meaning. Today: How do we get from language to meaning?

slide-9
SLIDE 9

PART I
 What is meaning?

slide-10
SLIDE 10

10

a + b = 17

Meaning in formal languages

slide-11
SLIDE 11

11

a + b = 17

Meaning in formal languages

slide-12
SLIDE 12

12

a + b = 17

a = ? b = ?

Meaning in formal languages

slide-13
SLIDE 13

13

{a=0, b=0} {a=3, b=10} {a=5, b=12} {a=17, b=0} {a=10, b=7} {a=5, b=5}

a + b = 17

Meanings are sets of valid assignments

slide-14
SLIDE 14

{a=0, b=0} {a=5, b=12}

14

✘ ✔

{a=3, b=10} {a=17, b=0} {a=10, b=7} {a=5, b=5}

✔ ✔ ✘ ✘

a + b = 17

Meanings are sets of valid assignments

slide-15
SLIDE 15

{a=0, b=0} {a=5, b=12}

15

✘ ✔

{a=3, b=10} {a=17, b=0} {a=10, b=7} {a=5, b=5}

✔ ✔ ✘ ✘

a + 3 = 20 - b

Meanings are sets of valid assignments

slide-16
SLIDE 16

{a=5, b=12}

16

⟦a + b = 17⟧

Meanings are functions that judge validity

slide-17
SLIDE 17

17

⟦a + b = 17⟧

{a=3, b=10}

Meanings are functions that judge validity

slide-18
SLIDE 18

Lessons from math

18

The meaning of a statement is the set of possible worlds consistent with that statement. Here, a “possible world” is an assignment 


  • f values to variables.

⟦a + b = 17⟧

{a=3, b=10}

slide-19
SLIDE 19

19

Pat likes Sal.

Meaning in natural languages

slide-20
SLIDE 20

Representing possible worlds

20

Individuals Properties Relations

Pat Sal

whale loves sad contains

slide-21
SLIDE 21

21

Pat Sal Sam Lou

Example world

slide-22
SLIDE 22

worried

22

Pat Sal Sam Lou

likes likes contains loves likes happy scared shark

Example world

slide-23
SLIDE 23

23

Pat Sal Sam Lou

loves loves loves sad sad sad sad

Different example world

slide-24
SLIDE 24

Representing possible worlds

24

Individuals Properties Relations

Pat Sal

whale={Lou}, sad={Pat,Sal} likes={(Pat,Sal),(Sal,Sam)}

slide-25
SLIDE 25

25

Pat likes Sal.

worried Pat Sal Sam Lou likes likes loves likes happy scared shark worried Pat Sal Sam Lou loves contains loves likes scared shark worried Pat Sal Sam Lou likes likes contains likes happy scared human worried Pat Sal Sam Lou likes likes contains loves likes happy scared dog

Interpretations of sentences

slide-26
SLIDE 26

26

Lou is a shark.

worried Pat Sal Sam Lou likes likes loves likes happy scared shark worried Pat Sal Sam Lou loves contains loves likes scared shark worried Pat Sal Sam Lou likes likes contains likes happy scared human worried Pat Sal Sam Lou likes likes contains loves likes happy scared dog

Interpretations of sentences

slide-27
SLIDE 27

27

Sam is inside Lou, a shark.

worried Pat Sal Sam Lou likes likes loves likes happy scared shark worried Pat Sal Sam Lou loves contains loves likes scared shark worried Pat Sal Sam Lou likes likes contains likes happy scared human worried Pat Sal Sam Lou likes likes contains loves likes happy scared dog

Interpretations of sentences

slide-28
SLIDE 28

KEY IDEA
 The meaning of a sentence is the set

  • f possible worlds it picks out.
slide-29
SLIDE 29

PART II
 How is meaning constructed?

slide-30
SLIDE 30

30

Pat likes Sal.

worried Pat Sal Sam Lou likes likes loves likes happy scared shark worried Pat Sal Sam Lou loves contains loves likes scared shark worried Pat Sal Sam Lou likes likes contains likes happy scared human worried Pat Sal Sam Lou likes likes contains loves likes happy scared dog

Explicit representation is too hard

slide-31
SLIDE 31

31

⟦Pat likes Sal⟧

worried Pat Sal Sam Lou likes loves likes happy scared whale

Meanings as functions

slide-32
SLIDE 32

32

⟦Pat likes Sal⟧

worried Pat Sal Sam Lou likes likes loves likes happy scared whale

likes(Pat, Sal)

Meanings as logical statements

slide-33
SLIDE 33

33

Pat likes Sal

likes(Pat, Sal)

Expressing functions with logic

slide-34
SLIDE 34

34

Lou is a shark

shark(Lou)

Meanings as logical statements

slide-35
SLIDE 35

35

Sam is inside Lou, a shark

Meanings as logical statements

slide-36
SLIDE 36

36

Sam is inside Lou, a shark

shark(Lou) ∧ contains(Lou, Sam)

Meanings as logical statements

slide-37
SLIDE 37

37

Nobody likes Lou

Meanings as logical statements

slide-38
SLIDE 38

38

Nobody likes Lou

∀x. ¬likes(x, Lou)

Meanings as logical statements

slide-39
SLIDE 39

39

Everyone who knows Sal is happy

Meanings as logical statements

slide-40
SLIDE 40

40

Everyone who knows Sal is happy ∀x. knows(x, Sal) → happy(x)

Meanings as logical statements

slide-41
SLIDE 41

KEY IDEA
 Collections of possible worlds can be compactly represented with logical forms.

slide-42
SLIDE 42

likes(Pat, Sal) shark(Lou) shark(Lou) ∧ contains(Lou, Sam) ∀x.¬likes(x, Lou)

42

Pat likes Sal Lou is a shark Sam is inside Lou,
 a shark Nobody likes Lou

Compositionality of meaning

slide-43
SLIDE 43

likes(Pat, Sal) shark(Lou) shark(Lou) ∧ contains(Lou, Sam) ∀x.¬likes(x, Lou)

43

Pat likes Sal Lou is a shark Sam is inside Lou,
 a shark Nobody likes Lou

Compositionality of meaning

slide-44
SLIDE 44

likes(Pat, Sal) shark(Lou) shark(Lou) ∧ contains(Lou, Sam) ∀x.¬likes(x, Lou)

44

Pat likes Sal Lou is a shark Sam is inside Lou,
 a shark Nobody likes Lou

Compositionality of meaning

slide-45
SLIDE 45

likes(Pat, Sal) shark(Lou) shark(Lou) ∧ contains(Lou, Sam) ∀x.¬likes(x, Lou)

45

A Sal le gusta Pat Lou es un tiburón Sam está dentro de
 Lou, un tiburón A nadie le gusta Lou

Compositionality of meaning

slide-46
SLIDE 46

likes(Pat, Sal) shark(Lou) shark(Lou) ∧ contains(Lou, Sam) ∀x.¬likes(x, Lou)

46

a12 b5 c67 a8 a12 b5 c0 a0 a12 b16 c12 c12 a53

Compositionality of meaning

slide-47
SLIDE 47

KEY IDEA
 Pieces of logical forms correspond to pieces of language

slide-48
SLIDE 48

48

Pat: Pat Sal: Sal Sam: Sam Lou: Lou

shark(Lou) ∧ contains(Lou, Sam) Sam is inside Lou, a shark

Building a lexicon

slide-49
SLIDE 49

49

Pat: Pat Sal: Sal Sam: Sam Lou: Lou shark: λx.whale(x) Sal: Sal Sam: Sam Lou: Lou

shark(Lou) ∧ contains(Lou, Sam) Sam is inside Lou, a shark

Building a lexicon

slide-50
SLIDE 50

50

Pat: Pat Sal: Sal Sam: Sam Lou: Lou shark: λx.shark(x) Sal: Sal Sam: Sam Lou: Lou

shark(Lou) ∧ contains(Lou, Sam) Sam is inside Lou, a shark

Building a lexicon

slide-51
SLIDE 51

51

Pat: Pat Sal: Sal Sam: Sam Lou: Lou shark: λx.shark(x) likes: λyx.likes(x, y) nobody: λf.∀x.¬f(x) Lou: Lou ...

shark(Lou) ∧ contains(Lou, Sam) Sam is inside Lou, a shark

Building a lexicon

slide-52
SLIDE 52

52

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat

What do we do now?

slide-53
SLIDE 53

53

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat

What do we do now?

slide-54
SLIDE 54

54

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat

What do we do now?

Ax.letter(x)?

slide-55
SLIDE 55

55

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat

What do we do now?

letter(λf.Ax.f(x))?

slide-56
SLIDE 56

56

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat

What do we do now?

??? Ax.letter(x)?

slide-57
SLIDE 57

57

Pat sent Lou urgently .

??? λyzx.sent(x,y,z) Lou Pat

What do we do now?

?????

slide-58
SLIDE 58

58

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat Object Bool Object Object Bool {Obj,Obj,Obj} Bool Object Bool

Semantic types

slide-59
SLIDE 59

59

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP S NP NP S NP,NP,NP S NP S

Semantic types & syntax

slide-60
SLIDE 60

60

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP NP S|NP ((S|NP)|NP)|NP S|(S|NP)

Semantic types & syntax

slide-61
SLIDE 61

61

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP NP S/NP NP/(S/NP) ((S\NP)/NP)/NP

Categorial grammar

slide-62
SLIDE 62

62

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP NP S/NP NP/(S/NP) ((S\NP)/NP)/NP NP Ax.letter(x)

Parsing with a categorial grammar

slide-63
SLIDE 63

63

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP NP S/NP NP/(S/NP) NP ((S\NP)/NP)/NP Ax.letter(x) (S\NP)/NP λzx.sent(x,Lou,z)

Parsing with a categorial grammar

slide-64
SLIDE 64

64

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP NP S/NP NP/(S/NP) NP ((S\NP)/NP)/NP Ax.letter(x) (S\NP)/NP λzx.sent(x,Lou,z) λx.sent(x,Lou,Ax.letter(x)) S\NP

Parsing with a categorial grammar

slide-65
SLIDE 65

65

Pat sent Lou a letter

λx.letter(x) λf.Ax.f(x) λyzx.sent(x,y,z) Lou Pat NP NP S/NP NP/(S/NP) NP ((S\NP)/NP)/NP Ax.letter(x) (S\NP)/NP λzx.sent(x,Lou,z) λx.sent(x,Lou,Ax.letter(x)) S\NP sent(Pat,Lou,Ax.letter(x)) S

Parsing with a categorial grammar

slide-66
SLIDE 66

66

Pat sent Lou a letter

Semantics → Synax!

slide-67
SLIDE 67

67

Pat sent Lou a letter

Semantics → Synax!

slide-68
SLIDE 68

KEY IDEA
 Types in logic correspond to grammatical categories in language

slide-69
SLIDE 69

Problem 1

69

Each of the three girls has a platypus. Each of the three girls climbed the mountain. ∀x.girl(x) → ∃y.platypus(y) ∧ has(x, y) ∃y.mountain(y) ∧ ∀x.girl(x) → climbed(x, y)

slide-70
SLIDE 70

Problem 2

70

name type coastal Columbia city no Cooper river yes Charleston city yes

There are 128 cities
 in South Carolina

slide-71
SLIDE 71

Problem 2

71

name type coastal Columbia city no Cooper river yes Charleston city yes

There are 128 cities
 in South Carolina

same(128,
 count x. city(x) ∧ in(x, SouthCarolina) ∧

slide-72
SLIDE 72

Problem 3

72

Is Barack Obama from the United States?

Barack Obama was the 44th President of the United

  • States. Obama was born on August 4 in Honolulu,
  • Hawaii. In late August 1961, Obama's mother moved with

him to the University of Washington in Seattle for a year…

slide-73
SLIDE 73

Problem 3

73

Is Barack Obama from the United States?

Barack Obama was the 44th President of the United

  • States. Obama was born on August 4 in Honolulu,
  • Hawaii. In late August 1961, Obama's mother moved with

him to the University of Washington in Seattle for a year…


 from(Obama, United States)
 ∧ 
 born(Obama, Hawaii, August 4)
 ∧

slide-74
SLIDE 74

Problem 3

74

Is Barack Obama from the United States?

Barack Obama was the 44th President of the United

  • States. Obama was born on August 4 in Honolulu,
  • Hawaii. In late August 1961, Obama's mother moved with

him to the University of Washington in Seattle for a year…


 born(Obama, Hawaii, August 4)
 ∧ 
 from(Obama, United States)
 ∧


 born(x, y, z) → from(x, y) from(x, y) ∧ in(y, z) → from(x, z) in(Hawaii, United States) ∧

slide-75
SLIDE 75

KEY IDEA
 The meaning of a sentence is the set

  • f possible worlds it picks out.
slide-76
SLIDE 76

KEY IDEA
 Collections of possible worlds can be compactly represented with logical forms.

slide-77
SLIDE 77

KEY IDEA
 Pieces of logical forms correspond to pieces of language

slide-78
SLIDE 78

KEY IDEA
 Types in logic correspond to grammatical categories in language

slide-79
SLIDE 79

BONUS ROUND
 What’s missing?

slide-80
SLIDE 80

80

Q: How do you like my cooking?

Saying what we mean

slide-81
SLIDE 81

81

Q: How do you like my cooking? A: It’s extremely interesting.

Saying what we mean

slide-82
SLIDE 82

82

Q: How do you like my cooking? A: It’s extremely interesting. Q: Do you know what time it is?

Saying what we mean

slide-83
SLIDE 83

83

Q: How do you like my cooking? A: It’s extremely interesting. Q: Do you know what time it is? A: Yes, I do.

Saying what we mean

slide-84
SLIDE 84

84

Sal might have seen a unicorn. Pat thinks Sal saw a unicorn. Pat wants to find a unicorn.

Belief & possibility

slide-85
SLIDE 85

KEY IDEA
 Not all meaning is literal!

slide-86
SLIDE 86

BONUS ROUND
 Historical Notes

slide-87
SLIDE 87

Alfred Tarski Richard Montague

slide-88
SLIDE 88

Learn more

88

ling121: “Logical Semantics” Ted Briscoe’s lecture notes: 
 https://www.cl.cam.ac.uk/teaching/1011/L107/semantics.pdf Mark Steedman, “The Syntactic Process”