Lecture 2
Lecture 2
CFG parsing:
The basics
Julia Hockenmaier
[email protected]
3324 Siebel Center
Office Hours: Fri, 2:00-3:00pm
http://www.cs.uiuc.edu/~juliahmr/cs598
Todayʼs topics
CFGs and PCFGs:
CFGs as AND/OR graphs
Shared parse forests
PCFGs
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)
What is:
- the language defined by a CFG?
- a CFG derivation?
- a CFG parse tree?
- the yield of a CFG?
(B.Lang 1989/1991)
Question:
Are there any other kinds of
ambiguity?
CS 598 JH: Advanced NLP (Springʼ09)
10
Shared parse forests
A1...Am ⊢B
( )
VP
NP
PP
V NP P NP
yield eat sushi with tuna eat sushi
= eat sushiwith with
tuna tuna
VP
CS 598 JH: Advanced NLP (Springʼ09)
VP PP 21
Computing P(τ)
T is the (infinite) set of all trees in the language:
L = {s ∈ Σ | ∃τ ∈ T : yield(τ) = s}
∗
...
XP XP wj
...