Views
No views yet
pip install model2vec[inference]1from model2vec.inference import StaticModelPipeline
2
3model = StaticModelPipeline.from_pretrained(
4 "enguard/tiny-guard-8m-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-8m |
| Precision | 0.9828 |
| Recall | 0.9905 |
| F1 | 0.9866 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 2508 | 24 |
| PASS | 44 | 7624 |
1{
2 "FAIL": {
3 "precision": 0.9827586206896551,
4 "recall": 0.990521327014218,
5 "f1-score": 0.9866247049567269,
6 "support": 2532.0
7 },
8 "PASS": {
9 "precision": 0.9968619246861925,
10 "recall": 0.9942618675013041,
11 "f1-score": 0.9955601984852442,
12 "support": 7668.0
13 },
14 "accuracy": 0.9933333333333333,
15 "macro avg": {
16 "precision": 0.9898102726879239,
17 "recall": 0.992391597257761,
18 "f1-score": 0.9910924517209856,
19 "support": 10200.0
20 },
21 "weighted avg": {
22 "precision": 0.9933609868705815,
23 "recall": 0.9933333333333333,
24 "f1-score": 0.9933420936211065,
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 | 5461.33 |
| 1000 | 0.0603 | 16570.29 |
| 10000 | 0.6861 | 14575.2 |
@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}
}