Downloads · 30 days
4
4% of all-time downloads
marinamen/gastos-bancarios-classifier
gastos-bancarios-classifier is a text classification model from marinamen. Use it when you need a label for a piece of text.
Fine-tuned dccuchile/bert-base-spanish-wwm-cased to classify Spanish bank transaction descriptions into 14 spending categories.
Downloads · 30 days
4
4% of all-time downloads
All-time downloads
104
Public
Parameters
110M
981 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors439 MB · 100%
From the Hugging Face model README
Fine-tuned dccuchile/bert-base-spanish-wwm-cased to classify Spanish bank transaction descriptions into 14 spending categories.
Test accuracy: 86.4%
I built a personal finance app and wanted automatic transaction categorization. The tricky part wasn't the model — it was the data. Real bank statements are messy: truncated merchant names, mixed case, reference codes, and genuinely ambiguous transactions (COMPRA AMAZON could be anything).
Rather than scraping real transactions, I generated a synthetic dataset of 1,400 examples designed to be hard to classify. The key constraints:
COMPRA MERCADONA, CARGO PERIODICO NETFLIX, TPV ZARA MAD)NIKE → Ropa or Deporte, CARREFOUR → Alimentacion or Tecnologia)Dataset: marinamen/gastos-bancarios-es
Alimentacion · Restaurantes · Transporte · Ropa · Salud · Tecnologia · Hogar · Viajes · Educacion · Deporte · Entretenimiento · Energia · Alquiler · Varios
model = "dccuchile/bert-base-spanish-wwm-cased"
epochs = 15
learning_rate = 3e-5
batch_size = 16
max_length = 64
Chose Spanish BERT over multilingual DistilBERT after the multilingual model stalled at 42% — the Spanish-specific pretraining made a significant difference on short, noisy text.
| Category | Precision | Recall | F1 |
|---|---|---|---|
| Alquiler | 1.000 | 1.000 | 1.000 |
| Educacion | 0.909 | 1.000 | 0.952 |
| Varios | 1.000 | 0.857 | 0.923 |
| Alimentacion | 0.867 | 0.929 | 0.897 |
| Deporte | 0.778 | 0.875 | 0.824 |
| Entretenimiento | 0.857 | 0.667 | 0.750 |
Entretenimiento is the weakest category — it overlaps with Tecnologia on merchants like Apple and Amazon, which is expected given how those companies operate.
from transformers import pipeline
classifier = pipeline("text-classification", model="marinamen/gastos-bancarios-classifier")
classifier("CARGO PERIODICO NETFLIX")
# [{'label': 'Entretenimiento', 'score': 0.97}]
Interactive demo: gastos-bancarios-space