Complete tutorial can be found here on the Twilio blog.
To run, install requirements.txt with pip3 install -r requirements.txt
then run the Flask app with
export FLASK_APP=main
export FLASK_ENV=development
flask run --without-threads
Please ignore some of the commits and commit messages, it was a pain to deploy to Heroku because the TensorFlow model was computationally-intensive.