CS626-449: Speech, NLP and the Web/Topics in AI p
Pushpak Bhattacharyya
CSE Dept., IIT Bombay
Lecture-17: PCFG; Arguments and Adjuncts
Compare
• P(w1,m) = P(w1) * i=1πi=m P(wi/w1, n-i ) Æ Statistics
(S h)
(Speech)
• P(w1,m) = ∑t Ԗ all parses P(t) Æ Statistics + Linguistics
• w1,m = yield(s) Æ linguistics
Probability of a parse tree (cont.)
S1,l
NP1,2 VP3,l
N2,2 V3,3 PP4,l
P NP
w DT1
w P ( t|s ) = P (t | S1,l )
= P ( NP1,2, DT1,1 , w1,
N w2 P4,4 NP5,l
w4
w1 w3
w5 wl
N2,2, w2,
VP3,l, V3,3 , w3,
PP4 l, P4 4 , w4 NP5 l, w5 l
|
S1 l )PP4,l, P4,4 , w4, NP5,l, w5…l
|
S1,l )= P ( NP1,2 , VP3,l | S1,l) * P ( DT1,1 , N2,2 | NP1,2) * D(w1 | DT1,1) * P (w2 | N2,2) * P (V3 3 PP4 l | VP3 l) * P(w3 | V3 3) * P( P4 4 NP l | PP4 l ) * P(w4|P4 4) * P
P (V3,3, PP4,l | VP3,l) P(w3 | V3,3) P( P4,4, NP5,l | PP4,l ) P(w4|P4,4) P (w5…l | NP5,l)
(Using Chain Rule, Context Freeness and Ancestor Freeness )
Example PCFG Rules &
Probabilities Probabilities
• S → NP VP 1.0
• NP → DT NN 0.5
• DT → the 1.0
• NN → gunman 0.5
• NP → NNS 0.3
• NP → NP PP 0.2
• NN → building 0.5
• VBD → sprayed 1.0
• PP → P NP 1.0
• VP → VP PP 0.6
• NNS → bullets 1.0
• VP → VBD NP 0.4
Example Parse t
1`• The gunman sprayed the building with bullets.
S1.0
NP0.5 VP0.6
P (t1)
= 1.0 * 0.5 * 1.0 * 0.5 * 0.6 * 0.4 * 1.0 * 0.5 * 1.0 * 0.5 * 1.0
0.5 0.6
DT1.0 NN0.5 PP1.0
* 1.0 * 0.3 * 1.0
= 0.00225 VP0.4
VBD1.0 NP0.5 P1.0 NP0.3 The gunman
DT1.0 NN0.5with NNS1.0
building the
sprayed
bullets building
the
Another Parse t
2S
• The gunman sprayed the building with bullets.
S1.0
NP0.5 VP0.4
P (t2)
= 1.0 * 0.5 * 1.0 * 0.5 * 0.4 * 1.0 * 0.2 * 0.5 * 1.0 * 0.5 * 1.0 DT1.0 NN0.5VBD1.0 NP0.2
* 1.0 * 0.3 * 1.0
= 0.0015
NP0.5 PP1.0 The gunman sprayed
DT1.0 NN0.5 P1.0 NP0.3
ith NNS b ilding
the NNS1.0
bullets building with
the
Complements and Adjuncts Complements and Adjuncts
or
A t d Adj t
Arguments and Adjuncts
Rules in bar notation: Noun
• NPÆ (D) N’
• N’Æ (AP) N’
• N’Æ N’ (PP)
• N’Æ N (PP)
Rules in bar notation: Verb
• VPÆ V’
• V’Æ V’ (PP)
• V’Æ V (NP)
Rules in bar notation: Adjective
• APÆ A’
• A’Æ (AP) A’
• A’Æ A (PP)
Rules in bar notation: Preposition
• PPÆ P’
• P’Æ P’ (PP)
• P’Æ P (NP)
Introducing the “X factor”
• Let X stand for any category N, V, A, P
• Let XP stand for NP, VP, AP and PP
• Let X’ stand for N’, V’, A’ and P’
XP to X’
• Collect the first level rules
– NPÆ (D) N’
– VPÆ V’
APÆ A’
– APÆ A’
– PPÆ P’
• And produce
• And produce
– XPÆ (YP) X’
X’ to X’
• Collect the 2nd level rules
– N’Æ (AP) N’ or N’ (PP) – V’Æ V’ (PP)
A’Æ (AP) A’
– A’Æ (AP) A’
– P’Æ P’ (PP)
• And produce
• And produce
– X’Æ (ZP) X’ or X (ZP)
X’ to X
• Collect the 3rd level rules
– N’Æ N (PP) – V’Æ V (NP) A’Æ A (PP) – A’Æ A (PP) – P’Æ P (NP)
• And produce
• And produce
– X’Æ X (WP)
Basic observations about X and X’
• X’Æ X (WP)
• X’Æ X’ (ZP)
• X is called Head
• Phrases must have Heads: Headedness property
• Category of XP and X must match: Endocentricity
Basic observations about X and X’
• X’Æ X (WP)
• X’Æ X’ (ZP)
• Sisters of X are complements
– Roughly correspond to objects
• Sisters of X’ are Adjuncts
– PPs and Adjectives are typical adjuncts
• We have adjunct rules and complement rules
Structural difference between complements and adjuncts complements and adjuncts
XP X’
X’
ZP
WP X
Adjunct
Complement X
Complements and Adjuncts in NPs
NP N’
N’
ZP
PP N
with red cover N
book
of poems
NP
N’
Any number of Adjuncts
N’
N’
ZP from Oxford Press
PP N
with red cover N
book
of poems