61A Lecture 37 Wednesday, April 29 Announcements 2 Announcements - - PowerPoint PPT Presentation

61a lecture 37
SMART_READER_LITE
LIVE PREVIEW

61A Lecture 37 Wednesday, April 29 Announcements 2 Announcements - - PowerPoint PPT Presentation

61A Lecture 37 Wednesday, April 29 Announcements 2 Announcements Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm 2 Announcements Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm Quiz 4 due Thursday 4/30 @ 11:59pm 2 Announcements


slide-1
SLIDE 1

61A Lecture 37

Wednesday, April 29

slide-2
SLIDE 2

Announcements

2

slide-3
SLIDE 3

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm

2

slide-4
SLIDE 4

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm

2

slide-5
SLIDE 5

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm
  • No videos on Friday 5/1; Come to lecture (and fill out the HKN course survey at the end)

2

slide-6
SLIDE 6

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm
  • No videos on Friday 5/1; Come to lecture (and fill out the HKN course survey at the end)

§If at least 60% of students respond, everyone gets an extra credit point

2

slide-7
SLIDE 7

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm
  • No videos on Friday 5/1; Come to lecture (and fill out the HKN course survey at the end)

§If at least 60% of students respond, everyone gets an extra credit point

  • Next week: 18 hours of review sessions Monday, Tuesday, & Wednesday 11-5 in 271/273 Soda

2

slide-8
SLIDE 8

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm
  • No videos on Friday 5/1; Come to lecture (and fill out the HKN course survey at the end)

§If at least 60% of students respond, everyone gets an extra credit point

  • Next week: 18 hours of review sessions Monday, Tuesday, & Wednesday 11-5 in 271/273 Soda

§Two TAs are available every hour

2

slide-9
SLIDE 9

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm
  • No videos on Friday 5/1; Come to lecture (and fill out the HKN course survey at the end)

§If at least 60% of students respond, everyone gets an extra credit point

  • Next week: 18 hours of review sessions Monday, Tuesday, & Wednesday 11-5 in 271/273 Soda

§Two TAs are available every hour §One room will be a review session going over topic-specific problems

2

slide-10
SLIDE 10

Announcements

  • Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm
  • Quiz 4 due Thursday 4/30 @ 11:59pm
  • No videos on Friday 5/1; Come to lecture (and fill out the HKN course survey at the end)

§If at least 60% of students respond, everyone gets an extra credit point

  • Next week: 18 hours of review sessions Monday, Tuesday, & Wednesday 11-5 in 271/273 Soda

§Two TAs are available every hour §One room will be a review session going over topic-specific problems §The other room is unstructured; staff will answer any questions you have

2

slide-11
SLIDE 11

Ambiguity

slide-12
SLIDE 12

Syntactic Ambiguity in English

4

Programs must be written for people to read

slide-13
SLIDE 13

Syntactic Ambiguity in English

4

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-14
SLIDE 14

Syntactic Ambiguity in English

4

Sentence

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-15
SLIDE 15

Syntactic Ambiguity in English

4

Sentence Noun
 Phrase

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-16
SLIDE 16

Syntactic Ambiguity in English

4

Sentence Noun
 Phrase Verb Phrase

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-17
SLIDE 17

Syntactic Ambiguity in English

4

Sentence Noun
 Phrase Verb Phrase Subordinate Clause

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-18
SLIDE 18

Syntactic Ambiguity in English

5

Sentence Noun
 Phrase Verb Phrase Subordinate Clause

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-19
SLIDE 19

Syntactic Ambiguity in English

6

Verb Phrase Verb Phrase Sentence Noun
 Phrase

1Preface of Structure and Interpretation of Computer Programs 


by Harold Abelson and Gerald Sussman with Julie Sussman

1

Programs must be written for people to read

slide-20
SLIDE 20

Syntactic Ambiguity in English

7

pro•gram (noun) 
 a series of coded software instructions pro•gram (verb) 
 provide a computer with coded instructions must (verb) 
 be obliged to must (noun) 
 dampness or mold

Definitions from the New Oxford American Dictionary

Programs must be written for people to read

slide-21
SLIDE 21

Syntax Trees

slide-22
SLIDE 22

Representing Syntactic Structure

9

slide-23
SLIDE 23

Representing Syntactic Structure

9

cows

slide-24
SLIDE 24

Representing Syntactic Structure

9

cows Noun

slide-25
SLIDE 25

Representing Syntactic Structure

9

cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-26
SLIDE 26

Representing Syntactic Structure

9

cows intimidate Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-27
SLIDE 27

