https://github.com/debugger22/sentiment-analyzer
Sentiment analysis on tweets and facebook comments
https://github.com/debugger22/sentiment-analyzer
Last synced: 12 months ago
JSON representation
Sentiment analysis on tweets and facebook comments
- Host: GitHub
- URL: https://github.com/debugger22/sentiment-analyzer
- Owner: debugger22
- Created: 2013-08-30T19:40:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-09T14:10:22.000Z (almost 12 years ago)
- Last Synced: 2025-03-21T12:13:07.579Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 3.09 MB
- Stars: 42
- Watchers: 9
- Forks: 27
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sentiment Analyzer
==================
A Python module to do a set of operations on tweets. It uses a collection of stopwords to train a dataset for the sentiment analysis. It uses the basic principle of bag-of-words used for natural language processing.
Dependencies
------------
* numpy
* matplotlib(To plot sentiments)
How to use
----------
```python
from src import features, datalink, hashtags
import time
dblink = datalink.DatabaseConnectionDown('perilipsi_tweets')
emoTest = features.Emoticons()
dictTest = features.DictionaryTest()
hashtest = hashtags.hashtags()
testTweet, tweetTime = dblink.fetchTweet()['tweet'], dblink.fetchTweet()['time'] #You can pass anything you want
emo_test = emoTest.analyse(testTweet)
dict_test = dictTest.analyse(testTweet)
hash_test = hashtest.analyseHashtagTweet(testTweet)
print "Emoticons:", emo_test
print "DictionaryTest:", dict_test
print "Hashtags: ", hash_test
```
Output
```python
Emoticons: {'positive': 0.33, 'negative': 0.66}
DictionaryTest: {'positive': 0.46153846153846156, 'negative': 0.5384615384615384}
Hashtags: {'positive': 0.38, 'negative': 0.62}
```
Progress
--------
* Emoticons: This class uses emoticons detection to classify the passed string as positive or negative
* DictionaryTest: This class uses a set of English words and their subjectivity to give a score to a string
* hashtags: This class extracts hashtags from the string sent and calculates the sentiment based on a trained dataset
* AllCaps
* ElongatedWords
* Negation
* Punctuation
Social Network APIs
---------------
* Twitter Search API
* Facebook Graph API
Computation Engines
-------------------
Wolfram Alpha
Team Members
------------
NameEmail
Sudhanshu Mishra mrsud94@gmail.com
Ambar Mehrotraambar.prince@gmail.com
[](https://bitdeli.com/free "Bitdeli Badge")