Skip to content

Gui-cm/backend-python-flask

Repository files navigation

Examples of requests using GET and POST methods

  • Examples of requests using GET and POST methods

    POST
      $ curl -X POST https://www.guicmtech.com.br/recms -H 'Content-Type: application/json' -d '{"movie_title":"Heat (1995)"}'
    
    GET
      $ curl -X GET https://www.guicmtech.com.br/api
    

movie-rec-engine-backend

Here you can find the Movie Recommendation engine backend Flask API code.

I created this project to leverage the open-source MovieLens dataset and hopefully help people figure out what to watch next. Below is an illustration of what the engine will recommend if you enter the movie "Heat (1995)".

image

Get started

To run the Flask API, you will first need to download the similarity matrix file from here:

Google drive folder: movie_similarity.csv

and place the movie_similarity.csv file into the root directory. Your code structure should look as follows:

image

Next, make sure you have the necessary libraries installed. For example, if you are using anaconda, you can create a separate environment and install necessary libraries as follows:

conda create --name py37_tut python=3.7
conda activate py37_tut
pip install Flask Flask-Cors pandas

To run the API:

python application.py

To test the API, in a separate terminal run the following:

curl -X POST https://0.0.0.0:80/recms -H 'Content-Type: application/json' -d '{"movie_title":"Heat (1995)"}'

If everything is working properly, you should see the following output/recommendations:

image

Next steps - Build out the frontend

This backend API is designed to work with the Vue.js frontend which you can find here: Vue.js Frontend Repo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published