enguard/tiny-guard-8m-en-response-safety-binary-nvidia-aegis
021
enguard/tiny-guard-8m-en-response-safety-binary-nvidia-aegis
This model is a fine-tuned Model2Vec classifier based on minishlab/potion-base-8m for the response-safety-binary found in the nvidia/Aegis-AI-Content-Safety-Dataset-2.0 dataset.
Installation
pip install model2vec[inference]Usage
from model2vec.inference import StaticModelPipeline
model = StaticModelPipeline.from_pretrained(
"enguard/tiny-guard-8m-en-response-safety-binary-nvidia-aegis"
)
# 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.
Confusion Matrix
<details> <summary><b>Full metrics (JSON)</b></summary>
{
"FAIL": {
"precision": 0.8195266272189349,
"recall": 0.7030456852791879,
"f1-score": 0.7568306010928961,
"support": 394.0
},
"PASS": {
"precision": 0.7542016806722689,
"recall": 0.8547619047619047,
"f1-score": 0.8013392857142857,
"support": 420.0
},
"accuracy": 0.7813267813267813,
"macro avg": {
"precision": 0.7868641539456018,
"recall": 0.7789037950205463,
"f1-score": 0.7790849434035909,
"support": 814.0
},
"weighted avg": {
"precision": 0.7858208808435052,
"recall": 0.7813267813267813,
"f1-score": 0.7797957700621635,
"support": 814.0
}
}</details>
<details> <summary><b>Sample Predictions</b></summary>
</details>
<details> <summary><b>Prediction Speed Benchmarks</b></summary>
</details>
Other model variants
Below is a general overview of the best-performing models for each dataset variant.
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}
}