Friday 2 March 2018

Analysis on Padmaavat Movie Review


Padmaavat Movie Review

Introduction

I had performed this analysis way back and was scared to past this. As the issue is little bit off the trend now, I want to show how I perfumed sentimental analysis to understand crowd sentiment.

In this article we will look into the sentiment of people towards the movie Padmavat . Which was one of the most controversial movies in Indian cinema? We will uncover the real review which is available on public domain and perform analysis.

I am little bit scared to perform sentimental analysis as I did on Modi’s Mann Ki Bath. So we will do only till word cloud and will not conclude on the movie.

Let me load the required packages for the same

library(rvest)
## Loading required package: xml2
library(tm)
## Loading required package: NLP
library(SnowballC)
library(wordcloud)
## Loading required package: RColorBrewer
library(RColorBrewer)

Now let me scrap the web and import the 720 comments of the people who wrote the review on the website imdb

result <- c()
for(i in c(1, seq(10, 290, 10))) {
  link <- paste0("http://www.imdb.com/title/tt5935704/reviews?ref_=tt_urv",i)
  HouseofCards_IMDb <- read_html(link)
  
  # Used SelectorGadget as the CSS Selector
  reviews <- HouseofCards_IMDb %>% html_nodes(".text")%>%
    html_text()
  
  # perfrom data cleaning on user reviews
  reviews <- gsub("\r?\n|\r", " ", reviews) 
  reviews <- tolower(gsub("[^[:alnum:] ]", " ", reviews))
  sapply(reviews, function(x){})
  result <- c(result, reviews)
}

Now lets clean the data

movie_data<-result
movie_data <- gsub("\r?\n|\r", " ", movie_data) 
movie_data <- tolower(gsub("[^[:alnum:] ]", " ", movie_data))
movie_data<-removeWords(movie_data,stopwords())
movie_data<-gsub(pattern = "\\b[A-z]\\b{1}","",movie_data)
movie_data<-stripWhitespace(movie_data)
movie_data <- Corpus(VectorSource(movie_data))
dtm <- TermDocumentMatrix(movie_data)
m <- as.matrix(dtm)
v <- sort(rowSums(m),decreasing=TRUE)
d <- data.frame(word = names(v),freq=v)

Now lets plot the data

wordcloud(words = d$word, freq = d$freq, min.freq = 1,
          max.words=200, random.order=FALSE, rot.per=0.35, 
          colors=brewer.pal(8, "Dark2"))

head(d, 10)
##                word freq
## movie         movie 1380
## ranveer     ranveer  510
## bhansali   bhansali  480
## padmaavat padmaavat  450
## film           film  420
## just           just  420
## great         great  390
## like           like  390
## deepika     deepika  360
## shahid       shahid  360

If you are interested kmowing the sentimental analysis of Modi’s Mann Ki Bath please visit the link below

PART-1: https://experimentswithdatascience.blogspot.in/2017/08/text-analysis-easy-way-to-web-scrapping.html

PART-2 : https://experimentswithdatascience.blogspot.in/2017/10/modis-mann-ki-baat-text-analytics-text.html

PART-3 : http://experimentswithdatascience.blogspot.in/2017/11/analysis-of-modis-speech-on-29102017_40.html

10 comments:

  1. Good work mate but Can't understand.. u should teach me how to read this analysis

    ReplyDelete
    Replies
    1. Hi Imran,
      It is nothing but a word frequency plot. In simple words I have plotted 790 reviews from 290 pages. Picked out which are the most frequent words used by the people that's it. One reason I do not want to conclude is because, I do not want to create any other controversy. Overall movie is good to watch; but slow and might be boring for few

      Delete
  2. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! Sites Like Putlocker

    ReplyDelete
  3. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work rdxhd

    ReplyDelete
  4. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. data analyst jobs

    ReplyDelete
  5. creativity of writer is purely impressive. It has touched to the level of expertise with his writing. Everything is up to the mark. Written perfectly and I can use such information for my coming assignment. the cinema matrix

    ReplyDelete
  6. i was just browsing along and came upon your blog. just wanted to say good blog and this article really helped me. jalshamoviez

    ReplyDelete
  7. Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. مزاجات

    ReplyDelete
  8. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. ดูหนัง

    ReplyDelete
  9. You have performed a great job on this article. It’s very precise and highly qualitative. You have even managed to make it readable and easy to read. You have some real writing talent. Thank you so much. imagefilm erstellen

    ReplyDelete