I am repeatedly getting errors when I am trying to predict emoji for a randomly given sentence. Pls guide me how to process a random string and get desired emoji for that.
Emoji Prediction : Custom Input
I have applied the same pre-processing. But still getting errors.
I am getting the same emoji again and again when i am trying it with custom input. Kindly check. Code : https://drive.google.com/open?id=1plKkxMjYGYn-8b0wlKD5dgtBvHK4kM5x
Hey @ds_course, you made two mistakes,
def predict(s):
embedding_matrix_o = np.zeros((1,10,50))
x = s.split()
for j in range(len(x)):
p = x[j].lower()
print(p)
embedding_matrix_o[0][j] = embeddings[p] # you forget to specify [j] here
pred = model.predict_classes(embedding_matrix_o)
return pred
and
s = input()
pred = predict(s) # after predicting you forgot to store it in pred.
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.