Sentiment Analysis on Twitter data using R: Part – I

Now, the past posts we have understood the importance of using Twitter API, Basics of Twitter API and how we can access the Twitter API using R. Now we will get into analytics of how to do sentiment analysis with R with the library TwitteR. Before we do that we will try to do little understanding of Sentiment Analysis(some times also called as opinion mining) in a Q & A Format.

What is Sentiment Analysis ?

In simple words, Sentiment analysis is the task of identifying whether the opinion expressed in a text is positive or negative in general about a particular topic or context.

Can we have some examples?

a. I’m in a happy mood today, I go to beach. – Positive

b. I very much like R and its capabilities – Positive

c. I don’t like SPSS, its very complex to use – Negative

d. I feel Rapid Miner is easy to use and has good interface – Positive

Where it is being used or what are its applications?

With the lot of micro-blogging platforms available and business are well placed there, it’s important to understand that sentiment analysis on those platforms help understand the problems and feel of the customers.

  • Understanding customer feedback received
  • To arrive at happiness index of the customers
  • Determining product recommendations
  • Predicting Stock market moods
  • As a competitive marketing tool

Steps for Sentiment Analysis?

How do we do the Practical implementation?

http://www.slideshare.net/jeffreybreen/r-by-example-mining-twitter-for (The one I Like the most).

http://stackoverflow.com/questions/10233087/sentiment-analysis-using-r

https://sites.google.com/site/miningtwitter/questions/sentiment

http://trestletechnology.net/2011/11/sermon-sentiment-analysis/

You can look at the above given references for the practical implementation of Sentiment Analysis. Some of them may be outdated, in the next post we will do a practical step by step implementation of Sentiment Analysis with Twitter data using R.

Advertisements

12 thoughts on “Sentiment Analysis on Twitter data using R: Part – I

  1. Pingback: Step by Step Sentiment analysis on Twitter data using R with Airtel Tweets: Part – II | My exploration in data analytics

  2. Pingback: Step by Step Sentiment analysis on Twitter data using R with Airtel Tweets: Part – III | My exploration in data analytics

  3. Hi!! I want help about how to get a data in twitter from R, and using library(streamR) . Do you anyone know the steps ?

  4. I found this code and I do not understand what it is writes in lines :
    setwd, load ans also why counter to 1001

    setwd( …..)
    library(streamR)
    load(‘my_oauth.Rdata’)

    location_name <- "london"
    location_bounding_box <- c(-0.229,51.444, 0.043, 51.563)

    end.date <- as.Date("2013-11-02")
    counter <- 1
    while (counter<1001){
    current.time <- format(Sys.time(), "%Y_%m_%d_%H_%M")
    file.name <- paste(location_name, "-",counter,"-", current.time, ".json", sep="")
    filterStream( file=file.name, locations=location_bounding_box, oauth=my_oauth, timeout=900)
    counter <- counter + 1
    }

    • 1. Setwd – Sets the working directory
      2. Load is essential for loading authentication data with twitter.
      3. They want to limit the number of tweets upto 1000.

      Hope this clarifies your doubt. Were you able to run this successfully. Do let me know if you need any help.

      Thanks.

      Regards
      Siva

  5. setwd(“———“) # find the correct directory

    library(twitteR) # Is it okay this library ?
    library(streamR)
    load(“my_oauth”) # Can I write anything name ? and i must to connect in twitter ?

    location_name <- "Cyprus"
    location_bounding_box <- c(35.1061,32.2817,34.963,34.0780)
    # I used this site for the location http://itouchmap.com/latlong.html

    end.date <- as.Date("2014-05-07")
    counter <- 1
    while (counter<1001){
    current.time <- format(Sys.time(), "%Y_%m_%d_%H_%M")
    file.name <- paste(location_name, "-",counter,"-", current.time, ".json", sep="")

    filterStream( file=file.name, locations=location_bounding_box, oauth=my_oauth, timeout=900)
    counter <- counter + 1
    }

    do you think it's okay to connect with twitter and i will gets the tweets?? I think it's something wrong because i can't to run.

    thanks,
    sofia

  6. Pingback: Sentiment analysis | Business Intelligence LATAM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s