118
61A Lecture 35 Wednesday, December 4

61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

61A Lecture 35

Wednesday, December 4

Page 2: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

2

Page 3: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

2

Page 4: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

2

Page 5: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

2

Page 6: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

!There will be a screencast of live lecture (as always).

2

Page 7: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

!There will be a screencast of live lecture (as always).

!Screencasts: http://www.youtube.com/view_play_list?p=-XXv-cvA_iCIEwJhyDVdyLMCiimv6Tup

2

Page 8: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

!There will be a screencast of live lecture (as always).

!Screencasts: http://www.youtube.com/view_play_list?p=-XXv-cvA_iCIEwJhyDVdyLMCiimv6Tup

• Homework 12 due Tuesday 12/10 @ 11:59pm.

2

Page 9: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

!There will be a screencast of live lecture (as always).

!Screencasts: http://www.youtube.com/view_play_list?p=-XXv-cvA_iCIEwJhyDVdyLMCiimv6Tup

• Homework 12 due Tuesday 12/10 @ 11:59pm.

!All you have to do is vote on your favorite recursive art.

2

Page 10: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

!There will be a screencast of live lecture (as always).

!Screencasts: http://www.youtube.com/view_play_list?p=-XXv-cvA_iCIEwJhyDVdyLMCiimv6Tup

• Homework 12 due Tuesday 12/10 @ 11:59pm.

!All you have to do is vote on your favorite recursive art.

• 29 review sessions next week! Come learn about the topics that interest you the most.

2

Page 11: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Announcements

• Homework 11 due Thursday 12/5 @ 11:59pm.

• No video of lecture on Friday 12/6.

!Come to class and take the final survey.

!There will be a screencast of live lecture (as always).

!Screencasts: http://www.youtube.com/view_play_list?p=-XXv-cvA_iCIEwJhyDVdyLMCiimv6Tup

• Homework 12 due Tuesday 12/10 @ 11:59pm.

!All you have to do is vote on your favorite recursive art.

• 29 review sessions next week! Come learn about the topics that interest you the most.

!See http://inst.eecs.berkeley.edu/~cs61a/fa13/exams/final.html for the schedule.

2

Page 12: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Natural Language Processing

Page 13: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Page 14: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Syntactic ambiguity:

Page 15: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Syntactic ambiguity: TEACHER STRIKES IDLE KIDS

Page 16: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Syntactic ambiguity: TEACHER STRIKES IDLE KIDS HOSPITALS ARE SUED BY 7 FOOT DOCTORS

Page 17: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Syntactic ambiguity:

Semantic ambiguity:

TEACHER STRIKES IDLE KIDS HOSPITALS ARE SUED BY 7 FOOT DOCTORS

Page 18: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Syntactic ambiguity:

Semantic ambiguity: IRAQI HEAD SEEKS ARMS

TEACHER STRIKES IDLE KIDS HOSPITALS ARE SUED BY 7 FOOT DOCTORS

Page 19: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Ambiguity in Natural Language

Unlike programming languages, natural languages are ambiguous.

4

Syntactic ambiguity:

Semantic ambiguity: IRAQI HEAD SEEKS ARMS

TEACHER STRIKES IDLE KIDS HOSPITALS ARE SUED BY 7 FOOT DOCTORS

STOLEN PAINTING FOUND BY TREE

Page 20: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

5

Page 21: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

5

Page 22: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

5

Page 23: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

5

Page 24: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

Semantic Parsing. "When's my birthday?" Siri says, "Your birthday is May 1st."

5

Page 25: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

Semantic Parsing. "When's my birthday?" Siri says, "Your birthday is May 1st."

Much attention is given to more focused language analysis problems:

5

Page 26: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

Semantic Parsing. "When's my birthday?" Siri says, "Your birthday is May 1st."

Much attention is given to more focused language analysis problems:

Coreference Resolution: Do the phrases "Barack Obama" and "the president" co-refer?

5

Page 27: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

Semantic Parsing. "When's my birthday?" Siri says, "Your birthday is May 1st."

Much attention is given to more focused language analysis problems:

Coreference Resolution: Do the phrases "Barack Obama" and "the president" co-refer?

Syntactic Parsing: In "I saw the man with the telescope," who has the telescope?

5

Page 28: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

Semantic Parsing. "When's my birthday?" Siri says, "Your birthday is May 1st."

Much attention is given to more focused language analysis problems:

Coreference Resolution: Do the phrases "Barack Obama" and "the president" co-refer?

Syntactic Parsing: In "I saw the man with the telescope," who has the telescope?

Word Sense Disambiguation: Does the "bank of the Seine" have an ATM?

5

Page 29: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tasks in Natural Language Processing

Research in natural language processing (NLP) focuses on tasks that involve language:

Question answering. "Harriet Boyd Hawes was the first woman to discover and excavate a Minoan settlement on this island." Watson says, "What is Crete?"

Machine Translation. "Call a spade a spade!" Google Translate says, "Appeler un chat un chat."

