Disaster BERT โ€” Fine-Tuned 12-Class Disaster Text Classification Model

Fine-tuned bert-base-uncased model trained on 203,976 disaster news articles to classify natural and man-made emergency occurrences into 12 distinct hazard categories.

Model Performance & Evaluation Metrics

  • Test Accuracy: 89.31%
  • Test Macro F1-Score: 84.66%
  • Test Weighted F1-Score: 89.12%
  • Epochs Trained: 4
  • Training Samples: 203,976

12 Supported Disaster Categories

  1. Drought & Extreme Heat
  2. Earthquake
  3. Epidemic & Biological
  4. Flood
  5. General & Other Disaster
  6. Industrial & Transportation Accident
  7. Non-Disaster
  8. Severe Weather & Storms
  9. Societal Event & Terrorism
  10. Tsunami
  11. Volcanic Eruption
  12. Wildfire & Fire

Python Usage Example

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_id = "harry2708/disaster-bert"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

text = "Flood situation in Assam improves marginally as river water recedes"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)

with torch.no_grad():
    outputs = model(**inputs)
    probs = torch.softmax(outputs.logits, dim=1).squeeze(0)
    top_idx = torch.argmax(probs).item()
    confidence = probs[top_idx].item()

predicted_label = model.config.id2label[top_idx]
print(f"Predicted Disaster: {predicted_label} ({confidence * 100:.2f}% Confidence)")
Downloads last month
25
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support