Updated on 2023-09-27 GMT+08:00

Text Classification Interface

Description

This interface is invoked by third-party access systems to implement the text classification capability and can be used in intelligent case classification scenarios.

Before invoking the text classification interface, commission the text classification function. For details, see OIAP VXXXRXXXCXX Product Documentation 01.

Interface Method

POST

URL

https://IP:PORT/oifde/rest/api/textClassification

Request

Table 1 Parameters in the request body

Parameter

Type

Position

Mandatory

Description

tenantId

String

Body

Yes

Tenant ID.

language

String

Body

Yes

Language. The options are as follows:
  • zh_CN: Chinese
  • en_US: English
  • es_ES: Spanish
  • ar: Arabic
  • th_TH: Thai
  • pt_BR: Portuguese

Note: In intelligent case classification scenarios, the languages supported by the LODAS text classification model are used.

text

String

Body

Yes

Statement.

Basis for text classification. The value can contain a maximum of 4096 characters.

authToken

String

Body

Yes

Authentication token.

For details, see C3 OIAP Interface Authentication.

Response

Parameter

Type

Position

Mandatory

Description

results

TextLabel[]

Body

Yes

Text classification result.

Table 2 TextLabel

Parameter

Mandatory

Type

Description

label

Yes

String

Classification tag.

Intelligent case classification scenario, that is, case type name.

probability

Yes

Long

Matching degree. The value ranges from 0 to 1.

Example

  • Request
    { 
        "tenantId":"fangyg",
        "language":"zh_CN",
        "text":"Failed to issue the invoice.",
        "authToken":"XI0*******************lYbYACW"
    }
  • Response
    {
        "results": [
            {
                "label": "Mobile business → Basic service → Electronic invoice → Global transfer → Function usage → Invoice printing failure → Global transfer",
                "probability": 0.41408610343933105
            },
            {
                "label": "Mobile business → Service touch point → One-point interconnection business → Global transfer → Business rules → Unsatisfied with business regulations/flows → Global transfer",
                "probability": 0.012493142858147621
            },
            {
                "label": "Mobile business → Business marketing → Tariff package → Downgrade package → Handling specifications → Restricted channel handling disapproval → Global transfer",
                "probability": 0.004905845504254103
            }
        ]
    }