Representing Syntactic Structure

9

cows intimidate Noun Verb

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-28
SLIDE 28

Representing Syntactic Structure

9

cows intimidate Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-29
SLIDE 29

Representing Syntactic Structure

9

Sentence cows intimidate Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-30
SLIDE 30

Representing Syntactic Structure

9

Sentence Noun
 Phrase cows intimidate Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-31
SLIDE 31

Representing Syntactic Structure

9

Sentence Noun
 Phrase cows intimidate Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-32
SLIDE 32

Representing Syntactic Structure

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-33
SLIDE 33

Representing Syntactic Structure

A Tree represents a phrase:

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-34
SLIDE 34

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-35
SLIDE 35

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-36
SLIDE 36

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-37
SLIDE 37

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-38
SLIDE 38

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-39
SLIDE 39

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-40
SLIDE 40

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-41
SLIDE 41

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-42
SLIDE 42

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-43
SLIDE 43

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-44
SLIDE 44

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-45
SLIDE 45

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

slide-46
SLIDE 46

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

cows = Leaf('N', 'cows')

slide-47
SLIDE 47

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

cows = Leaf('N', 'cows') intimidate = Leaf('V', 'intimidate')

slide-48
SLIDE 48

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

cows = Leaf('N', 'cows') intimidate = Leaf('V', 'intimidate') S, NP, VP = 'S', 'NP', 'VP'

slide-49
SLIDE 49

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

