cs 544 nlp spring 2011 - isinlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · cs 544 nlp...
TRANSCRIPT
![Page 1: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/1.jpg)
CS 544 NLPSpring 2011
Syntax and Parsing
Dirk Hovy1-13-2011
(some slides from Liang Huang)
S → NP VP
1Freitag, 14. Januar 2011
![Page 2: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/2.jpg)
CS 544 NLPSpring 2011
Syntax and Parsing
Dirk Hovy1-13-2011
(some slides from Liang Huang)
S → NP VP
1Freitag, 14. Januar 2011
![Page 3: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/3.jpg)
CS 544 NLPSpring 2011
Syntax and Parsing
Dirk Hovy1-13-2011
(some slides from Liang Huang)
S → NP VP
1Freitag, 14. Januar 2011
![Page 4: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/4.jpg)
What’s wrong here?
hovercraft full my is eels of
2Freitag, 14. Januar 2011
![Page 5: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/5.jpg)
What’s wrong here?
my hovercraft is full of eels
3Freitag, 14. Januar 2011
![Page 6: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/6.jpg)
Order, please!
• some orders are grammatical, others not
*hovercraft full my is eels ofvs.
my hovercraft is full of eels
4Freitag, 14. Januar 2011
![Page 7: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/7.jpg)
Order, please!
• some orders are grammatical, others not
*hovercraft full my is eels ofvs.
my hovercraft is full of eels
ungrammatical sentences are marked with a *
4Freitag, 14. Januar 2011
![Page 8: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/8.jpg)
Syntax
• study of word order
• one of fundamental levels of language (phonetics/phonology, morphology, syntax, semantics, pragmatics)
• has to do with trees…
• Chomsky says: independent of meaning!Colorless green ideas sleep furiously
5Freitag, 14. Januar 2011
![Page 9: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/9.jpg)
Sentence elements
• [my hovercraft] [is full of eels][it] [is full of eels][my air-powered aquatic vehicle] [is full of eels][my hovercraft] [sank]
• we can exchange certain elements: phrases (or constituents)
6Freitag, 14. Januar 2011
![Page 10: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/10.jpg)
How to spot phrases from a large distance
• substitution:it is full of eels {it = my hovercraft}
• deletion (produces nonsense):*Ø is full of eels
7Freitag, 14. Januar 2011
![Page 11: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/11.jpg)
Recurring structures
• substitution shows: many sentences have the same structure
• pick any two to make a sentence:
my hovercraftDennis Moore
a man with three buttocks
is full of eelshas a brotherowns a shack
is huge
8Freitag, 14. Januar 2011
![Page 12: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/12.jpg)
Recurring structures
• substitution shows: many sentences have the same structure
• pick any two to make a sentence:
my hovercraftDennis Moore
a man with three buttocks
is full of eelshas a brotherowns a shack
is huge
Noun
phrases
8Freitag, 14. Januar 2011
![Page 13: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/13.jpg)
Recurring structures
• substitution shows: many sentences have the same structure
• pick any two to make a sentence:
my hovercraftDennis Moore
a man with three buttocks
is full of eelshas a brotherowns a shack
is huge
Noun
phrasesVerb
phrases
8Freitag, 14. Januar 2011
![Page 14: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/14.jpg)
CS 544 - Syntax and Parsing
Context-Free Grammars
• S ! NP VP
• NP ! Det N
• NP ! NP PP
•PP ! P NP
•VP ! V NP
•VP ! VP PP
• ...
20
• N ! {ball, garden, house, sushi }
• P ! {in, behind, with}
• V ! ...
• Det ! ...
slide by Liang Huang
9Freitag, 14. Januar 2011
![Page 15: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/15.jpg)
CS 544 - Syntax and Parsing
Context-Free Grammars
• S ! NP VP
• NP ! Det N
• NP ! NP PP
•PP ! P NP
•VP ! V NP
•VP ! VP PP
• ...
20
• N ! {ball, garden, house, sushi }
• P ! {in, behind, with}
• V ! ...
• Det ! ...
slide by Liang Huang
most famous rule in linguistics ever…
9Freitag, 14. Januar 2011
![Page 16: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/16.jpg)
CS 544 - Syntax and Parsing
Context-Free Grammars
21
A CFG is a 4-tuple〈N,!,R,S〉 A set of nonterminals N
(e.g. N = {S, NP, VP, PP, Noun, Verb, ....})
A set of terminals !
(e.g. ! = {I, you, he, eat, drink, sushi, ball, })
A set of rules R
R ! {A ! " with left-hand-side (LHS)" A " N
and right-hand-side (RHS) " " (N # !)* }
A start symbol S (sentence)
slide by Liang Huang
10Freitag, 14. Januar 2011
![Page 17: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/17.jpg)
CS 544 - Syntax and Parsing
Parse Trees
• N ! {sushi, tuna}
• P ! {with}
• V ! {eat}
• NP ! N
• NP ! NP PP
• PP!P NP
• VP!V NP
• VP!VP PP
22
slide by Liang Huang
11Freitag, 14. Januar 2011
![Page 18: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/18.jpg)
CS 544 - Syntax and Parsing
Parse Trees
• N ! {sushi, tuna}
• P ! {with}
• V ! {eat}
• NP ! N
• NP ! NP PP
• PP!P NP
• VP!V NP
• VP!VP PP
22
slide by Liang Huang
terminals
11Freitag, 14. Januar 2011
![Page 19: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/19.jpg)
CS 544 - Syntax and Parsing
Parse Trees
• N ! {sushi, tuna}
• P ! {with}
• V ! {eat}
• NP ! N
• NP ! NP PP
• PP!P NP
• VP!V NP
• VP!VP PP
22
slide by Liang Huang
terminalspre-terminals
11Freitag, 14. Januar 2011
![Page 20: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/20.jpg)
CS 544 - Syntax and Parsing
Parse Trees
• N ! {sushi, tuna}
• P ! {with}
• V ! {eat}
• NP ! N
• NP ! NP PP
• PP!P NP
• VP!V NP
• VP!VP PP
22
slide by Liang Huang
terminalspre-terminals
non-terminals
11Freitag, 14. Januar 2011
![Page 21: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/21.jpg)
Grammaticality
• a sentence is grammatical if there is an acceptor for it
DT ADJ NN>
12Freitag, 14. Januar 2011
![Page 22: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/22.jpg)
Generate from CFGs
initialize stack with Swhile stack not empty:
x = stack.pop()if x ∈ terminals:
print xelse if x ∈ rule:
stack.push(y in RHS for selected x → RHS)
13Freitag, 14. Januar 2011
![Page 23: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/23.jpg)
Parsing
• find a path b/w root node S and terminals
• recursively apply CFG rules
• glorified search
• options:
• direction: top-down, bottom-up
• expansion: breadth-first, depth-first, bidirectional
14Freitag, 14. Januar 2011
![Page 24: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/24.jpg)
Probabilistic parsing
• some rules are more likely than others:N → dog, 0.9V → dog, 0.1
• use probabilities to decide best path
15Freitag, 14. Januar 2011
![Page 25: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/25.jpg)
Playtime
• Given the following CFG, how many parses exists for the rose rose rose?
• S→NP• S →NP VP• NP → DT NP2• NP2 →JJ NP2• NP2 →N N• NP2 →N • VP→V• V →rose• N → rose• JJ →rose
16Freitag, 14. Januar 2011
![Page 26: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/26.jpg)
CS 544 - Syntax and Parsing
Ambiguity Explosion by Recursion
• how about...
• I saw her duck with a telescope.
• I saw her duck with a telescope in the garden...9
...
I saw her duck.
slide by Liang Huang
17Freitag, 14. Januar 2011
![Page 27: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/27.jpg)
Why do we care?
• parsing first step for most NLP tasks (MT, IE, IR, etc.)
• disambiguate
• find certain structures (noun phrases = chunking)
• find syntactically related words
18Freitag, 14. Januar 2011
![Page 28: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/28.jpg)
Other parsing• dependency parsing: instead of
constituents, find grammatical relations
Steve/NNP
Young/NNP
throw/VBD
pass/NN
a/DT
to/TO
Michael/NNP
Holt/NNP
nsubj
dobj
prep
nn
nn
pobjdet
• depends on verb
• adds information
• less readable
Steve Young threw a pass to Michael Holt
19Freitag, 14. Januar 2011
![Page 29: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/29.jpg)
CS 544 - Syntax and Parsing
Chomsky Hierarchy
24CS 498 JH: Introduction to NLP (Fall ’08)
computer science and linguistics share the same mathematical foundations.
slide by Liang Huang
20Freitag, 14. Januar 2011
![Page 30: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/30.jpg)
In sum: Syntax
21Freitag, 14. Januar 2011
![Page 31: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/31.jpg)
In sum: Syntax
• syntax = study of word order
21Freitag, 14. Januar 2011
![Page 32: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/32.jpg)
In sum: Syntax
• syntax = study of word order
• sentences consist of phrases (constituents)
I fart [in your general direction][on Sundays]
[with pleasure]
21Freitag, 14. Januar 2011
![Page 33: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/33.jpg)
In sum: Syntax
• syntax = study of word order
• sentences consist of phrases (constituents)
• substitution can determine constituents
I fart [in your general direction][on Sundays]
[with pleasure]
21Freitag, 14. Januar 2011
![Page 34: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/34.jpg)
In sum: Syntax
• syntax = study of word order
• sentences consist of phrases (constituents)
• substitution can determine constituents
• CFGs capture syntax rules
S → NP VP
21Freitag, 14. Januar 2011
![Page 35: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/35.jpg)
In sum: Syntax
• syntax = study of word order
• sentences consist of phrases (constituents)
• substitution can determine constituents
• CFGs capture syntax rules
• syntax rules are recursive
S → NP VPNP → DT N
21Freitag, 14. Januar 2011
![Page 36: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/36.jpg)
In sum: Syntax
• syntax = study of word order
• sentences consist of phrases (constituents)
• substitution can determine constituents
• CFGs capture syntax rules
• syntax rules are recursive
21Freitag, 14. Januar 2011
![Page 37: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/37.jpg)
In sum: Parsing
22Freitag, 14. Januar 2011
![Page 38: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/38.jpg)
In sum: Parsing
• parsers find rule structure of sentence
22Freitag, 14. Januar 2011
![Page 39: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/39.jpg)
In sum: Parsing
• parsers find rule structure of sentence
• different strategies for search
22Freitag, 14. Januar 2011
![Page 40: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/40.jpg)
In sum: Parsing
• parsers find rule structure of sentence
• different strategies for search
• path b/w root and terminals
22Freitag, 14. Januar 2011
![Page 41: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/41.jpg)
In sum: Parsing
• parsers find rule structure of sentence
• different strategies for search
• path b/w root and terminals
• language is ambiguous
22Freitag, 14. Januar 2011
![Page 42: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/42.jpg)
In sum: Parsing
• parsers find rule structure of sentence
• different strategies for search
• path b/w root and terminals
• language is ambiguous
• parse trees are unambiguous
22Freitag, 14. Januar 2011
![Page 43: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/43.jpg)
In sum: Parsing
• parsers find rule structure of sentence
• different strategies for search
• path b/w root and terminals
• language is ambiguous
• parse trees are unambiguous
• used to find structure, constituents, disambiguate words
22Freitag, 14. Januar 2011
![Page 44: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/44.jpg)
If you learned nothing else:
• S → NP VP
• parsing is search
23Freitag, 14. Januar 2011
![Page 45: CS 544 NLP Spring 2011 - ISInlg.isi.edu/teaching/cs544/spring11/dirk-syntax.pdf · CS 544 NLP Spring 2011 Syntax and Parsing Dirk Hovy 1-13-2011 (some slides from Liang Huang) S →](https://reader030.vdocuments.us/reader030/viewer/2022040302/5e7c1031bfb4ed16be0084ae/html5/thumbnails/45.jpg)
ask now or enjoy your afternoon…
24Freitag, 14. Januar 2011