Missing percentage with LIME, how to improve the interpretation of LIME

78 views Asked by At

Creating one script using LIME on text interpretation, it is possible don't have percentages? In other hand, I have this script where "df['text']' is the dataset with several tweets text and each tweet has been classified, considering 0 or 1:

model = tf.saved_model.load('cnn_bert/', tags=["serve"]) # the model name is "saved_model.pb"
def predict_fn(texts):
predictions = model(texts, training=False) #texts is the tweet text pre-elaborated
return predictions.numpy()

LIME

class_names=['0','1']
explainer = LimeTextExplainer(class_names=class_names)
exp = explainer.explain_instance(df['text'][4587],predict_fn, num_features=5, num_samples=10)
exp.show_in_notebook(text=df['text'][4587])

Below there is the result, but no percentage (in particular on the second plot) has been shown, maybe there is some error in my script. reference image

0

There are 0 answers