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-self-harm-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-self-harm-binary |
| Base Model | minishlab/potion-multilingual-128M |
| Precision | 0.9375 |
| Recall | 0.8571 |
| F1 | 0.8955 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 30 | 5 |
| PASS | 2 | 33 |
1{
2 "FAIL": {
3 "precision": 0.9375,
4 "recall": 0.8571428571428571,
5 "f1-score": 0.8955223880597015,
6 "support": 35.0
7 },
8 "PASS": {
9 "precision": 0.868421052631579,
10 "recall": 0.9428571428571428,
11 "f1-score": 0.9041095890410958,
12 "support": 35.0
13 },
14 "accuracy": 0.9,
15 "macro avg": {
16 "precision": 0.9029605263157895,
17 "recall": 0.8999999999999999,
18 "f1-score": 0.8998159885503987,
19 "support": 70.0
20 },
21 "weighted avg": {
22 "precision": 0.9029605263157894,
23 "recall": 0.9,
24 "f1-score": 0.8998159885503987,
25 "support": 70.0
26 }
27}| Text | True Label | Predicted Label |
|---|---|---|
| *Mojangsta rap\n\nFTFY | PASS | PASS |
| RASHEEEED WALLACE^WALLACE^WALLACE^WALLACE | PASS | PASS |
| I've thought of that before a few times. Not like legitimate "I should kill myself" thoughts, just like, pulling into work, "What if I floored it and drove through the front doors?" | FAIL | FAIL |
| There is no average. I get all men and women under the sun. Old, young, hot, not so hot, short, tall, wheelchair, celebrities, women.... | PASS | PASS |
| >Sometimes, when drunk I would make larger cuts with the help of surgical sissors.\n\naaaand that's enough internet for today. | FAIL | FAIL |
| *Mojangsta rap\n\nFTFY | PASS | PASS |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0003 | 3521.67 |
| 70 | 0.0791 | 885.45 |
| 70 | 0.011 | 6345.8 |
@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}
}