'Shap to explain a simple transforms classification model

I have a pre-trained model for detect toxic speech. This model is a ClassificationModel of Simple Transforms python lib. I'm trying to use the shap Kernel Explainer this way:

explainer = shap.KernelExplainer(model=model.predict, data=tt_df['text'].to_numpy())

But when I run this code I got an error: IndexError: tuple index out of range

I did not find any tutorial or example with this paticular model, and for what a I see in others tutorials the model argument is the prediction function of the model while the data argumetn is the data you want to use to predict. I'm kinda new in this, so help me to find out and understand where are my mistake. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source