Twitter Sentimental Analysis
- NLTK and its dependencies
You may install NLTK by using pip:
pip install nltk
How to use
- Clone this project
- Install NLTK (if it is not installed)
- 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
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
sad.txt using one line for each new tweet.
Test data are separated into
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
sad_test.txt using one line for each new tweet.