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-harmfulness-multilabel-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-harmfulness-multilabel |
| Base Model | minishlab/potion-base-2m |
| Precision | 0.7687 |
| Recall | 0.5006 |
| F1 | 0.6064 |
1{
2 "0": {
3 "precision": 0.8734419942473634,
4 "recall": 0.46033350176856996,
5 "f1-score": 0.6029119788219722,
6 "support": 1979.0
7 },
8 "1": {
9 "precision": 0.5401785714285714,
10 "recall": 0.4859437751004016,
11 "f1-score": 0.5116279069767442,
12 "support": 249.0
13 },
14 "2": {
15 "precision": 0.265625,
16 "recall": 0.4857142857142857,
17 "f1-score": 0.3434343434343434,
18 "support": 35.0
19 },
20 "3": {
21 "precision": 0.8220140515222483,
22 "recall": 0.6041308089500861,
23 "f1-score": 0.6964285714285714,
24 "support": 581.0
25 },
26 "4": {
27 "precision": 0.5912408759124088,
28 "recall": 0.5869565217391305,
29 "f1-score": 0.5890909090909091,
30 "support": 276.0
31 },
32 "micro avg": {
33 "precision": 0.7687007874015748,
34 "recall": 0.5006410256410256,
35 "f1-score": 0.6063664596273292,
36 "support": 3120.0
37 },
38 "macro avg": {
39 "precision": 0.6185000986221184,
40 "recall": 0.5246157786544947,
41 "f1-score": 0.548698741950508,
42 "support": 3120.0
43 },
44 "weighted avg": {
45 "precision": 0.8054857985857364,
46 "recall": 0.5006410256410256,
47 "f1-score": 0.6089078358510209,
48 "support": 3120.0
49 },
50 "samples avg": {
51 "precision": 0.2524464549483013,
52 "recall": 0.2492152880354505,
53 "f1-score": 0.24635911233030874,
54 "support": 3120.0
55 }
56}| Text | True Label | Predicted Label |
|---|---|---|
| If you can fold your penis into the shape of a vulva, you deserve not to be caught. In fact you deserve an ace origami prize. | harassment | |
| I'm surprised they let you stay without buying anything. | ||
| Pirates flew the Jolly Roger.\n\nPimps blew the roger jolly. | ||
| Seriously? You're "depressed" because of a story? Oh, Reddit. | ||
| Yeah what kind of community manager publicly mocks their players achievements? With no clarification, straight douche. | harassment | |
| If you can fold your penis into the shape of a vulva, you deserve not to be caught. In fact you deserve an ace origami prize. | harassment |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0002 | 5077.85 |
| 1000 | 0.5461 | 1831.16 |
| 5452 | 0.3289 | 16577.88 |
@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}
}