Downloads · 30 days
4
13% of all-time downloads
SimoneAstarita/trilingual-no-bio-20251014-t03
trilingual-no-bio-20251014-t03 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
4
13% of all-time downloads
All-time downloads
30
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-14 08:32:43
Data case:
en-es-it
Model: Alibaba-NLP/gte-multilingual-base
| Hyperparameter | Value |
|---|---|
| LANGUAGES | en-es-it |
| LR | 2e-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 | False |
| R_DROP | True |
| R_KL_ALPHA | 0.5 |
| TEXT_NORMALIZE | True |
| Metric | Value |
|---|---|
| f1_macro_dev_0.5 | 0.7308074106835716 |
| f1_weighted_dev_0.5 | 0.866252272018095 |
| accuracy_dev_0.5 | 0.8641425389755011 |
| f1_macro_dev_best_global | 0.7588614393125672 |
| f1_weighted_dev_best_global | 0.8874859755178593 |
| accuracy_dev_best_global | 0.8930957683741648 |
| f1_macro_dev_best_by_lang | 0.7424440224701321 |
| f1_weighted_dev_best_by_lang | 0.872443990751573 |
| accuracy_dev_best_by_lang | 0.8708240534521158 |
| default_threshold | 0.5 |
| best_threshold_global | 0.55 |
| thresholds_by_lang | {"en": 0.4, "it": 0.55, "es": 0.5} |
0.50.55{ "en": 0.4, "it": 0.55, "es": 0.5 } precision recall f1-score support
no-recl (0) 0.9263 0.9143 0.9203 385
recl (1) 0.5217 0.5625 0.5414 64
accuracy 0.8641 449
macro avg 0.7240 0.7384 0.7308 449
weighted avg 0.8686 0.8641 0.8663 449
precision recall f1-score support
no-recl (0) 0.9223 0.9558 0.9388 385
recl (1) 0.6600 0.5156 0.5789 64
accuracy 0.8931 449
macro avg 0.7912 0.7357 0.7589 449
weighted avg 0.8849 0.8931 0.8875 449
precision recall f1-score support
no-recl (0) 0.9291 0.9195 0.9243 385
recl (1) 0.5441 0.5781 0.5606 64
accuracy 0.8708 449
macro avg 0.7366 0.7488 0.7424 449
weighted avg 0.8743 0.8708 0.8724 449
| lang | n | acc | f1_macro | f1_weighted | prec_macro | rec_macro | prec_weighted | rec_weighted |
|---|---|---|---|---|---|---|---|---|
| en | 154 | 0.8506 | 0.5331 | 0.8531 | 0.5321 | 0.5344 | 0.8557 | 0.8506 |
| it | 163 | 0.9202 | 0.8618 | 0.9175 | 0.8902 | 0.8397 | 0.9175 | 0.9202 |
| es | 132 | 0.8333 | 0.7199 | 0.8441 | 0.6985 | 0.7580 | 0.8617 | 0.8333 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoConfig
import torch, numpy as np
repo = "SimoneAstarita/trilingual-no-bio-20251014-t03"
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.