Downloads · 30 days
4
5% of all-time downloads
julisses/ecoicop-pt-bertimbau
ecoicop-pt-bertimbau is a machine learning model from julisses. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model classifies short product names (product + brand) into 71 ECOICOP categories related to food and beverage products, in Portuguese. It is based on fine-tuning BERTimbau with data collected from retailers in P…
Downloads · 30 days
4
5% of all-time downloads
All-time downloads
84
Public
Parameters
109M
872 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors436 MB · 100%
From the Hugging Face model README
This model classifies short product names (product + brand) into 71 ECOICOP categories related to food and beverage products, in Portuguese.
It is based on fine-tuning BERTimbau with data collected from retailers in Portugal.
neuralmind/bert-base-portuguese-cased fine-tuned for classification"Leite meio-gordo Mimosa")"01.1.4.1" → Leite meio-gordo ou magro)Evaluated using a stratified 80/20 split on ≈98k manually verified product entries.
| Metric | Value |
|---|---|
| Accuracy | 0.97 |
| Macro F1 | 0.94 |
📌 These results show strong generalization across all ECOICOP categories, including those with few examples.
pytorch_model.bin – Trained BERT weightsconfig.json – Classification head configtokenizer/ – Tokenizer fileslabel_encoder.pkl – Scikit-learn LabelEncoder to map back to ECOICOPThis model is designed for:
from transformers import BertTokenizer, BertForSequenceClassification
import torch, joblib
# Load model and tokenizer
model = BertForSequenceClassification.from_pretrained("julisses/ecoicop-pt-bertimbau")
tokenizer = BertTokenizer.from_pretrained("julisses/ecoicop-pt-bertimbau")
label_encoder = joblib.load("label_encoder.pkl") # load this from your local clone or repo
# Predict
inputs = tokenizer("Iogurte natural Danone", return_tensors="pt", truncation=True)
with torch.no_grad():
logits = model(**inputs).logits
pred = torch.argmax(logits, axis=1).item()
ecoicop_label = label_encoder.inverse_transform([pred])[0]
print("Predicted ECOICOP code:", ecoicop_label)