Views
No views yet
1), or does it not
(label 0, covering both Neutral and Support stances)?jhu-clsp/mmBERT-base on hand-annotated parliamentary speeches
from AUS, CZE, DEU, DNK, ESP, GBR, NLD, and SWE.0 — Non-Opposition (Neutral or Support)1 — OppositionNeutral,
Support, or Opposition.Opposition vs the other two classes.Stance_Retrain_undersampled.csv (undersampled to address class imbalance).StratifiedGroupKFold (n_splits=10) on
country × speech_ID, so no speech appears in more than one fold.
Realised allocation: 8 folds train / 1 fold val / 1 fold test
(~80/10/10). The Opposition and Support detectors share the same
underlying stance split for consistent cascade evaluation.jhu-clsp/mmBERT-basef1_positive on val)compute_class_weight)f1_positive (minority-class F1)1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4tok = AutoTokenizer.from_pretrained("LBenoit/opposition-detector-mmbert")
5mdl = AutoModelForSequenceClassification.from_pretrained("LBenoit/opposition-detector-mmbert")
6
7text = "This directive from Brussels undermines our national sovereignty."
8enc = tok(text, truncation=True, max_length=320, return_tensors="pt")
9with torch.no_grad():
10 prob_opp = torch.softmax(mdl(**enc).logits, dim=-1)[0, 1].item()
11print("P(Opposition) =", prob_opp)