IMDB Scraping, Exploring and Data Analyzing

Posted on Sep 17, 2019
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Introduction

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.

Research Questions

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:

  1. 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?
  2. Is there a recurring word or phrase in good reviews? bad reviews?

Web Scraping

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.

  1. Title of the movie
  2. Username of person giving the review
  3. Date of the review
  4. Review content
  5. Rating given by the reviewer
  6. Average score given to the review

Data Preparation

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.

                                          Figure 1

                                     Figure 2

 

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.

 

About Author

Leave a Comment

No comments found.

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI