Downloads · 30 days
9
3% of all-time downloads
schauflerg/fibu-item-level-3-classifier
fibu-item-level-3-classifier is a text classification model from schauflerg. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model classifies German financial transactions into 42 different Item Level 3 categories with 60.2% accuracy.
Downloads · 30 days
9
3% of all-time downloads
All-time downloads
301
Public
Parameters
109M
2.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors218 MB · 100%
From the Hugging Face model README
This model classifies German financial transactions into 42 different Item Level 3 categories with 60.2% accuracy.
This model is designed to automatically classify German financial transactions based on account information ("Konto") and descriptions ("Bezeichnung").
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import json
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("schauflerg/fibu-item-level-3-classifier")
model = AutoModelForSequenceClassification.from_pretrained("schauflerg/fibu-item-level-3-classifier")
# Load label mappings (download from repository)
with open('label_mappings.json', 'r', encoding='utf-8') as f:
label_mappings = json.load(f)
# Example usage
account_code = 7345
description = "kilometergelder"
text = f"Konto: {account_code} (other_expenses); Bezeichnung: {description.lower()}"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
predicted_class_id = torch.argmax(outputs.logits, dim=-1).item()
predicted_category = label_mappings['id2label'][str(predicted_class_id)]
confidence = torch.softmax(outputs.logits, dim=-1).max().item()
print(f"Predicted: {predicted_category} (confidence: {confidence:.3f})")
| Metric | Value |
|---|---|
| Validation Accuracy | 0.6019 |
| Validation Precision | 0.5358 |
| Validation Recall | 0.6019 |
| Validation F1-Score | 0.5421 |
| Average Confidence | 0.5328 |
Training data was collected from 16 Nextcloud tables containing German financial transaction records with:
The model expects input in the format: "Konto: {account_code} ({category}); Bezeichnung: {description}"
Where:
account_code is a 3-4 digit numbercategory is determined by account code ranges (assets, liabilities_equity, revenue, etc.)description is the German text description (automatically preprocessed)The model can predict 42 different Item Level 3 categories including: Abschreibungen, Aufwendungen für bezogene Leistungen, Betriebs- und Geschäftsausstattung, Betriebskosten, Büro- und Verwaltungsaufwand, Erlöse aus Förderzuschüssen, Forderungen aus Lieferungen und Leistungen, Gebühren und Beiträge, Gewinn-/Verlustvortrag, Halb- und Fertigprodukte...
pytorch_model.bin / model.safetensors: Model weightsconfig.json: Model configurationtokenizer.json / vocab.txt: Tokenizer fileslabel_mappings.json: Label mappings (id2label, label2id)preprocessing_components.pkl: Text preprocessing componentsIf you use this model, please cite:
@misc{fibu-classifier-2024,
title={German Financial Transaction Classifier},
author={Your Name},
year={2024},
url={https://huggingface.co/schauflerg/fibu-item-level-3-classifier}
}