Hebrew Grocery Item Classifier v2
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
What's new in v2
- Larger dataset โ 3043 total items (2434 train / 609 test), up from ~600 in v1
- 4 training sources โ manual lists, Excel grocery data, Gemini-labelled web data, and a ChatGPT-labelled set
- Synthetic augmentation โ rule-based Hebrew item generator to balance under-represented categories
- Weak-class booster โ extra hand-curated examples for ืืฉืงืืืช, ืงืคืืืื ืืกืืืื, and ืจืืืื ืืืืจืืื
- Per-class F1 tracking โ evaluation now reports per-category F1 to surface weak spots
Categories
ืืืฆืจื ืืื ืืืืฆืื
ืืจืงืืช ืืคืืจืืช
ืืื ืืืคืื ืืืื ืื
ืืืืคืื ืืืชืืงืื
ื ืืงืืื ืืืคืื ืืื ืคืขืื
ืืฉืงืืืช
ืืืฆืจืื ืืืคืืื
ืืฉืจ ืืืืื
ืงืคืืืื ืืกืืืื
ืืืฉืื
ืจืืืื ืืืืจืืื
ืืืจ
Usage
from transformers import pipeline
classifier = pipeline(
"text-classification",
model=f"davidit17/e5-grocery-finetuned-v1",
)
items = ["ืืืื ื ืฆืืืื", "ืขืืื ืืืช ืฉืจื", "ืฉืืคื", "ืงืืงื ืงืืื", "ืืื ืขืืฃ"]
for item in items:
result = classifier(item)[0]
print(item, "โ", result["label"], f"({result['score']:.2f})")
With confidence threshold (recommended)
CONFIDENCE_THRESHOLD = 0.5
def predict(text: str) -> str:
result = classifier(text)[0]
return result["label"] if result["score"] >= CONFIDENCE_THRESHOLD else "ืืืจ"
Training
Data sources
Evaluation
Overall
Per-class F1 (fine-tuned v2)
Limitations
- Primarily covers Israeli supermarket conventions and Hebrew product naming.
- Brand-specific or very niche items may fall back to
ืืืจ.
- Low-confidence predictions (score < 0.5) should be treated as
ืืืจ.
- Synthetic training examples may not fully reflect natural shopping list variation.
- The
ืืืจ category is a catch-all and may have lower precision than domain-specific categories.