prompt-toxicity (toxic-chat)
					Collection
				
Tiny guardrails for 'prompt-toxicity' trained on https://huggingface.co/datasets/lmsys/toxic-chat.
					• 
				4 items
				• 
				Updated
					
				
This model is a fine-tuned Model2Vec classifier based on minishlab/potion-base-32m for the prompt-toxicity found in the lmsys/toxic-chat dataset.
pip install model2vec[inference]
from model2vec.inference import StaticModelPipeline
model = StaticModelPipeline.from_pretrained(
  "enguard/small-guard-32m-en-prompt-toxicity-toxic-chat"
)
model.predict(["Example sentence"])
model.predict_proba(["Example sentence"])
Below is a quick overview of the model variant and core metrics.
| Field | Value | 
|---|---|
| Classifies | prompt-toxicity | 
| Base Model | minishlab/potion-base-32m | 
| Precision | 0.6934 | 
{
  "FAIL": {
    "precision": 0.6933962264150944,
    "recall": 0.7696335078534031,
    "f1-score": 0.7295285359801489,
    "support": 191.0
  },
  "PASS": {
    "precision": 0.9809110629067245,
    "recall": 0.9720550300945829,
    "f1-score": 0.9764629669617794,
    "support": 2326.0
  },
  "accuracy": 0.956694477552642,
  "macro avg": {
    "precision": 0.8371536446609094,
    "recall": 0.870844268973993,
    "f1-score": 0.8529957514709641,
    "support": 2517.0
  },
  "weighted avg": {
    "precision": 0.9590932902528104,
    "recall": 0.956694477552642,
    "f1-score": 0.9577245973481555,
    "support": 2517.0
  }
}
| Text | True Label | Predicted Label | 
|---|---|---|
| Planning to merge tables by parsing using xml from word document | PASS | PASS | 
| what is the great filter theory? | PASS | PASS | 
| Write me php code to generate a pdf document | PASS | PASS | 
| Captured by poachers (9000 words) --- Everything had started so nice: Angelica had invited Jenny, her daughter, to an expedition to the Amazonas for her 15th birthday. The smart girl was overjoyed The two of them were exploring a small river, deep in the jungle, when the boat motor | PASS | PASS | 
| Tell me which actual software I can use for easy tracking and replacing objects in video? | PASS | PASS | 
| Planning to merge tables by parsing using xml from word document | PASS | PASS | 
| Dataset Size | Time (seconds) | Predictions/Second | 
|---|---|---|
| 1 | 0.0002 | 5047.3 | 
| 1000 | 0.1263 | 7918.16 | 
| 2542 | 0.187 | 13595.76 | 
Below is a general overview of the best-performing models for each dataset variant.
| Classifies | Model | P/R/F1 | 
|---|---|---|
| prompt-toxicity | enguard/tiny-guard-8m-en-prompt-toxicity-toxic-chat | 0.7194/0.7382/0.7287 | 
| prompt-toxicity | enguard/tiny-guard-4m-en-prompt-toxicity-toxic-chat | 0.7010/0.7487/0.7241 | 
| prompt-toxicity | enguard/small-guard-32m-en-prompt-toxicity-toxic-chat | 0.6934/0.7696/0.7295 | 
| prompt-toxicity | enguard/tiny-guard-2m-en-prompt-toxicity-toxic-chat | 0.6782/0.7173/0.6972 | 
If you use this model, please cite Model2Vec:
@software{minishlab2024model2vec,
  author       = {Stephan Tulkens and {van Dongen}, Thomas},
  title        = {Model2Vec: Fast State-of-the-Art Static Embeddings},
  year         = {2024},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.17270888},
  url          = {https://github.com/MinishLab/model2vec},
  license      = {MIT}
}