Downloads · 30 days
7
6% of all-time downloads
abhinavdread/msme-legal-dispute-classifier-longformer
msme-legal-dispute-classifier-longformer is a text classification model from abhinavdread. 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.
This model is a multi-class legal document classifier designed to categorize MSME-related dispute cases into six statutory dispute categories. It is fine-tuned from allenai/longformer-base-4096 and optimized for long-…
Downloads · 30 days
7
6% of all-time downloads
All-time downloads
115
Public
Parameters
149M
595 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors595 MB · 99%
From the Hugging Face model README
This model is a multi-class legal document classifier designed to categorize MSME-related dispute cases into six statutory dispute categories. It is fine-tuned from allenai/longformer-base-4096 and optimized for long-form legal documents up to 1200 tokens. The system is intended for automated dispute categorization, legal triage, and decision-support applications in MSME dispute resolution workflows.
MSME dispute cases often involve lengthy legal narratives including:
Manual classification is time-consuming and error-prone. This model automates dispute categorization into predefined legal classes.
The model predicts one of the following six categories:
| Label ID | Category |
|---|---|
| 0 | Delayed payment (no dispute) |
| 1 | Quality dispute |
| 2 | No formal contract |
| 3 | Partial payment dispute |
| 4 | Government procurement delay |
| 5 | Service-related dispute |
Label mapping is included in label_mapping.json.
allenai/longformer-base-4096Longformer was selected due to the long-document nature of legal dispute texts.
Class imbalance handled using weighted cross-entropy loss.
Test Set Size: 431 samples
| Metric | Score |
|---|---|
| Accuracy | 0.77 |
| Macro Precision | 0.76 |
| Macro Recall | 0.74 |
| Macro F1 Score | 0.75 |
| Macro AUC-ROC (OvR) | 0.948 |
These results indicate strong class separability and balanced performance across all categories.
This model is suitable for:
This model is intended as a decision-support tool. Human oversight is recommended for legal decision-making applications. It does not provide legal advice.
from transformers import LongformerForSequenceClassification, AutoTokenizer
import torch
model = LongformerForSequenceClassification.from_pretrained("YOUR_USERNAME/msme-legal-dispute-classifier-longformer")
tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/msme-legal-dispute-classifier-longformer")
text = "The buyer failed to release payment within the agreed 45-day period."
inputs = tokenizer(text, truncation=True, max_length=1200, return_tensors="pt")
outputs = model(**inputs)
predicted_class = torch.argmax(outputs.logits, dim=1)
print("Predicted Label:", predicted_class.item())