Responde: Multi-Task RoBERTa for Tagalog Disaster Response & Emergency Triage

This repository contains the fine-tuned weights and configurations for Responde Tagalog Disaster Triage Model (v5), based on jcblaise/roberta-tagalog-base.

It is an open-source, multi-task NLP classifier designed to help local emergency dispatchers, disaster management units (e.g., MDRRMO / NDRRMC in the Philippines), and humanitarian responders triage citizen distress reports sent in colloquial or Batangas Tagalog.


Model Architecture

The model uses a shared Tagalog RoBERTa transformer encoder with three concurrent linear classification heads trained with class-weighted cross-entropy loss:

  1. Intent Classification (6 classes):
    • EMERGENCY_REPORT
    • RESOURCE_REQUEST
    • STATUS_INQUIRY
    • FEEDBACK_OR_THANKS
    • CASUAL_OR_GREETING
    • OTHER
  2. Urgency Level (4 classes):
    • CRITICAL
    • HIGH
    • MEDIUM
    • LOW
  3. Incident Type (8 classes):
    • fire, flood, earthquake, landslide, typhoon, volcanic_eruption, general, none

Evaluation & Benchmarks (v5 โ€” Held-out Test Set)

Evaluated against 103 stratified held-out test samples with zero data leakage:

Classification Head Macro F1-Score Weighted F1-Score Accuracy Production Status
Incident Type (8 classes) 82.9% 77.5% 78.6% PASSED ($\ge 70%$)
Intent (6 classes) 80.4% 78.5% 78.6% PASSED ($\ge 70%$)
Urgency (4 classes) 71.1% 76.7% 76.7% PASSED ($\ge 70%$)
Overall Combined Average 78.1% 77.6% 78.0% PASSED

Critical Emergency Class Breakdown

  • fire: 100% F1-score
  • landslide: 94.1% F1-score
  • typhoon: 88.9% F1-score
  • volcanic_eruption: 88.9% F1-score
  • earthquake: 82.4% F1-score
  • flood: 81.8% F1-score

How to Use

1. Download Files

from transformers import AutoTokenizer, AutoConfig
from huggingface_hub import snapshot_download

# Download model repository
repo_id = "samsonjeff/responde-tagalog-disaster-triage"
model_dir = snapshot_download(repo_id=repo_id)

2. PyTorch Multi-Task Model Definition & Inference

Because this model uses a multi-task head architecture, define the MultiTaskRoberta class or import it directly from the Responde ML API Repository:

import torch
import torch.nn as nn
from transformers import AutoTokenizer, AutoConfig, RobertaModel, RobertaPreTrainedModel

class MultiTaskRoberta(RobertaPreTrainedModel):
    def __init__(self, config):
        super().__init__(config)
        self.roberta = RobertaModel(config)
        hidden = config.hidden_size
        self.dropout = nn.Dropout(0.2)
        
        self.intent_head = nn.Linear(hidden, 6)
        self.urgency_head = nn.Linear(hidden, 4)
        self.incident_head = nn.Linear(hidden, 8)
        self.post_init()

    def forward(self, input_ids, attention_mask=None):
        outputs = self.roberta(input_ids=input_ids, attention_mask=attention_mask)
        pooled = outputs.last_hidden_state[:, 0, :]
        pooled = self.dropout(pooled)
        return {
            "intent": self.intent_head(pooled),
            "urgency": self.urgency_head(pooled),
            "incident_type": self.incident_head(pooled),
        }

# Load tokenizer and model
repo_id = "samsonjeff/responde-tagalog-disaster-triage"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
config = AutoConfig.from_pretrained(repo_id)
model = MultiTaskRoberta.from_pretrained(repo_id, config=config)
model.eval()

# Sample Tagalog disaster report
text = "Baha na po hanggang dibdib dine sa Brgy Aya kailangan namin ng rescue boat agad!"
inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True, padding=True)

with torch.no_grad():
    outputs = model(**inputs)
    intent_pred = outputs["intent"].argmax(dim=-1).item()
    urgency_pred = outputs["urgency"].argmax(dim=-1).item()
    incident_pred = outputs["incident_type"].argmax(dim=-1).item()

print(f"Predicted intent ID: {intent_pred}")
print(f"Predicted urgency ID: {urgency_pred}")
print(f"Predicted incident ID: {incident_pred}")

(Refer to label_maps.json in this repository for class label indices.)


Upload and Maintenance Reference

To push updates to Hugging Face Hub using the Hugging Face CLI:

# 1. Install the Hugging Face CLI (Windows PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"

# 2. Login with your HF token (write access)
hf auth login

# 3. Upload all model assets from this folder
cd model
hf upload samsonjeff/responde-tagalog-disaster-triage .

License and Open Source

This model and its associated configs are released under the MIT License. You are free to use, adapt, commercialize, or integrate this model for public safety, academic research, and disaster relief operations.

Downloads last month
30
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

Model tree for samsonjeff/responde-tagalog-disaster-triage

Finetuned
(14)
this model