Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

This branch is even with victorneo:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README.md
classification.py
happy.txt
happy_test.txt
sad.txt
sad_test.txt

README.md

Twitter Sentimental Analysis

This tool is an implementation of the Twitter Sentiment analysis tool described on Laurent Luce's blog.

Requirements

  • NLTK and its dependencies

You may install NLTK by using pip:

pip install nltk

How to use

  1. Clone this project
  2. Install NLTK (if it is not installed)
  3. Run the classifier

Or run the following commands:

git clone git://github.com/victorneo/Twitter-Sentimental-Analysis.git twanalysis
cd twanalysis
pip install nltk
python classification.py

Training data

The training data is obtained from the Twitter Search API with the keywords I am happy and I am sad for happy (positive) and sad (negative) tweets. There is a total of 160 tweets used for training (80 / 80 distribution).

To add more training data, add in new happy tweets to happy.txt and sad tweets to sad.txt using one line for each new tweet.

Test data

Test data are separated into happy_test.txt and sad_test.txt. A total of 20 tweets are used for test (10 / 10 distribution).

To add more test data, add in new happy tweets to happy_test.txt and sad tweets to sad_test.txt using one line for each new tweet.

Something went wrong with that request. Please try again.