Ideapitch: Twitter - Sentiment Analysis

Punyashree PB

Introduction

  • Twitter gets with tweets on any important events, and hashtags trends
  • We could derive the insights and impacts of any such events by simply downloading and analysing those events.
  • This presentation shows a small glimpse of what can be done.

Required Packages

  • twitteR
  • RCurl
  • ROAuth
  • tm
  • sentiment
  • wordcloud
  • shiny

Word Cloud and Sentiment Analysis

  • WordCloud: Word cloud is a very good measure to identify the emotions from the text, by knowing which words are more frequently used.

  • Sentiment Analysis: We can give a score based on negative and positive words and can plot the sentiments which gives a very good insights of the events.

Word Cloud Example

library(tm)
library(wordcloud)
data(crude)
crude <- tm_map(crude, removePunctuation)
crude <- tm_map(crude, function(x)removeWords(x,stopwords()))
wordcloud(crude)

plot of chunk unnamed-chunk-1

Conclusion

  • This presentation is just to how the idea.
  • Drawing a word cloud with the data expracted from twitter about an incident will speak a lot
  • Going futher ahead, with tm and Sentiment packages, sentiment analysis can be done