Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,7 +7,136 @@ sdk: gradio
|
|
| 7 |
sdk_version: 5.38.2
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
sdk_version: 5.38.2
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
short_description: AI Shopping Assistant, Locator & Smart Suggestions
|
| 11 |
license: mit
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# ποΈ RetailGenie β In-Store Smart Assistant
|
| 15 |
+
|
| 16 |
+
**RetailGenie** is an AI-powered shopping assistant that helps users **locate in-store products** using dropdown filters and get **intelligent product suggestions** based on natural language queries. Built with Gradio and sample retail data, this project simulates a real-time in-store assistant combining **rule-based filtering** with **FLAN-T5-based AI recommendations**.
|
| 17 |
+
|
| 18 |
+
> β οΈ This project is for **educational and demonstration purposes only**. Product data is mock/simulated and may not reflect real-time inventory.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## π Try Live on Hugging Face
|
| 23 |
+
|
| 24 |
+
RetailGenie is live and accessible via Hugging Face Spaces:
|
| 25 |
+
|
| 26 |
+
π [**Launch RetailGenie on Hugging Face Spaces**](https://huggingface.co/spaces/raviix46/RetailGenie)
|
| 27 |
+
|
| 28 |
+
No setup needed β just visit and start exploring!
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## β¨ Key Features
|
| 33 |
+
|
| 34 |
+
### π§ Navigator Tab
|
| 35 |
+
- Multi-level dropdown filters:
|
| 36 |
+
- Country β State β City β Store β Category β Product β Brand
|
| 37 |
+
- Displays:
|
| 38 |
+
- β
Availability
|
| 39 |
+
- π° Price
|
| 40 |
+
- π¬ Floor, πͺ Aisle
|
| 41 |
+
- π Offers
|
| 42 |
+
- Data is dynamically loaded from nested `.csv` files
|
| 43 |
+
|
| 44 |
+
### π§ Smart Suggestions Tab
|
| 45 |
+
- Accepts natural language queries like:
|
| 46 |
+
- `"gift under 500"`, `"shampoo for dry hair"`
|
| 47 |
+
- Filters products based on:
|
| 48 |
+
- Price limits
|
| 49 |
+
- Tags (dry, oily, gift, budget, etc.)
|
| 50 |
+
- Stock status
|
| 51 |
+
- Response is generated using:
|
| 52 |
+
- `google/flan-t5-small` via Hugging Face Transformers
|
| 53 |
+
- Fallback to hardcoded suggestions if no match is found
|
| 54 |
+
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
+
## π§ System Architecture
|
| 58 |
+
|
| 59 |
+
```text
|
| 60 |
+
User Input (Dropdown / Text)
|
| 61 |
+
β
|
| 62 |
+
βββ Navigator Tab β File system path chaining β Data lookup β Result
|
| 63 |
+
βββ Smart Suggestions β Rule filters + model call β Generated response
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## π οΈ Tech Stack
|
| 68 |
+
|
| 69 |
+
| Category | Tool / Library | Purpose |
|
| 70 |
+
|---------------------|--------------------------------------|----------------------------------------------|
|
| 71 |
+
| **Programming Language** | Python 3.10 | Core backend logic and data handling |
|
| 72 |
+
| **Frontend Framework** | Gradio | Web UI with tabs, dropdowns, and text input |
|
| 73 |
+
| **NLP Model** | google/flan-t5-small (via π€ Transformers) | Natural language product recommendations |
|
| 74 |
+
| **Data Handling** | Pandas | Reading, filtering, and managing CSV data |
|
| 75 |
+
| **Deployment** | Hugging Face Spaces | Hosting and public access to the app |
|
| 76 |
+
| **UI Styling** | HTML, CSS (via Gradio Markdown) | Custom styling for layout and response boxes |
|
| 77 |
+
| **Fallback Logic** | Python conditionals + emoji formatting | Default suggestions when model fails |
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## π Example Queries and Outputs
|
| 82 |
+
|
| 83 |
+
### πΉ Smart Suggestions Tab (Natural Language)
|
| 84 |
+
|
| 85 |
+
| π¬ User Query | π€ AI Response (Sample) |
|
| 86 |
+
|------------------------------------------|--------------------------------------------------------------------------------|
|
| 87 |
+
| `shampoo for dry hair under 300` | "You may try Dove Dryness Repair β βΉ280, available at Floor 1, Aisle 3." |
|
| 88 |
+
| `gift for brother under 500` | "A perfect gift is our Menβs Grooming Kit β βΉ450, available at Floor 2, Aisle 5." |
|
| 89 |
+
| `budget skincare for oily skin` | "Try Clean & Clear Oil Control Face Wash β βΉ150, available at Floor 1, Aisle 2." |
|
| 90 |
+
| `face cream above 700` | "You might like Olay Regenerist β βΉ899, found at Floor 3, Aisle 7." |
|
| 91 |
+
|
| 92 |
+
### πΉ Navigator Tab (Dropdowns)
|
| 93 |
+
|
| 94 |
+
Sample user path:
|
| 95 |
+
|
| 96 |
+
```
|
| 97 |
+
Country β India
|
| 98 |
+
β State β Karnataka
|
| 99 |
+
β City β Bangalore
|
| 100 |
+
β Store β StoreA
|
| 101 |
+
β Category β Shampoo
|
| 102 |
+
β Product β Dove
|
| 103 |
+
β Brand β Dryness Repair
|
| 104 |
+
β Quantity β 500ml
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
**Output:**
|
| 108 |
+
|
| 109 |
+
```
|
| 110 |
+
β
In Stock: Yes
|
| 111 |
+
π° Price: βΉ280
|
| 112 |
+
π¬ Floor: 1
|
| 113 |
+
πͺ Aisle: 3
|
| 114 |
+
π Offer: Buy 1 Get 1 Free
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
---
|
| 118 |
+
|
| 119 |
+
## π§ͺ Run Locally
|
| 120 |
+
|
| 121 |
+
Follow the steps below to set up and run RetailGenie on your machine:
|
| 122 |
+
|
| 123 |
+
### 1. Clone the Repository
|
| 124 |
+
|
| 125 |
+
```bash
|
| 126 |
+
git clone https://github.com/your_username/RetailGenie.git
|
| 127 |
+
cd RetailGenie
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
### 2. Install Dependencies
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
pip install -r requirements.txt
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
### 3. Launch the App
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
python app.py
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
The app will be available at `http://localhost:7860/`
|