Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,14 +1,43 @@
|
|
| 1 |
---
|
| 2 |
library_name: swirl-wine-recommendations
|
| 3 |
tags:
|
| 4 |
-
- model_hub_mixin
|
| 5 |
-
- pytorch_model_hub_mixin
|
| 6 |
- recommendation
|
| 7 |
- two-tower
|
| 8 |
- wine
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
library_name: swirl-wine-recommendations
|
| 3 |
tags:
|
|
|
|
|
|
|
| 4 |
- recommendation
|
| 5 |
- two-tower
|
| 6 |
- wine
|
| 7 |
+
- pytorch
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# Two-Tower Wine Recommendation Model
|
| 11 |
+
|
| 12 |
+
Neural network for personalized wine recommendations.
|
| 13 |
+
|
| 14 |
+
## Usage
|
| 15 |
+
|
| 16 |
+
This model is designed to be used with HuggingFace Inference Endpoints.
|
| 17 |
+
The custom `handler.py` processes requests in this format:
|
| 18 |
+
|
| 19 |
+
```json
|
| 20 |
+
{
|
| 21 |
+
"inputs": {
|
| 22 |
+
"user_wines": [
|
| 23 |
+
{"embedding": [768 floats], "rating": 4.5},
|
| 24 |
+
...
|
| 25 |
+
],
|
| 26 |
+
"candidate_wine": {
|
| 27 |
+
"embedding": [768 floats],
|
| 28 |
+
"color": "red",
|
| 29 |
+
"type": "still"
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
Returns: `{"score": 75.5}`
|
| 36 |
+
|
| 37 |
+
## Architecture
|
| 38 |
+
|
| 39 |
+
- **User Tower**: Encodes user preferences from reviewed wines
|
| 40 |
+
- **Wine Tower**: Encodes wine characteristics
|
| 41 |
+
- **Output**: Match score 0-100 via dot product
|
| 42 |
+
|
| 43 |
+
See [Swirl Wine App](https://swirlyourwines.com) for more info.
|