Instructions to use hsilvosa/nova-group-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hsilvosa/nova-group-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hsilvosa/nova-group-classifier")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hsilvosa/nova-group-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Ingredient-to-NOVA Ultra-Processed Food Classifier
This model is a high-precision multilingual text classification model fine-tuned to predict the NOVA Group (processing level 1 to 4) directly from uncompressed raw ingredient lists of food products worldwide.
Dataset
Trained on hsilvosa/open-food-facts.
Model Description
The NOVA classification system assigns food products into four categories based on the extent and purpose of industrial processing:
NOVA 1: Unprocessed or minimally processed foods (e.g. fresh fruits, vegetables, plain meat, grains).
NOVA 2: Processed culinary ingredients (e.g. oils, butter, sugar, salt).
NOVA 3: Processed foods (e.g. canned vegetables, cheeses, freshly baked breads).
NOVA 4: Ultra-processed food and drink products (e.g. industrial snacks, soft drinks, pre-packaged meals with additives).
Pipeline Tag:
text-classificationInput: Uncompressed raw ingredient strings in any major global language.
Output: Multi-class probability distribution across NOVA 1, 2, 3, and 4.
Performance Metrics
| Metric | Score |
|---|---|
| Top-1 Accuracy | 96.20% |
| Top-2 Accuracy | 99.53% |
| Weighted F1-Score | 0.9608 |
| Macro F1-Score | 0.8138 |
Per-Class Performance breakdown
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| NOVA 1 (Minimally Processed) | 0.9407 | 0.9603 | 0.9504 |
| NOVA 2 (Culinary Ingredients) | 0.5333 | 0.3265 | 0.4051 |
| NOVA 3 (Processed Foods) | 0.9180 | 0.9138 | 0.9159 |
| NOVA 4 (Ultra-Processed Foods) | 0.9820 | 0.9861 | 0.9840 |
Python Code Example
from src.models.nova_classifier import NOVAClassifier
classifier = NOVAClassifier.from_pretrained("your-username/nova-group-classifier")
ingredient_text = "Whole milk, sugar, cocoa butter, emulsifier (soy lecithin), natural vanilla flavouring"
result = classifier.predict([ingredient_text])[0]
print(f"Predicted Group: {result['label']}")
print(f"Confidence Score: {result['score']:.4f}")
Training Data
Trained on 30,000+ multilingual records from hsilvosa/open-food-facts, covering global products with verified ingredient text strings and ground-truth NOVA assignments.
- Downloads last month
- 8