Natural Language Processing · 免费预览

平滑、插值与回退

为什么零计数会破坏困惑度,拉普拉斯平滑与 add-k 平滑,通过插值混合 n-gram 阶数,以及愚蠢回退评分。

1. Smoothing, Interpolation, and Backoff

Smoothing, Interpolation, and Backoff

2. Adding counts, blending orders, backing off

Adding counts, blending orders, backing off

3. Smoothing a bigram table three ways

Smoothing a bigram table three ways

4. Laplace unigram smoothing

A word occurs 29 times in a corpus of 1,089,757 tokens with vocabulary size 5,873. What is its Laplace-smoothed (add-one) unigram probability? Round to six decimal places.

5. Laplace bigram smoothing

In a corpus with vocabulary size 1,534, the word "tide" occurs 120 times and the sequence "tide turns" occurs 18 times. What is the add-one smoothed estimate of P(turns∣tide)P(\text{turns} \mid \text{tide})? Use four decimal places.

6. Add-k smoothing

With k=0.1k = 0.1, vocabulary size 5,733, prefix count C(fog)=78C(\text{fog}) = 78 and pair count C(fog drift)=8C(\text{fog drift}) = 8, compute the add-k smoothed P(drift∣fog)P(\text{drift} \mid \text{fog}). Round to four decimal places.

7. Linear interpolation

A trigram model is smoothed by interpolation with λ1=0.4\lambda_1 = 0.4 on the unigram estimate, λ2=0.6\lambda_2 = 0.6 on the bigram estimate, and λ3=0\lambda_3 = 0 on the trigram (its count is zero). Suppose P(w)=0.03P(w) = 0.03 and P(w∣h)=0.5P(w \mid h) = 0.5 for the word in question. What is the interpolated probability? Use three decimals.

8. Stupid backoff score

A stupid backoff model uses weight α=0.4\alpha = 0.4 and terminates in the unigram distribution. For the next word ww, the trigram count is zero, the bigram count is positive with relative frequency 0.5 and the bigram estimate is 0.5. Compute the stupid backoff score S(w∣context)S(w \mid \text{context}). Round to four decimal places.

进入交互式练习

免费注册 · 即时批改 · 自动安排间隔复习。

免费开始这门课