manuelraileanu/ro-political-leaning-v2
040
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:
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, batchsize=16, gradaccum=2, maxlength=512, weightdecay=0.01
- learning_rate=6e-05, 7 epochs, MSE loss, early stopping on
mae(patience=2)
Dataset sources
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)