SHAP KernelExplainer AttributeError numpy.ndarray

I've developed a text classifier of the form of python function that can input a np.array of strings (each string is one observation).

def model(vector_of_strins):
     ... # do smthg
     return vec_of_probabilities # like [0.1, 0.23, ..., 0.09]

When I try to use KernelExplainer from shap package like that

test_texts = pd.Series(['text1','text2','text3'])
shap.KernelExplainer(model, test_texts )

I receive the following error:

AttributeError: 'numpy.ndarray' object has no attribute 'find'

What can I do about it?

Topic shap explainable-ai predictor-importance nlp python

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.