This project walks through sentiment analysis of tweets about political candidates, classifying each tweet as positive or negative. The neutral tweets are dropped, the data is split into training and test sets (10% for testing), and the text is cleaned of hashtags, mentions, links and stop words.
Word clouds show the most characteristic words of each class: words such as “truth”, “strong”, “legitimate” and “love” dominate the positive tweets, while “disappointing”, “softball” and “cherry picking” appear in the negative ones. Word features are then extracted with nltk by measuring their frequency distribution, and an nltk Naive Bayes classifier is trained on them and evaluated with simple metrics.
The Arabic article is a translation of an English tutorial. Read the original: Twitter Sentiment Analysis (thecleverprogrammer.com).
Post links
- Original link: google.com.eg


Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.