Semantic Parsing. "When's my birthday?" Siri says, "Your birthday is May 1st."

Much attention is given to more focused language analysis problems:

Coreference Resolution: Do the phrases "Barack Obama" and "the president" co-refer?

Syntactic Parsing: In "I saw the man with the telescope," who has the telescope?

Word Sense Disambiguation: Does the "bank of the Seine" have an ATM?

Named-Entity Recognition: What names are in "Did van Gogh paint the Bank of the Seine?"

5

Page 30: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

Page 31: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

7

Page 32: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

Target language corpus gives examples of well-formed sentences

I will get to it later See you later He will do it

7

Page 33: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

Parallel corpus gives translation examples

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

Target language corpus gives examples of well-formed sentences

I will get to it later See you later He will do it

7

Page 34: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

Parallel corpus gives translation examples

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

Machine translation system:

Target language corpus gives examples of well-formed sentences

I will get to it later See you later He will do it

7

Page 35: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

Parallel corpus gives translation examples

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

Machine translation system:

Model of translation

Target language corpus gives examples of well-formed sentences

I will get to it later See you later He will do it

7

Page 36: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Machine Translation

I will do it later

Target language

Parallel corpus gives translation examples

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

Machine translation system:

Model of translation

Target language corpus gives examples of well-formed sentences

I will get to it later See you later He will do it

Yo lo haré despuésNOVEL SENTENCE

Source language

7

Page 37: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Agreement in Translation

VB

MD VP

VPNP

S

PRP ADV

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

PRPVB

MD VP

VPNP

S

PRP ADV

I will do it laterModel of translation

Yo lo haré después

Machine translation system:

8

Page 38: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Agreement in Translation

VB

MD VP

VPNP

S

PRP ADV

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

PRPVB

MD VP

VPNP

S

PRP ADV

I will do it laterModel of translation

Yo lo haré despuésADV ADV

Machine translation system:

8

Page 39: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Agreement in Translation

VB

MD VP

VPNP

S

PRP ADV

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

PRPVB

MD VP

VPNP

S

PRP ADV

I will do it laterModel of translation

Yo lo haré después

S SADV ADV

Machine translation system:

8

Page 40: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Agreement in Translation

VB

MD VP

VPNP

S

PRP ADV

Yo lo haré de muy buen grado

I will do it gladly

Después lo veras

You will see later

PRPVB

MD VP

VPNP

S

PRP ADV

I will do it laterModel of translation

Yo lo haré después

S SADV ADV

Machine translation system:

8

Page 41: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

Page 42: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

Page 43: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

pair

NP

S

NN

Page 44: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

pair

NP

S

NN

VP

added

VBD

Page 45: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

pair

NP

S

NN

VP

added

VBD

Page 46: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 47: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 48: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 49: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 50: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 51: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

一対 がpair

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 52: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

一対 がpair

目録list

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 53: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

一対 がpair

目録list

にto

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 54: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Syntactic Reordering in Translation

9

pair added to the lexicon

NP

PP

VP

NP

S

NN VBD TO DT NN

to

PP

TO

一対 がpair

目録list

にto

追加されましたadd was

pair

NP

S

NN

the lexicon

NP

DT NN

VP

added

VBD

Page 55: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Context-Free Grammars

Page 56: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Grammar Rules

A Context-Free Grammar Models Language Generation

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 57: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Grammar Rules

A Context-Free Grammar Models Language Generation

S

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 58: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

Grammar Rules

A Context-Free Grammar Models Language Generation

S

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 59: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

Grammar Rules

A Context-Free Grammar Models Language Generation

S

NP VP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 60: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

Grammar Rules

A Context-Free Grammar Models Language Generation

S

NP VP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 61: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

Grammar Rules

A Context-Free Grammar Models Language Generation

S

NP VP

PRP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 62: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

Grammar Rules

Lexicon

A Context-Free Grammar Models Language Generation

S

NP VP

PRP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 63: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 64: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP

I

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 65: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP

I

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 66: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP

I

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 67: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP VB NP

I

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 68: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

VB -> know

VB -> help

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP VB NP

I

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 69: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

VB -> know

VB -> help

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP VB NP

I know

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 70: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

VB -> know

VB -> help

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP VB NP

I know PRP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 71: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

PRP -> you

VB -> know

VB -> help

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP VB NP

I know PRP

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 72: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

S -> NP VP

NP -> PRP

VP -> VB

VP -> VB NP

PRP -> you

VB -> know

VB -> help

Grammar Rules

Lexicon

PRP -> I

A Context-Free Grammar Models Language Generation

S

NP VP

PRP VB NP

I know PRP

you

A grammar contains rules that hierarchically generate word sequences using syntactic tags.

11

Page 73: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VB -> know

VB -> help

Grammar Rules

Lexicon

S

NP VP

PRP

I

12

Page 74: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VB -> know

VB -> help

Grammar Rules

Lexicon

S

NP VP

PRP

I

12

Page 75: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

Grammar Rules

Lexicon

S

NP VP

PRP

I

12

Page 76: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

