Text Classification
PEFT
Safetensors
English
multilingual
content-safety
lora
mlcommons
ai-safety
hazard-classification
moderation
Instructions to use llm-semantic-router/mmbert-safety-binary-hazard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use llm-semantic-router/mmbert-safety-binary-hazard with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("jhu-clsp/mmBERT-base") model = PeftModel.from_pretrained(base_model, "llm-semantic-router/mmbert-safety-binary-hazard") - Notebooks
- Google Colab
- Kaggle
| { | |
| "label_to_id": { | |
| "S1_violent_crimes": 0, | |
| "S2_nonviolent_crimes": 1, | |
| "S3_sex_crimes": 2, | |
| "S5_weapons_cbrne": 3, | |
| "S6_self_harm": 4, | |
| "S7_hate": 5, | |
| "S8_specialized_advice": 6, | |
| "S9_privacy": 7, | |
| "S13_misinformation": 8 | |
| }, | |
| "id_to_label": { | |
| "0": "S1_violent_crimes", | |
| "1": "S2_nonviolent_crimes", | |
| "2": "S3_sex_crimes", | |
| "3": "S5_weapons_cbrne", | |
| "4": "S6_self_harm", | |
| "5": "S7_hate", | |
| "6": "S8_specialized_advice", | |
| "7": "S9_privacy", | |
| "8": "S13_misinformation" | |
| }, | |
| "mlcommons_taxonomy": { | |
| "labels": [ | |
| "S1_violent_crimes", | |
| "S2_nonviolent_crimes", | |
| "S3_sex_crimes", | |
| "S5_weapons_cbrne", | |
| "S6_self_harm", | |
| "S7_hate", | |
| "S8_specialized_advice", | |
| "S9_privacy", | |
| "S13_misinformation" | |
| ], | |
| "id2label": { | |
| "0": "S1_violent_crimes", | |
| "1": "S2_nonviolent_crimes", | |
| "2": "S3_sex_crimes", | |
| "3": "S5_weapons_cbrne", | |
| "4": "S6_self_harm", | |
| "5": "S7_hate", | |
| "6": "S8_specialized_advice", | |
| "7": "S9_privacy", | |
| "8": "S13_misinformation" | |
| }, | |
| "label2id": { | |
| "S1_violent_crimes": 0, | |
| "S2_nonviolent_crimes": 1, | |
| "S3_sex_crimes": 2, | |
| "S5_weapons_cbrne": 3, | |
| "S6_self_harm": 4, | |
| "S7_hate": 5, | |
| "S8_specialized_advice": 6, | |
| "S9_privacy": 7, | |
| "S13_misinformation": 8 | |
| } | |
| } | |
| } |