I'm trying to solve a text classification problem with Keras and LSTM, my model is the following:
I have 5 classes: 'sport', 'tech', 'business', 'politics', 'entertainment'
The problem is that when i pass the STR in explain_instance() it becomes a list of length 5000, so when i execute my code i get the following error:
ValueError: Found input variables with inconsistent numbers of samples: [5000, 1]
Can someone explain to me how to solve this problem? My code is the following:
The prediction function used as an argument to explain_instance should take as input a list of strings and return a 2d array of prediction probabilities. It looks as if your function takes in a single string.
I'm trying to solve a text classification problem with Keras and LSTM, my model is the following:
I have 5 classes: 'sport', 'tech', 'business', 'politics', 'entertainment' The problem is that when i pass the STR in explain_instance() it becomes a list of length 5000, so when i execute my code i get the following error:
ValueError: Found input variables with inconsistent numbers of samples: [5000, 1]
Can someone explain to me how to solve this problem? My code is the following: