IMDB Scraping, Exploring and Data Analyzing
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
IMDB is one of the most widely used websites for people deciding whether or not a movie is worth watching. Users can not only access movie ratings, but they can read different reviews on the movie to see why or why not it was well received. Having access to movie reviews in addition to ratings allows potential viewers a certain level of autonomy in deciding whether a movie would be "good" or "bad" to watch.
I wanted to find a polarizing movie with good and bad reviews and ratings, so I scraped IMDB.com for reviews and ratings on the first Purge movie. I used the Purge because it's such a polarizing
With this project, I set out to answer the following questions:
- IMDB users have the ability to critique reviews based on how helpful they are. Is there a common theme among reviews? Do higher ratings typically have a higher helpfulness score?
- Is there a recurring word or phrase in good reviews? bad reviews?
I scraped the IMDB website for the movie, Purge, using Selenium. Selenium seemed like the optimal choice because IMDB is a dynamic website with people constantly posting new reviews and ratings. Below are the fields that I thought could be interesting to analyze and chose to scrape.
- Title of the movie
- Username of person giving the review
- Date of the review
- Review content
- Rating given by the reviewer
- Average score given to the review
The data scraped from IMDB is well formatted and so strenuous data cleaning was not necessary. Most of the data preparation was done on the review content feature. In order to maximize the information gained from the review content, the characters in the review were first changed to lower case (for uniformity), all characters that are not in the alphabet and stopwords (words that do not provide useful information) were removed, and the combined string was split into a list of words.
Analysis and Conclusion
I first did some initial data exploration to gain insight into the data. First, I wanted to see the distribution of ratings for the movie and how the ratings for the movie have changed over time. This is shown in figures 1 and 2 below.
Although an overwhelming majority gave the Purge a very low rating, there is still a high variance in the ratings, so I decided to do some analysis on that. There doesn't seem to be a visible trend in ratings over the years shown above, but the rating seemed to be highest when it came out in 2013. For the main part of my analysis, I wanted to see if there were any frequently occurring words that distinguished good reviews from bad reviews. In order to do that, I split the data into reviews for ratings less than 5 (bad reviews) and reviews for ratings greater than or equal to 5 (good reviews).
Figure 3 (Good Reviews)
Figure 4 (Bad Reviews)
The words that show in bigger print on the word cloud represent the words that most commonly occur. Some common words in the good reviews are enjoyed, decent, and far fetched. Common words in the bad reviews are waste, plot hole, and wasted potential. It's interesting to see the commonalities in the different kinds of reviews. For future research, I would like to expand this project to multiple movies and see if common words show up in reviews among different genres. I also think it would be cool to utilize machine learning to predict movie ratings based on the different words that show up in reviews.