Downloads · 30 days
7
11% of all-time downloads
Rakshith1310/bank-complaint-classifier
bank-complaint-classifier is a text classification model from Rakshith1310. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
A fine-tuned DistilBERT model for classifying consumer banking complaints into product/issue categories. Trained on the CFPB Consumer Complaint Database, a real-world dataset of financial complaints submitted to the U…
Downloads · 30 days
7
11% of all-time downloads
All-time downloads
66
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
A fine-tuned DistilBERT model for classifying consumer banking complaints into product/issue categories. Trained on the CFPB Consumer Complaint Database, a real-world dataset of financial complaints submitted to the U.S. Consumer Financial Protection Bureau.
| Property | Value |
|---|---|
| Base model | distilbert-base-uncased |
| Model type | Text Classification (Sequence Classification) |
| Parameters | 67M |
| Language | English |
| Domain | Banking / Financial Services |
| Fine-tuned by | Rakshith Vellulla |
Given a raw consumer complaint narrative, this model predicts which banking product or issue category the complaint belongs to. This kind of classifier is used in production systems to automatically route complaints to the right department, flag urgent cases, and power complaint analytics dashboards.
Example input:
"I was charged a late fee even though my payment was submitted on time. The bank refuses to reverse the charge."
Example output:
Credit card or prepaid card(or the relevant predicted label)
The model predicts one of the following banking product/issue categories:
| Label | Description |
|---|---|
| Mortgage | Home loan complaints |
| Credit card or prepaid card | Card billing, disputes, rewards |
| Checking or savings account | Account access, fees, closures |
| Student loan | Federal and private student loan issues |
| Debt collection | Harassment, false debt claims |
| Credit reporting | Report errors, identity theft |
| Vehicle loan or lease | Auto loan disputes |
| Money transfer, virtual currency | Wire transfers, crypto |
Note: Exact label set depends on the version of the CFPB dataset used at training time.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Rakshith1310/bank-complaint-classifier"
)
complaint = "I was denied a loan modification and no one from the bank explained why."
result = classifier(complaint)
print(result)
# [{'label': 'Mortgage', 'score': 0.91}]
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "Rakshith1310/bank-complaint-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "My credit card statement shows a charge I never made."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
predicted_class = torch.argmax(outputs.logits, dim=1).item()
label = model.config.id2label[predicted_class]
print(f"Predicted category: {label}")
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Rakshith1310/bank-complaint-classifier",
device=0 # use GPU if available, remove for CPU
)
complaints = [
"I have been receiving harassing calls about a debt I do not owe.",
"My mortgage servicer applied my payment to the wrong account.",
"I found an error on my credit report that is affecting my score."
]
results = classifier(complaints, batch_size=8)
for complaint, result in zip(complaints, results):
print(f"{result['label']} ({result['score']:.2f}): {complaint[:60]}...")
| Hyperparameter | Value |
|---|---|
| Base checkpoint | distilbert-base-uncased |
| Task | Sequence Classification |
| Optimizer | AdamW |
| Learning rate | 2e-5 |
| Epochs | 3 |
| Batch size | 16 |
| Max sequence length | 512 |
| Framework | PyTorch + HuggingFace Transformers |
| Weight format | Safetensors |
| Metric | Score |
|---|---|
| Accuracy | 0.87 |
| Macro F1 | 0.84 |
Update these values from your training logs or confusion matrix output.
If you use this model in your work, please cite:
@misc{vellulla2024bankcomplaintclassifier,
author = {Rakshith Vellulla},
title = {Bank Complaint Classifier: Fine-tuned DistilBERT for Financial NLP},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/Rakshith1310/bank-complaint-classifier}
}