Grammar Rules

Lexicon

S

NP VP

PRP

I

12

Page 77: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

Grammar Rules

Lexicon

S

NP VP

PRP

I

0.2

0.7

0.1

12

Page 78: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

Grammar Rules

Lexicon

S

NP VP

PRP

I

MD VP

0.2

0.7

0.1

12

Page 79: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

MD -> can

Grammar Rules

Lexicon

S

NP VP

PRP

I

MD VP

0.2

0.7

0.1

12

Page 80: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

MD -> can

Grammar Rules

Lexicon

S

NP VP

PRP

I can

MD VP

0.2

0.7

0.1

12

Page 81: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

MD -> can

Grammar Rules

Lexicon

S

NP VP

PRP

I can

MD VP

0.2

0.7

0.1

12

Page 82: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

MD -> can

Grammar Rules

Lexicon

S

NP VP

PRP

I can

MD VP

VB NP

help

0.2

0.7

0.1

12

Page 83: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

MD -> can

Grammar Rules

Lexicon

S

NP VP

PRP

I can

MD VP

VB NP

help PRP

0.2

0.7

0.1

12

Page 84: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Probabilistic Context-Free Grammars

S -> NP VP

NP -> PRP

PRP -> I

VP -> VB

VP -> VB NP

PRP -> you

VP -> MD VP

VB -> know

VB -> help

MD -> can

Grammar Rules

Lexicon

S

NP VP

PRP

I can

MD VP

VB NP

help PRP

you

0.2

0.7

0.1

12

Page 85: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Learning Probabilistic Context-Free Grammars

(Demo)

Page 86: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing with Probabilistic Context-Free Grammars

Page 87: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

15

Page 88: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

time flies like an arrow

15

Page 89: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

time flies like an arrow

15

Page 90: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

time flies like an arrow

15

Page 91: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananastime flies like an arrow

15

Page 92: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananastime flies like an arrow

15

Page 93: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananastime flies like an arrow

15

Page 94: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow

15

Page 95: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

15

Page 96: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

15

Page 97: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

S -> NP VP

15

Page 98: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

S -> NP VP

NP -> NN

15

Page 99: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time

S -> NP VP

NP -> NN

15

Page 100: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time

S -> NP VP

NP -> NN VP -> VBZ PP

15

Page 101: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies

S -> NP VP

NP -> NN VP -> VBZ PP

15

Page 102: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies

S -> NP VP

NP -> NN VP -> VBZ PP

PP -> IN NP

15

Page 103: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies IN -> like

S -> NP VP

NP -> NN VP -> VBZ PP

PP -> IN NP

15

Page 104: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies IN -> like

S -> NP VP

NP -> NN VP -> VBZ PP

PP -> IN NP

NP -> DT NN

15

Page 105: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies IN -> like DT -> an

S -> NP VP

NP -> NN VP -> VBZ PP

PP -> IN NP

NP -> DT NN

15

Page 106: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies IN -> like DT -> an NN -> arrow

S -> NP VP

NP -> NN VP -> VBZ PP

PP -> IN NP

NP -> DT NN

15

Page 107: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Parsing is Maximizing Likelihood

A probabilistic context-free grammar can be used to select a parse for a sentence.

fruit flies like bananas

Parse by finding the tree with the highest total probability that yields the sentence.

time flies like an arrow0 1 2 3 4 5

time flies like an arrow

Algorithm: Try every rule over every span. Match the lexicon to each word.

NN -> time VBZ -> flies IN -> like DT -> an NN -> arrow

S -> NP VP

NP -> NN VP -> VBZ PP

PP -> IN NP

NP -> DT NN

(Demo)

15

Page 108: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Tree Transformations

Page 109: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

17

Page 110: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English

17

Page 111: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English

17

Page 112: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

17

Page 113: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

When 900 years old you reach, look as good, you will not. Hm.

17

Page 114: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

When 900 years old you reach, look as good, you will not. Hm.

S

NP VP

PRP

I can

MD VP

VB PRP

help you

17

Page 115: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

When 900 years old you reach, look as good, you will not. Hm.

S

NP VP

PRP

I can

MD VP

VB PRP

help you

17

Page 116: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

When 900 years old you reach, look as good, you will not. Hm.

S

NP VP

PRP

I can

MDVB PRP

help you

VP

17

Page 117: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

When 900 years old you reach, look as good, you will not. Hm.

S

NP VP

PRP

I can

MDVB PRP

help you

VP .

,

17

Page 118: 61A Lecture 35 - wla.berkeley.eduwla.berkeley.edu/~cs61a/fa13/slides/35-NLP_1pp.pdf · Announcements •Homework 11 due Thursday 12/5 @ 11:59pm. •No video of lecture on Friday 12/6.!Come

Reordering Modal Arguments

English Yoda-English Help you, I can! Yes! Mm!

When 900 years old you reach, look as good, you will not. Hm.

S

NP VP

PRP

I can

MDVB PRP

help you

VP .

,

(Demo)

17