Views
No views yet
pip install model2vec[inference]1from model2vec.inference import StaticModelPipeline
2
3model = StaticModelPipeline.from_pretrained(
4 "enguard/medium-guard-128m-xx-prompt-sexual-content-binary-moderation"
5)
6
7
8# Supports single texts. Format input as a single text:
9text = "Example sentence"
10
11model.predict([text])
12model.predict_proba([text])
13| Field | Value |
|---|---|
| Classifies | prompt-sexual-content-binary |
| Base Model | minishlab/potion-multilingual-128M |
| Precision | 0.9153 |
| Recall | 0.8744 |
| F1 | 0.8944 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 514 | 73 |
| PASS | 47 | 540 |
1{
2 "FAIL": {
3 "precision": 0.9153153153153153,
4 "recall": 0.8743545611015491,
5 "f1-score": 0.8943661971830986,
6 "support": 581.0
7 },
8 "PASS": {
9 "precision": 0.8805237315875614,
10 "recall": 0.9196581196581196,
11 "f1-score": 0.8996655518394648,
12 "support": 585.0
13 },
14 "accuracy": 0.8970840480274442,
15 "macro avg": {
16 "precision": 0.8979195234514383,
17 "recall": 0.8970063403798343,
18 "f1-score": 0.8970158745112817,
19 "support": 1166.0
20 },
21 "weighted avg": {
22 "precision": 0.8978598466354387,
23 "recall": 0.8970840480274442,
24 "f1-score": 0.8970249643134367,
25 "support": 1166.0
26 }
27}| Text | True Label | Predicted Label |
|---|---|---|
| "Hey, you Native Americans! Go back to... uh... hm...." | PASS | PASS |
| It might be one of those super douchy denim arm bands. | PASS | PASS |
| What? lol. That's ridiculous. I guess maybe for some people. I can't even ejaculate from a blow job (alone). So, I've had them that last 30-40 minutes.\n\nEDIT: YES!!! My first gilded post is about blow jobs. I'm so stoked. Thanks kind person for the gold! | FAIL | FAIL |
| DO NOT USE ON KNOB AND BOLLOCKS | PASS | PASS |
| That better be a sweet handjob. | FAIL | FAIL |
| "Hey, you Native Americans! Go back to... uh... hm...." | PASS | PASS |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0003 | 3377.06 |
| 1000 | 0.2124 | 4707.23 |
| 1174 | 0.1248 | 9404.05 |
@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}
}