ro-political-leaning-v2
Fine-tuned dumitrescustefan/bert-base-romanian-cased-v1 for Romanian political leaning scoring (v2).
Unlike v1 (manuelraileanu/ro-political-leaning, 6-class classification on XLM-RoBERTa),
this model uses a single regression head that directly outputs a leaning score on the
-1.0 .. +1.0 axis (v2 labeling pipeline, gemma2:9b labels, extended training set).
All 7 political classes are present (far_left is no longer merged into left).
Output
A single regression value in [-1.0, +1.0], the midpoint of the predicted leaning class:
| score | leaning |
|---|---|
| -1.0 | far_left |
| -0.6 | left |
| -0.3 | center_left |
| 0.0 | center |
| +0.3 | center_right |
| +0.6 | right |
| +1.0 | far_right |
Training
- Base model:
dumitrescustefan/bert-base-romanian-cased-v1 - Labels produced with
gemma2:9b(local, via Ollama), rows without a clear stance (unclear) excluded - Dataset 2 (extended):
petrematei/ro-political+readerbench/news-ro-offense - Labeled rows: 72400 (train), 8045 (test, 10% stratified split, seed 42)
- fp16, batch_size=16, grad_accum=2, max_length=512, weight_decay=0.01
- learning_rate=6e-05, 7 epochs, MSE loss, early stopping on
mae(patience=2)
Dataset sources
| source | link |
|---|---|
| ro-political (~120k social-media texts about the 2024-2025 RO presidential elections) | petrematei/ro-political |
| news-ro-offense (Romanian reader comments on news articles) | readerbench/news-ro-offense |
Results (test set)
- Eval MAE: 0.181 (on the -1..+1 axis)
- Eval RMSE: 0.303
- Exact class accuracy: 0.610
- Adjacent-class accuracy: 0.884
- Pearson correlation: 0.606
Usage
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
model_id = "manuelraileanu/ro-political-leaning-v2"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id).eval()
inputs = tok("Guvernul a anunțat ieri noi măsuri de stimulare economică.", return_tensors="pt")
with torch.no_grad():
score = model(**inputs).logits.reshape(-1)[0].item() # -1.0 (far left) .. +1.0 (far right)