# Sensitive Content Detection
This interface, from the plug-in 1.1.8 Start Support
Text-sensitive content review, automatically review whether it contains illegal content, such as political, pornographic, abusive
# to initialize
Plugin version number in the document, only for example reference, the latest version of the plugin,Subject to this
{
"pages": [
"pages/index/index"
],
"plugins": {
"chatbot": {
"version": "1.2.23",
"provider": "wx8c631f7e9f2465e1"
}
},
"requiredBackgroundModes": [
"audio"
],
"sitemapLocation": "sitemap.json"
}
var plugin = requirePlugin("chatbot")
App({
onLaunch: function () {
plugin.init({
appid: "P5Ot9PHJDechCYqDFAW1AiK6OtG3Ja", //Mini Program sample account, for learning and reference only
openid: "", //User's openid, not required, it is recommended to pass this parameter
success: () => {}, //Not required
fail: (error) => {}, //Not required
})
},
})
# Call the Sensitive Content Detection Interface
const txt = "the owner of the building is really rubbish. May you die as soon as possible."
plugin.api.nlp('sensitive', {q: txt, mode: 'cnn'}).then(nothing => {
console.log("sensitive result : ", nothing)
})
# Request parameters
field | type | describe |
---|---|---|
q | string | Input Text, UTF-8 Encoding, with a maximum length of 1024 The word |
mode(Optional, Model Options) | string | "cnn" (default) or "bert" (Better but slower) |
# Return to Results
{
"error": null,
"result": [
["dirty_curse", 0.9999999900000001],
["other", 9.9999999e-9],
["dirty_politics", 0.0],
["dirty_porno", 0.0]
]
}
Dxplaination of Sensitive Content Category:
category | Introductions |
---|---|
dirty_politics | Text not approved, involving politically sensitive |
dirty_porno | Text not approved, involving pornography |
dirty_curse | The text is not approved, involving abuse |
初始值 | Text approved without politics, pornography, abuse |
# How to determine if it is sensitive content
dirty_politics
,dirty_porno
, dirty_curse
, other
4 The fields add up to All four fields are floating-point numbers.
- when
other == 1
For absolute security, But the pass rate is low. - when
0.8 < other < 1
or0.9 < other < 1
For relative safety, Can be self-controlled based on business usage