bareethul commited on
Commit
75fa406
Β·
verified Β·
1 Parent(s): e937210

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -29
README.md CHANGED
@@ -10,37 +10,42 @@ license: mit
10
  ---
11
  # Book Genre Predictor
12
 
13
- This Space hosts a **Gradio app** that predicts the **numeric genre code of a book** based on its **physical dimensions and page count**.
14
- It was built using a **tabular AutoGluon model** and deployed on Hugging Face Spaces.
15
 
16
  ---
17
 
18
- ## Dataset & Model
19
 
20
- - **Source Model Repo:** [FaiyazAzam/24679-tabular-autolguon-predictor](https://huggingface.co/FaiyazAzam/24679-tabular-autolguon-predictor)
21
- - **Task:** Predict `Genre` of a book given its physical features.
22
- - **Features Used:**
23
- - `Height` (cm)
24
- - `Width` (cm)
25
- - `Depth` (cm, spine thickness)
26
- - `Page Count` (integer)
27
 
28
- The model was trained using [AutoGluon Tabular](https://auto.gluon.ai/stable/index.html).
29
- Prediction outputs are **numeric labels** (e.g., 0, 1, 2) that correspond to genres in the training data.
 
 
 
 
 
30
 
31
- ---
 
 
32
 
33
- ## App Instructions
34
 
35
- 1. Enter values for **Height, Width, Depth, Page Count**.
36
- 2. Click **Predict** to see the model’s prediction.
37
- 3. Use one of the **example inputs** to quickly test the app.
38
 
39
- βœ”οΈ Input validation ensures all values must be **positive numbers**.
 
 
 
40
 
41
  ---
42
 
43
- ## Example Inputs
44
 
45
  | Height (cm) | Width (cm) | Depth (cm) | Page Count |
46
  |-------------|------------|------------|------------|
@@ -48,24 +53,45 @@ Prediction outputs are **numeric labels** (e.g., 0, 1, 2) that correspond to gen
48
  | 24.0 | 15.0 | 2.2 | 320 |
49
  | 18.5 | 12.0 | 1.5 | 180 |
50
 
 
 
 
51
  ---
52
 
53
- ## Technical Notes
54
 
55
- - **Framework:** [Gradio](https://www.gradio.app/) interface.
56
- - **Backend:** AutoGluon `TabularPredictor`.
57
  - **Deployment:** Hugging Face Spaces (`sdk: gradio`).
58
- - **Known Limitation:** Output is a **numeric genre code**, since the training dataset only contained encoded labels.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  ---
61
 
62
- ## How This Fits the Assignment
 
 
 
 
 
63
 
64
- - βœ… Uses a **classmate’s tabular model** (not my own).
65
- - βœ… Researched and linked the **dataset/model docs**.
66
- - βœ… Built a Gradio app with **widgets + examples**.
67
- - βœ… Exposed inputs with validation and presented predictions clearly.
68
- - βœ… Deployed publicly on Hugging Face Spaces with proper documentation.
69
 
70
  ---
71
 
 
10
  ---
11
  # Book Genre Predictor
12
 
13
+ This Hugging Face Space hosts a **Gradio app** that predicts the **genre of a book** based on its **physical dimensions and page count**.
14
+ It uses a **AutoGluon Tabular model** trained during last session.
15
 
16
  ---
17
 
18
+ ## Dataset & Model Card
19
 
20
+ - **Dataset:** Book metadata dataset (features: `Height`, `Width`, `Depth`, `Page Count`; label: `Genre`).
21
+ - **Model Repo:** [FaiyazAzam/24679-tabular-autolguon-predictor](https://huggingface.co/FaiyazAzam/24679-tabular-autolguon-predictor)
22
+ - **Framework:** [AutoGluon Tabular](https://auto.gluon.ai/stable/index.html)
23
+ - **Task:** Multi class classification -> predict `Genre` (numeric code).
 
 
 
24
 
25
+ ### Input Features
26
+ | Feature | Type | Unit / Description |
27
+ |--------------|---------|-------------------------------------|
28
+ | Height | float | cm – height of the book |
29
+ | Width | float | cm – width of the book |
30
+ | Depth | float | cm – spine thickness |
31
+ | Page Count | integer | number of pages |
32
 
33
+ ### Label
34
+ - `Genre` β†’ encoded as **numeric codes** (e.g. 0, 1, 2, …).
35
+ - Mapping to actual names was not provided in the original dataset.
36
 
37
+ ---
38
 
39
+ ## App Interface
 
 
40
 
41
+ - **Widgets:** Numeric input boxes for each feature.
42
+ - **Output:** Numeric code prediction (e.g. `"Predicted Genre: 1"`).
43
+ - **Examples:** 3 preloaded examples for quick testing.
44
+ - **Validation:** Ensures all inputs are positive.
45
 
46
  ---
47
 
48
+ ## πŸ” Example Usage
49
 
50
  | Height (cm) | Width (cm) | Depth (cm) | Page Count |
51
  |-------------|------------|------------|------------|
 
53
  | 24.0 | 15.0 | 2.2 | 320 |
54
  | 18.5 | 12.0 | 1.5 | 180 |
55
 
56
+ Note: The model often defaults to predicting a single genre (e.g. Fiction / code 0).
57
+ This reflects dataset/model limitations, not the app itself.
58
+
59
  ---
60
 
61
+ ## Technical Details
62
 
63
+ - **Backend:** AutoGluon `TabularPredictor` loaded from a zipped artifact.
64
+ - **Interface:** [Gradio](https://www.gradio.app/).
65
  - **Deployment:** Hugging Face Spaces (`sdk: gradio`).
66
+ - **Environment:** Python 3.10, pinned requirements.
67
+
68
+ ---
69
+
70
+ ## Limitations
71
+
72
+ - **Numeric labels only:** Original training dataset did not include human readable genre names.
73
+ - **Collapsed predictions:** Model tends to overpredict the majority class (`0`).
74
+ - **Generalization:** Accuracy on unseen books is uncertain due to limited feature set.
75
+
76
+ ---
77
+
78
+ ## Future Improvements
79
+
80
+ - Map numeric codes to the actual genre categories from the dataset.
81
+ - Retrain model with balanced classes.
82
+ - Provide confidence scores along with predictions.
83
+ - Explore richer book features (author, publisher, language).
84
 
85
  ---
86
 
87
+ ## AI Disclosure
88
+
89
+ Parts of this project were supported with the help of AI tools (GPT-5), mainly for:
90
+ - Debugging deployment issues on Hugging Face Spaces
91
+ - Improving the stability of the Gradio interface
92
+ - Polishing documentation
93
 
94
+ The dataset, model training, and integration choices remain based on classmate provided artifacts and my own implementation work.
 
 
 
 
95
 
96
  ---
97