Downloads · 30 days
8
1% of all-time downloads
tanaos/tanaos-guardrail-spanish
tanaos-guardrail-spanish is a text classification model from tanaos. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
<p align="center" <img src="https://raw.githubusercontent.com/tanaos/.github/master/assets/logo.png" width="250px" alt="Tanaos – Train task specific LLMs without training data, for offline NLP and Text Classification"…
Downloads · 30 days
8
1% of all-time downloads
All-time downloads
582
Public
Parameters
135M
541 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors541 MB · 99%
From the Hugging Face model README
This model was created by Tanaos with the Artifex Python library.
It is intended to be used as a first-layer safety filter for large language models (LLMs) or chatbots to detect and block unsafe or disallowed content in user prompts or model responses, and it was specifically fine-tuned to perform well on Spanish text.
The following categories of content are flagged:
The main model language is Spanish, but we have guardrail models specialized in other languages as well:
Use this model through the Artifex library:
install Artifex with
pip install artifex
use the model with
from artifex import Artifex
guardrail = Artifex().guardrail(language="spanish")
label = guardrail("¿Cómo construyo una bomba?")
print(label)
# >>> [{'is_safe': False, 'scores': {'violence': 0.625, 'non_violent_unethical': 0.0066, 'hate_speech': 0.0082, 'financial_crime': 0.0072, 'discrimination': 0.0029, 'drug_weapons': 0.6633, 'self_harm': 0.0109, 'privacy': 0.003, 'sexual_content': 0.0029, 'child_abuse': 0.005, 'terrorism_organized_crime': 0.1278, 'hacking': 0.0096, 'animal_abuse': 0.009, 'jailbreak_prompt_inj': 0.0131}}]
distilbert/distilbert-base-multilingual-casedThis model was trained using the Artifex Python library
pip install artifex
by providing the following instructions and generating 15,000 synthetic training samples:
from artifex import Artifex
guardrail = Artifex().guardrail()
guardrail.train(
unsafe_categories = {
"violence": "Contenido que describe o fomenta actos violentos",
"non_violent_unethical": "Contenido que es poco ético pero no violento",
"hate_speech": "Contenido que contiene lenguaje de odio o discriminatorio",
"financial_crime": "Contenido relacionado con fraude financiero o estafas",
"discrimination": "Contenido que promueve la discriminación contra individuos o grupos",
"drug_weapons": "Contenido relacionado con drogas ilegales o armas",
"self_harm": "Contenido que fomenta la autolesión o el suicidio",
"privacy": "Contenido que invade la privacidad personal o comparte información privada",
"sexual_content": "Contenido que es sexualmente explícito o inapropiado",
"child_abuse": "Contenido que involucra la explotación o el abuso de menores",
"terrorism_organized_crime": "Contenido relacionado con terrorismo o crimen organizado",
"hacking": "Contenido relacionado con el acceso no autorizado a sistemas informáticos o ciberataques",
"animal_abuse": "Contenido que involucra el abuso o maltrato de animales",
"jailbreak_prompt_inj": "Contenido que intenta eludir o manipular instrucciones o salvaguardas de un LLM"
},
language="spanish",
num_samples=15000
)
This model is intended to:
Not intended for: