CoolFace
Modelpublic

enguard/medium-guard-128m-xx-general-politeness-binary-intel

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes12downloads
Model Card

enguard/medium-guard-128m-xx-general-politeness-binary-intel

This model is a fine-tuned Model2Vec classifier based on minishlab/potion-multilingual-128M for the general-politeness-binary found in the Intel/polite-guard dataset.

Installation

bash
pip install model2vec[inference]

Usage

python
from model2vec.inference import StaticModelPipeline

model = StaticModelPipeline.from_pretrained(
  "enguard/medium-guard-128m-xx-general-politeness-binary-intel"
)


# Supports single texts. Format input as a single text:
text = "Example sentence"

model.predict([text])
model.predict_proba([text])

Why should you use these models?

  • —Optimized for precision to reduce false positives.
  • —Extremely fast inference: up to x500 faster than SetFit.

This model variant

Below is a quick overview of the model variant and core metrics.

FieldValue
Classifiesgeneral-politeness-binary
Base Modelminishlab/potion-multilingual-128M
Precision0.9831
Recall0.9901
F10.9866

Confusion Matrix

True \ PredictedFAILPASS
FAIL250725
PASS437625

<details> <summary><b>Full metrics (JSON)</b></summary>

json
{
  "FAIL": {
    "precision": 0.9831372549019608,
    "recall": 0.9901263823064771,
    "f1-score": 0.9866194411648957,
    "support": 2532.0
  },
  "PASS": {
    "precision": 0.9967320261437909,
    "recall": 0.9943922796035473,
    "f1-score": 0.9955607781694739,
    "support": 7668.0
  },
  "accuracy": 0.9933333333333333,
  "macro avg": {
    "precision": 0.9899346405228758,
    "recall": 0.9922593309550122,
    "f1-score": 0.9910901096671848,
    "support": 10200.0
  },
  "weighted avg": {
    "precision": 0.993357324106113,
    "recall": 0.9933333333333333,
    "f1-score": 0.9933412227483374,
    "support": 10200.0
  }
}

</details>

<details> <summary><b>Sample Predictions</b></summary>

TextTrue LabelPredicted 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.PASSPASS
I understand you're concerned about the ski lessons, and I'll look into the options for rescheduling.PASSPASS
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.PASSPASS
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.PASSPASS
I'll look into your policy details and see what options are available to you.PASSPASS
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.PASSPASS

</details>

<details> <summary><b>Prediction Speed Benchmarks</b></summary>

Dataset SizeTime (seconds)Predictions/Second
10.00033446.43
10000.10929156.49
100001.18758420.85

</details>

Other model variants

Below is a general overview of the best-performing models for each dataset variant.

ClassifiesModelPrecisionRecallF1
general-politeness-binaryenguard/tiny-guard-2m-en-general-politeness-binary-intel0.98430.98890.9866
general-politeness-multiclassenguard/tiny-guard-2m-en-general-politeness-multiclass-intel0.98750.97040.9789
general-politeness-binaryenguard/tiny-guard-4m-en-general-politeness-binary-intel0.98310.98780.9854
general-politeness-multiclassenguard/tiny-guard-4m-en-general-politeness-multiclass-intel0.98960.97830.9839
general-politeness-binaryenguard/tiny-guard-8m-en-general-politeness-binary-intel0.98280.99050.9866
general-politeness-multiclassenguard/tiny-guard-8m-en-general-politeness-multiclass-intel0.98730.97950.9833
general-politeness-binaryenguard/small-guard-32m-en-general-politeness-binary-intel0.98580.98890.9874
general-politeness-multiclassenguard/small-guard-32m-en-general-politeness-multiclass-intel0.98970.98620.9879
general-politeness-binaryenguard/medium-guard-128m-xx-general-politeness-binary-intel0.98310.99010.9866
general-politeness-multiclassenguard/medium-guard-128m-xx-general-politeness-multiclass-intel0.98810.98700.9876

Resources

  • —Awesome AI Guardrails: <https://github.com/enguard-ai/awesome-ai-guardails>
  • —Model2Vec: https://github.com/MinishLab/model2vec
  • —Docs: https://minish.ai/packages/model2vec/introduction

Citation

If you use this model, please cite Model2Vec:

@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}
}