Views
No views yet
pip install model2vec[inference]1from model2vec.inference import StaticModelPipeline
2
3model = StaticModelPipeline.from_pretrained(
4 "enguard/tiny-guard-2m-en-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-base-2m |
| Precision | 0.8929 |
| Recall | 0.7143 |
| F1 | 0.7937 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 25 | 10 |
| PASS | 3 | 32 |
1{
2 "FAIL": {
3 "precision": 0.8928571428571429,
4 "recall": 0.7142857142857143,
5 "f1-score": 0.7936507936507936,
6 "support": 35.0
7 },
8 "PASS": {
9 "precision": 0.7619047619047619,
10 "recall": 0.9142857142857143,
11 "f1-score": 0.8311688311688312,
12 "support": 35.0
13 },
14 "accuracy": 0.8142857142857143,
15 "macro avg": {
16 "precision": 0.8273809523809523,
17 "recall": 0.8142857142857143,
18 "f1-score": 0.8124098124098125,
19 "support": 70.0
20 },
21 "weighted avg": {
22 "precision": 0.8273809523809523,
23 "recall": 0.8142857142857143,
24 "f1-score": 0.8124098124098124,
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 | PASS |
| *Mojangsta rap\n\nFTFY | PASS | PASS |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0002 | 5809.29 |
| 70 | 0.0073 | 9606.11 |
| 70 | 0.0054 | 12990.06 |
@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}
}