An open API service indexing awesome lists of open source software.

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

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

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mrsud/sentiment-analyzer/trend.png)](https://bitdeli.com/free "Bitdeli Badge")