Closed Neihtq closed 3 years ago
See #200. You need the predict_fn to take a list of strings as input, and produce a 2d array of prediction probabilities. To do that, you need to wrap your encoding function with your prediction function into a function that does it all.
Hi,
we have a classification model based on this. So basically it takes in a text input and outputs the probability whether the content is classified as true news. Currently we use TensorFlow version
2.4.1
.We prepare our data for inference and training like this:
and this is how we try to get explanation via lime from a single test sample:
However the error
TypeError: cannot use a string pattern on a bytes-like object
occurs. This is an example output ofmodel.predict(X_test[:1])
:I am not sure what to do at this point as the encoding of the text data is required by the model in order to make predictions.