CoolFace
Modelpublic

SimoneAstarita/Pride-large-try-sweep-20251008-202520-t00

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes6downloads
Model Card

Pride-large-try-sweep-20251008-202520-t00

Multilingual XLM-T (EN/IT/ES) binary classifier Task: LGBTQ+ reclamation vs non-reclamation on social media text.

Trial timestamp (UTC): 2025-10-08 20:25:20 Data case: es-it

Configuration (trial hyperparameters)

HyperparameterValue
LANGUAGESes-it
LR2e-05
EPOCHS3
MAX_LENGTH256
USE_BIOTrue
USELANGTOKENFalse
GATED_BIOTrue
FOCAL_LOSSTrue
FOCAL_GAMMA1.5
USE_SAMPLERTrue
R_DROPTrue
RKLALPHA1.0
TEXT_NORMALIZETrue

Dev set results (summary)

MetricValue
f1macrodev_0.50.794306219281985
f1weighteddev_0.50.8709441410975659
accuracydev0.50.8610169491525423
f1macrodevbestglobal0.8245942434319188
f1weighteddevbestglobal0.9039516171475004
accuracydevbest_global0.9084745762711864
f1macrodevbestby_lang0.8117021276595744
f1weighteddevbestby_lang0.8847818247385503
accuracydevbestbylang0.8779661016949153
default_threshold0.5
bestthresholdglobal0.85
thresholdsbylang{"it": 0.7, "es": 0.6}

Thresholds

  • —Default: 0.5
  • —Best global: 0.85
  • —Best by language: { "it": 0.7, "es": 0.6 }

Detailed evaluation

Classification report @ 0.5

text
              precision    recall  f1-score   support

 no-recl (0)     0.9635    0.8648    0.9114       244
    recl (1)     0.5658    0.8431    0.6772        51

    accuracy                         0.8610       295
   macro avg     0.7646    0.8539    0.7943       295
weighted avg     0.8947    0.8610    0.8709       295

Classification report @ best global threshold (t=0.85)

text
              precision    recall  f1-score   support

 no-recl (0)     0.9255    0.9672    0.9459       244
    recl (1)     0.8000    0.6275    0.7033        51

    accuracy                         0.9085       295
   macro avg     0.8627    0.7973    0.8246       295
weighted avg     0.9038    0.9085    0.9040       295

Classification report @ best per-language thresholds

text
              precision    recall  f1-score   support

 no-recl (0)     0.9602    0.8893    0.9234       244
    recl (1)     0.6087    0.8235    0.7000        51

    accuracy                         0.8780       295
   macro avg     0.7844    0.8564    0.8117       295
weighted avg     0.8994    0.8780    0.8848       295

Per-language metrics (at best-by-lang)

langnaccf1_macrof1_weightedprec_macrorec_macroprec_weightedrec_weighted
it1630.96320.94170.96360.93170.95260.96450.9632
es1320.77270.66000.79650.64410.72230.84130.7727

Data

  • —Train/Dev: private multilingual splits with ~15% stratified Dev (by (lang,label)).
  • —Source: merged EN/IT/ES data with bios retained (ignored if unused by model).

Usage

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoConfig
import torch, numpy as np

repo = "SimoneAstarita/Pride-large-try-sweep-20251008-202520-t00"
tok = AutoTokenizer.from_pretrained(repo)
cfg = AutoConfig.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo)

texts = ["example text ..."]
langs = ["en"]

mode = "best_global"  # or "0.5", "by_lang"

enc = tok(texts, truncation=True, padding=True, max_length=256, return_tensors="pt")
with torch.no_grad():
    logits = model(**enc).logits
probs = torch.softmax(logits, dim=-1)[:, 1].cpu().numpy()

if mode == "0.5":
    th = 0.5
    preds = (probs >= th).astype(int)
elif mode == "best_global":
    th = getattr(cfg, "best_threshold_global", 0.5)
    preds = (probs >= th).astype(int)
elif mode == "by_lang":
    th_by_lang = getattr(cfg, "thresholds_by_lang", {})
    preds = np.zeros_like(probs, dtype=int)
    for lg in np.unique(langs):
        t = th_by_lang.get(lg, getattr(cfg, "best_threshold_global", 0.5))
        preds[np.array(langs) == lg] = (probs[np.array(langs) == lg] >= t).astype(int)
print(list(zip(texts, preds, probs)))

### Files
reports.json — all metrics (macro/weighted/accuracy) for @0.5, @best_global, and @best_by_lang.
config.json — stores thresholds: default_threshold, best_threshold_global, thresholds_by_lang.
report_0.5.txt, report_best.txt — readable classification reports.
postprocessing.json — duplicate threshold info for external tools.