You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multilingual event detection across 168 event types using XLM-RoBERTa, trained on the MAVEN dataset translated into Hindi, Malayalam, and French via Meta's NLLB-200.
Architecture
The pipeline consists of three stages:
Translation — MAVEN English sentences are translated into Hindi, Malayalam, and French using facebook/nllb-200-distilled-600M
Encoding — XLM-RoBERTa encodes multilingual text into 768-dim embeddings, passed through a projection head (768→512→256)
Classification — A linear classifier detects 168 event types with multi-label BCE loss
Key Features
168 event types from the MAVEN taxonomy (Catastrophe, Attack, Motion, etc.)
4 languages — English, Hindi (हिन्दी), Malayalam (മലയാളം), French (Français)
XLM-RoBERTa base encoder with projection head
Live news detection — fetch and classify real-time multilingual news via GNews API
Cross-lingual transfer — train on 4 languages, predict on all
defpredict_events(text, threshold=0.5):
enc=tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
enc= {k: v.to(device) fork, vinenc.items()}
withtorch.no_grad():
logits=model(**enc)
probs=torch.sigmoid(logits).cpu().numpy()[0]
return [(event_names[i], float(p)) fori, pinenumerate(probs) ifp>=threshold]
# Works in any of the 4 languages!predict_events("The earthquake destroyed several buildings")
predict_events("सेना ने शहर पर हमला किया")
predict_events("Le festival de musique a eu lieu dans le parc")
Live News Demo
The model can detect events in real-time multilingual news: