Downloads · 30 days
13
16% of all-time downloads
SimoneAstarita/trilingual-no-bio-20251012-203009-t17
trilingual-no-bio-20251012-203009-t17 is a text classification model from SimoneAstarita. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Slur reclamation binary classifier Task: LGBTQ+ reclamation vs non-reclamation use of harmful words on social media text.
Downloads · 30 days
13
16% of all-time downloads
All-time downloads
81
Public
Parameters
611M
4.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.4 GB · 50%
From the Hugging Face model README
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:30:09
Data case:
en-es-it
Model: Alibaba-NLP/gte-multilingual-base
| Hyperparameter | Value |
|---|---|
| LANGUAGES | en-es-it |
| LR | 3e-05 |
| EPOCHS | 3 |
| MAX_LENGTH | 256 |
| USE_BIO | False |
| USE_LANG_TOKEN | False |
| GATED_BIO | False |
| FOCAL_LOSS | True |
| FOCAL_GAMMA | 1.5 |
| USE_SAMPLER | True |
| R_DROP | True |
| R_KL_ALPHA | 0.5 |
| TEXT_NORMALIZE | True |
| Metric | Value |
|---|---|
| f1_macro_dev_0.5 | 0.7034044715447154 |
| f1_weighted_dev_0.5 | 0.8398862875043005 |
| accuracy_dev_0.5 | 0.8262806236080178 |
| f1_macro_dev_best_global | 0.7246815412611758 |
| f1_weighted_dev_best_global | 0.8636470245965091 |
| accuracy_dev_best_global | 0.8619153674832962 |
| f1_macro_dev_best_by_lang | 0.735635932135837 |
| f1_weighted_dev_best_by_lang | 0.8627582255118008 |
| accuracy_dev_best_by_lang | 0.8552338530066815 |
| default_threshold | 0.5 |
| best_threshold_global | 0.7000000000000001 |
| thresholds_by_lang | {"en": 0.5, "it": 0.55, "es": 0.75} |
0.50.7000000000000001{ "en": 0.5, "it": 0.55, "es": 0.75 } precision recall f1-score support
no-recl (0) 0.9348 0.8571 0.8943 385
recl (1) 0.4271 0.6406 0.5125 64
accuracy 0.8263 449
macro avg 0.6810 0.7489 0.7034 449
weighted avg 0.8625 0.8263 0.8399 449
precision recall f1-score support
no-recl (0) 0.9239 0.9143 0.9191 385
recl (1) 0.5147 0.5469 0.5303 64
accuracy 0.8619 449
macro avg 0.7193 0.7306 0.7247 449
weighted avg 0.8656 0.8619 0.8636 449
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
| lang | n | acc | f1_macro | f1_weighted | prec_macro | rec_macro | prec_weighted | rec_weighted |
|---|---|---|---|---|---|---|---|---|
| en | 154 | 0.8052 | 0.5690 | 0.8342 | 0.5611 | 0.6143 | 0.8735 | 0.8052 |
| it | 163 | 0.9018 | 0.8407 | 0.9018 | 0.8407 | 0.8407 | 0.9018 | 0.9018 |
| es | 132 | 0.8561 | 0.7455 | 0.8624 | 0.7273 | 0.7714 | 0.8718 | 0.8561 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoConfig
import torch, numpy as np
repo = "SimoneAstarita/october-finetuning-more-variables-sweep-20251012-203009-t09"
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)))
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. postprocessing.json: duplicate threshold info for external tools.