REST API for classification done

First job of the day was hosting the API that I had developed last week up somewhere.

It now lives at http://api.polite.ai thanks to some free GCP developer programme credits from Google!

How to use the API

POST to http://api.polite.ai/api/1.0/classify:

{ 
    "text" : <String> // Message to be classified
}

Response

{ 
    "request" : { }, // your request verbatim 
    "results" : {
        "aggression" : bool, // text is aggressive
        "attack" :  bool, // text is a personal attack
        "toxicity": bool // text is toxic 
     }
}

Example

curl -i -H "Content-Type: application/json" -X POST -d '{"text":"You stink"}' http://api.polite.ai/api/1.0/classify

Produces

{"request": {"text": "You stink"}, "results": {"aggression": "1", "attack": "1", "toxicity": "1"}}

Leave a Reply

Your email address will not be published. Required fields are marked *