metadata
license: other
license_name: govtech-singapore
license_link: LICENSE
language:
- en
- ms
- ta
- zh
pipeline_tag: text-classification
tags:
- classifier
- safety
- moderation
- multilingual
LionGuard 2
LionGuard 2 is a multilingual content moderation classifier tuned for English/Singlish, Chinese, Malay, and Tamil in the Singapore context.
It leverages OpenAI’s text-embedding-3-large with a multi-head classifier to return fine-grained scores for the following categories:
- Overall safety (
binary) - Hate (
hateful_l1,hateful_l2) - Insults (
insults) - Sexual content (
sexual_l1,sexual_l2) - Physical violence (
physical_violence) - Self-harm (
self_harm_l1,self_harm_l2) - Other misconduct (
all_other_misconduct_l1,all_other_misconduct_l2)
Usage
- Install packages
pip install -r requirements.txt
- Set your OpenAI key
export OPENAI_API_KEY=sk-...
- Run inference on an array of texts
python inference.py "['Text 1', 'Text 2']"