prompt-harmfulness-binary (moderation)
Collection
Tiny guardrails for 'prompt-harmfulness-binary' trained on https://huggingface.co/datasets/enguard/multi-lingual-prompt-moderation.
•
5 items
•
Updated
This model is a fine-tuned Model2Vec classifier based on minishlab/potion-base-32m for the prompt-harmfulness-binary found in the enguard/multi-lingual-prompt-moderation dataset.
pip install model2vec[inference]
from model2vec.inference import StaticModelPipeline
model = StaticModelPipeline.from_pretrained(
"enguard/small-guard-32m-en-prompt-harmfulness-binary-moderation"
)
# Supports single texts. Format input as a single text:
text = "Example sentence"
model.predict([text])
model.predict_proba([text])
Below is a quick overview of the model variant and core metrics.
| Field | Value |
|---|---|
| Classifies | prompt-harmfulness-binary |
| Base Model | minishlab/potion-base-32m |
| Precision | 0.8548 |
| Recall | 0.8239 |
| F1 | 0.8391 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 2241 | 485 |
| PASS | 379 | 2347 |
{
"FAIL": {
"precision": 0.8547955674436377,
"recall": 0.8239410681399632,
"f1-score": 0.8390847711927982,
"support": 2715.0
},
"PASS": {
"precision": 0.8292247231153984,
"recall": 0.8593113661606813,
"f1-score": 0.844,
"support": 2701.0
},
"accuracy": 0.8415805022156573,
"macro avg": {
"precision": 0.8420101452795181,
"recall": 0.8416262171503222,
"f1-score": 0.841542385596399,
"support": 5416.0
},
"weighted avg": {
"precision": 0.8420431947459689,
"recall": 0.8415805022156573,
"f1-score": 0.8415360328265228,
"support": 5416.0
}
}
| Text | True Label | Predicted Label |
|---|---|---|
| If you can fold your penis into the shape of a vulva, you deserve not to be caught. In fact you deserve an ace origami prize. | FAIL | FAIL |
| I'm surprised they let you stay without buying anything. | PASS | PASS |
| Pirates flew the Jolly Roger.\n\nPimps blew the roger jolly. | PASS | FAIL |
| Seriously? You're "depressed" because of a story? Oh, Reddit. |
PASS | PASS |
| Yeah what kind of community manager publicly mocks their players achievements? With no clarification, straight douche. | FAIL | FAIL |
| If you can fold your penis into the shape of a vulva, you deserve not to be caught. In fact you deserve an ace origami prize. | FAIL | FAIL |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0006 | 1610.1 |
| 1000 | 0.0785 | 12738.89 |
| 5452 | 0.3757 | 14512.9 |
Below is a general overview of the best-performing models for each dataset variant.
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}
}