Durrani95/eurobert-geopolitical-multiclass
130
EuroBERT Geopolitical Classifier (Multiclass)
Fine-tuned EuroBERT/EuroBERT-210m for detecting and categorizing geopolitical themes in (European) news text.
- Task: Sequence classification (single-label multiclass)
- Labels: 11 geopolitical topics
- Intended use: Topic categorization of news on geopolitical tensions (best performance on full article-level text)
- Languages: English, German, French, Spanish, Italian
- Framework: 🤗 Transformers (PyTorch)
Quick start
Inference with transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "durrani95/eurobert-geopolitical-multiclass"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
texts = [
"Russia cut off gas supplies to Europe amid rising tensions.",
"Terrorist activity has increased along the southern border.",
"New sanctions were imposed on financial institutions.",
"Talks at the UN Security Council failed to reach consensus.",
"Tarrifs on soybeans are applied to pressure China into a deal with the US" ,
"Tom and Jerry have a fight! The mouse finally had enough.",
]
inputs = tokenizer(texts, padding=True, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=1)
for text, p in zip(texts, probs):
label_id = int(p.argmax())
label = model.config.id2label[label_id]
confidence = float(p[label_id])
print(f"{label:>28} {confidence:6.2%} | {text}")Category Definitions
Training & Configuration
- Base model:
EuroBERT/EuroBERT-210m - Objective: Cross-entropy (single-label multiclass)
- Number of labels: 11
- Data: European news text labeled across geopolitical topics
- Hardware: A100 GPU
- Epochs: 1
- Optimizer: AdamW with linear scheduler
Training setup
Limitations & Risks
- May be sensitive to domain shift (non-news, social media text)
- The model predicts one dominant label per text; it is not multi-label.
- Multilingual performance can vary across languages and registers
How to cite
If you use this model, please cite this repository and the EuroBERT base model.
