Text Classification
Scikit-learn
Joblib
Italian
fiscal
italian
expense-categorization
tfidf
random-forest
on-prem
Instructions to use FedCal/expense-categorizer-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use FedCal/expense-categorizer-it with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("FedCal/expense-categorizer-it", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- it
|
| 5 |
+
library_name: sklearn
|
| 6 |
+
pipeline_tag: text-classification
|
| 7 |
+
tags:
|
| 8 |
+
- fiscal
|
| 9 |
+
- italian
|
| 10 |
+
- expense-categorization
|
| 11 |
+
- tfidf
|
| 12 |
+
- random-forest
|
| 13 |
+
- on-prem
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Expense Categorizer IT v1
|
| 17 |
+
|
| 18 |
+
Pipeline **scikit-learn** (`TfidfVectorizer` + `RandomForestClassifier`) che classifica
|
| 19 |
+
descrizioni di spese in **italiano** nelle categorie fiscali. Puro machine learning:
|
| 20 |
+
**nessun LLM**, on-prem, deterministico, ~1 ms/inferenza. Macro-F1 ≥ 0.80 sul set di test.
|
| 21 |
+
|
| 22 |
+
## Input / Output
|
| 23 |
+
- **Input:** descrizione testuale della spesa (IT) + importo in EUR (usato come bucket di ordine di grandezza, segnale debole).
|
| 24 |
+
- **Output:** categoria fiscale predetta.
|
| 25 |
+
|
| 26 |
+
## Uso
|
| 27 |
+
```python
|
| 28 |
+
import joblib
|
| 29 |
+
model = joblib.load("expense_categorizer_it_v1.joblib")
|
| 30 |
+
# Il testo combina descrizione + bucket importo (vedi training script)
|
| 31 |
+
pred = model.predict(["cena di lavoro con cliente"])
|
| 32 |
+
print(pred)
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Training
|
| 36 |
+
`TfidfVectorizer` su `descrizione` (+ bucket `importo`) → `RandomForestClassifier`.
|
| 37 |
+
Riproducibile con lo script `train_expense_categorizer.py` del progetto
|
| 38 |
+
(CSV con colonne `descrizione, importo, categoria`).
|
| 39 |
+
|
| 40 |
+
## Source & Attribution
|
| 41 |
+
- **Author:** Federico Calò — https://federicocalo.dev (Wikidata Q139562320, ORCID 0009-0004-4102-281X)
|
| 42 |
+
- **Project:** https://federicocalo.dev — dev-tools fiscali on-prem
|
| 43 |
+
- **License:** Apache-2.0
|
| 44 |
+
|
| 45 |
+
## Citation
|
| 46 |
+
```
|
| 47 |
+
Federico Calò, "Expense Categorizer IT v1", federicocalo.dev, 2026. https://huggingface.co/FedCal/expense-categorizer-it
|
| 48 |
+
```
|