Views
No views yet
text-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipelinetextdetox dataset. All credits go to the authors of the original corpora.| Language | Validation F1 | Training F1 | ΔF1 |
|---|---|---|---|
| Russian | 0.9572 | 0.9897 | -0.0324 |
| English | 0.9528 | 0.9853 | -0.0325 |
| Hindi | 0.9248 | 0.9599 | -0.0351 |
| Armenian | 0.6513 | 0.6915 | -0.0402 |
| French | 0.9446 | 0.9874 | -0.0428 |
| Tatar | 0.9200 | 0.9682 | -0.0482 |
| Ukrainian | 0.8997 | 0.9511 | -0.0514 |
| Japanese | 0.8658 | 0.9253 | -0.0595 |
| German | 0.8904 | 0.9547 | -0.0643 |
| Spanish | 0.8564 | 0.9399 | -0.0835 |
| Chinese | 0.6865 | 0.7807 | -0.0942 |
| Arabic | 0.7563 | 0.8550 | -0.0987 |
| Italian | 0.8223 | 0.9271 | -0.1048 |
| Hinglish | 0.7234 | 0.8533 | -0.1299 |
| Hebrew | 0.6455 | 0.8441 | -0.1987 |
| Language | Val F1 | Quantized Val F1 | Δ Val F1 | Train F1 | Quantized Train F1 | Δ Train F1 |
|---|---|---|---|---|---|---|
| Russian | 0.9572 | 0.9609 | +0.0037 | 0.9897 | 0.9875 | −0.0022 |
| English | 0.9528 | 0.9495 | −0.0033 | 0.9853 | 0.9857 | +0.0004 |
| German | 0.8904 | 0.8842 | −0.0062 | 0.9547 | 0.9369 | −0.0178 |
| Hindi | 0.9248 | 0.8940 | −0.0300 | 0.9599 | 0.9335 | −0.0264 |
| French | 0.9446 | 0.9351 | −0.0095 | 0.9874 | 0.9814 | −0.0060 |
| Japanese | 0.8658 | 0.8584 | −0.0074 | 0.9253 | 0.9081 | −0.0172 |
| Ukrainian | 0.8997 | 0.8988 | −0.0009 | 0.9511 | 0.9476 | −0.0035 |
| Tatar | 0.9200 | 0.9148 | −0.0052 | 0.9682 | 0.9631 | −0.0051 |
| Amharic | 0.6513 | 0.6377 | −0.0136 | 0.6915 | 0.6863 | −0.0052 |
| Spanish | 0.8564 | 0.8439 | −0.0125 | 0.9399 | 0.9273 | −0.0126 |
| Chinese | 0.6865 | 0.6697 | −0.0168 | 0.7807 | 0.7596 | −0.0211 |
| Arabic | 0.7563 | 0.7535 | −0.0028 | 0.8550 | 0.8481 | −0.0069 |
| Italian | 0.8223 | 0.8033 | −0.0190 | 0.9271 | 0.9193 | −0.0078 |
| Hinglish | 0.7234 | 0.7260 | +0.0026 | 0.8533 | 0.8436 | −0.0097 |
| Hebrew | 0.6455 | 0.6190 | −0.0265 | 0.8441 | 0.8204 | −0.0237 |
1from transformers import AutoTokenizer
2from optimum.onnxruntime import ORTModelForSequenceClassification
3import numpy as np
4
5# Load model and tokenizer using optimum
6model = ORTModelForSequenceClassification.from_pretrained(
7 "gravitee-io/distilbert-multilingual-toxicity-classifier",
8 file_name="model.quant.onnx"
9)
10tokenizer = AutoTokenizer.from_pretrained("gravitee-io/distilbert-multilingual-toxicity-classifier")
11
12# Tokenize input
13text = "Your text here"
14inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
15
16# Run inference
17outputs = model(**inputs)
18logits = outputs.logits
19
20# Optional: convert to probabilities
21probs = 1 / (1 + np.exp(-logits))
22print(probs)1@inproceedings{dementieva2024overview,
2 title={Overview of the Multilingual Text Detoxification Task at PAN 2024},
3 author={Dementieva, Daryna and Moskovskiy, Daniil and Babakov, Nikolay and Ayele, Abinew Ali and Rizwan, Naquee and Schneider, Frolian and Wang, Xintog and Yimam, Seid Muhie and Ustalov, Dmitry and Stakovskii, Elisei and Smirnova, Alisa and Elnagar, Ashraf and Mukherjee, Animesh and Panchenko, Alexander},
4 booktitle={Working Notes of CLEF 2024 - Conference and Labs of the Evaluation Forum},
5 editor={Guglielmo Faggioli and Nicola Ferro and Petra Galu{{s}}{{c}}{'a}kov{'a} and Alba Garc{'i}a Seco de Herrera},
6 year={2024},
7 organization={CEUR-WS.org}
8}
9
10@inproceedings{dementieva-etal-2024-toxicity,
11 title = "Toxicity Classification in {U}krainian",
12 author = "Dementieva, Daryna and Khylenko, Valeriia and Babakov, Nikolay and Groh, Georg",
13 booktitle = "Proceedings of the 8th Workshop on Online Abuse and Harms (WOAH 2024)",
14 month = jun,
15 year = "2024",
16 address = "Mexico City, Mexico",
17 publisher = "Association for Computational Linguistics",
18 url = "https://aclanthology.org/2024.woah-1.19/",
19 doi = "10.18653/v1/2024.woah-1.19",
20 pages = "244--255"
21}
22
23@inproceedings{DBLP:conf/ecir/BevendorffCCDEFFKMMPPRRSSSTUWZ24,
24 author = {Janek Bevendorff and et al.},
25 title = {Overview of {PAN} 2024: Multi-author Writing Style Analysis, Multilingual Text Detoxification, Oppositional Thinking Analysis, and Generative {AI} Authorship Verification - Extended Abstract},
26 booktitle = {ECIR 2024, Glasgow, UK, March 24-28, 2024, Proceedings, Part {VI}},
27 series = {Lecture Notes in Computer Science},
28 volume = {14613},
29 pages = {3--10},
30 publisher = {Springer},
31 year = {2024},
32 doi = {10.1007/978-3-031-56072-9_1}
33}