Offline Text Result Acquisition API

2020.11.20 14:34:17

    API Address

    https://as.dun.163yun.com/v3/text/callback/results

    API Description

    Online detection of suspected data in the API results will be performed offline and manually. The offline results of these data require the client to obtain periodically through the API. After getting the result of data processed, the next call will not return the offline data obtained before. The API limits the frequency of requests. If the request frequency is too fast, the server will refuse to process. It is recommended to obtain it once every 30 seconds.

    Request parameter

    The API parameters are consistent with the public request parameters. For details, see Public Request Parameters

    Response Results

    The response field is as follows, the common response field has been omitted, see Response General Fields:

    Result array data structure

    Parameter Name Type Description
    action Number Test results, 0: Pass, 2: Not pass
    censorSource Number Source of audit, 0: Yi Dun human audit, 1: customer audit, 2: Yi Dun machine audit, version support V3.1 or above
    censorRound Number Number of audit rounds: 1:1st round, 2:2nd round, 3:3rd round, 4:4th round, 5:5th round. No audit mode is set, and the default return is 0
    taskId String The data request identifier returned by the online API detection, which can query the latest result of the data according to the identifier
    callback String The callback field data passed by the product call online text detection.
    labels jjson array classification information

    Labels data structure

    Parameter Name Type Description
    label Number Classified information, 100: porn, 200: advertising, 300:terrorism,400: contraband, 500: political, 600: abuses, 700: meaningless
    level Number Classification level, 1: Uncertain, 2: OK
    details json object Other information

    Details data structure

    Parameter Name Type Description
    hint jjson array clue information for locating the problematic part of the text, assisting with manual review

    censorLabels data structure

    Parameter Name Type Description
    code Number A unique tag ID is generated after the smart system has configured the custom tag

    Request example

    Java code

    Python code

    PHP code

    C# code

    js code

    Response example

    When the offline result is obtained, the output example is as follows:

    {
        "code": 200,
        "msg": "ok",
        "result": [
            {
               "action": 2,
    	   "censorSource": 0,
    	   "censorRound":0,
                "taskId": "a9840b389d2e483d9349cd62e9cda250",
                "callback": "ebfcad1c-dba1-490c-b4de-e784c2691768",
                "labels": [
                    {
                        "label": 600,
                        "level": 2,
                        "details": {
                            "hint": [
                                "xxx"
                            ]
                        }
                    }
                ]
            },
            {
                "action": 1,
                "taskId": "11140b389d2e483d9349cd62e9cdas11",
                "callback": "asdffcad1c-dba1-490c-b4de-e784c269112",
                "censorLabels": [
    	       {
    	       	"code":Customize the tag mapping ID
    	       }
    	   ]
           }
            
        ]
    }
    

    When there is no latest offline result to be obtained, the output example is as follows:

    {
        "code": 200,
        "msg": "ok",
        "result":[]
    }
    
    Online Chat Tel:95163223