Notes on computational linguistics.pdf - UCLA Department of ...
Notes on computational linguistics.pdf - UCLA Department of ...
Notes on computational linguistics.pdf - UCLA Department of ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Stabler - Lx 185/209 2003<br />
a. probability <strong>of</strong> the first symbol s1 from <strong>on</strong>e <strong>of</strong> the initial states<br />
<br />
<br />
p(qi|s1) = p(qi)p(s1|qi) = 0.7 · 0.8<br />
<br />
0.2 · 0.1<br />
<br />
0.1 · 0.2<br />
= 0.56 0.02 0.02<br />
b. probabilities <strong>of</strong> the following symbols from each state (transposed to column matrix)<br />
p(qi|s1s3) ′ ⎡<br />
⎤<br />
((p(q1,s1) · p(q1|q1)) + (p(q2,s1) · p(q1|q2)) + (p(q3,s1) · p(q1|q3))) · p(s3|q1)<br />
⎢<br />
⎥<br />
= ⎣((p(q1,s1)<br />
· p(q2|q1)) + (p(q2,s1) · p(q2|q2)) + (p(q3,s1) · p(q2|q3))) · p(s3|q2) ⎦<br />
⎡<br />
((p(q1,s1) · p(q3|q1)) + (p(q2,s1) · p(q3|q2))<br />
⎤<br />
+ (p(q3,s1) · p(q3|q3))) · p(s3|q3)<br />
((0.56 · 0.7) + (0.02 · 0.2) + (0.02 · 0)) · 0.1<br />
⎢<br />
⎥<br />
= ⎣((0.56<br />
· 0.2) + (0.02 · 0.7) + (0.02 · 0)) · 0.1⎦<br />
⎡<br />
((0.56 · 0.1) + (0.02 · 0.1) +<br />
⎤<br />
(0.02 · 1)) · 0.6<br />
(0.392 + 0.04) · 0.1<br />
⎢<br />
⎥<br />
= ⎣ (0.112 + 0.014) · 0.1 ⎦<br />
⎡<br />
(0.056<br />
⎤<br />
+ 0.002 + 0.02) · 0.6<br />
0.0432<br />
⎢ ⎥<br />
= ⎣0.0126⎦<br />
0.0456<br />
p(qi|s1s3s3) ′ ⎡<br />
⎤<br />
((p(q1,s1s3) · p(q1|q1)) + (p(q2,s1s3) · p(q1|q2)) + (p(q3,s1s3) · p(q1|q3))) · p(s3|q1)<br />
⎢<br />
⎥<br />
= ⎣((p(q1,s1s3)<br />
· p(q2|q1)) + (p(q2,s1s3) · p(q2|q2)) + (p(q3,s1s3) · p(q2|q3))) · p(s3|q2) ⎦<br />
⎡<br />
((p(q1,s1s2) · p(q3|q1)) + (p(q2,s1s3) · p(q3|q2)) +<br />
⎤<br />
(p(q3,s1s3) · p(q3|q3))) · p(s3|q3)<br />
((0.0432 · 0.7) + (0.0126 · 0.2) + (0.0456 · 0)) · 0.1<br />
⎢<br />
⎥<br />
= ⎣((0.0432<br />
· 0.2) + (0.0126 · 0.7) + (0.0456 · 0)) · 0.1⎦<br />
⎡<br />
((0.0432 · 0.1) + (0.0126 · 0.1) + (0.0456<br />
⎤<br />
· 1)) · 0.6<br />
(0.03024 + 0.00252) · 0.1<br />
⎢<br />
⎥<br />
= ⎣ (0.00864 + 0.00882) · 0.1 ⎦<br />
⎡<br />
(0.00432<br />
⎤<br />
+ 0.00126 + 0.0456) · 0.6<br />
0.003276<br />
⎢ ⎥<br />
= ⎣0.001746⎦<br />
0.030708<br />
c. Finally, we calculate p(s1s3s3) as the sum <strong>of</strong> the elements <strong>of</strong> the last matrix:<br />
p(s1s3s3) = 0.03285<br />
8.1.10 Computing output sequence probabilities: backward<br />
Another feasible way to compute the probability <strong>of</strong> an output sequence a1 ...an.<br />
(85) a. Let P(qi ⇒ a1 ...an) be the probability <strong>of</strong> emitting a1 ...an beginning from state qi.<br />
And for each possible final state qi ∈ ΩX, let<br />
P(qi ⇒ ɛ) = 1<br />
b.<br />
(With this base case, the first use <strong>of</strong> the recursive step calculates P(qj ⇒ an) for each qi ∈ ΩX.)<br />
Recursive step: Given P(qi ⇒ at ...an) for all qi ∈ ΩX, calculateP(qj ⇒ at−1 ...an) for all qj ∈ ΩX<br />
as follows:<br />
P(qj ⇒ at−1 ...an) = <br />
P(qi ⇒ at ...an)P(qj|qi) P(at−1|qj)<br />
j∈ΩX<br />
145