1{
2 0: "Education", 1: "Entertainment", 2: "Fees",
3 3: "Groceries", 4: "Healthcare", 5: "Income",
4 6: "Insurance", 7: "Mortgage", 8: "Personal Care",
5 9: "Rent", 10: "Restaurants", 11: "Shopping",
6 12: "Subscription", 13: "Transfer", 14: "Transportation",
7 15: "Travel", 16: "Utilities"
8}
Evaluated on a held-out test set of 4,298 samples (10% of 42,975 total).
All experiments tracked on
W&B.
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="fahadkamraan/transaction-categorizer",
6 device=-1, # CPU
7 top_k=3,
8)
9
10results = classifier("starbucks coffee purchase")
11# [{'label': 'Restaurants', 'score': 0.9999}]
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("fahadkamraan/transaction-categorizer")
5model = AutoModelForSequenceClassification.from_pretrained("fahadkamraan/transaction-categorizer")
6
7inputs = tokenizer("netflix monthly subscription", return_tensors="pt", truncation=True, max_length=64)
8with torch.no_grad():
9 logits = model(**inputs).logits
10predicted_class = logits.argmax(-1).item()
11print(model.config.id2label[predicted_class]) # → Subscription
1docker run --rm \
2 -e HF_TOKEN=<token> \
3 -e INPUT_TEXT="delta airlines flight booking" \
4 fahadkamraan/mlops-transaction-classifier:latest
1@misc{kamraan2025transactioncategorizer,
2 author = {S Fahad Kamraan and Dhruvi Patel and Mahesh V and Himanshu Choubey},
3 title = {Bank Transaction Merchant Categoriser},
4 year = {2025},
5 publisher = {HuggingFace Hub},
6 url = {https://huggingface.co/fahadkamraan/transaction-categorizer}
7}