Unit 3-2
Unit 3-2
Sudeshna Sarkar
16 AUG 2019
Parsing
• Parsing is the process of taking a string and a
grammar and returning parse tree(s) for that string
15-Aug-19
“The old dog the footsteps of the young.”
S NP VP VP V
S Aux NP VP VP -> V PP
S -> VP PP -> Prep NP
NP Det Nom N old | dog | footsteps | young
NP PropN V dog | eat | sleep | bark | meow
Nom -> Adj N Aux does | can
Nom N Prep from | to | on | of
Nom N Nom PropN Fido | Felix
Nom Nom PP Det that | this | a | the
VP V NP Adj -> old | happy| young
Parsing
• Parsing with CFGs refers to the task of assigning
proper trees to input strings
• Proper: a tree that covers all and only the elements
of the input and has an S at the top
9.12.1999 http://ufal.mff.cuni.cz/course/npfl094 5
Search Framework
• Think about parsing as a form of search…
– A search through the space of possible trees given an
input sentence and grammar
S NP VP VP V
S Aux NP VP VP -> V PP
S -> VP PP -> Prep NP
NP Det Nom N old | dog | footsteps | young
NP PropN V dog | eat | sleep | bark | meow
Nom -> Adj N Aux does | can
Nom N Prep from | to | on | of
Nom N Nom PropN Fido | Felix
Nom Nom PP Det that | this | a | the
VP V NP Adj -> old | happy| young
Bottom-Up Parsing
• Of course, we also want trees that cover the input
words. So we might also start with trees that link up
with the words in the right way.
• Then work your way up from there to larger and
larger trees.
15-Aug-19
Ambiguity
15-Aug-19
Treebanks as Grammars
• The sentences in a treebank implicitly constitute a
grammar of the language represented by the corpus
being annotated.
15-Aug-19