Skip to content

Files

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Sebastian Raschka, 2015

Embedding a machine learning algorithm in a web application

This is the source code of a very simple web application that attempts to detect the sentiment of a movie review (positive or negative).

Web app URL: http://raschkas.pythonanywhere.com

The underlying model is a logistic regression classifier trained on the 50,000 movie review dataset from IMDb via stochastic gradient descent. The word vectors (1-grams) are created via scikit-learn's HashingVectorizer, stop words are removed, and the words are transformed into their root form using the Porter stemmer algorithm implemented in the NLTK library. The code for model training can be found in the IPython notebook webapp.ipynb.

Don't worry, I will surely post a blog article or IPython notebook to explain more about this topic ;)