Is anyone else seeing this?
Run the following cell to check what sentences_to_indices() does, and take a look at your results.
In [7]:
X1 = np.array([“funny lol”, “lets play baseball”, “food is ready for you”])
X1_indices = sentences_to_indices(X1, word_to_index, max_len=5)
print(“X1 =”, X1)
print(“X1_indices =\n”, X1_indices)
NameError Traceback (most recent call last)
in
1 X1 = np.array([“funny lol”, “lets play baseball”, “food is ready for you”])
----> 2 X1_indices = sentences_to_indices(X1, word_to_index, max_len=5)
3 print(“X1 =”, X1)
4 print(“X1_indices =\n”, X1_indices)
NameError: name ‘word_to_index’ is not defined