NLP C2W2 Ex7 viterbi_backward

I could only pass 3/4 test cases and the message is shown as below:

Wrong values for pred list.
Expected: [‘PRP’, ‘MD’, ‘RB’, ‘VB’, ‘PRP’, ‘RB’, ‘IN’, ‘PRP’, ‘.’, ‘–s–’].
Got: [‘PRP’, ‘MD’, ‘RB’, ‘VB’, ‘PRP’, ‘RB’, ‘IN’, ‘PRP’, ‘.’, ‘#’].
3 Tests passed
1 Tests failed

My id is: luqgqctu

I hade the same problem. This has to do with the range of your for-loop in the second step. Make sure you stop at the correct point.

what is it? i tried 0 and -1, but it keeps failing on one test.

Did you find any solution to that? I am stuck on exactly that !

(Solution code removed, as posting it publicly is against the honour code of this community)

Did you find any solution to that? I am stuck on exactly that !

(Solution code removed, as posting it publicly is against the honour code of this community)

Could you point out exactly where did i do wrong here?

(Solution code removed, as posting it publicly is against the honour code of this community)

I too encounter the same problem, but having looked at all the replies I didn’t find any remedy.

Wrong values for pred list.

  • Expected: [‘PRP’, ‘MD’, ‘RB’, ‘VB’, ‘PRP’, ‘RB’, ‘IN’, ‘PRP’, ‘.’, ‘–s–’].*
  • Got: [‘PRP’, ‘MD’, ‘RB’, ‘VB’, ‘PRP’, ‘RB’, ‘IN’, ‘PRP’, ‘.’, ‘#’].*
  • 3 Tests passed*
  • 1 Tests failed*
    . My range seems to me correct (m-1, -1, -1), or isn’t it? so maybe the mistake lies in this line? pred[i - 1] = states[z[i-1]]
    i am really stuck. Please help me…

hi @Doron_Modan

avoid commenting on older threads, always create a new topic for your issue. you can always tag the post link which you find similar to your issue in your created new topic

Regards
DP

Those older threads don’t provide any answer…

that’s why I told you to create new topic always as courses can have changes and I can see you created a new thread and one of the mentor has replied there. So closing this thread.