Code Monkey home page Code Monkey logo

movie-recommendation's Introduction

Cinewise - Movie Recommendation Using Graph Theory

PyPI - Python Version PyPI - Django Version PyPI - License

Recommend movies based on user's preferred movies, genres, actors, directors and storywriters. Click here to see it in action.

Preview

This project implements the first two algorithms from a research paper published in IEEE Xplore:

  • Union Colors - a combination of multisource 'breadth first search' (BFS) and union-find data structure.
  • Energy Spread - a variation of multisource breadth first search.

The explanation for these algorithms can be found in the paper. Credits for the same go to the respective authors.

We have created a Django application around the algorithm for a smooth experience. Bootstrap is used for creating a simple yet elegant frontpage.

The Graph

The graph has movie titles, genres and the assoicated directors, actors and story writers as the vertices. These vertices are mutually connected for every movie.

OMDB API

We used OMDB API to obtain movie information and create a graph around it. The data is stored using serialization. (movies.pickle, node.pickle and graph.pickle)

Configuration

You need to manually add the movie attributes in the database for autocompletion. Rest of the steps are the same as any other Django project.

  • Clone this repository
git clone https://github.com/yashrajkakkad/movie-recommendation.git
cd movie-recommendation
  • Install the required packages. Using a virtual environment is recommended.
pip install -r requirements.txt
  • Create a file to store your environment variables for python-decouple to give them at the right places.
nano .env
DB_NAME=''
DB_USER=''
DB_PASSWORD=''
DB_HOST=''
APIKEY=''
SECRET_KEY=''
DEBUG=''
  • If you're not going to use a PostgreSQL database, change the DATABASES variable in mysite/settings.py accordingly. Refer Django documentation for that.

  • If you're going to play with movie related information, you can obtain your API key from OMDB website here. Otherwise keep it blank.

  • DEBUG=True for development and False for production.

  • Make the initial migrations

python manage.py makemigrations
python manage.py migrate

Here's the 'different' part:

  • Open the Django shell:
python manage.py shell
  • Add the vertices:
from utils.Movies import *
from cinewise.models import Node
nodes = load_nodes()
for node in nodes:
    Node(name=node).save()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.