ERP GL Account Classifier

Multimodal classifier for ERP GL account classification. Achieves 90.8% test accuracy by learning from:

  • Text: vendor + description
  • Numerical: transaction amount + log(amount)
  • Categorical: department embeddings

Model Details

  • Base model: DistilBERT (distilbert-base-uncased)
  • Architecture: 3-branch fusion (text 768-d + numerical 64-d + categorical 32-d)
  • Parameters: 66.6M (all trainable)
  • Training data: 659 samples (synthetic ERP transactions)
  • Test accuracy: 90.8%
  • Test F1: 90.6%

Usage

import json
import numpy as np
import torch
from pathlib import Path
from transformers import AutoTokenizer, AutoConfig
from huggingface_hub import hf_hub_download

# Download auxiliary files
scaler_path = hf_hub_download(repo_id="EHTB/erp-classifier-dataset", filename="scaler.json", repo_type="dataset")
vocab_path = hf_hub_download(repo_id="EHTB/erp-classifier-dataset", filename="dept_vocab.json", repo_type="dataset")

with open(scaler_path) as f:
    scaler_params = json.load(f)
    scaler_mean = np.array(scaler_params['mean'])
    scaler_scale = np.array(scaler_params['scale'])

with open(vocab_path) as f:
    dept_vocab = json.load(f)['dept2id']

# Load model (requires custom ERPClassifierModel class)
# See: https://github.com/yourusername/erp-classifier/blob/main/src/model.py

tokenizer = AutoTokenizer.from_pretrained("EHTB/erp-classifier")
config = AutoConfig.from_pretrained("EHTB/erp-classifier")

# Note: This model uses a custom architecture (ERPClassifierModel).
# You need to import the model class from the repository to load weights.

Training Procedure

  • Optimizer: AdamW (lr=3e-5, weight_decay=0.01)
  • Warmup: 10% of training steps
  • Batch size: 16
  • Epochs: 10 (early stopping patience=5)
  • Loss: CrossEntropyLoss
  • Training time: ~3 minutes (Apple M1/M2)

Performance

GL Account F1 Score Support
GL_6410_FACILITY_PANTRY 100% 18
GL_6450_CLEANING_MAINTENANCE 100% 19
GL_6400_OFFICE_CONSUMABLES 96.8% 15
GL_6250_TECH_BOOKS_TRAINING 95.0% 19
GL_6150_MARKETING_PROMO 94.1% 18
GL_6310_WORKPLACE_SAFETY_ERGONOMICS 91.9% 19
GL_1400_IT_HARDWARE_CAPEX 79.1% 19
GL_6220_IT_PERIPHERALS_OPEX 64.0% 15

Limitations

  • Trained on synthetic data (942 samples)
  • GL_6220 (IT peripherals < 800 EUR) has lower accuracy due to limited training examples
  • Requires custom model class (not compatible with standard AutoModelForSequenceClassification)

Citation

@misc{erp-classifier,
  title={ERP GL Account Classifier},
  author={Your Name},
  year={2024},
  publisher={HuggingFace},
  howpublished={\url{https://huggingface.co/EHTB/erp-classifier}}
}
Downloads last month
18
Safetensors
Model size
66.6M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for EHTB/erp-classifier

Finetuned
(12770)
this model