Learn what the API response contains and how to act on it.
flagged
field and will be sufficient for most use cases. The flagged
field is a boolean that indicates if any of the models that you have enabled detected something non-neutral.
You can adjust the thresholds for flagging content in the project settings. See flagging thresholds.
flagged
field instead of hardcoding the thresholds in your code.🅼🅾🅽🅴🆈
instead of money
, or it can be an even more subtle replacement like hidden spaces or very similar looking letters.
Moderation API detects and normalizes look-alike characters before analyzing content. You can find the normalized text in the content
field of the response, and the original text in the original
field.
Additionally you can use the unicode_spoofing
field to see if look-alike characters were detected.
Lastly, models like the spam
model are trained to take look-alike characters into account. Specifically the spam
model should raise a flag for excessive use of look-alike characters. Other models like the email
model will run on the normalized text to improve accuracy.
email
model can mask email addresses with {{ email hidden }}
. You can store the modified content in your database by using the content
field.