KVG Movie Zone is an AI based web application in which you can search for any Hollywood Movie. This application will provide all the information related to that movie, does sentiment analysis on the movie reviews and the most interesting part, this application will provide you the top 10 movie recommendations based on your search.
ReactJS was used for frontend which was deployed using firebase hosting and a Flask API was deployed using Docker container on Heroku to serve the machine learning models to the Frontend.
This application uses Content Based Movie Recommendation to recommend movies to the user.TMDB API was used to retrieve all the information related to the movie and its cast. Web Scraping was done on IMDB website to get the reviews related to the searched movie. Sentiments analysis is done using a machine learning model trained on a sample of IMDB Dataset.
Deployed Web Application Link: https://kvg-movie-zone.web.app/
Deployed Flask API Link: https://kvgmrs-api.herokuapp.com/
- Login to you your tmdb account: https://www.themoviedb.org/ or create one if you dont have.
- Then open https://www.themoviedb.org/settings/api link and create your api key by filing all the necessary information.
- IMPORTANT: After generating the TMDB API KEY, replace "ENTER YOUR TMDB_API_KEY" with your generated key in the API and FRONTEND code.
- BASE URL: https://api.themoviedb.org/3
- FOR MOVIE DATA: https://api.themoviedb.org/3/movie/{tmdb_movie_id}?api_key={TMDB_API_KEY}
- FOR MOVIE CAST DATA: https://api.themoviedb.org/3/movie/{tmdb_movie_id}/credits?api_key={TMDB_API_KEY} NOTE: Please do refer the documentation at the BASE URL for better understanding.
- To get recommendations: https://kvgmrs-api.herokuapp.com/recommend_movie
Data to be sent in POST request:
{
movie_name:"The Avengers",
number_of_recommendations:"10"
}
Data Returned by the API in JSON format:
{
input_movie:{
movie_id:TMDB_MOVIE_ID
},
recommendations:[
{
rank:1,
movie_id:TMDB_MOVIE_ID
},
{
rank:2,
movie_id:TMDB_MOVIE_ID
},
.
.
.
]
}
- To get Movie Reviews with Sentiments: https://kvgmrs-api.herokuapp.com/movie_reviews_sentiment
Data to be sent in POST request:
{
movie_imdb_id:"MOVIE_IMDB_ID"
}
Data Returned by the API in JSON format:
[
{
id: 1,
content: "THE REVIEW",
sentiment: "SENTIMENT FOR THE REVIEW"
},
{
id: 2,
content: "THE REVIEW",
sentiment: "SENTIMENT FOR THE REVIEW"
},
.
.
.
10
]
NOTE: The error messages are returned in the following format:
{
error:"Content of ERROR Message"
}
- Clone or download the repository in your local machine.
- Open command prompt in the following folder
FRONTEND/kvg-mrs
- Install all the npm packages
npm install
- Since the Flask API is already deployed on Heroku no need to run the Flask API in your local machine to start the React frontend. You can start the react application using the following command:
npm start
- Clone or download the repository and open command prompt in
API
folder. - Create a virtual environemt
mkvirtualenv environment_name
- Install all the dependencies
pip install -r requirements.txt
- Run the app.py file
python app.py
The API will be running at http://127.0.0.1:5000/
NOTE: You can run the Flask API and the React Frontend in parallel and can use for development by replacing the baseURL,present in FRONTEND/kvg-mrs/src/api/recommenderapi.js
, with the Flask API running link.
- Clone or download the repository and open command prompt in
API
folder. - Create your docker account at https://hub.docker.com
- Download the docker desktop based on you windows version from the official website of Dockers and login to the docker desktop.
- Start the Docker desktop in you machine.
- The Dockerfile for dockerinzing this Flask API is already present in the API folder.
- Open command prompt in API folder and run the below mentioned commands:
- Building the Image:
docker build -t ENTER_YOUR_OWN_TAG_NAME .
It will take some time for the execution of the above command. After execution of the above command you can see the docker image details using the following command:
docker images
- Install Heroku CLI in your local machine.
- Login to your account using follwing command:
heroku login
- Run the following commands for deplyment. Logging into heroku container:
heroku container:login
- Create a app in heroku:
heroku create YOUR_APP_NAME
- Pushing the docker image into heroku:
heroku container:push web --app YOUR_APP_NAME
- Releasing the web app:
heroku container:release web --app YOUR_APP_NAME
That's it, you can see your API running at https://YOUR_APP_NAME.herokuapp.com/
- Clone or download the repository and open command prompt in
API
folder. - Create your docker account at https://hub.docker.com
- Download the docker desktop based on you windows version from the official website of Dockers and login to the docker desktop.
- Start the Docker desktop in you machine.
- Replace the code present in Dockerfile with the code present in localhost_docker_code.txt.
- Open command prompt in API folder and run the below mentioned commands:
- Building the Image:
docker build -t ENTER_YOUR_OWN_TAG_NAME .
- Run the docker container:
docker run -d -p 5000:5000 PREVIOUSLY_ENTERED_TAG_NAME
After execution of the above command you can notice the Flask API running at http://localhost:5000
For Movie Recommendation System
For Deployment Using Dockers
- IMDB 5000 Dataset
- movies_metadata.csv and credits.csv from Movies Dataset
- Remaining Datasets are generated using
MovieRecommendationDatasetPreparation.ipynb
inMovieRecommendationCodes folder
- IMDB 50k Movie Reviews Dataset