Hi,
Could you please give any hints about what is causing this error in the sentences_to_indices (I am getting this error in the third iteration of the loop when w = deep)
IndexError Traceback (most recent call last)
in
20 print("\033[92mAll tests passed!")
21
—> 22 sentences_to_indices_test(sentences_to_indices)
in sentences_to_indices_test(target)
9 max_len = 4
10 sentences = np.array([“I like deep learning”, “deep ´0.= love machine”, “machine learning smile”]);
—> 11 indexes = target(sentences, word_to_index, max_len)
12 print(indexes)
13
in sentences_to_indices(X, word_to_index, max_len)
37 # Set the (i,j)th entry of X_indices to the index of the correct word.
38 #print(list(m,word_to_index.keys()).index(‘deep’) )
—> 39 X_indices[i, j] = list(word_to_index.keys()).index(w)
40 # Increment j to j + 1
41 j = j+1
IndexError: index 1 is out of bounds for axis 1 with size 1
Thanks,
Suprio