We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose.You can read our privacy policies and terms of use etc by clicking here.
Text Data Model Explanations
In this demo we will:
- Launch a movie sentiment model which takes text input
- Send a request to get a sentiment predicton
- Create an explainer for the model
- Send the same request and then get an explanation for it
Create Model
Use the model url:
gs://seldon-models/sklearn/moviesentiment
Get Predictions
Run a single prediction using the JSON below.
{
"data": {
"names": [
"Text review"
],
"ndarray": [
"this film has bad actors"
]
}
}
Add an Anchor Text Explainer
Create an Anchor Text explainer using the default settings.
Get Explanation for one Request
Resend a single request using the JSON below and then explain it:
{
"data": {
"names": [
"Text review"
],
"ndarray": [
"this film has bad actors"
]
}
}
Delete Deployment
Finally, delete the deployment.
Notes
This demo can also be run for kfserving/inferenceservices using the same models and the predict form {"instances":["a visually flashy but narratively opaque and emotionally vapid exercise ."]}
(see https://github.com/kubeflow/kfserving/tree/master/docs/samples/explanation/alibi/moviesentiment). The namespace must be labelled serving.kubeflow.org/inferenceservice=enabled
.