Online Text Detection API
API Address
https://as.dun.163yun.com/v4/text/check
API Description
The API synchronizes return the results of the real-time anti-spam detection of the Neteasetm content security service, according to the published content, publisher, ip, device id and other information, and the product can perform preliminary filtering on the data according to the result. The API returns the result status in the following three categories:
- UnPass: Indicates that the content is illegal, and the product can delete and hide the data.
- Suspect: The content is suspected to be illegal,and the offline detection module of content Content Moderation service needs to be further confirmed. The confirmation result needs to be periodically called by the product offline text detection result acquisition. The product can be suspected. Do special strategy processing, such as invisibly.
- Pass: Indicates that the real-time anti-spam engine of Content Moderation service is not recognized text as illegal content, and the product can be directly released for this type of data and published successfully. The offline detection module of Content Moderation service will further analyze and process the data, and the analysis result needs to be obtained by the product itself periodically offline text detection result acquisition.
Text Restrictions
A single request less than 5000 characters, the field length exceeds 5000 characters will intercept the first 5000 characters for detection and storage;
Request Parameters
The public parameters have been omitted. See Public Request Parametersfor details. Other parameters are as follow
Parameter Name | Type | Required | Maximum Length | Description |
---|---|---|---|---|
dataId | String | Y | 128 | The unique identifier of the data, which can be located according to the value. If there is any objection to the data result, you can send the value to the account manager. |
content | String | Y | 2^24-1 | User publishing content, it is recommended to filter JSON, emoticons, HTML tags, UBB tags, etc. in the content, only pass plain text, to reduce the probability of misjudgment. Please note that in order to check the effect and performance, if the field is longer than 5000 characters, the first 5000 characters will be intercepted for detection and storage. |
dataType | Number | N | 4 | Subdata type, with EasyShield content security service agreement |
ip | String | N | 32 | User IP Address |
account | String | N | 128 | User unique identifier, null if no login required |
deviceType | Number | N | 4 | User Device Type, 1:web, 2:wap, 3:android, 4:iphone, 5:ipad, 6:pc, 7:wp |
deviceId | String | N | 128 | User Equipment id |
Callback | String | N | 2^16-1 | Data callback parameters, the caller design according to the business situation, when calling the text offline result acquisition API, the API will return the field as it is, see offline text detection result acquisition ](/documents/312371190261010432?locale=zh-CN&docId=150426005789659136). As the data processing identifier, the field should be designed to uniquely locate the data structure of the request, such as detecting the user's nickname, the dataId can be set to the user ID (user ID), the user modifies multiple times, because the dataId may be consistent on different requesting data, but the callback parameter can be designed to locate the data structure of the request. For example, the callback field is designed to be json, including the dataId and the timestamp of the request. Of course, if you do not want to distinguish, you can directly set the callback to dataId |
publishTime | Number | N | 13 | Publish time, UNIX timestamp (millisecond value) |
callbackUrl | String | N | 256 | The manual audit results are notified back to the customer's URL. The timeout time of the data interface of the active callback is set to 2s. In order to ensure the smooth reception of data, the performance of the receiving interface needs to be stable and idempotent |
Business Extension Parameter
The business extension parameter helps to assist the anti-garbage result determination through the business dimension
Parameter Name | Type | Required | Maximum Length | Description |
---|---|---|---|---|
userinfo | - | N | - | User information includes account number, nickname, rank, role, etc |
equipment information | - | N | - | Device information includes device ID, device ID type, etc |
Scene information | - | N | - | Scene information includes private chat, group chat, live broadcast, post and other scene fields |
ip | String | N | 128 | P address of users, cc is suggested, and accurate tuning of machine audit strategy is assisted |
relatedKeys | String | N | 512 | String array, multiple associated keys separated by commas (" XXX, XXX "), up to three keys, the length of a single Key is not more than 128, suitable for private chat/comment/post and other situations where the same user or different user sends multiple illegal content association detection scenarios.If the same user or different users under the same comment need to be detected to send illegal content to build the scene, the Key value transmission method can be (" Comment ID, user ID"). |
extStr1 | String | N | 128 | Custom extension parameters |
extStr2 | String | N | 128 | Custom extension parameters |
extLon1 | Long | N | 2^63-1 | Custom extension parameters |
extLon2 | Long | N | 2^63-1 | Custom extension parameters |
Response Results
The response field is as follows, the common response field has been omitted, see Response General Fields for details:
antispam data structure
Parameter Name | type | Description |
---|---|---|
action | Number | Test results: 0: pass, 1: suspect, 2: fail |
censorType | Number | Audit mode, 0: pure machine audit, 1: machine audit + partial person audit, 2: machine audit + full person audit |
strategyVersion | String | Policy version number, which is updated when the policy is updated and can be used to trace the policy tuning effect |
taskId | String | This time a data id is requested, and the latest result of the data can be queried according to the id |
lang | json array | Language code array |
labels | json array | classified information |
labels data structure
Parameter Name | type | Description |
---|---|---|
label | Number | Classified information, 100: pornography, 200: advertising, 260: Advertising law, 300: violence and terrorism, 400: prohibition, 500: political involvement, 600: abuse, 700: irrigation, 900: Others |
subLabels | json object | Fine classified information, may contain multiple, may be empty |
level | Number | Classification level, 0: pass, 1: suspect, 2: fail |
details | json array | other information |
subLabels data structure
Parameter Name | type | Description |
---|---|---|
subLabel | Number | For detailed codes, please refer to the corresponding fine classification codes below对应表 |
Custom fine classification
YIDUN allows subLabel to custom classify checks and returns, and contact your dedicated security policy manager to add them if required.
details data structure
Parameter Name | type | Description |
---|---|---|
hint | json array | Clue information, used to locate the problematic part of the text, assist manual audit |
hitInfos | json array | Clue details |
hitInfos data structure
Parameter Name | type | Description |
---|---|---|
hitType | Number clues | classification information, return 10: said hit a user-defined add user list, return 11: said hit a user-defined add IP list, return 30: said hit a user-defined add words, return 140: logo hit against cheating (hitReason for anti-cheating hit reason, 1:2: abnormal data behavior model 3: device model 4: business type 5: abnormal 6: check the simulator 7: prison break or root 8: browser anomaly 9: IP anomaly 10: easy to shield the blacklist 11: custom list 12:Custom whitelist) |
情感分析结果
emotionAnalysis 数据结构
Parameter Name | type | Description |
---|---|---|
taskId | String | This time a data id is requested, and the latest result of the data can be queried according to the id |
sentiment | String | negative,neutral,positive,unknown |
positiveProb | Number | 0~1 represents positive emotional tendency, and the higher the score, the higher the positive emotional tendency |
negativeProb | number | 0~1 represents positive emotional tendency, and the higher the score, the higher the positive emotional tendency |
Request example
Response example
When the result is unpass, the output example is as follows:
{
"code": 200,
"msg": "ok",
"antispam": {
"taskId": "fx6sxdcd89fvbvg4967b4787d78a",
"action": 1,
"censorType": 0,
"lang": ["en","vi"],
"labels": [
{
"label": 100,
"level": 1,
"details": {
"hint": [
"xxx,ooo"
],
"hitInfos": []
},
"subLabels": [
{
"subLabel": "100002"
}
]
}
]
},
"emotionAnalysis":{
"taskId":"fx6sxdcd89fvbvg4967b4787d78a",
"sentiment":"positive",
"positiveProb":0.95,
"negativeProb":0.05
}
}
When the result is pass, the output example is as follows:
{
"code": 200,
"msg": "ok",
"antispam": {
"taskId": "079560a6c9f34783bdce47e168510038",
"action": 0,
"labels": [
]
},
"emotionAnalysis":{
"taskId":"fx6sxdcd89fvbvg4967b4787d78a",
"sentiment":"positive",
"positiveProb":0.95,
"negativeProb":0.05
}
}