background preloader

Twitter sentiment analysis using Python and NLTK

Twitter sentiment analysis using Python and NLTK
This post describes the implementation of sentiment analysis of tweets using Python and the natural language toolkit NLTK. The post also describes the internals of NLTK related to this implementation. Background The purpose of the implementation is to be able to automatically classify a tweet as a positive or negative tweet sentiment wise. The classifier needs to be trained and to do that, we need a list of manually classified tweets. Positive tweets: I love this car.This view is amazing.I feel great this morning.I am so excited about the concert.He is my best friend. Negative tweets: I do not like this car.This view is horrible.I feel tired this morning.I am not looking forward to the concert.He is my enemy. In the full implementation, I use about 600 positive tweets and 600 negative tweets to train the classifier. Next is a test set so we can assess the exactitude of the trained classifier. Test tweets: Implementation The following list contains the positive tweets: Classifier Classify Voilà.

The Python “with” Statement by Example Python’s with statement was first introduced five years ago, in Python 2.5. It’s handy when you have two related operations which you’d like to execute as a pair, with a block of code in between. The classic example is opening a file, manipulating the file, then closing it: with open('output.txt', 'w') as f: f.write('Hi there!') The above with statement will automatically close the file after the nested block of code. Here’s another example. This code sample uses a Context object (“cairo context”) to draw six rectangles, each with a different rotation. cr.translate(68, 68) for i in xrange(6): cr.save() cr.rotate(2 * math.pi * i / 6) cr.rectangle(-25, -60, 50, 40) cr.stroke() cr.restore() That’s a fairly simple example, but for larger scripts, it can become cumbersome to keep track of which save goes with which restore, and to keep them correctly matched. By themselves, pycairo’s save and restore methods do not support the with statement, so we’ll have to add the support on our own.

python-twitter - A python wrapper around the Twitter API GitHub is now the "source of truth" but I will always try to update to this project page. A Python wrapper around the Twitter API Author: The Python-Twitter Developers <python-twitter@googlegroups.com> Introduction This library provides a pure Python interface for the Twitter API. Twitter ( provides a service that allows people to connect via the web, IM, and SMS. Building From source: Install the dependencies: Download the latest python-twitter library from: Extract the source distribution and run: $ python setup.py build $ python setup.py install Testing With setuptools installed: $ python setup.py test Without setuptools installed: $ python twitter_test.py Getting the code View the trunk at: Documentation Using Todo

20 Tools & Converters for HTML to RSS Conversions Do you have a static HTML website, but you want to either turn this content into an RSS Feed or add an RSS feed to your web site? Then this is the list that will make you very happy. This is the ultimate list of free tools to turn any static web page into an XML RSS feed. These tools are very useful to both web savvy users as well as the non-geek user who has no idea how to read or use HTML. So look below and find the best HTML to RSS feed conversion too to take virtually any web page and convert it into a fully formed and fully coded RSS feed. Please let us know about any HTML to RSS conversion tools that we may have missed. The RSS Wizard This is a program that will allow you to generate an RSS 2.0 feed from any type of HTML document. DapperDapper allows anyone to create Dapps that track the content of any website. Feed43Your favorite site doesn’t provide news feeds? FeedityCreate RSS for ANY web page! Feed Fire RSS Builder

15 Fascinating Ways to Track Twitter Trends One of the great things about TwitterTwitter reviews is that it is a great place to track emerging trends. When major events or big stories occur, people tweet about it and it inevitably ends up at the top of Twitter Search as a top trend. But this only scratches the surface of tracking Twitter trends. There are a wide variety of web applications, Twitter accounts, and even iPhone apps that can help people do everything from track popular hashtags to graph out recent Twitter trends. Web-based Applications 1. 2. 3. 4. 5. 6. 7. Twitter Accounts 8. twithority: Twithority is an easy way to have the most recent Twitter trends tweeted to you. 9. 10. 11. gtrend: gtrend is short for "Google Trend." iPhone Apps 12. 13.

13 cours en ligne gratuits sur l’Open Data Belle initiative du Portail européen des données qui propose depuis mars 2016, une série de 13 cours en ligne d’autoformation sur l’Open Data (données ouvertes) : Programme e-learning du Portail Européen des Données, une séquence de formation ouverte et à distance (FOAD) lancée dans le cadre de l’Open Data Day le 5 mars 2016. Ces 13 modules en ligne en accès libre permettent d’appréhender les différentes facettes de l’Open Data via des textes informatifs, des infographies, des vidéos, des images et des QCM récapitulatifs. Les différents cours peuvent être suivis étape par étape ou indépendamment les uns des autres. Ces modules proposent aussi la découverte d’outils et d’une méthodologie éprouvée. Cours 1 – L’open data, c’est quoi ?Cours 2 – Générer de la valeur à partir de l’open dataCours 3 – L’open data. Licence : Contrat spécifique : merci de prendre contactGéographie : Europe Tags: autoformation, cours, Europe, formation, open data, outil en ligne, pédagogie, univers libre

BeginnersGuide/Programmers This is a Wiki page. Users with edit rights can edit it. You are, therefore, free to (in fact, encouraged to) add details of material that other Python users will find useful. It is not an advertising page and is here to serve the whole Python community. A beginner-friendly Python tutorial that starts with the absolute basics but also covers more advanced stuff like Python software deployment.

Related: