lmsys/toxic-chat
Viewer • Updated • 20.3k • 10.3k • 201
How to use AgentPublic/camembert-base-toxic-fr-user-prompts with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="AgentPublic/camembert-base-toxic-fr-user-prompts") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("AgentPublic/camembert-base-toxic-fr-user-prompts")
model = AutoModelForSequenceClassification.from_pretrained("AgentPublic/camembert-base-toxic-fr-user-prompts", device_map="auto")This model is a camembert-base model fine-tuned on a French translated toxic-chat dataset plus additional synthetic data. The model is trained to classify user prompts into three categories: "Toxic", "Non-Toxic", and "Sensible".
The evaluation results are as follows (still under evaluation, more data is needed):
| Precision | Recall | F1-Score | |
|---|---|---|---|
| Non-Toxic | 0.97 | 0.95 | 0.96 |
| Sensible | 0.95 | 0.99 | 0.98 |
| Toxic | 0.87 | 0.90 | 0.88 |
| Accuracy | 0.94 | ||
| Macro Avg | 0.93 | 0.95 | 0.94 |
| Weighted Avg | 0.94 | 0.94 | 0.94 |
Note: This model is still under development, and its performance and characteristics are subject to change as training is not yet complete.