Text Classification
Transformers
Safetensors
xlm-roberta
Inference Endpoints
dardem commited on
Commit
926ad04
·
verified ·
1 Parent(s): 6297ac2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -0
README.md CHANGED
@@ -49,6 +49,21 @@ Now, the models covers 15 languages from various language families:
49
  | Japanese | ja | 0.8773 |
50
  | Tatar | tt | 0.5744 |
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ## Citation
53
  The model is prepared for [TextDetox 2025 Shared Task](https://pan.webis.de/clef25/pan25-web/text-detoxification.html) evaluation.
54
 
 
49
  | Japanese | ja | 0.8773 |
50
  | Tatar | tt | 0.5744 |
51
 
52
+ ## How to use
53
+
54
+ ```python
55
+ import torch
56
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
57
+
58
+ tokenizer = AutoTokenizer.from_pretrained('textdetox/xlmr-large-toxicity-classifier-v2')
59
+ model = AutoModelForSequenceClassification.from_pretrained('textdetox/xlmr-large-toxicity-classifier-v2')
60
+
61
+ batch = tokenizer.encode("You are amazing!", return_tensors="pt")
62
+
63
+ output = model(batch)
64
+ # idx 0 for neutral, idx 1 for toxic
65
+ ```
66
+
67
  ## Citation
68
  The model is prepared for [TextDetox 2025 Shared Task](https://pan.webis.de/clef25/pan25-web/text-detoxification.html) evaluation.
69