CoolFace
Modelpublic

mrigaanksh/priority-classification-distilbert

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes7downloads
Model Card

๐Ÿšฆ 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

HyperparameterValue
Base modeldistilbert-base-uncased
Batch size4
Epochs15
Learning rate3e-5
Weight decay0.02
Max sequence length64
OptimizerAdamW
Evaluation strategyper epoch

Hardware

  • โ€”Trained on: Google Colab (T4 GPU)
  • โ€”Framework: PyTorch + Hugging Face Transformers

โš™๏ธ How to Use

python
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})")