Skip to content

A content-based recommender system that recommends movies similar to the movie the user likes and analyses the sentiments of the reviews given by the user.

Notifications You must be signed in to change notification settings

Kritagya-web/ML_Project_Movie-Recommendation-System-with-Sentiment-Analysis

Repository files navigation

Movie Recommendation System

·Author Kritagya Python Framework Frontend API

A content-based recommender system that recommends movies similar to the movie the user likes and analyses the sentiments of the reviews given by the user.

Overview

The movies are recommended based on the content of the movie you entered or selected. The main parameters that are considered for the recommendations are the genre, director, and top 3 casts. The details of the movies, such as title, genre, runtime, rating, poster, casts, etc., are fetched from TMDB. The reviews of each individual movie given by the users are "web-scraped" from the IMDB website with the help of beautifulsoup4, and the reviews are subjected to sentiment analysis, where the model predicts whether the review is positive or negative.

Taken inspiration from Krish's Live Session on YouTube

Some Screenshots of the Project

##Home Page

homepage

##Movie Search

MovieSearch

##Movie Cast

MovieCast

##Reviews of People

ReviewsOfViewers

##Movie Recommendation

MovieRecommendation

How to get the API key?

Create an account in https://www.themoviedb.org/. Once you successfully created an account, click on the API link from the left hand sidebar in your account settings and fill all the details to apply for an API key. If you are asked for the website URL, just give "NA" if you don't have one. You will see the API key in your API sidebar once your request has been approved.

How to run the project?

  1. Clone or download this repository to your local machine.
  2. Install all the libraries mentioned in the requirements.txt file with the command pip install -r requirements.txt
  3. Get your API key from https://www.themoviedb.org/. (Refer the above section on how to get the API key)
  4. Replace YOUR_API_KEY in both the places (line no. 15 and 29) of static/recommend.js file and hit save.
  5. Open your terminal/command prompt from your project directory and run the file main.py by executing the command python main.py.
  6. Go to your browser and type http://127.0.0.1:5000/ in the address bar.
  7. Hurray! That's it.

Architecture

Recommendation App

Similarity Score :

How does it decide which item is most similar to the item user likes(or selects in our case)? Here comes the similarity scores.

It is a numerical value ranges between zero to one which helps to determine how much two items are similar to each other on a scale of zero to one. This similarity score is obtained measuring the similarity between the text details of both of the items. So, similarity score is the measure of similarity between given text details of two items. This can be done by cosine-similarity.

How Cosine Similarity works?

Cosine similarity is a metric used to measure how similar the documents are irrespective of their size. Mathematically, it measures the cosine of the angle between two vectors projected in a multi-dimensional space. The cosine similarity is advantageous because even if the two similar documents are far apart by the Euclidean distance (due to the size of the document), chances are they may still be oriented closer together. The smaller the angle, higher the cosine similarity.

image

More about Cosine Similarity : Understanding the Math behind Cosine Similarity

Sources of the datasets

  1. IMDB 5000 Movie Dataset
  2. The Movies Dataset
  3. List of movies in 2018
  4. List of movies in 2019
  5. List of movies in 2020

About

A content-based recommender system that recommends movies similar to the movie the user likes and analyses the sentiments of the reviews given by the user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published