Parsing with PCFGs
Joakim Nivre
Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se
Parsing with PCFGs 1(15)
Parsing with PCFGs Joakim Nivre Uppsala University Department of - - PowerPoint PPT Presentation
Parsing with PCFGs Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Parsing with PCFGs 1(15) Probabilistic Context-Free Grammar (PCFG) 1. Grammar Formalism 2. Parsing Model 3. Parsing
Parsing with PCFGs 1(15)
Parsing with PCFGs 2(15)
Parsing with PCFGs 3(15)
JJ Economic
✟✟
NN news
❍ ❍ ✑✑✑✑✑✑✑✑✑✑✑ ✑
NP VBD had
S JJ little
✟✟
NN effect
❍ ❍ ✧✧✧✧✧ ❍ ❍
NP NP IN
❍
PP JJ financial
✟✟
NNS markets
❍ ❍ ❍ ❍
NP PU .
◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗
JJ Economic
✟✟
NN news
❍ ❍ ✑✑✑✑✑✑✑✑✑✑✑ ✑
NP VBD had
✡ ✡ ✡ ✡
VP S JJ little
✟✟
NN effect
❍ ❍ ❍ ❍ ✦✦✦✦✦
NP VP IN
❍ ❍ ❍
PP JJ financial
✟✟
NNS markets
❍ ❍ ❍ ❍
NP PU .
◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ Parsing with PCFGs 4(15)
Parsing with PCFGs 5(15)
Parsing with PCFGs 6(15)
Parsing with PCFGs 7(15)
Parsing with PCFGs 8(15)
JJ Economic
✟✟
NN news
❍ ❍ ✑✑✑✑✑✑✑✑✑✑✑ ✑
NP VBD had
S JJ little
✟✟
NN effect
❍ ❍ ✧✧✧✧✧ ❍ ❍
NP NP IN
❍
PP JJ financial
✟✟
NNS markets
❍ ❍ ❍ ❍
NP PU .
◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗
0.0000794
JJ Economic
✟✟
NN news
❍ ❍ ✑✑✑✑✑✑✑✑✑✑✑ ✑
NP VBD had
✡ ✡ ✡ ✡
VP S JJ little
✟✟
NN effect
❍ ❍ ❍ ❍ ✦✦✦✦✦
NP VP IN
❍ ❍ ❍
PP JJ financial
✟✟
NNS markets
❍ ❍ ❍ ❍
NP PU .
◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗
0.0001871
Parsing with PCFGs 9(15)
◮ Compute GEN(x) ◮ Compute EVAL(y) for y ∈ GEN(x)
◮ CKY ◮ Earley
Parsing with PCFGs 10(15)
Parsing with PCFGs 11(15)
j−1w j
Parsing with PCFGs 12(15)
◮ Treebank Y = {y 1, . . . , y m}
◮ N = the set of all nonterminals occurring in some yi ∈ Y ◮ Σ = the set of all terminals occurring in some yi ∈ Y ◮ R = the set of all rules needed to derive some yi ∈ Y ◮ S = the nonterminal at the root of every yi ∈ Y
Parsing with PCFGs 13(15)
JJ Economic
✟✟
NN news
❍ ❍ ✑✑✑✑✑✑✑✑✑✑✑ ✑
NP VBD had
S JJ little
✟✟
NN effect
❍ ❍ ✧✧✧✧✧ ❍ ❍
NP NP IN
❍
PP JJ financial
✟✟
NNS markets
❍ ❍ ❍ ❍
NP PU .
◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗
JJ Economic
✟✟
NN news
❍ ❍ ✑✑✑✑✑✑✑✑✑✑✑ ✑
NP VBD had
✡ ✡ ✡ ✡
VP S JJ little
✟✟
NN effect
❍ ❍ ❍ ❍ ✦✦✦✦✦
NP VP IN
❍ ❍ ❍
PP JJ financial
✟✟
NNS markets
❍ ❍ ❍ ❍
NP PU .
◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ◗ Parsing with PCFGs 14(15)
◮ Corpus X = {x1, . . . , xm} ◮ Grammar G = (N, Σ, R, S)
m
Parsing with PCFGs 15(15)