SlideShare a Scribd company logo
Probabilistic Parsing
Chapter 14, Part 2
•This slide set was adapted from J. Martin, R. Mihalcea, Rebecca Hwa, and Ray
Mooney
2
Vanilla PCFG Limitations
• Since probabilities of productions do not rely on
specific words or concepts, only general structural
disambiguation is possible (e.g. prefer to attach
PPs to Nominals).
• Consequently, vanilla PCFGs cannot resolve
syntactic ambiguities that require semantics to
resolve, e.g. ate with fork vs. meatballs.
• In order to work well, PCFGs must be lexicalized,
Example of Importance of Lexicalization
• A general preference for attaching PPs to NPs
rather than VPs can be learned by a vanilla PCFG.
• But the desired preference can depend on specific
words.
3
S → NP VP
S → VP
NP → Det A N
NP → NP PP
NP → PropN
A → ε
A → Adj A
PP → Prep NP
VP → V NP
VP → VP PP
0.9
0.1
0.5
0.3
0.2
0.6
0.4
1.0
0.7
0.3
English
PCFG
Parser
S
NP VP
John V NP PP
put the dog in the pen
John put the dog in the pen.
3
4
Example of Importance of Lexicalization
• A general preference for attaching PPs to NPs
rather than VPs can be learned by a vanilla PCFG.
• But the desired preference can depend on specific
words.
S → NP VP
S → VP
NP → Det A N
NP → NP PP
NP → PropN
A → ε
A → Adj A
PP → Prep NP
VP → V NP
VP → VP PP
0.9
0.1
0.5
0.3
0.2
0.6
0.4
1.0
0.7
0.3
English
PCFG
Parser
S
NP VP
John V NP
put the dog in the pen
X
John put the dog in the pen.
4
5
Head Words
• Syntactic phrases usually have a word in them that
is most “central” to the phrase.
• Linguists have defined the concept of a lexical
head of a phrase.
• Simple rules can identify the head of any phrase
by percolating head words up the parse tree.
– Head of a VP is the main verb
– Head of an NP is the main noun
– Head of a PP is the preposition
– Head of a sentence is the head of its VP
6
Head propagation in parse trees
VP (bought)
bought
NP (book)
the
NN (book)
book
S (bought)
the
NN (man)
man DT (the)
V (bought)DT (the)
NP (man)
7
Lexicalized Productions
• Specialized productions can be generated by
including the head word and its POS of each non-
terminal as part of that non-terminal’s symbol.
S
VP
VBD NP
DT Nominal
Nominal PP
liked
IN NP
in
the
dog
NN
DT Nominal
NNthe
pen
NNP
NP
John
pen-NN
pen-NN
in-IN
dog-NN
dog-NN
dog-NN
liked-VBD
liked-VBD
John-NNP
Nominaldog-NN → Nominaldog-NN PPin-IN
8
Lexicalized Productions
S
VP
VP PP
DT Nominalput
IN NP
in
the
dog
NN
DT Nominal
NNthe
pen
NNP
NP
John
pen-NN
pen-NN
in-IN
dog-NN
dog-NN
put-VBD
put-VBD
John-NNP
NPVBD
put-VBD
VPput-VBD → VPput-VBD PPin-IN
9
Parameters
• We used to have
– VP -> V NP PP P(r|VP)
• That’s the count of this rule divided by the number
of VPs in a treebank
• Now we have
– VP(dumped-VBD)-> V(dumped-VBD) NP(sacks-NNS)PP(into-P)
– P(r where dumped is the verb ^ sacks is the head of the NP ^ into is the head of the
PP|VP whose head is dumped-VBD)
– Not likely to have significant counts in any
treebank
10
Challenges for Probabilistic Lexicalized
Grammar
• Huge number of rules
• Most rules are too specific, so it is hard to make good
probability estimates for them
• Need to make more manageable independence
assumptions
• Many approaches have been developed; We’ll look at one
(simplified version)
11
Collins Parser [1997]
• Replaces production rules with a model of
bilexical relationships
• Focus on head and dependency relationship
(see notes in lecture)
• Generate parses in smaller steps; generate
the head, then generate siblings assuming
they are conditionally independent given
the head
12
Dependency Representation
• Represented as an 8 tuple:
(head word, head tag, modifier word, modifier tag,
parent non-terminal, head non-terminal,
modifier non-terminal, direction)
Example CFG rule:
VP(bought, VBD)  V(bought, VBD) NP(book,NN) PP(with,Prep)
Decomposes into two dependencies
(bought, VBD, book, NN, VP, V, NP, right)
(bought, VBD, with, Prep, VP, V, PP, right)
13
Collins: (see lecture)
VP(bought, VBD)  V(bought, VBD) NP(book,NN) PP(with,Prep)
(head word, head tag, modifier word, modifier tag,parent non-terminal, head non-
terminal, modifier non-terminal, direction)
1. Prhead(headNT| parentNT, headword, headtag)x
2. Prleft(modNT, modword, modtag | parentNT, headNT, headword, headtag) x … x
3. Prleft(STOP| parentNT, headNT, headword, headtag)x
4. Prright(modNT, modword, modtag | parentNT, headNT, headword, headtag) x … x
5. Prright(STOP| parentNT, headNT, headword, headtag)
6. Prhead(V| VP, bought, VBD) x
7. Prleft(STOP| VP, V, bought, VBD)x
8. Prright(NP, book, NN | VP, V, bought, VBD) x
9. Prright(PP, with, Prep | VP, V, bought, VBD) x
10. Prright(STOP| VP, V, bought, VBD)
14
Estimating Production Generation Parameters
• Smooth estimates by linearly interpolating with
simpler models conditioned on just POS tag or no
lexical info. Using the version in the text:
smPR(PPin-IN | VPput-VBD) = λ1 PR(PPin-IN | VPput-VBD)
+ (1− λ1) (λ2 PR(PPin-IN | VPVBD) +
(1− λ2) PR(PPin-IN | VP))
15
Missed Context Dependence
• Another problem with CFGs is that which
production is used to expand a non-terminal
is independent of its context.
• However, this independence is frequently
violated for normal grammars.
– NPs that are subjects are more likely to be
pronouns than NPs that are objects.
16
Splitting Non-Terminals
• To provide more contextual information,
non-terminals can be split into multiple new
non-terminals based on their parent in the
parse tree using parent annotation.
– A subject NP becomes NP^S since its parent
node is an S.
– An object NP becomes NP^VP since its parent
node is a VP
17
Parent Annotation Example
18
S
VP
VBD NP
DT Nominal
Nominal PP
liked
IN NP
in
the
dog
NN
DT Nominal
NNthe
pen
NNP
NP
John
^NP
^PP
^Nominal
^Nominal
^NP
^VP
^S^S
^Nominal
^NP
^PP
^Nominal
^NP
^VP^NP
VP^S → VBD^VP NP^VP
Split and Merge
• Non-terminal splitting greatly increases the size of
the grammar and the number of parameters that need
to be learned from limited training data.
• Best approach is to only split non-terminals when it
improves the accuracy of the grammar.
• May also help to merge some non-terminals to
remove some un-helpful distinctions and learn more
accurate parameters for the merged productions.
• Method: Heuristically search for a combination of
splits and merges that produces a grammar that
maximizes the likelihood of the training treebank.
19
20
Treebanks
• English Penn Treebank: Standard corpus for
testing syntactic parsing consists of 1.2 M words
of text from the Wall Street Journal (WSJ).
• Typical to train on about 40,000 parsed sentences
and test on an additional standard disjoint test set
of 2,416 sentences.
• Chinese Penn Treebank: 100K words from the
Xinhua news service.
• Other corpora existing in many languages, see the
Wikipedia article “Treebank”
First WSJ Sentence
21
( (S
(NP-SBJ
(NP (NNP Pierre) (NNP Vinken) )
(, ,)
(ADJP
(NP (CD 61) (NNS years) )
(JJ old) )
(, ,) )
(VP (MD will)
(VP (VB join)
(NP (DT the) (NN board) )
(PP-CLR (IN as)
(NP (DT a) (JJ nonexecutive) (NN director) ))
(NP-TMP (NNP Nov.) (CD 29) )))
(. .) ))
WSJ Sentence with Trace (NONE)
22
( (S
(NP-SBJ (DT The) (NNP Illinois) (NNP Supreme) (NNP Court) )
(VP (VBD ordered)
(NP-1 (DT the) (NN commission) )
(S
(NP-SBJ (-NONE- *-1) )
(VP (TO to)
(VP
(VP (VB audit)
(NP
(NP (NNP Commonwealth) (NNP Edison) (POS 's) )
(NN construction) (NNS expenses) ))
(CC and)
(VP (VB refund)
(NP (DT any) (JJ unreasonable) (NNS expenses) ))))))
(. .) ))
23
Parsing Evaluation Metrics
• PARSEVAL metrics measure the fraction of the
constituents that match between the computed and
human parse trees. If P is the system’s parse tree and T
is the human parse tree (the “gold standard”):
– Recall = (# correct constituents in P) / (# constituents in T)
– Precision = (# correct constituents in P) / (# constituents in P)
• Labeled Precision and labeled recall require getting the
non-terminal label on the constituent node correct to
count as correct.
• F1 is the harmonic mean of precision and recall.
Computing Evaluation Metrics
Correct Tree T
S
VP
Verb NP
Det Nominal
Nominal PP
book
Prep NP
through
Houston
Proper-Noun
the
flight
Noun
Computed Tree P
VP
Verb NP
Det Nominalbook
Prep NP
through
Houston
Proper-Noun
the
flight
Noun
S
VP
PP
# Constituents: 12 # Constituents: 12
# Correct Constituents: 10
Recall = 10/12= 83.3% Precision = 10/12=83.3% F1 = 83.3%
24
25
Treebank Results
• Results of current state-of-the-art systems on the
English Penn WSJ treebank are slightly greater than
90% labeled precision and recall.
Discriminative Parse Reranking
• Motivation: Even when the top-ranked
parse not correct, frequently the correct
parse is one of those ranked highly by a
statistical parser.
• Use a classifier that is trained to select the
best parse from the N-best parses produced
by the original parser.
• Reranker can exploit global features of the
entire parse whereas a PCFG is restricted to
making decisions based on local info. 26
2-Stage Reranking Approach
• Adapt the PCFG parser to produce an N-
best list of the most probable parses in
addition to the most-likely one.
• Extract from each of these parses, a set of
global features that help determine if it is a
good parse tree.
• Train a classifier (e.g. logistic regression)
using the best parse in each N-best list as
positive and others as negative.
27
Parse Reranking
28
sentence
N-Best
Parse Trees
PCFG Parser
Parse Tree
Feature
Extractor
Parse Tree
Descriptions
Parse Tree
ClassifierBest
Parse
Tree
Sample Parse Tree Features
• Probability of the parse from the PCFG.
• The number of parallel conjuncts.
– “the bird in the tree and the squirrel on the ground”
– “the bird and the squirrel in the tree”
• The degree to which the parse tree is right branching.
– English parses tend to be right branching (cf. parse of
“Book the flight through Houston”)
• Frequency of various tree fragments, i.e. specific
combinations of 2 or 3 rules.
29
Evaluation of Reranking
• Reranking is limited by oracle accuracy,
i.e. the accuracy that results when an
omniscient oracle picks the best parse from
the N-best list.
• Typical current oracle accuracy is around
F1=97%
• Reranking can generally improve test
accuracy of current PCFG models a
percentage point or two.
30
Dependency Grammars
• An alternative to phrase-structure grammar is to
define a parse as a directed graph between the
words of a sentence representing dependencies
between the words.
31
liked
John dog
pen
inthe
the
liked
John dog
pen
in
the
the
nsubj dobj
det
det
Typed
dependency
parse
Dependency Graph from Parse Tree
• Can convert a phrase structure parse to a dependency
tree by making the head of each non-head child of a
node depend on the head of the head child.
32
S
VP
VBD NP
DT Nominal
Nominal PP
liked
IN NP
in
the
dog
NN
DT Nominal
NNthe
pen
NNP
NP
John
pen-NN
pen-NN
in-IN
dog-NN
dog-NN
dog-NN
liked-VBD
liked-VBD
John-NNP
liked
John dog
pen
inthe
the
Statistical Parsing Conclusions
• Statistical models such as PCFGs allow for
probabilistic resolution of ambiguities.
• PCFGs can be easily learned from treebanks.
• Lexicalization and non-terminal splitting are
required to effectively resolve many
ambiguities.
• Current statistical parsers are quite accurate but
not yet at the level of human-expert agreement.
33

More Related Content

PDF
The CLEAR Dependency
PPTX
Pptphrase tagset mapping for french and english treebanks and its application...
PPT
SLoSP-2007-1statisticalstatisticalstatistical.ppt
PPT
SLoSP-2007-1 natural language processing.ppt
PPT
stats-parsing.ppt
PPT
stats-parsing.ppt
PPTX
NLP_KASHK:Parsing with Context-Free Grammar
PPT
unit -3 part 1.ppt
The CLEAR Dependency
Pptphrase tagset mapping for french and english treebanks and its application...
SLoSP-2007-1statisticalstatisticalstatistical.ppt
SLoSP-2007-1 natural language processing.ppt
stats-parsing.ppt
stats-parsing.ppt
NLP_KASHK:Parsing with Context-Free Grammar
unit -3 part 1.ppt

Similar to Chapter14part2 (20)

PDF
CFG Parsing
PDF
Adnan: Introduction to Natural Language Processing
PPTX
computerdictionariesandparsingppt-201216152127.pptx
PPTX
Natural Language parsing.pptx
PDF
Implementation Of Syntax Parser For English Language Using Grammar Rules
PDF
Ay34306312
PDF
Lecture: Context-Free Grammars
PPT
PPT
grammer
PPT
Natural Language Processing 9th Chapter.ppt
PPTX
gdhfjdhjcbdjhvjhdshbajhbvdjbklcbdsjhbvjhsdbvjjv
PDF
Natural Language Processing Course in AI
PDF
Natural Language Processing basics presentation
PPTX
5. Syntacticfffgffg analysis-Parsing.pptx
PPTX
Dhdhddhd5. Syntactic analysis-Parsing.pptx
PPTX
Types of parsers
PPTX
Unit II Natural Language Processing.pptx
PDF
CS571: Tree Adjoining Grammar
PPT
Moore_slides.ppt
PPT
Ch2 (1).ppt
CFG Parsing
Adnan: Introduction to Natural Language Processing
computerdictionariesandparsingppt-201216152127.pptx
Natural Language parsing.pptx
Implementation Of Syntax Parser For English Language Using Grammar Rules
Ay34306312
Lecture: Context-Free Grammars
grammer
Natural Language Processing 9th Chapter.ppt
gdhfjdhjcbdjhvjhdshbajhbvdjbklcbdsjhbvjhsdbvjjv
Natural Language Processing Course in AI
Natural Language Processing basics presentation
5. Syntacticfffgffg analysis-Parsing.pptx
Dhdhddhd5. Syntactic analysis-Parsing.pptx
Types of parsers
Unit II Natural Language Processing.pptx
CS571: Tree Adjoining Grammar
Moore_slides.ppt
Ch2 (1).ppt
Ad

Recently uploaded (20)

PPTX
Microbiology with diagram medical studies .pptx
PDF
The scientific heritage No 166 (166) (2025)
PDF
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PPTX
neck nodes and dissection types and lymph nodes levels
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
DOCX
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
PPTX
2. Earth - The Living Planet earth and life
PDF
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PPT
6.1 High Risk New Born. Padetric health ppt
PPTX
famous lake in india and its disturibution and importance
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PPTX
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PDF
HPLC-PPT.docx high performance liquid chromatography
PPTX
ECG_Course_Presentation د.محمد صقران ppt
Microbiology with diagram medical studies .pptx
The scientific heritage No 166 (166) (2025)
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
POSITIONING IN OPERATION THEATRE ROOM.ppt
neck nodes and dissection types and lymph nodes levels
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
7. General Toxicologyfor clinical phrmacy.pptx
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
2. Earth - The Living Planet earth and life
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
Phytochemical Investigation of Miliusa longipes.pdf
6.1 High Risk New Born. Padetric health ppt
famous lake in india and its disturibution and importance
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
HPLC-PPT.docx high performance liquid chromatography
ECG_Course_Presentation د.محمد صقران ppt
Ad

Chapter14part2

  • 1. Probabilistic Parsing Chapter 14, Part 2 •This slide set was adapted from J. Martin, R. Mihalcea, Rebecca Hwa, and Ray Mooney
  • 2. 2 Vanilla PCFG Limitations • Since probabilities of productions do not rely on specific words or concepts, only general structural disambiguation is possible (e.g. prefer to attach PPs to Nominals). • Consequently, vanilla PCFGs cannot resolve syntactic ambiguities that require semantics to resolve, e.g. ate with fork vs. meatballs. • In order to work well, PCFGs must be lexicalized,
  • 3. Example of Importance of Lexicalization • A general preference for attaching PPs to NPs rather than VPs can be learned by a vanilla PCFG. • But the desired preference can depend on specific words. 3 S → NP VP S → VP NP → Det A N NP → NP PP NP → PropN A → ε A → Adj A PP → Prep NP VP → V NP VP → VP PP 0.9 0.1 0.5 0.3 0.2 0.6 0.4 1.0 0.7 0.3 English PCFG Parser S NP VP John V NP PP put the dog in the pen John put the dog in the pen. 3
  • 4. 4 Example of Importance of Lexicalization • A general preference for attaching PPs to NPs rather than VPs can be learned by a vanilla PCFG. • But the desired preference can depend on specific words. S → NP VP S → VP NP → Det A N NP → NP PP NP → PropN A → ε A → Adj A PP → Prep NP VP → V NP VP → VP PP 0.9 0.1 0.5 0.3 0.2 0.6 0.4 1.0 0.7 0.3 English PCFG Parser S NP VP John V NP put the dog in the pen X John put the dog in the pen. 4
  • 5. 5
  • 6. Head Words • Syntactic phrases usually have a word in them that is most “central” to the phrase. • Linguists have defined the concept of a lexical head of a phrase. • Simple rules can identify the head of any phrase by percolating head words up the parse tree. – Head of a VP is the main verb – Head of an NP is the main noun – Head of a PP is the preposition – Head of a sentence is the head of its VP 6
  • 7. Head propagation in parse trees VP (bought) bought NP (book) the NN (book) book S (bought) the NN (man) man DT (the) V (bought)DT (the) NP (man) 7
  • 8. Lexicalized Productions • Specialized productions can be generated by including the head word and its POS of each non- terminal as part of that non-terminal’s symbol. S VP VBD NP DT Nominal Nominal PP liked IN NP in the dog NN DT Nominal NNthe pen NNP NP John pen-NN pen-NN in-IN dog-NN dog-NN dog-NN liked-VBD liked-VBD John-NNP Nominaldog-NN → Nominaldog-NN PPin-IN 8
  • 9. Lexicalized Productions S VP VP PP DT Nominalput IN NP in the dog NN DT Nominal NNthe pen NNP NP John pen-NN pen-NN in-IN dog-NN dog-NN put-VBD put-VBD John-NNP NPVBD put-VBD VPput-VBD → VPput-VBD PPin-IN 9
  • 10. Parameters • We used to have – VP -> V NP PP P(r|VP) • That’s the count of this rule divided by the number of VPs in a treebank • Now we have – VP(dumped-VBD)-> V(dumped-VBD) NP(sacks-NNS)PP(into-P) – P(r where dumped is the verb ^ sacks is the head of the NP ^ into is the head of the PP|VP whose head is dumped-VBD) – Not likely to have significant counts in any treebank 10
  • 11. Challenges for Probabilistic Lexicalized Grammar • Huge number of rules • Most rules are too specific, so it is hard to make good probability estimates for them • Need to make more manageable independence assumptions • Many approaches have been developed; We’ll look at one (simplified version) 11
  • 12. Collins Parser [1997] • Replaces production rules with a model of bilexical relationships • Focus on head and dependency relationship (see notes in lecture) • Generate parses in smaller steps; generate the head, then generate siblings assuming they are conditionally independent given the head 12
  • 13. Dependency Representation • Represented as an 8 tuple: (head word, head tag, modifier word, modifier tag, parent non-terminal, head non-terminal, modifier non-terminal, direction) Example CFG rule: VP(bought, VBD)  V(bought, VBD) NP(book,NN) PP(with,Prep) Decomposes into two dependencies (bought, VBD, book, NN, VP, V, NP, right) (bought, VBD, with, Prep, VP, V, PP, right) 13
  • 14. Collins: (see lecture) VP(bought, VBD)  V(bought, VBD) NP(book,NN) PP(with,Prep) (head word, head tag, modifier word, modifier tag,parent non-terminal, head non- terminal, modifier non-terminal, direction) 1. Prhead(headNT| parentNT, headword, headtag)x 2. Prleft(modNT, modword, modtag | parentNT, headNT, headword, headtag) x … x 3. Prleft(STOP| parentNT, headNT, headword, headtag)x 4. Prright(modNT, modword, modtag | parentNT, headNT, headword, headtag) x … x 5. Prright(STOP| parentNT, headNT, headword, headtag) 6. Prhead(V| VP, bought, VBD) x 7. Prleft(STOP| VP, V, bought, VBD)x 8. Prright(NP, book, NN | VP, V, bought, VBD) x 9. Prright(PP, with, Prep | VP, V, bought, VBD) x 10. Prright(STOP| VP, V, bought, VBD) 14
  • 15. Estimating Production Generation Parameters • Smooth estimates by linearly interpolating with simpler models conditioned on just POS tag or no lexical info. Using the version in the text: smPR(PPin-IN | VPput-VBD) = λ1 PR(PPin-IN | VPput-VBD) + (1− λ1) (λ2 PR(PPin-IN | VPVBD) + (1− λ2) PR(PPin-IN | VP)) 15
  • 16. Missed Context Dependence • Another problem with CFGs is that which production is used to expand a non-terminal is independent of its context. • However, this independence is frequently violated for normal grammars. – NPs that are subjects are more likely to be pronouns than NPs that are objects. 16
  • 17. Splitting Non-Terminals • To provide more contextual information, non-terminals can be split into multiple new non-terminals based on their parent in the parse tree using parent annotation. – A subject NP becomes NP^S since its parent node is an S. – An object NP becomes NP^VP since its parent node is a VP 17
  • 18. Parent Annotation Example 18 S VP VBD NP DT Nominal Nominal PP liked IN NP in the dog NN DT Nominal NNthe pen NNP NP John ^NP ^PP ^Nominal ^Nominal ^NP ^VP ^S^S ^Nominal ^NP ^PP ^Nominal ^NP ^VP^NP VP^S → VBD^VP NP^VP
  • 19. Split and Merge • Non-terminal splitting greatly increases the size of the grammar and the number of parameters that need to be learned from limited training data. • Best approach is to only split non-terminals when it improves the accuracy of the grammar. • May also help to merge some non-terminals to remove some un-helpful distinctions and learn more accurate parameters for the merged productions. • Method: Heuristically search for a combination of splits and merges that produces a grammar that maximizes the likelihood of the training treebank. 19
  • 20. 20 Treebanks • English Penn Treebank: Standard corpus for testing syntactic parsing consists of 1.2 M words of text from the Wall Street Journal (WSJ). • Typical to train on about 40,000 parsed sentences and test on an additional standard disjoint test set of 2,416 sentences. • Chinese Penn Treebank: 100K words from the Xinhua news service. • Other corpora existing in many languages, see the Wikipedia article “Treebank”
  • 21. First WSJ Sentence 21 ( (S (NP-SBJ (NP (NNP Pierre) (NNP Vinken) ) (, ,) (ADJP (NP (CD 61) (NNS years) ) (JJ old) ) (, ,) ) (VP (MD will) (VP (VB join) (NP (DT the) (NN board) ) (PP-CLR (IN as) (NP (DT a) (JJ nonexecutive) (NN director) )) (NP-TMP (NNP Nov.) (CD 29) ))) (. .) ))
  • 22. WSJ Sentence with Trace (NONE) 22 ( (S (NP-SBJ (DT The) (NNP Illinois) (NNP Supreme) (NNP Court) ) (VP (VBD ordered) (NP-1 (DT the) (NN commission) ) (S (NP-SBJ (-NONE- *-1) ) (VP (TO to) (VP (VP (VB audit) (NP (NP (NNP Commonwealth) (NNP Edison) (POS 's) ) (NN construction) (NNS expenses) )) (CC and) (VP (VB refund) (NP (DT any) (JJ unreasonable) (NNS expenses) )))))) (. .) ))
  • 23. 23 Parsing Evaluation Metrics • PARSEVAL metrics measure the fraction of the constituents that match between the computed and human parse trees. If P is the system’s parse tree and T is the human parse tree (the “gold standard”): – Recall = (# correct constituents in P) / (# constituents in T) – Precision = (# correct constituents in P) / (# constituents in P) • Labeled Precision and labeled recall require getting the non-terminal label on the constituent node correct to count as correct. • F1 is the harmonic mean of precision and recall.
  • 24. Computing Evaluation Metrics Correct Tree T S VP Verb NP Det Nominal Nominal PP book Prep NP through Houston Proper-Noun the flight Noun Computed Tree P VP Verb NP Det Nominalbook Prep NP through Houston Proper-Noun the flight Noun S VP PP # Constituents: 12 # Constituents: 12 # Correct Constituents: 10 Recall = 10/12= 83.3% Precision = 10/12=83.3% F1 = 83.3% 24
  • 25. 25 Treebank Results • Results of current state-of-the-art systems on the English Penn WSJ treebank are slightly greater than 90% labeled precision and recall.
  • 26. Discriminative Parse Reranking • Motivation: Even when the top-ranked parse not correct, frequently the correct parse is one of those ranked highly by a statistical parser. • Use a classifier that is trained to select the best parse from the N-best parses produced by the original parser. • Reranker can exploit global features of the entire parse whereas a PCFG is restricted to making decisions based on local info. 26
  • 27. 2-Stage Reranking Approach • Adapt the PCFG parser to produce an N- best list of the most probable parses in addition to the most-likely one. • Extract from each of these parses, a set of global features that help determine if it is a good parse tree. • Train a classifier (e.g. logistic regression) using the best parse in each N-best list as positive and others as negative. 27
  • 28. Parse Reranking 28 sentence N-Best Parse Trees PCFG Parser Parse Tree Feature Extractor Parse Tree Descriptions Parse Tree ClassifierBest Parse Tree
  • 29. Sample Parse Tree Features • Probability of the parse from the PCFG. • The number of parallel conjuncts. – “the bird in the tree and the squirrel on the ground” – “the bird and the squirrel in the tree” • The degree to which the parse tree is right branching. – English parses tend to be right branching (cf. parse of “Book the flight through Houston”) • Frequency of various tree fragments, i.e. specific combinations of 2 or 3 rules. 29
  • 30. Evaluation of Reranking • Reranking is limited by oracle accuracy, i.e. the accuracy that results when an omniscient oracle picks the best parse from the N-best list. • Typical current oracle accuracy is around F1=97% • Reranking can generally improve test accuracy of current PCFG models a percentage point or two. 30
  • 31. Dependency Grammars • An alternative to phrase-structure grammar is to define a parse as a directed graph between the words of a sentence representing dependencies between the words. 31 liked John dog pen inthe the liked John dog pen in the the nsubj dobj det det Typed dependency parse
  • 32. Dependency Graph from Parse Tree • Can convert a phrase structure parse to a dependency tree by making the head of each non-head child of a node depend on the head of the head child. 32 S VP VBD NP DT Nominal Nominal PP liked IN NP in the dog NN DT Nominal NNthe pen NNP NP John pen-NN pen-NN in-IN dog-NN dog-NN dog-NN liked-VBD liked-VBD John-NNP liked John dog pen inthe the
  • 33. Statistical Parsing Conclusions • Statistical models such as PCFGs allow for probabilistic resolution of ambiguities. • PCFGs can be easily learned from treebanks. • Lexicalization and non-terminal splitting are required to effectively resolve many ambiguities. • Current statistical parsers are quite accurate but not yet at the level of human-expert agreement. 33