marcotcr / lime

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

TypeError: TextEncodeInput #721

Open nipunikajain opened 1 year ago

nipunikajain commented 1 year 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)