Downloads · 30 days
5
2% of all-time downloads
davidit17/e5-grocery-finetuned-v2
e5-grocery-finetuned-v2 is a text classification model from davidit17. Use it when you need a label for a piece of text. The card lists the license as mit.
Fine-tuned intfloat/multilingual-e5-small for classifying Hebrew grocery shopping list items into 12 supermarket categories. finetune code at https://github.com/davidit17/shoppinglistbot - Larger dataset — 1886 total…
Downloads · 30 days
5
2% of all-time downloads
All-time downloads
261
Public
Parameters
118M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.onnx589 MB · 54%
From the Hugging Face model README
Fine-tuned intfloat/multilingual-e5-small for classifying Hebrew grocery shopping list items into 12 supermarket categories. finetune code at https://github.com/davidit17/shopping_list_bot
מוצרי חלב וביציםירקות ופירותלחם מאפים ודגניםחטיפים ומתוקיםניקיון טיפוח וחד פעמימשקאותמוצרים לאפייהבשר ודגיםקפואים וסלטיםיבשיםרטבים וממרחיםאחרfrom transformers import pipeline
classifier = pipeline(
"text-classification",
model=f"davidit17/e5-grocery-finetuned-v2",
)
items = ["גבינה צהובה", "עגבניות שרי", "שמפו", "קוקה קולה", "חזה עוף"]
for item in items:
result = classifier(item)[0]
print(item, "→", result["label"], f"({result['score']:.2f})")
CONFIDENCE_THRESHOLD = 0.5
def predict(text: str) -> str:
result = classifier(text)[0]
return result["label"] if result["score"] >= CONFIDENCE_THRESHOLD else "אחר"
| Parameter | Value |
|---|---|
| Base model | intfloat/multilingual-e5-small |
| Max epochs | 50 (early stopping, patience=8) |
| Learning rate | 2e-5 |
| Weight decay | 0.01 |
| Warmup ratio | 0.1 |
| Batch size | 16 |
| Max sequence length | 32 |
| Train / test split | 80% / 20% stratified |
| Hardware | GPU (CUDA) |
| Source | Description |
|---|---|
| Source A | Manual Hebrew grocery lists from Israeli forum |
| Source B | Excel-format grocery list, cleaned and melted |
| Source C | Web grocery list labelled with Gemini |
| Source D | ChatGPT-labelled items across all 12 categories |
| Source E | Synthetic items generated with rule-based Hebrew augmentor |
| Source F | Hand-curated booster set for weak categories |
| Metric | Base (zero-shot) | Fine-tuned v2 |
|---|---|---|
| Accuracy | 0.0556 | 0.6878 |
| Weighted F1 | 0.0146 | 0.6758 |
| Category | F1 |
|---|---|
מוצרי חלב וביצים | 0.8333 |
ירקות ופירות | 0.5000 |
לחם מאפים ודגנים | 0.6897 |
חטיפים ומתוקים | 0.8308 |
ניקיון טיפוח וחד פעמי | 0.7292 |
משקאות | 0.8125 |
מוצרים לאפייה | 0.8000 |
בשר ודגים | 0.7317 |
קפואים וסלטים | 0.4091 |
יבשים | 0.3243 |
רטבים וממרחים | 0.1429 |
אחר | 0.8182 |
אחר.אחר.אחר category is a catch-all and may have lower precision than domain-specific categories.This repository now includes optimized ONNX versions of the model for efficient inference.
The repository includes the original PyTorch model as well as optimized ONNX versions for faster CPU inference.
| Model | Accuracy | Weighted F1 | Macro F1 | Avg. Latency (ms) | Throughput (samples/sec) |
|---|---|---|---|---|---|
| PyTorch (safetensors) | 0.6878 | 0.6758 | 0.6351 | 19.83 | 50.43 |
| ONNX (FP32) | 0.6878 | 0.6758 | 0.6351 | 9.80 | 102.09 |
| ONNX (INT8) | 0.6402 | 0.6184 | 0.5701 | 6.70 | 149.21 |
safetensors) — Best for further fine-tuning and GPU inference.from optimum.onnxruntime import ORTModelForFeatureExtraction
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(
"davidit17/e5-grocery-finetuned-v2"
)
model = ORTModelForFeatureExtraction.from_pretrained(
"davidit17/e5-grocery-finetuned-v2",
subfolder="onnx",
)
model = ORTModelForFeatureExtraction.from_pretrained(
"davidit17/e5-grocery-finetuned-v2",
subfolder="onnx-int8",
)