Problem in Exercise 6 (Viterbi Forward)

Hello, I calculate the variable prob as the best_probs of the previous (i-1) word. Then I store the biggest prob I found in the best_prob_i variable.

Then i calculate the best_probs[j,i] following the instructions:

best probs of POS tag k, previous word i-1 +
log(prob of transition from POS k to POS j) +
log(prob that emission of POS j is word i)

The output is correct:

best_probs[0,1]: -24.7822
best_probs[0,4]: -49.5601

But i cannot pass the test

What I’m doing wrong?

Please click my name and message your notebook as an attachment.


Please make corrections in the following places in exercise 6:

  1. Computation of prob in the inner for loop using k is incorrect. See the equations and the code comments.
  2. You already found the best prob and best path. So, there’s no need for additional calculations when assigning to best_probs and best_paths after the inner for loop using k.