Text Classification
Transformers
Safetensors
distilbert
civic-issues
priority-detection
ai4gov
text-embeddings-inference
Instructions to use mrigaanksh/priority-classification-distilbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrigaanksh/priority-classification-distilbert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mrigaanksh/priority-classification-distilbert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("mrigaanksh/priority-classification-distilbert") model = AutoModelForSequenceClassification.from_pretrained("mrigaanksh/priority-classification-distilbert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
π¦ Civic Issue Priority Classification Model
This model classifies civic issue reports (text descriptions) into three priority levels β High, Medium, and Low β to assist municipal systems in automatically routing and prioritizing citizen complaints.
π§ Model Details
Model Description
This model fine-tunes DistilBERT (distilbert-base-uncased) for text classification to predict the priority of civic issues reported by citizens through an app or web portal.
- Model Type: DistilBERT For Sequence Classification
- Language: English
- Fine-tuned On: Custom civic issue dataset
- Labels:
0 β Low(Minor issues, e.g., paint fade, broken bench)1 β Medium(Moderate issues, e.g., streetlight not working, drainage blockage)2 β High(Critical issues, e.g., gas leak, transformer fire, road flood)
π Training Details
Dataset
A custom dataset of 30 handcrafted civic issue reports divided evenly into three categories:
- 10 High priority examples
- 10 Medium priority examples
- 10 Low priority examples
Each example represents a real-world scenario commonly reported in urban complaint systems.
Training Configuration
| Hyperparameter | Value |
|---|---|
| Base model | distilbert-base-uncased |
| Batch size | 4 |
| Epochs | 15 |
| Learning rate | 3e-5 |
| Weight decay | 0.02 |
| Max sequence length | 64 |
| Optimizer | AdamW |
| Evaluation strategy | per epoch |
Hardware
- Trained on: Google Colab (T4 GPU)
- Framework: PyTorch + Hugging Face Transformers
βοΈ How to Use
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import torch.nn.functional as F
# Load model
tokenizer = AutoTokenizer.from_pretrained("mrigaanksharma/priority-classifier")
model = AutoModelForSequenceClassification.from_pretrained("mrigaanksharma/priority-classifier")
text = "Transformer caught fire near main road"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)
probs = F.softmax(outputs.logits, dim=-1)
pred = torch.argmax(probs).item()
confidence = torch.max(probs).item()
label_map = {0: "Low", 1: "Medium", 2: "High"}
print(f"Text: {text}")
print(f"Predicted Label: {label_map[pred]} (Confidence: {confidence:.2f})")
- Downloads last month
- 8