Views
No views yet
Trial timestamp (UTC): 2025-10-08 18:36:51Data case:es-it
| Hyperparameter | Value |
|---|---|
| LANGUAGES | es-it |
| LR | 2e-05 |
| EPOCHS | 3 |
| MAX_LENGTH | 256 |
| USE_BIO | True |
| USE_LANG_TOKEN | False |
| GATED_BIO | True |
| FOCAL_LOSS | True |
| FOCAL_GAMMA | 1.5 |
| USE_SAMPLER | True |
| R_DROP | True |
| R_KL_ALPHA | 1.0 |
| TEXT_NORMALIZE | True |
| Metric | Value |
|---|---|
| f1_macro_dev_0.5 | 0.7779196124639958 |
| f1_weighted_dev_0.5 | 0.8572152617820797 |
| accuracy_dev_0.5 | 0.8440677966101695 |
| f1_macro_dev_best_global | 0.8132320354542577 |
| f1_weighted_dev_best_global | 0.8923452497840444 |
| accuracy_dev_best_global | 0.8915254237288136 |
| f1_macro_dev_best_by_lang | 0.8132320354542577 |
| f1_weighted_dev_best_by_lang | 0.8923452497840444 |
| accuracy_dev_best_by_lang | 0.8915254237288136 |
| default_threshold | 0.5 |
| best_threshold_global | 0.8 |
| thresholds_by_lang | {"it": 0.75, "es": 0.8} |
0.50.8{ "it": 0.75, "es": 0.8 } precision recall f1-score support
hate (0) 0.9670 0.8402 0.8991 244
recl (1) 0.5301 0.8627 0.6567 51
accuracy 0.8441 295 precision recall f1-score support
hate (0) 0.9380 0.9303 0.9342 244
recl (1) 0.6792 0.7059 0.6923 51
accuracy 0.8915 295 precision recall f1-score support
hate (0) 0.9380 0.9303 0.9342 244
recl (1) 0.6792 0.7059 0.6923 51
accuracy 0.8915 2951from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoConfig
2import torch, numpy as np
3
4repo = "SimoneAstarita/Pride-large-try-sweep-20251008-183651-t00"
5tok = AutoTokenizer.from_pretrained(repo)
6cfg = AutoConfig.from_pretrained(repo)
7model = AutoModelForSequenceClassification.from_pretrained(repo)
8
9texts = ["example text ..."]
10langs = ["en"]
11
12mode = "best_global" # or "0.5", "by_lang"
13
14enc = tok(texts, truncation=True, padding=True, max_length=256, return_tensors="pt")
15with torch.no_grad():
16 logits = model(**enc).logits
17probs = torch.softmax(logits, dim=-1)[:, 1].cpu().numpy()
18
19if mode == "0.5":
20 th = 0.5
21 preds = (probs >= th).astype(int)
22elif mode == "best_global":
23 th = getattr(cfg, "best_threshold_global", 0.5)
24 preds = (probs >= th).astype(int)
25elif mode == "by_lang":
26 th_by_lang = getattr(cfg, "thresholds_by_lang", {})
27 preds = np.zeros_like(probs, dtype=int)
28 for lg in np.unique(langs):
29 t = th_by_lang.get(lg, getattr(cfg, "best_threshold_global", 0.5))
30 preds[np.array(langs) == lg] = (probs[np.array(langs) == lg] >= t).astype(int)
31print(list(zip(texts, preds, probs)))
32
33### Files
34reports.json — all metrics (macro/weighted/accuracy) for @0.5, @best_global, and @best_by_lang.
35config.json — stores thresholds: default_threshold, best_threshold_global, thresholds_by_lang.
36report_0.5.txt, report_best.txt — readable classification reports.
37postprocessing.json — duplicate threshold info for external tools.