Sentiment Analysis with Python NLTK Text Classification

This is a demonstration of sentiment analysis using a NLTK 2.0.1rc1 powered text classification process. It can tell you whether it thinks the text you enter below expresses positive sentiment, negative sentiment, or if it's neutral. Using hierarchical classification, neutrality is determined first, and sentiment polarity is determined second, but only if the text is not neutral.

Analyze Sentiment
  • Enter up to 50000 characters

How Sentiment Analysis with Text Classification Works

The classifiers have been trained on movie reviews from the data sets created by Bo Pang and Lillian Lee using nltk-trainer (also on bitbucket). These classifiers can be downloaded from github or bitbucket.

The results will be more accurate on text that is similar to movie reviews. If you get an odd result, it could be the words you've used are unrecognized. Try entering more words to improve accuracy.

Sentiment Analysis Articles

To read more about how it works, please read the following articles I've written about the process:

  1. Training a naive bayes classifier for sentiment analysis using movie reviews
  2. Calculating high information words for sentiment analysis

Natural Language Sentiment Analysis API

If you'd like to use this thru an API, please see the Sentiment Analysis API Docs. And for higher limits and premium API access, signup for Mashape to use the Text-Processing Sentiment API.

Natural Language Processing Services

  • Want to download/purchase any of these models?
  • Need a custom model, trained on a public or custom corpus?
  • Want help creating or bootstrapping a custom corpus?

If you answered yes to any of these questions, please fill out this Natural Language Processing Services Survey.


Real-time Web Analytics by Mixpanel  python powered  A Django project.  Powered by NLTK.
Python Text Processing with NLTK 2.0 Cookbook

Natural Language Processing with Python