shap.text_plot

shap.text_plot(shap_values, num_starting_labels=0, group_threshold=1, separator='', xmin=None, xmax=None, cmax=None)

Plots an explanation of a string of text using coloring and interactive labels.

The output is interactive HTML and you can click on any token to toggle the display of the SHAP value assigned to that token.