I attended the live streams of Kaggle CareerCon 2019. Rachael Tatman of Kaggle took sessions of wrapping machine learning models into REST API endpoints and then deploying them on Heroku and GCP's AppEngine.
I wanted to try the deployment part as I am aware of how to wrap a machine learning model as a REST API endpoint. Decided to start with something a bit complicated intentionally but the end result was very satisfactory to me. I used the Zomato reviews' data from this repository and built a sentiment classifier out of it using TF 2.0. I then built a sklearn
pipeline including the tf-keras
model (had to wrap it in a sklearn
compatible model class) and a CountVectorizer
.
The simple API documentation is available here. You can preview this on the Swagger Editor which should look like:
Here's how to test the API endpoint in Postman (it is currently deployed on Heroku):