UNQ_C7 GRADED FUNCTION: viterbi_backward,

I am not getting the correct answer to this question. I wanted the following information to help me isolate the issue in my code:

  1. Do the unit tests of UNQ_C6 GRADED FUNCTION: viterbi_forward test the best_path array along with the best_probs array returned by it?

  2. The corpus is sent as an input parameter to the viterbi_backward function, but in my understanding it is not needed. Is my understanding correct?


EDIT: I have solved the problem. But the answers to these questions might help someone else debug. So leaving them here.

Hi @Ritu_Pande

Yes - both.

It is definitely needed, even at the beginning there’s a code hint:
# Go through every word in the corpus starting from word 1
And it is also needed to # Calculate the probability


I don’t think the corpus is needed in viterbi_backward function. The size of corpus is obtained from the shape of best_prob matrix. There is no need to calculate any probability in this function.

Ah, yes @Ritu_Pande you are correct :+1: