Views
No views yet
pip install model2vec[inference]1from model2vec.inference import StaticModelPipeline
2
3model = StaticModelPipeline.from_pretrained(
4 "enguard/tiny-guard-4m-en-general-politeness-binary-intel"
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 | general-politeness-binary |
| Base Model | minishlab/potion-base-4m |
| Precision | 0.9831 |
| Recall | 0.9878 |
| F1 | 0.9854 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 2501 | 31 |
| PASS | 43 | 7625 |
1{
2 "FAIL": {
3 "precision": 0.9830974842767296,
4 "recall": 0.9877567140600316,
5 "f1-score": 0.9854215918045706,
6 "support": 2532.0
7 },
8 "PASS": {
9 "precision": 0.9959508881922675,
10 "recall": 0.9943922796035473,
11 "f1-score": 0.9951709736361264,
12 "support": 7668.0
13 },
14 "accuracy": 0.9927450980392157,
15 "macro avg": {
16 "precision": 0.9895241862344986,
17 "recall": 0.9910744968317895,
18 "f1-score": 0.9902962827203485,
19 "support": 10200.0
20 },
21 "weighted avg": {
22 "precision": 0.992760219690881,
23 "recall": 0.9927450980392157,
24 "f1-score": 0.9927508329697048,
25 "support": 10200.0
26 }
27}| Text | True Label | Predicted Label |
|---|---|---|
| I appreciate your interest in our vegetarian options. I can provide you with a list of our current dishes that cater to your dietary preferences. | PASS | PASS |
| I understand you're concerned about the ski lessons, and I'll look into the options for rescheduling. | PASS | PASS |
| Our technical skills course will cover the essential topics in data analysis, including data visualization and statistical modeling. The course materials will be available on our learning platform. | PASS | PASS |
| Our buffet hours are from 11 AM to 9 PM. Please note that we have a limited selection of options available during the lunch break. | PASS | PASS |
| I'll look into your policy details and see what options are available to you. | PASS | PASS |
| I appreciate your interest in our vegetarian options. I can provide you with a list of our current dishes that cater to your dietary preferences. | PASS | PASS |
| Dataset Size | Time (seconds) | Predictions/Second |
|---|---|---|
| 1 | 0.0002 | 5210.32 |
| 1000 | 0.0574 | 17436.45 |
| 10000 | 0.6413 | 15594.01 |
@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}
}