EU_Ukraine / README.md
LBenoit's picture
Upload README.md with huggingface_hub
840d25c verified
|
Raw
History Blame Contribute Delete
1.46 kB
metadata
language: multilingual
license: mit
tags:
  - text-classification
  - political-science
  - euroscepticism
  - parliamentary-speech
base_model: jhu-clsp/mmBERT-base

EU_Ukraine

Binary classifier: is a parliamentary sentence about the European Union (EU=1) or not (EU=0)? Fine-tuned from jhu-clsp/mmBERT-base on hand-annotated parliamentary speeches, including Ukrainian Rada data alongside other European parliaments.

Labels

  • 0 — Non-EU
  • 1 — EU

Training

  • Base model: jhu-clsp/mmBERT-base
  • Max sequence length: 320
  • Train/val/test split: leakage-safe (StratifiedGroupKFold on country × speech_ID)
  • Loss: cross-entropy with balanced class weights

Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tok = AutoTokenizer.from_pretrained("LBenoit/EU_Ukraine")
mdl = AutoModelForSequenceClassification.from_pretrained("LBenoit/EU_Ukraine")

text = "The European Commission proposed new climate targets."
enc  = tok(text, truncation=True, max_length=320, return_tensors="pt")
with torch.no_grad():
    logits = mdl(**enc).logits
probs = torch.softmax(logits, dim=-1)[0]
pred  = int(probs.argmax().item())
prob  = probs[1].item()
print(pred, prob)

Intended use

Research on parliamentary discourse about the EU. Outputs reflect the training corpus and annotation scheme; downstream prevalence estimates should ideally be calibrated against a base-rate-representative sample.