Chinese word segmentation (General)

更新时间:
复制 MD 格式

Chinese word segmentation (Premium Edition - General domain)

Usage notes

  • This is a Premium Edition feature. You must activate the Premium Edition to call this service for free. To check your activation status, click Confirm activation.

  • Supported language: Chinese

  • Supported domain: General

  • Feature description: This feature segments continuous natural language text into a meaningful sequence of words.

Request parameters

Name

Type

Required

Example

Description

Action

String

Yes

GetWsCustomizedChGeneral

A required parameter. The value must be GetWsCustomizedChGeneral.

ServiceCode

String

Yes

alinlp

A static field. The value must be alinlp.

Text

String

Yes

Please enter text

The text to analyze. The maximum length is 1024 characters.

TokenizerId

String

Yes

GENERAL_CHN

The tokenizer type. The default value is GENERAL_CHN.

OutType

String

No

1

0: large granularity, 1: medium granularity (default), 2: small granularity.

Response data

Name

Type

Example

Description

Data

String

{
  "result": [
    {
      "id": "0",
      "word": "Please",
      "tags": [
        "basic word-Chinese"
      ]
    },
    {
      "id": "1",
      "word": "enter",
      "tags": [
        "basic word-Chinese",
        "product type modifier"
      ]
    },
    {
      "id": "2",
      "word": "text",
      "tags": [
        "basic word-Chinese",
        "product type modifier"
      ]
    }
  ],
  "success": true
}
  • id: The word ID.

  • word: The segmented word.

  • tags: The semantic tags.

RequestId

String

FA53D08F-37D1-4D81-BEE7-41F24E825F60

The unique ID of the request. Use this ID to troubleshoot issues.

API access

  1. To access the service using code, see Quick Start.

  2. To try the service online, see Online trial.

Error codes

If an error occurs during a call, refer to the following table for error descriptions, causes, and solutions.

HttpCode

Error code

Error message

Description

400

UserStatusInvalid

The user status is invalid.

The user status is invalid. Check if your account has overdue payments or unpaid bills.

400

BasicServiceNotActivated

The NLP API (Version : base) service has not been activated. Please click the url to confirm the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpBasePost_public_cn#/buy

The NLP API (Basic Edition) service is not activated. Click the link to check the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpBasePost_public_cn#/buy

400

AdvancedServiceNotActivated

The NLP API (Version : advanced) service has not been activated. Please click the url to confirm the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpAdvancedPost_public_cn#/buy

The NLP API (Premium Edition) service is not activated. Click the link to check the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpAdvancedPost_public_cn#/buy

400

IndustryServiceNotActivated

The NLP API (Version : industry) service has not been activated. Please click the url to confirm the activation status:https://common-buy.aliyun.com/?commodityCode=nlp_alinlpIndustryPost_public_cn#/buy

The NLP API (Industry Application Edition) service is not activated. Click the link to check the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpIndustryPost_public_cn#/buy

401

InvalidParameter

The parameter is invalid.

The parameter is invalid. Check the request parameters.

403

Forbidden.NoAuth

You are not authorized to operate on the specified resource. Please click the URL for help information:https://help.aliyun.com/document_detail/177209.html

Your account does not have the permissions to operate on the specified resource. Click the URL for help information: https://help.aliyun.com/document_detail/177209.html

405

TextLimitExceeded

The maximum length of the text is exceeded.

The text length exceeds the limit.

406

TextCodingError

An encoding error occurred to the input text.

The input text has an encoding error.

410

FrameworkError

Framework internal server error.

Framework error.

411

FrameworkApiError

Framework API error.

Framework API error.

412

FrameworkFormatError

Framework request format error.

Framework request format error.

413

FrameworkReturnError

Framework return type format error.

Framework return format error.

429

Throttling.User

Flow control has been triggered.

The maximum number of queries per second (QPS) is exceeded. Click the URL for help information: https://help.aliyun.com/document_detail/69780.html#p-wq5-zb9-5wu

500

InternalError

A server error occurred while processing your request. Please try again later or contact customer support.

A server error occurred while processing your request. Try again later or contact customer support.