NLP Sample App

Colin Carroll

An example of wiring responsive jQuery together with Flask and spaCy to make a simple, ml-powered app. This is a demo used in a lecture for MAS 500 at MIT in the Fall of 2017. The goal was to provide an overview of tools and considerations for using machine learning while building software. My lecture notes, a Jupyter notebook, are available on github

It runs on ~20 lines of Python, and ~20 lines of JavaScript.


This assumes you are using conda, a Python package manager similar to pip, but focused on numerical computing. It can be downloaded here.

  1. Get the code
                        $ git clone 
                        $ cd working_ml
  2. Create a virtual environment
                        $ conda create -n working_ml python=3.6
                        $ source activate working_ml
                        $ conda install keras spacy scikit-learn seaborn matplotlib flask jupyter
                        # The nlp library requires extra files
                        $ python -m spacy download en
  3. This command runs the this site:
                        $ flask run
                         * Serving Flask app "app"
                         * Running on (Press CTRL+C to quit)
  4. In a new terminal
                        $ cd working_ml
                        $ open index.html
  5. You could also (or instead) run the notebook in a new terminal with
                        $ cd working_ml
                        $ jupyter notebook


Basic Tools


Numeric Libraries

Machine Learning


Natural Language Processing

Deep Learning