POST /predict-api/api/classification/text

As of Versionproduct version 2022 Winter
Request MethodPOST
Response FormatJSON
Description

Retrieves classification predictions based on a plain text, e.g., a text rendition of a binary content file.


The JSON request body contains the lists columns and data. Set text as single value in the columns list. Pass your plain text as single String value in the data list.

The endpoint will return a JSON structure containing a list of predictions with one entry that is structured as already described for the endpoint GET /predict-api/api/classification/{objectId}.

Request Header

Content-Type: application/json

X-ID-TENANT-NAME: tenant_name

Request Example
/predict-api/api/classification/text
{
  "columns": [
    "text"
  ],
  "data": [
    "This is the text rendition of an example document."
  ]
}

Result Example


{
    "predictions": [{
        "properties": {
            "Class1": {
                "probability": 98.45
            },
            "Class2": {
                "probability": 12.77
            },
            "Class3": {
                "probability": 1.38
            },
            "Class4": {
                "probability": 0.99
            },
            "Class5": {
                "probability": 0.02
            }
        },
        "predictionId": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
        "system:objectId": {
            "value": "da20c2fb-8071-45e9-b4bf-2af376cdf9b6"
        }
    }]
}