Back to Blog

Get in Touch

Sentiment Analysis using TweetSentiments.com API

By Tom Zeng November 29, 2010 in analysis, twitter, sentiment, machine learning, tweet, classification

Missing

The TweetSentiments.com API is now available for developers who are interested in Twitter related sentiment analysis.

Support Vector Machines

TweetSentiments.com sentiment analysis is based on a machine learning method called Support Vector Machines(SVM). SVM is one of the most efficient supervised learning algorithms. We are using LIBSVM - a popular implementation of SVM developed at Taiwan National University.

SVM is very computational intensive and LIBSVM is implemented in C++ for performance. For Ruby and Rails, a gem called libsvm-ruby-swig is available on Github; you can install it by running "gem install libsvm-ruby-swig". Currently, it only runs on the Linux platform.

For large scale text classification, LIBLINEAR is much more efficient. You can use the liblinear-ruby-swig gem with Ruby and Rails.

Currently three API calls are available:

- Sentiment on tweets http://data.tweetsentiments.com:8080/api/analyze.json?q=<text to analyze>
- Sentiment on topics http://data.tweetsentiments.com:8080/api/search.json?topic=<topic to analyze>
- Sentiment on users http://data.tweetsentiments.com:8080/api/search.json?user=<twitter user to analyze>

The sentiment analysis API is available either as web service (at http://data.tweetsentiments.com:8080) or as a standalone app that can be installed behind the firewall.

To try out the API calls, run the following sample code in irb:

We will be working on improving sentiment analysis accuracy, performance, and also adding additional features. Feel free to contact us for suggestions, feature requests, and bug reports.

Medium

Tom Zeng

Tom is passionate about leading edge technologies, he enjoys building awesome applications with the talented people at Intridea. He had many years of experience with building enterprise applications using Java. His current favorite tools are Ruby and Rails, CoffeeScript, and MongoDB, and he still enjoys using Java with JRuby. His other interests include Big Data and Machine Learning. Prior to Intridea, Tom worked as the Lead Software Architect for a leading corporate GPS fleet tracking company. Tom also had experiences in developing enterprise applications in corporate risk management, context aware computing, business-to-business ecommerce, banking and finance with companies such as iJET Inteilligent Systems, Unwired Express, Spaceworks, Ironside Technologies, and Footprint Software/IBM Canada. Tom holds a M.A.Sc in Management Sciences from the University of Waterloo, and a B.A.Sc from Huazhong University of Science and Technology. Tom currently resides in Ellicott City, Maryland with his wife and two sons. He enjoys rollerblading and biking on Maryland's beautiful bike trails.

More posts by Tom Zeng

Tom Zeng

For Rails developers, Backbone + Rails + CoffeeScript is a perfect combinatio...

Tom Zeng

The TweetSentiments.com API...

Tom Zeng

RubyWorld Conf 2010 was held in Matsue, the capital city of Shimane, Japan on...