Container.Classification

Text classification

Given a text input, the model classifies it into categories.

post/classify

Request

Request body

modelstring nullable

Routes the request to a specific adapter.

tokensinteger[] nullable

The tokenized prompt (i.e., input tokens).

Either input or tokens field is required.

Example request

{
  "input": "I love programming."
}

Response

Successfully classified the text input.

object'list' required

The object type, which is always set to list.

Example response

{
  "data": [
    {
      "label": "Positive",
      "num_classes": 2,
      "probs": [
        0.1,
        0.9
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "total_tokens": 10
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.