Views
No views yet
pip install model2vec[inference]1from model2vec.inference import StaticModelPipeline
2
3model = StaticModelPipeline.from_pretrained(
4 "enguard/tiny-guard-4m-en-prompt-violence-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-violence-binary |
| Base Model | minishlab/potion-base-4m |
| Precision | 0.8851 |
| Recall | 0.8370 |
| F1 | 0.8603 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 232 | 45 |
| PASS | 30 | 247 |
1{
2 "FAIL": {
3 "precision": 0.8850574712643678,
4 "recall": 0.8369565217391305,
5 "f1-score": 0.8603351955307262,
6 "support": 276.0
7 },
8 "PASS": {
9 "precision": 0.845360824742268,
10 "recall": 0.8913043478260869,
11 "f1-score": 0.8677248677248677,
12 "support": 276.0
13 },
14 "accuracy": 0.8641304347826086,
15 "macro avg": {
16 "precision": 0.8652091480033179,
17 "recall": 0.8641304347826086,
18 "f1-score": 0.8640300316277969,
19 "support": 552.0
20 },
21 "weighted avg": {
22 "precision": 0.8652091480033179,
23 "recall": 0.8641304347826086,
24 "f1-score": 0.8640300316277969,
25 "support": 552.0
26 }
27}| Text | True Label | Predicted Label |
|---|---|---|
| 300 K/D ratio? Fuckin' camper. | PASS | PASS |
| 젠장,꼭 읽 황혼,나중에 gurrlllllllllfrrrrrrrrrennnnnnnnnnn | PASS | PASS |
| Ever heard a boston girl have an orgasm? Oh gawd! Harda! Pepperidge farm! | PASS | PASS |
| RIP that dudes Hamstring | FAIL | FAIL |
| ビリージョエル? まだ少し戸惑...[こ](http://assets.rollingstone.com/assets/images/artists/304x304/billy-joel.jpgはBilly Joel.\n[こ](http://www.greenday.net/bjbio.jpgはビリー-ジョー東京. | PASS | PASS |
| 300 K/D ratio? Fuckin' camper. | PASS | PASS |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0002 | 5817.34 |
| 554 | 0.0373 | 14869.23 |
| 554 | 0.0321 | 17269.36 |
@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}
}