Views
No views yet
pip install model2vec[inference]1from model2vec.inference import StaticModelPipeline
2
3model = StaticModelPipeline.from_pretrained(
4 "enguard/small-guard-32m-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-32m |
| Precision | 0.9858 |
| Recall | 0.9889 |
| F1 | 0.9874 |
| True \ Predicted | FAIL | PASS |
|---|---|---|
| FAIL | 2504 | 28 |
| PASS | 36 | 7632 |
1{
2 "FAIL": {
3 "precision": 0.9858267716535433,
4 "recall": 0.9889415481832543,
5 "f1-score": 0.9873817034700315,
6 "support": 2532.0
7 },
8 "PASS": {
9 "precision": 0.9963446475195823,
10 "recall": 0.9953051643192489,
11 "f1-score": 0.9958246346555324,
12 "support": 7668.0
13 },
14 "accuracy": 0.9937254901960785,
15 "macro avg": {
16 "precision": 0.9910857095865628,
17 "recall": 0.9921233562512516,
18 "f1-score": 0.991603169062782,
19 "support": 10200.0
20 },
21 "weighted avg": {
22 "precision": 0.9937337395104832,
23 "recall": 0.9937254901960785,
24 "f1-score": 0.9937288011494845,
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 | 4650.0 |
| 1000 | 0.0675 | 14811.34 |
| 10000 | 0.7501 | 13332.07 |
@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}
}