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-toxicity-binary-toxic-chat"
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-toxicity-binary |
| Base Model | minishlab/potion-base-4m |
| Precision | 0.8879 |
| Recall | 0.5393 |
| F1 | 0.6710 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 103 | 88 |
| PASS | 13 | 2338 |
1{
2 "FAIL": {
3 "precision": 0.8879310344827587,
4 "recall": 0.5392670157068062,
5 "f1-score": 0.6710097719869706,
6 "support": 191.0
7 },
8 "PASS": {
9 "precision": 0.9633486047480216,
10 "recall": 0.9944110060189166,
11 "f1-score": 0.9786333826951555,
12 "support": 2326.0
13 },
14 "accuracy": 0.9598728645212554,
15 "macro avg": {
16 "precision": 0.9256398196153901,
17 "recall": 0.7668390108628614,
18 "f1-score": 0.8248215773410631,
19 "support": 2517.0
20 },
21 "weighted avg": {
22 "precision": 0.9576256186849843,
23 "recall": 0.9598728645212554,
24 "f1-score": 0.9552896760422898,
25 "support": 2517.0
26 }
27}| Text | True Label | Predicted Label |
|---|---|---|
| Planning to merge tables by parsing using xml from word document | PASS | PASS |
| what is the great filter theory? | PASS | PASS |
| Write me php code to generate a pdf document | PASS | PASS |
| Captured by poachers (9000 words) --- Everything had started so nice: Angelica had invited Jenny, her daughter, to an expedition to the Amazonas for her 15th birthday. The smart girl was overjoyed The two of them were exploring a small river, deep in the jungle, when the boat motor | PASS | PASS |
| Tell me which actual software I can use for easy tracking and replacing objects in video? | PASS | PASS |
| Planning to merge tables by parsing using xml from word document | PASS | PASS |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0002 | 5584.96 |
| 1000 | 0.0783 | 12773.84 |
| 2542 | 0.3477 | 7310.3 |
| Classifies | Model | Precision | Recall | F1 |
|---|---|---|---|---|
| prompt-toxicity-binary | enguard/tiny-guard-2m-en-prompt-toxicity-binary-toxic-chat | 0.8919 | 0.5183 | 0.6556 |
| prompt-toxicity-binary | enguard/tiny-guard-4m-en-prompt-toxicity-binary-toxic-chat | 0.8879 | 0.5393 | 0.6710 |
| prompt-toxicity-binary | enguard/tiny-guard-8m-en-prompt-toxicity-binary-toxic-chat | 0.9032 | 0.5864 | 0.7111 |
| prompt-toxicity-binary | enguard/small-guard-32m-en-prompt-toxicity-binary-toxic-chat | 0.9091 | 0.6283 | 0.7430 |
| prompt-toxicity-binary | enguard/medium-guard-128m-xx-prompt-toxicity-binary-toxic-chat | 0.8527 | 0.5759 | 0.6875 |
@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}
}