marcotcr / lime

Lime: Explaining the predictions of any machine learning classifier
BSD 2-Clause "Simplified" License
11.4k stars 1.79k forks source link

TypeError: TextEncodeInput #721

Open nipunikajain opened 11 months ago

nipunikajain commented 11 months ago

Hi, I am working on a multi-class classification text model. I am trying to use LIME to intrepret the model results but getting the error like:

TypeError: TextEncodeInput must be Union[TextInputSequence, Tuple[InputSequence, InputSequence]]

This is coming when I am running the below code:

explainer = LimeTextExplainer(class_names=class_names) exp = explainer.explain_instance(text), classifier_fn=prediction_res, num_features = 63 , num_samples = 1000)