Downloads · 30 days
11
7% of all-time downloads
enguard/tiny-guard-8m-en-prompt-harmfulness-binary-moderation
tiny-guard-8m-en-prompt-harmfulness-binary-moderation is a text classification model from enguard. Use it when you need a label for a piece of text. It is set up for model2vec. The card lists the license as mit.
This model is a fine-tuned Model2Vec classifier based on minishlab/potion-base-8m for the prompt-harmfulness-binary found in the enguard/multi-lingual-prompt-moderation dataset.
Downloads · 30 days
11
7% of all-time downloads
All-time downloads
147
Public
Parameters
7.6M
83.7 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors30.6 MB · 83%
How the weights are stored.
F327.6M · 100%
From the Hugging Face model README
This model is a fine-tuned Model2Vec classifier based on minishlab/potion-base-8m 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/tiny-guard-8m-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-8m |
| Precision | 0.8627 |
| Recall | 0.7912 |
| F1 | 0.8254 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 2154 | 572 |
| PASS | 343 | 2383 |
{
"FAIL": {
"precision": 0.8626506024096385,
"recall": 0.7911602209944751,
"f1-score": 0.8253602305475505,
"support": 2715.0
},
"PASS": {
"precision": 0.80622009569378,
"recall": 0.8733802295446131,
"f1-score": 0.8384574373556068,
"support": 2701.0
},
"accuracy": 0.8321639586410635,
"macro avg": {
"precision": 0.8344353490517092,
"recall": 0.8322702252695442,
"f1-score": 0.8319088339515787,
"support": 5416.0
},
"weighted avg": {
"precision": 0.8345082836061795,
"recall": 0.8321639586410635,
"f1-score": 0.8318919062470629,
"support": 5416.0
}
}
</details>
<details>
<summary><b>Sample Predictions</b></summary>
| 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 | PASS |
| Seriously?<br><br>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.0004 | 2427.26 |
| 1000 | 0.0861 | 11612.36 |
| 5452 | 0.3163 | 17234.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}
}