Natural Language Processing · 免费预览

基于编码器-解码器的机器翻译

语言在语序、词汇和省略上的差异,在它们之间进行映射的交叉注意力编码器-解码器,束搜索解码,以及 chrF 评估。

1. Machine Translation with Encoder-Decoders

Machine Translation with Encoder-Decoders

2. The encoder-decoder with cross-attention

The encoder-decoder with cross-attention

3. Beam search and evaluation

Beam search and evaluation

4. Beam search and chrF in NumPy

Beam search and chrF in NumPy

5. Reading a typological map

Which set of typological statements about translation divergences is correct?

6. Where cross-attention looks

In the decoder's cross-attention layer, where do the queries, keys, and values come from?

7. Greedy versus a beam of two

A decoder's first-token probabilities are fog 0.60.6 and mist 0.40.4. After fog, the next token is bank with 0.50.5 then end with 1.01.0; after mist, the next token is shoal with 0.950.95 then end with 1.01.0. Compute the probability of greedy's complete output and of the beam's best output, then give the beam path's probability.

8. Dividing the score by length

Why do beam search implementations divide each hypothesis's log probability by its length before comparing finished candidates?

9. chrF with one wrong character

The reference is 'red fishing boat' and a candidate is 'red fishing boot'. With k=2k = 2, chrF ignores spaces, averages unigram and bigram precision into chrP and recall into chrR, then computes chrF2=5⋅P⋅R4P+R\text{chrF}_2 = \frac{5 \cdot P \cdot R}{4P + R}. Compute chrP, rounding to three decimals.

进入交互式练习

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

免费开始这门课