cows = Leaf('N', 'cows') intimidate = Leaf('V', 'intimidate') S, NP, VP = 'S', 'NP', 'VP' Tree(S, [Tree(NP, [cows]),

slide-50
SLIDE 50

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

cows = Leaf('N', 'cows') intimidate = Leaf('V', 'intimidate') S, NP, VP = 'S', 'NP', 'VP' Tree(S, [Tree(NP, [cows]), Tree(VP, [intimidate,

slide-51
SLIDE 51

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

cows = Leaf('N', 'cows') intimidate = Leaf('V', 'intimidate') S, NP, VP = 'S', 'NP', 'VP' Tree(S, [Tree(NP, [cows]), Tree(VP, [intimidate, Tree(NP, [cows])])])

slide-52
SLIDE 52

Representing Syntactic Structure

A Tree represents a phrase:

  • tag -- What kind of phrase (e.g., S, NP, VP)
  • branches -- Sequence of Tree or Leaf components

A Leaf represents a single word:

  • tag -- What kind of word (e.g., N, V)
  • word -- The word

9

Sentence Noun
 Phrase cows intimidate Noun
 Phrase Verb
 Phrase Noun Verb cows Noun

Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/

(Demo) cows = Leaf('N', 'cows') intimidate = Leaf('V', 'intimidate') S, NP, VP = 'S', 'NP', 'VP' Tree(S, [Tree(NP, [cows]), Tree(VP, [intimidate, Tree(NP, [cows])])])

slide-53
SLIDE 53

Grammars

slide-54
SLIDE 54

Context-Free Grammar Rules

11

slide-55
SLIDE 55

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

slide-56
SLIDE 56

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP

slide-57
SLIDE 57

A Sentence ...

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP

slide-58
SLIDE 58

A Sentence ... ... can be expanded as ...

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP

slide-59
SLIDE 59

A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP

slide-60
SLIDE 60

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP

slide-61
SLIDE 61

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S NP VP

slide-62
SLIDE 62

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S S NP VP

slide-63
SLIDE 63

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S NP VP S NP VP

slide-64
SLIDE 64

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S NP VP S NP VP NP N

slide-65
SLIDE 65

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S NP VP N S NP VP NP N

slide-66
SLIDE 66

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S NP VP N S NP VP NP N N buffalo

slide-67
SLIDE 67

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo NP VP N S NP VP NP N N buffalo

slide-68
SLIDE 68

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo NP VP N S NP VP NP N N buffalo

slide-69
SLIDE 69

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo NP VP N S NP VP NP N VP V NP N buffalo

slide-70
SLIDE 70

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo NP VP N NP V S NP VP NP N VP V NP N buffalo

slide-71
SLIDE 71

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo NP VP N NP V S NP VP NP N VP V NP N buffalo V buffalo

slide-72
SLIDE 72

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo buffalo NP VP N NP V S NP VP NP N VP V NP N buffalo V buffalo

slide-73
SLIDE 73

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo buffalo NP VP N NP V S NP VP NP N VP V NP N buffalo V buffalo

slide-74
SLIDE 74

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo buffalo NP VP N NP V N S NP VP NP N VP V NP N buffalo V buffalo

slide-75
SLIDE 75

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo buffalo NP VP N NP V buffalo N S NP VP NP N VP V NP N buffalo V buffalo

slide-76
SLIDE 76

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo buffalo NP VP N NP V buffalo N S NP VP NP N VP V NP N buffalo V buffalo

slide-77
SLIDE 77

Grammar A Sentence ... ... can be expanded as ... ... a Noun Phrase then a Verb Phrase.

Context-Free Grammar Rules

A grammar rule describes how a tag can be expanded as a sequence of tags or words

11

S NP VP S buffalo buffalo NP VP N NP V buffalo N S NP VP NP N VP V NP N buffalo V buffalo (Demo)

slide-78
SLIDE 78

Parsing

slide-79
SLIDE 79

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

slide-80
SLIDE 80

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo

slide-81
SLIDE 81

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S

slide-82
SLIDE 82

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S

slide-83
SLIDE 83

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S

slide-84
SLIDE 84

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S 1 2 3 4

slide-85
SLIDE 85

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S NP 1 2 3 4

slide-86
SLIDE 86

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S VP NP 1 2 3 4

slide-87
SLIDE 87

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

13

buffalo buffalo buffalo buffalo S VP NP 1 2 3 4

slide-88
SLIDE 88

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

14

S NP VP buffalo buffalo buffalo buffalo 1 2 3 4

slide-89
SLIDE 89

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

14

S NP VP N buffalo buffalo buffalo buffalo 1 2 3 4

slide-90
SLIDE 90

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

14

S NP VP N

Constraint: A Leaf must match the input word

buffalo buffalo buffalo buffalo 1 2 3 4

slide-91
SLIDE 91

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

14

S NP VP N

Constraint: A Leaf must match the input word

buffalo buffalo buffalo buffalo 1 2 3 4

slide-92
SLIDE 92

V J N NP

Exhaustive Parsing

Expand all tags recursively, but constrain words to match input

14

S NP VP N

Constraint: A Leaf must match the input word

buffalo buffalo buffalo buffalo 1 2 3 4

slide-93
SLIDE 93

Exhaustive Parsing

15

1 2 3 4 Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo

slide-94
SLIDE 94

Exhaustive Parsing

16

Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo 1 2 3 4

slide-95
SLIDE 95

Exhaustive Parsing

16

Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo J N 1 2 3 4

slide-96
SLIDE 96

Exhaustive Parsing

16

Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo NP N V J N 1 2 3 4

slide-97
SLIDE 97

Exhaustive Parsing

16

(Demo) Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo NP N V J N 1 2 3 4

slide-98
SLIDE 98

Learning

(Demo)

slide-99
SLIDE 99

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

slide-100
SLIDE 100

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

slide-101
SLIDE 101

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S

slide-102
SLIDE 102

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS

slide-103
SLIDE 103

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP

slide-104
SLIDE 104

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS

slide-105
SLIDE 105

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags

slide-106
SLIDE 106

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 25372

slide-107
SLIDE 107

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 25372 1335

slide-108
SLIDE 108

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 25372 1335 6679

slide-109
SLIDE 109

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 25372 1335 6679 4282

slide-110
SLIDE 110

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 5 25372 1335 6679 4282

slide-111
SLIDE 111

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 5 25372 1335 6679 4282 25

slide-112
SLIDE 112

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 5 25372 1335 6679 4282 26 25

slide-113
SLIDE 113

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

18

teacher strikes idle kids

S NP NN NNS VB NNS NP VP S NP VP NP NN NNS NN teacher NNS strikes VB idle NNS kids VP VB NP NP NNS Rule frequency per 100,000 tags 5 32 25372 1335 6679 4282 26 25

slide-114
SLIDE 114

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

19

VP S NN VBZ JJ NNS NP NP Rule frequency per 100,000 tags 19 5 18 32 4358 25372 3160 2526 1335 6679 4282 26 25

teacher strikes idle kids

S NP VP NP NN NN teacher VBZ strikes JJ idle NNS kids VP VBZ NP NP JJ NNS

slide-115
SLIDE 115

Scoring a Tree Using Relative Frequencies

Not all syntactic structures are equally common

19

VP S NN VBZ JJ NNS NP NP Rule frequency per 100,000 tags 19 5 18 32 4358 25372 3160 2526 1335 6679 4282 26 25 (Demo)

teacher strikes idle kids

S NP VP NP NN NN teacher VBZ strikes JJ idle NNS kids VP VBZ NP NP JJ NNS