Skip to content

A system based on the study by Aranzamendez, Bolito, and Rafe (2024) titled "An Enhancement of Content-based Filtering Applied in Movie Recommendation System."

Notifications You must be signed in to change notification settings

JCBolito/cinematic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cinematic

A movie recommender system that demonstrates the movie recommendations made by the Content-based Filtering algorithm and the enhanced Content-based Filtering algorithm developed by Aranzamendez, Bolito, and Rafe (2024) which utilizes Maximal Marginal Relevance, Temporary Preference Profile, and FastText under the hood.

Notes

  • The Next.js application in this repository is a Progressive Web App. You may opt to install in your desktop or mobile device through your browser settings.
  • To install it in your mobile device, the Next.js application must first be accessible publicly. To do this:
    • Create a tunnel of the PORT you wish to expose (in this case, 3000) using VS Code. A proxy URL should be generated by VS Code.
    • Set the port's visibility to Public.
    • Add the generated proxy URL to the allowedOrigins array in the next.config.js file. Be sure to follow the same format as the URLs that are already included in the array.

Requirements

  1. Node.js
  2. Node Package Manager (Included in the installation process of Node.js)
  3. Python

Set-up

/next-app directory

  1. Go to the /next-app directory.
  2. Run npm install.
  3. Setup and connect your Vercel Postgres storage to the /next-app directory as seen in the official documentation. Once completed, this will automatically generate environment variables that you should add to your .env.local file.
  4. Run npm run db:push in your terminal to initialize the database schema of your Vercel Postgres storage.
  5. Go to The Movie Database. Create an account and acquire your API key. For more information, read their official documentation. Once you have acquired the API key, store it as TMDB_TOKEN in your .env.local file.
  6. Once you have a .env.local file identical to the contents of .env.local.example, run npm run dev in the terminal to run the Next.js app locally.
  7. Using an API testing platform like Postman or Insomnia, do a POST request to http://localhost:3000/api/initialize-database to fill your database with data from The Movie Database. This may take a while to finish.

Notes

  • Going to http://localhost:3000/movies may throw some errors since you have yet to setup your /fast-api directory.
  • If you only want to setup your PostgreSQL locally, you may do so by referring to Drizzle's official documentation.

/fast-api directory

  1. Once you're done setting up the next-app directory (its development environment should still be running), go to the /fast-api directory.
  2. Run pip install -r requirements.txt to install the necessary dependencies.
  3. Run python main.py in the terminal to run your FastAPI code. The application should now work properly.

Notes

  • For a faster build time, the actual code for FastText is not included. Instead, FastText was utilized to create the normalized_similarity_keywords.pkl file in the /pickle directory.

System Walkthrough and Screenshots

  1. To enable the functionality of user profiles, authentication is a must to store and generate the necessary user information. The Login Page is routed at the root of the web app as seen in the following image. Login Page
  2. If the user does not have an account, they may click the “Sign up” link in the Login Page and they will be redirected to the Sign-Up Page where they can create their own account once they have filled up the necessary information. Sign In Page
  3. Once the user has an account, they may now input their credentials in the Login Page and once they log in successfully, they will be redirected to the Home Page where the movies will be listed. Users can browse movies through pagination or search for specific movies they wish to rate. If the user has yet to rate any movie, the original Content-based Filtering algorithm (CBF Recommendations) will not recommend any movies. To rate a movie, a user must click on the card of the movie they wish to rate. Home Page
  4. Upon clicking the movie card of the movie, they wish to rate, they will be redirected to that movie’s page. In that movie’s page, the original and enhanced algorithm will recommend movies based on the selected movie. Movie Page
  5. Once a single movie has been rated, the original algorithm will now be able to recommend movies based on the movie/s rated by the user. In contrast, the enhanced algorithm (ABR-CBF Recommendations) will only recommend movies once the user has rated at least 5 movies. Home w/ only CBF
  6. In the meantime, they will be encouraged to build their Temporary Preference Profile for the algorithm to provide recommendations while they do not have the optimal number of rated movies yet. Upon clicking the “Preference Profile” button, a modal will appear where the users are prompted to rate their preferred genres from 1 to 5 stars (1 – lowest; 5 – highest). TPP Modal
  7. Once the user has built their Preference Profile by rating their preferred genres, the enhanced algorithm will now be able to recommend movies based on their Temporary Preference Profile until such time that they have rated the optimal number of movies (in this case, 5). Home w/ CBF and TPP
  8. Once the user has rated at least five movies, the enhanced algorithm will now recommend movies using Maximal Marginal Relevance. From the movie recommendations, they can choose how diverse they want the recommendations to be, with 0 being the most diverse, to 1 being the most relevant. They can also choose a 0.5 diversity parameter – a decent balance between diversity and relevance of movie recommendations. Home w/ CBF and ABR-CBF
  9. Users also can navigate to their Profile where they can see and search for the movies they have rated. User Profile

About

A system based on the study by Aranzamendez, Bolito, and Rafe (2024) titled "An Enhancement of Content-based Filtering Applied in Movie Recommendation System."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published