Using LIME on text data
In the previous section, we discussed how LIME is an effective approach to explaining complicated black-box models trained on image datasets. Like images, text is also a form of unstructured data, which is very much different from structured tabular data. Explaining such black-box models trained on unstructured data is always very challenging. But LIME can also be applied to models trained on text data.
Using the LIME algorithm, we can analyze whether the presence of a particular word or group of words increases the probability of predicting a specific outcome. In other words, LIME helps to highlight the importance of text tokens or words that can influence the model's outcome toward a particular class. In this section, we will see how LIME can be used to interpret text classifiers.
Installing the required Python modules
Like the previous tutorials, the complete notebook tutorial is available at https://github.com/PacktPublishing/Applied-Machine...