GoogleCloudPlatform / ai-platform-text-classifier-shap

Text classification demo from our Next '19 breakout session

Home Page:https://sararobinson.dev/2019/04/23/interpret-bag-of-words-models-shap.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Text classification model interpretability demo

This code is provided as example only. It is provided without guarantee or level of support. This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

This is the demo I presented at my Cloud Next '19 talk with Yufeng. It shows how to build a bag of words text classification model to tag ML-related Stack Overflow questions, deploy the model to AI Platform, and interpret it's predictions with SHAP. For more details on the SHAP piece of this demo, see my blog post.

Architecture diagram

Running the notebook

To run the notebook, create a new Colab notebook and import the stackoverflow-classifier.ipynb file in this repo. The CSV we used for the Stack Overflow training data is public. You'll need to create a Google Cloud project to deploy the model. If you don't want to do that, you'll still be able to run the SHAP code at the end of the notebook.

Got any feedback? File an issue or ping me on Twitter at @SRobTweets

This is not an officially supported Google product.

About

Text classification demo from our Next '19 breakout session

https://sararobinson.dev/2019/04/23/interpret-bag-of-words-models-shap.html

License:Apache License 2.0


Languages

Language:Jupyter Notebook 95.8%Language:JavaScript 2.1%Language:Python 1.0%Language:HTML 0.7%Language:CSS 0.3%