Hi,
I am getting this error message
IndexError Traceback (most recent call last)
in
1 # Run and test your function
----> 2 pred = viterbi_backward(best_probs, best_paths, prep, states)
3 m=len(pred)
4 print(‘The prediction for pred[-7:m-1] is: \n’, prep[-7:m-1], “\n”, pred[-7:m-1], “\n”)
5 print(‘The prediction for pred[0:8] is: \n’, pred[0:7], “\n”, prep[0:7])
in viterbi_backward(best_probs, best_paths, corpus, states)
57 # and the column representing the word’s position in the corpus
58 # to retrieve the predicted POS for the word at position i-1 in the corpus
—> 59 z[i - 1] = best_paths[pos_tag_for_word_i,i]
60
61 # Get the previous word’s POS tag in string form
IndexError: index -208545 is out of bounds for axis 0 with size 46