Spaces:
Sleeping
Sleeping
File size: 3,656 Bytes
6cf0f64 7068f46 75fa406 7068f46 75fa406 7068f46 c1c854f cc827a8 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 e937210 7068f46 c699ba7 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 75fa406 7068f46 6cf0f64 |
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 |
---
title: Book Genre Predictor
colorFrom: indigo
colorTo: red
sdk: gradio
sdk_version: 5.47.1
app_file: app.py
pinned: false
license: mit
---
# Book Genre Predictor
This Hugging Face Space hosts a **Gradio app** that predicts the **genre of a book** based on its **physical dimensions and page count**.
It uses a **AutoGluon Tabular model** trained during last session.
---
## Dataset & Model Card
- **Dataset:** Book metadata dataset (features: `Height`, `Width`, `Depth`, `Page Count`; label: `Genre`).
- **Dataset Information:** This app uses the [Books-tabular-dataset (its-zion-18)](https://huggingface.co/datasets/its-zion-18/Books-tabular-dataset) The dataset is licensed under **MIT** and consists of **~330 records** in Parquet format (split into `original` and `augmented`).
- **Model Repo:** [FaiyazAzam/24679-tabular-autolguon-predictor](https://huggingface.co/FaiyazAzam/24679-tabular-autolguon-predictor)
- **Framework:** [AutoGluon Tabular](https://auto.gluon.ai/stable/index.html)
- **Task:** Multi class classification -> predict `Genre` (numeric code).
### Input Features
| Feature | Type | Unit / Description |
|--------------|---------|-------------------------------------|
| Height | float | cm β height of the book |
| Width | float | cm β width of the book |
| Depth | float | cm β spine thickness |
| Page Count | integer | number of pages |
### Label
- `Genre` β encoded as **numeric codes** (e.g. 0, 1, 2, β¦).
- Mapping to actual names was not provided in the original dataset.
---
## App Interface
- **Widgets:** Numeric input boxes for each feature.
- **Output:** Numeric code prediction (e.g. `"Predicted Genre: 1"`).
- **Examples:** 3 preloaded examples for quick testing.
- **Validation:** Ensures all inputs are positive.
---
## π Example Usage
| Height (cm) | Width (cm) | Depth (cm) | Page Count |
|-------------|------------|------------|------------|
| 20.1 | 13.5 | 1.8 | 250 |
| 24.0 | 15.0 | 2.2 | 320 |
| 18.5 | 12.0 | 1.5 | 180 |
Note: The model often defaults to predicting a single genre (e.g. code 0).
This reflects dataset/model limitations, not the app itself.
---
## Technical Details
- **Backend:** AutoGluon `TabularPredictor` loaded from a zipped artifact.
- **Interface:** [Gradio](https://www.gradio.app/).
- **Deployment:** Hugging Face Spaces (`sdk: gradio`).
- **Environment:** Python 3.10, pinned requirements.
---
## Limitations
- **Numeric labels only:** Original training dataset did not include human readable genre names.
- **Collapsed predictions:** Model tends to overpredict the majority class (`0`).
- **Generalization:** Accuracy on unseen books is uncertain due to limited feature set.
---
## Future Improvements
- Map numeric codes to the actual genre categories from the dataset.
- Retrain model with balanced classes.
- Provide confidence scores along with predictions.
- Explore richer book features (author, publisher, language).
---
## AI Disclosure
Parts of this project were supported with the help of AI tools (GPT-5), mainly for:
- Debugging deployment issues on Hugging Face Spaces
- Improving the stability of the Gradio interface
- Polishing documentation
The dataset, model training, and integration choices remain based on classmate provided artifacts and my own implementation work.
---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|