victorneo / Twitter-Sentimental-Analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

License:MIT License


Languages

Language:Python 100.0%