Spaces:
Sleeping
Sleeping
File size: 3,753 Bytes
fb63f4e b25d524 d327ca1 fb63f4e d327ca1 fb63f4e c15a4cb 0a2f730 f2b8255 0a2f730 b13b0da 0a2f730 c15a4cb 0a2f730 c15a4cb 0a2f730 c15a4cb 0a2f730 c15a4cb 0a2f730 c15a4cb 0a2f730 c15a4cb 0a2f730 c15a4cb 0a2f730 f2b8255 0a2f730 f2b8255 0a2f730 069d6cd 0a2f730 c15a4cb 5de445a b13b0da c15a4cb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | ---
title: Netflix Recommendation App
emoji: πΏ
colorFrom: blue
colorTo: red
sdk: docker
python_version: "3.12"
app_port: 7860
pinned: false
short_description: "Netflix title recommendations using cosine similarity."
tags: ["recommendation", "netflix", "flask", "cosine-similarity", "docker"]
---
# Netflix Recommender App
A Flask-based web application that provides personalized recommendations for Netflix content using a content-based filtering approach.
## Features
- Content-based recommendations based on TF-IDF and cosine similarity
- Search and autocomplete functionality
- Visualizations of Netflix content distribution
- Deployed on huggingface for easiest access
- Works on both macOS and Windows locally
- Docker deployment available
## Prerequisites
- **Google Chrome and Internet Access**
Ensure you have the following installed to build/run locally:
- **Python 3.12+** (Check with `python --version` or `python3 --version`)
- **Node.js and npm** (Check with `node -v` and `npm -v`)
- **pip** (Python package manager)
## View application online (easiest method)
https://huggingface.co/spaces/erichier/finalcapstone
## Manual Installation
### 1. Clone the Repository
```sh
git clone https://huggingface.co/spaces/erichier/finalcapstone
cd finalcapstone
```
### 2. Set Up a Virtual Environment
#### macOS & Linux
```sh
python3.12 -m venv venv
source venv/bin/activate
```
#### Windows (Command Prompt)
```sh
python -m venv venv
venv\Scripts\activate
```
#### Windows (PowerShell)
```powershell
python -m venv venv
venv\Scripts\Activate.ps1
```
### 3. Install Dependencies
```sh
pip install -r requirements.txt
npm install
```
### 4. Download Dataset
Verify `netflix_titles.csv` is placed present from git clone.
Available here if needed: https://www.kaggle.com/datasets/shivamb/netflix-shows
### 5. Build or Load Model & Run Application
Run the following command to preprocess the dataset and generate a similarity model:
```sh
gunicorn -w 2 -b 0.0.0.0:7860 recommend_app:app
```
This will load the Netflix dataset, process it, and save a cached similarity model (`cosine_sim_cache.pkl`).
The app will be available at:
Access app at [http://0.0.0.0:7860] or [http://localhost:7860]
## File Structure
```
finalcapstone/
βββ Dockerfile # For huggingface or local easy deployment
βββ README.md # Info and instructions on how to build and run
βββ recommend_app.py # Flask API entry point
βββ recommendation_engine.py # Machine Learning Recommendation Engine
βββ netflix_titles.csv # Dataset file from Kaggle.com
βββ requirements.txt # Python dependencies
βββ package.json # Frontend dependencies
βββ static/
β βββ index.html # Main frontend page
β βββ js/ # Frontend scripts
β βββ styles.css # Stylesheet
βββ venv/ # Python virtual environment
```
## Stopping the Server
To stop the Flask server, press **Ctrl + C** in the terminal.
To deactivate the virtual environment:
#### macOS & Linux
```sh
deactivate
```
#### Windows
```sh
venv\Scripts\deactivate
```
## DOCKER Deployment (optional EASY local deployment using Docker)
```sh
docker build -t my-recommend-app .
docker run -p 7860:7860 my-recommend-app
```
access app at http://0.0.0.0:7860 or http://localhost:7860
# Example Use of the Application
## Steps:
1. Enter the name of a Netflix show or movie you like.
2. As you type, autocomplete will suggest matching options.
3. Select one of the autocomplete suggestions.
4. The application will display 10 similar movies and shows, each with a corresponding similarity score percentage.
|