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-harassment-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-harassment-binary |
| Base Model | minishlab/potion-multilingual-128M |
| Precision | 0.8660 |
| Recall | 0.8034 |
| F1 | 0.8336 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 1593 | 391 |
| PASS | 247 | 1737 |
1{
2 "FAIL": {
3 "precision": 0.8660130718954249,
4 "recall": 0.8034360788276907,
5 "f1-score": 0.8335517693315858,
6 "support": 1979.0
7 },
8 "PASS": {
9 "precision": 0.8157271435338702,
10 "recall": 0.875,
11 "f1-score": 0.8443245893601373,
12 "support": 1968.0
13 },
14 "accuracy": 0.839118317709653,
15 "macro avg": {
16 "precision": 0.8408701077146475,
17 "recall": 0.8392180394138453,
18 "f1-score": 0.8389381793458616,
19 "support": 3947.0
20 },
21 "weighted avg": {
22 "precision": 0.8409401793148473,
23 "recall": 0.839118317709653,
24 "f1-score": 0.8389231678155457,
25 "support": 3947.0
26 }
27}| Text | True Label | Predicted Label |
|---|---|---|
| you don't have much experience with european gypsies, do you? Touch one, and they spawn cousins all around you like an RPG boss. | FAIL | FAIL |
| 良い、悪天候時butthole! | FAIL | FAIL |
| I know what you are thinking....but where will he build the fire for the smoke signals? | PASS | PASS |
| Not really even an "unnatural" disaster. Oil comes from the earth, water comes from the earth. Its inevitable that they will find each other. | PASS | PASS |
| You don't even know what you were quoting, do you? You just saw it on the internet somewhere and decided to parrot it here on reddit for karma. Nicely done, I'll give you a C for effort, but you should try harder next time. | FAIL | PASS |
| you don't have much experience with european gypsies, do you? Touch one, and they spawn cousins all around you like an RPG boss. | FAIL | FAIL |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0003 | 3688.92 |
| 1000 | 0.1995 | 5012.0 |
| 3968 | 0.4654 | 8525.49 |
@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}
}