CoolFace
Modelpublic

SimoneAstarita/october-finetuning-more-variables-sweep-20251012-201341-t07

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

october-finetuning-more-variables-sweep-20251012-201341-t07

Slur reclamation binary classifier Task: LGBTQ+ reclamation vs non-reclamation use of harmful words on social media text.

Trial timestamp (UTC): 2025-10-12 20:13:41 Data case: en-es-it

Configuration (trial hyperparameters)

Model: Alibaba-NLP/gte-multilingual-base

HyperparameterValue
LANGUAGESen-es-it
LR2e-05
EPOCHS3
MAX_LENGTH256
USE_BIOFalse
USELANGTOKENFalse
GATED_BIOFalse
FOCAL_LOSSTrue
FOCAL_GAMMA1.5
USE_SAMPLERTrue
R_DROPTrue
RKLALPHA0.5
TEXT_NORMALIZETrue

Dev set results (summary)

MetricValue
f1macrodev_0.50.6822920086077982
f1weighteddev_0.50.8107834514586362
accuracydev0.50.7839643652561247
f1macrodevbestglobal0.7327145250903959
f1weighteddevbestglobal0.8744347857513664
accuracydevbest_global0.8797327394209354
f1macrodevbestby_lang0.750740192450037
f1weighteddevbestby_lang0.8789340239598152
accuracydevbestbylang0.8797327394209354
default_threshold0.5
bestthresholdglobal0.8
thresholdsbylang{"en": 0.8, "it": 0.65, "es": 0.8}

Thresholds

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

Detailed evaluation

Classification report @ 0.5

text
              precision    recall  f1-score   support

 no-recl (0)     0.9528    0.7870    0.8620       385
    recl (1)     0.3740    0.7656    0.5026        64

    accuracy                         0.7840       449
   macro avg     0.6634    0.7763    0.6823       449
weighted avg     0.8703    0.7840    0.8108       449

Classification report @ best global threshold (t=0.80)

text
              precision    recall  f1-score   support

 no-recl (0)     0.9169    0.9455    0.9309       385
    recl (1)     0.5962    0.4844    0.5345        64

    accuracy                         0.8797       449
   macro avg     0.7565    0.7149    0.7327       449
weighted avg     0.8712    0.8797    0.8744       449

Classification report @ best per-language thresholds

text
              precision    recall  f1-score   support

 no-recl (0)     0.9276    0.9325    0.9301       385
    recl (1)     0.5806    0.5625    0.5714        64

    accuracy                         0.8797       449
   macro avg     0.7541    0.7475    0.7507       449
weighted avg     0.8782    0.8797    0.8789       449

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

langnaccf1_macrof1_weightedprec_macrorec_macroprec_weightedrec_weighted
en1540.88310.55940.87330.57320.55210.86490.8831
it1630.88340.80840.88270.81240.80460.88210.8834
es1320.87120.76390.87480.75050.78040.87960.8712

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/october-finetuning-more-variables-sweep-20251012-201341-t07"
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)))

Additional files

reports.json: all metrics (macro/weighted/accuracy) for @0.5, @bestglobal, and @bestbylang. config.json: stores thresholds: defaultthreshold, bestthresholdglobal, thresholdsbylang. postprocessing.json: duplicate threshold info for external tools.