DistilBERT Food Category Classifier (7 labels)
Model Summary
This model is a fine-tuned DistilBERT classifier that predicts a single food category for a given product/ingredient name.
Labels (7):
vegetablefruitdairymeatbeveragesnackgrain
Typical output:
- a category label (optionally with a confidence score)
Eval Results
Synthetic split (train/validation/test from the same generated distribution)
- Accuracy: ~0.99
- Macro F1: ~0.988
Manual unseen set (n=20)
- Accuracy: 0.70
Note: The manual unseen set is small and intended as a quick sanity check for generalization to unseen product names.
Dataset
This model was fine-tuned on a custom product classification dataset.
The dataset consists of product/ingredient names mapped to 7 coarse food categories:
- vegetable
- fruit
- dairy
- meat
- beverage
- snack
- grain
The data includes a mix of manually labeled and generated samples. All entries are short product titles or ingredient names in English.
Note: The dataset is domain-specific (food products only) and does not cover non-food categories. Model performance depends on vocabulary coverage and label consistency.
Intended Use
- Food/product categorization for search, filtering, or analytics
- Categorizing short product titles, ingredient names, and simple food phrases
- A lightweight baseline model for food taxonomy experiments
Not Intended For
- General “anything in the world” categorization (electronics, cosmetics, etc.)
- Medical, nutrition, allergen, or dietary advice
- High-stakes decisions
How to Use
Install
pip install transformers torch
- Downloads last month
- 11
Model tree for muhammad1707/distilbert-food-category
Base model
distilbert/distilbert-base-uncased