小小API是一个稳定 快速 的 API 接口服务 点击加入QQ群
var axios = require('axios')
var config = {
method: 'get',
url: 'https://v2.xxapi.cn/detect?text=你好'
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
正常内容
{
"text": "你好",
"is_prohibited": false,
"confidence": 0.27084919520901346,
"status": "success",
"max_variant": "妳好",
"triggered_variants": []
}
当检测到违禁内容时
{
"text": "某违禁词", // 原始输入文本
"is_prohibited": true, // 是违禁内容
"confidence": 0.95, // 95%的概率是违禁内容
"status": "success", // 检测成功
"max_variant": "某变体", // 最高概率的变体形式
"triggered_variants": [ // 所有触发的变体列表
{
"variant": "变体1",
"probability": 0.95
},
{
"variant": "变体2",
"probability": 0.85
}
]
}