A lightweight web app that provides movie recommendations using a pre‑trained collaborative filtering model. Enter comma‑separated movie titles, and the app will suggest a new movie you might enjoy.
- Overview
- Features
- Technologies
- Project Structure
- Installation & Setup
- Usage
- API Endpoint
- Deployment
- License
MovieRecSystem is a minimal viable product (MVP) that integrates a PyTorch‑based collaborative filtering model into a Flask web application. Users enter comma‑separated movie titles in the front end, and the backend returns a recommendation. The UI also reformats titles with leading articles (e.g.,
"Christmas Story, A (1983)" → "A Christmas Story (1983)") and handles extra parentheses (e.g., "Taste of Others, The (Le goût des autres) (2000)") for readability.
-
Simple Form‑based UI
- Input box for comma‑separated movie titles
- Button to fetch recommendations
- Clean, centered layout with basic CSS styling
-
Intelligent Title Formatting
- Regex in the front end rearranges
<Title>, A/An/The (Year)intoA/An/The <Title> (Year) - Supports extra parenthetical content (e.g., foreign titles)
- Regex in the front end rearranges
-
Backend Recommendation
- Loads a pre‑trained PyTorch collaborative filtering model
- Uses a movies CSV (
movies.csv) for title lookup and ID mappings - Returns JSON with either a recommendation or a specific “couldn’t find” error message
- Python 3.x
- Flask – lightweight web framework
- PyTorch – model loading & inference
- Pandas – CSV data loading & processing
- Axios – AJAX requests from front end
- Gunicorn – WSGI HTTP server for deployment
- Git & Git LFS – version control & large‑file management
MovieRecSystem/
├── .gitignore
├── .gitattributes # LFS tracking
├── Procfile # web: gunicorn src.app:app --bind 0.0.0.0:$PORT
├── requirements.txt # pip install requirements
├── Pipfile / Pipfile.lock # Pipenv dependency management
├── data/
│ └── raw/ml-latest/
│ └── movies.csv # Movie metadata
└── src/
├── app.py # Flask application & model integration
├── collaborative_filtering_checkpoint.pt
├── movie_recommender.py # helper logic
├── preprocess_archive.py # data preprocessing scripts
├── preprocess_interviews.py
├── preprocess_ml_latest.py
├── train_model.py # model training script
└── templates/
└── index.html # Front‑end HTML & JS
- Clone the repo and enter its folder:
git clone https://github.com/YourUsername/MovieRecSystem.git cd MovieRecSystem - Install dependencies:
pip install -r requirements.txt
- If using Git LFS for the model checkpoint:
git lfs install git lfs pull
- Start the Flask server:
cd src python app.py