Update README.md
Browse files
README.md
CHANGED
|
@@ -9,4 +9,86 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
|
| 13 |
+
# Hybrid Book Recommender System
|
| 14 |
+
|
| 15 |
+
This is a **Hybrid Recommendation System** deployed on Hugging Face Spaces using **Gradio**.
|
| 16 |
+
It combines **Collaborative Filtering (SVD++)** and **Content-Based Filtering** to recommend books to users, even if they are new to the system (cold-start support).
|
| 17 |
+
|
| 18 |
+
π **Live Demo**: [Check it out on Hugging Face Spaces](https://huggingface.co/spaces/khalednabawi11/Book-Recommender-System)
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## Features
|
| 23 |
+
|
| 24 |
+
- **Hybrid Model**: Combines collaborative filtering and content-based filtering for more accurate recommendations.
|
| 25 |
+
- **Cold Start Ready**: Recommends top-rated books to new users with no prior ratings.
|
| 26 |
+
- **Book Covers**: Shows book covers alongside titles for a more visual experience.
|
| 27 |
+
- **Gradio**: Backend runs on FastAPI, frontend built with Gradio for an interactive experience.
|
| 28 |
+
- Model loaded from Kaggle Models using `kagglehub`.
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## How It Works
|
| 33 |
+
|
| 34 |
+
1. **For registered users**:
|
| 35 |
+
- Predicts ratings for books the user hasnβt rated yet.
|
| 36 |
+
- Shows the top N books sorted by predicted rating.
|
| 37 |
+
|
| 38 |
+
2. **For new users**:
|
| 39 |
+
- Recommends globally top-rated books as a fallback (cold start).
|
| 40 |
+
|
| 41 |
+
3. **Visual Output**:
|
| 42 |
+
- Book title, predicted rating, and cover image in a neat table.
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## Project Structure
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
βββ app.py # Main Gradio app
|
| 50 |
+
βββ requirements.txt # Dependencies
|
| 51 |
+
βββ README.md
|
| 52 |
+
βββ books-recomendation-system-0.ipynb => Model Development Notebook
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
## Setup Locally
|
| 59 |
+
|
| 60 |
+
Clone the repo and run:
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
pip install -r requirements.txt
|
| 64 |
+
python app.py
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Dependencies
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
- gradio
|
| 71 |
+
- pandas
|
| 72 |
+
- numpy
|
| 73 |
+
- scikit-learn
|
| 74 |
+
- kagglehub
|
| 75 |
+
- surprise (for SVD++ model)
|
| 76 |
+
- fastapi
|
| 77 |
+
- uvicorn
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Model Details
|
| 81 |
+
|
| 82 |
+
- Collaborative Filtering: SVD++ trained on user-item ratings.
|
| 83 |
+
- Content-Based Filtering: Uses book metadata (title, genres, etc.).
|
| 84 |
+
- Hybrid approach balances both for better personalization.
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
## Deployment
|
| 88 |
+
```
|
| 89 |
+
This app is deployed on Hugging Face Spaces using Gradio UI and loads the model directly from Kaggle Models via kagglehub.
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
|
| 94 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|