Downloads · 30 days
5
14% of all-time downloads
SimoneAstarita/trilingual-no-bio-20251014-t01
trilingual-no-bio-20251014-t01 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
5
14% of all-time downloads
All-time downloads
35
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:19:46
Data case:
en-es-it
Model: Alibaba-NLP/gte-multilingual-base
| Hyperparameter | Value |
|---|---|
| LANGUAGES | en-es-it |
| LR | 1e-05 |
| EPOCHS | 5 |
| 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 | 1.0 |
| TEXT_NORMALIZE | True |
| Metric | Value |
|---|---|
| f1_macro_dev_0.5 | 0.6992930670966142 |
| f1_weighted_dev_0.5 | 0.8352727836218509 |
| accuracy_dev_0.5 | 0.8195991091314031 |
| f1_macro_dev_best_global | 0.7380178377927815 |
| f1_weighted_dev_best_global | 0.8735890357147564 |
| accuracy_dev_best_global | 0.8752783964365256 |
| f1_macro_dev_best_by_lang | 0.7174485125858123 |
| f1_weighted_dev_best_by_lang | 0.8573654650813146 |
| accuracy_dev_best_by_lang | 0.8530066815144766 |
| default_threshold | 0.5 |
| best_threshold_global | 0.65 |
| thresholds_by_lang | {"en": 0.45000000000000007, "it": 0.65, "es": 0.7000000000000001} |
0.50.65{ "en": 0.45000000000000007, "it": 0.65, "es": 0.7000000000000001 } precision recall f1-score support
no-recl (0) 0.9368 0.8468 0.8895 385
recl (1) 0.4158 0.6562 0.5091 64
accuracy 0.8196 449
macro avg 0.6763 0.7515 0.6993 449
weighted avg 0.8625 0.8196 0.8353 449
precision recall f1-score support
no-recl (0) 0.9229 0.9325 0.9276 385
recl (1) 0.5667 0.5312 0.5484 64
accuracy 0.8753 449
macro avg 0.7448 0.7319 0.7380 449
weighted avg 0.8721 0.8753 0.8736 449
precision recall f1-score support
no-recl (0) 0.9253 0.9013 0.9132 385
recl (1) 0.4865 0.5625 0.5217 64
accuracy 0.8530 449
macro avg 0.7059 0.7319 0.7174 449
weighted avg 0.8628 0.8530 0.8574 449
| lang | n | acc | f1_macro | f1_weighted | prec_macro | rec_macro | prec_weighted | rec_weighted |
|---|---|---|---|---|---|---|---|---|
| en | 154 | 0.7987 | 0.5239 | 0.8245 | 0.5240 | 0.5409 | 0.8557 | 0.7987 |
| it | 163 | 0.9018 | 0.8407 | 0.9018 | 0.8407 | 0.8407 | 0.9018 | 0.9018 |
| es | 132 | 0.8561 | 0.7142 | 0.8545 | 0.7189 | 0.7098 | 0.8531 | 0.8561 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoConfig
import torch, numpy as np
repo = "SimoneAstarita/trilingual-no-bio-20251014-t01"
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.