CoolFace
Modelpublic

SimoneAstarita/Pride-large-try-sweep-20251009-113931-t00

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

Pride-large-try-sweep-20251009-113931-t00

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

Trial timestamp (UTC): 2025-10-09 11:39:31 Data case: en-es-it

Configuration (trial hyperparameters)

HyperparameterValue
LANGUAGESen-es-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.7228199520248342
f1weighteddev_0.50.8538982414867337
accuracydev0.50.844097995545657
f1macrodevbestglobal0.735635932135837
f1weighteddevbestglobal0.8627582255118008
accuracydevbest_global0.8552338530066815
f1macrodevbestby_lang0.7461364493026761
f1weighteddevbestby_lang0.8710389633284837
accuracydevbestbylang0.8663697104677061
default_threshold0.5
bestthresholdglobal0.55
thresholdsbylang{"en": 0.65, "it": 0.65, "es": 0.55}

Thresholds

  • —Default: 0.5
  • —Best global: 0.55
  • —Best by language: { "en": 0.65, "it": 0.65, "es": 0.55 }

Detailed evaluation

Classification report @ 0.5

text
              precision    recall  f1-score   support

 no-recl (0)     0.9363    0.8779    0.9062       385
    recl (1)     0.4659    0.6406    0.5395        64

    accuracy                         0.8441       449
   macro avg     0.7011    0.7593    0.7228       449
weighted avg     0.8692    0.8441    0.8539       449

Classification report @ best global threshold (t=0.55)

text
              precision    recall  f1-score   support

 no-recl (0)     0.9372    0.8909    0.9134       385
    recl (1)     0.4940    0.6406    0.5578        64

    accuracy                         0.8552       449
   macro avg     0.7156    0.7658    0.7356       449
weighted avg     0.8740    0.8552    0.8628       449

Classification report @ best per-language thresholds

text
              precision    recall  f1-score   support

 no-recl (0)     0.9357    0.9065    0.9208       385
    recl (1)     0.5263    0.6250    0.5714        64

    accuracy                         0.8664       449
   macro avg     0.7310    0.7657    0.7461       449
weighted avg     0.8773    0.8664    0.8710       449

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

langnaccf1_macrof1_weightedprec_macrorec_macroprec_weightedrec_weighted
en1540.86360.60030.87000.59240.61130.87700.8636
it1630.89570.83280.89630.82880.83690.89710.8957
es1320.83330.71990.84410.69850.75800.86170.8333

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-20251009-113931-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.