prompt-hate-speech-binary (moderation)
Collection
Tiny guardrails for 'prompt-hate-speech-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-hate-speech-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-hate-speech-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-hate-speech-binary |
| Base Model | minishlab/potion-base-32m |
| Precision | 0.9207 |
| Recall | 0.8394 |
| F1 | 0.8782 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 210 | 40 |
| PASS | 18 | 232 |
{
"FAIL": {
"precision": 0.920704845814978,
"recall": 0.8393574297188755,
"f1-score": 0.8781512605042017,
"support": 249.0
},
"PASS": {
"precision": 0.8529411764705882,
"recall": 0.928,
"f1-score": 0.8888888888888888,
"support": 250.0
},
"accuracy": 0.8837675350701403,
"macro avg": {
"precision": 0.8868230111427831,
"recall": 0.8836787148594378,
"f1-score": 0.8835200746965453,
"support": 499.0
},
"weighted avg": {
"precision": 0.8867551116745022,
"recall": 0.8837675350701403,
"f1-score": 0.8835308338432233,
"support": 499.0
}
}
| Text | True Label | Predicted Label |
|---|---|---|
| It really only works on bitchy women because they get insulted that I think they look old | FAIL | FAIL |
| You mean the Master of Mesopotamia | PASS | PASS |
| Oh fuck that's so stupid. You believed his father to be dead and you acted like a decent person. Fuck this gay earth | FAIL | FAIL |
| I'm taking it. Thanks for suggestion. | PASS | PASS |
| I think you fell for a person, not a gender. | PASS | PASS |
| It really only works on bitchy women because they get insulted that I think they look old | FAIL | FAIL |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0003 | 3771.86 |
| 500 | 0.0693 | 7217.1 |
| 500 | 0.037 | 13514.93 |
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}
}