lionguard-2 / README.md
leannetanyt's picture
Update README.md
c783a6a verified
|
raw
history blame
1.02 kB
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

  1. Install packages
pip install -r requirements.txt
  1. Set your OpenAI key
export OPENAI_API_KEY=sk-...
  1. Run inference on an array of texts
python inference.py "['Text 1', 'Text 2']"