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
File size: 1,376 Bytes
7a44c77 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | {
"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
}
}
} |