IBM API Hub
IBM Watson Natural Language Processing Library for Embed

By Embeddable AI

Provides API details for IBM Watson Natural Language Processing Library for Embed


API reference

CategoriesPredict

POST

/v1/watson.runtime.nlp.v1/NlpService/CategoriesPredict

Performs categories predictions on an input document, with optional explanations

Request URL
https://localhost:8080/v1/watson.runtime.nlp.v1/NlpService/v1/watson.runtime.nlp.v1/NlpService/CategoriesPredict
Parameters
Name
Description
  • grpc-metadata-mm-model-id
    string
    (header)
    Default: <SELECTED_MODEL_ID>
  • Content-type
    string
    (header)
    application/json
  • Accept
    string
    (header)
    application/json
  • Request body
    Responses
    • 200

      A successful response.

    • default

      An unexpected error response.

    Code snippet
      1curl --request POST \
      2  --url https://localhost:8080/v1/watson.runtime.nlp.v1/NlpService/v1/watson.runtime.nlp.v1/NlpService/CategoriesPredict \
      3  --header 'accept: application/json' \
      4  --header 'content-type: application/json' \
      5  --header 'grpc-metadata-mm-model-id: <SELECTED_MODEL_ID>' \
      6  --data REPLACE_REQUEST_BODY
      

        Example response

          1{
          2  "categories": [
          3    {
          4      "labels": [
          5        "duvde"
          6      ],
          7      "score": 70.0815355,
          8      "explanation": [
          9        {
          10          "text": "luzfisuz"
          11        }
          12      ]
          13    }
          14  ],
          15  "producerId": {
          16    "name": "Amanda Thornton",
          17    "version": "6.5.4"
          18  }
          19}