Question 6
Given the input string:
peanutbutter
And the following vocabulary of subword tokens with their corresponding log-probabilities:
| Subword | Log-Probability (base ) |
|---|---|
pea | -1.0 |
nut | -0.8 |
but | -1.2 |
ter | -0.7 |
butter | -1.0 |
peanut | -0.5 |
t | -2.0 |
er | -1.5 |
Using the Viterbi algorithm (as used in the SentencePiece tokenizer), determine the most probable tokenization of the input string. The probability of a tokenized sequence is the sum of the log-probabilities of the selected subwords. Only subwords from the vocabulary may be used.