How to print 2-ngrams in LimeTextExplainer

117 views Asked by At

I try to explain the importance of a sentence using the following pipeline with LimeTextExplainer from LIME package.

Pipeline(steps=[('vect', CountVectorizer()),
                ('tfidf', TfidfTransformer()),
                ('clf', LogisticRegression())])

When I try to explain a sentence using the code below, the "importance" of the single words is shown, while I want pairs

explainer.explain_instance(text, cls.predict_proba, num_features=7)
exp.show_in_notebook(text=False)

enter image description here Is it possible to display the importance of pairs of words?

0

There are 0 answers