drdeveloper88's picture
Upload WorldDisasterLM-8B source code: FastAPI backend, training pipeline, 11-language support
495526b
Raw
History Blame Contribute Delete
443 Bytes
HIGH_RISK_KEYWORDS = {
"ignore authorities",
"do not evacuate",
"violence",
"weapon",
"bioweapon",
}
def is_unsafe_prompt(text: str) -> bool:
lowered = text.lower()
return any(keyword in lowered for keyword in HIGH_RISK_KEYWORDS)
def needs_human_review(confidence: float, text: str) -> bool:
if confidence < 0.55:
return True
return "critical" in text.lower() or "mass casualty" in text.lower()