Send Inference Request

Prev Next

This step involves utilizing the trained model to generate predictions on new data.

Text Classification Inference

Token Endpoint:

URL: {{baseUrl}}/published/:tenantName-modelId/v1/text/classification/inference
HTTP Method: POST
Content-Type: application/json


Here's an example of a request:

curl --location '{{baseUrl}}/published/:tenantName-modelId/v1/text/classification/inference' \
--header 'Content-Type: application/json' \
--data '{
  "inputs": [
    {
      "text": "string"
    }
  ],
  "batchSize": 1,
  "topN": 1,
  "textNormalizationConfiguration": {
    "language": "en-US",
    "lowerCase": true,
    "spellCorrection": false,
    "stemming": false,
    "removeStopwords": false,
    "removePunctuation": false
  }
}'


Expected Response:

{
  "result": [
      {
          "text": "string",
          "normalizedText": "string",
          "topPrediction": "prediction_1",
          "topConfidence": 0.761,
          "predictions": [
              {
                  "label": "prediction_1",
                  "confidence": 0.761
              },
              {
                  "label": "prediction_2",
                  "confidence": 0.184
              },
              {
                  "label": "prediction_3",
                  "confidence": 0.03
              },
              {
                  "label": "prediction_4",
                  "confidence": 0.026
              }
          ]
      }
  ]
}