Domain name for API request: es.intl.tencentcloudapi.com.
Text segmentation is a technology that splits long text into short fragments for adapting to model input, improving processing efficiency, or information retrieval. It balances fragment length and semantic consistency, suitable for NLP and data analysis scenarios.
This API is used to slice text based on delimiter rules. It has a single-account call limit. If you need to increase the concurrent limit, please contact us (https://www.tencentcloud.com/act/event/Online_service?from_cn_redirect=1).
A maximum of 100 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: ChunkDocument. |
| Version | Yes | String | Common Params. The value used for this API: 2025-01-01. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| Document | Yes | ChunkDocument | Slice file info. |
| ModelName | Yes | String | Model name, selectable model list: doc-chunk. |
| Config | No | ChunkConfig | File slice configuration. |
| Parameter Name | Type | Description |
|---|---|---|
| Chunks | Array of Chunk | None. |
| Usage | Usage | token consumption |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: es.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ChunkDocument
<Common request parameters>
{
"Document": {
"FileType": "TXT",
"FileContent": "Slice based on separator and text length, applicable to text with strong rules"
},
"ModelName": "doc-chunk",
"Config": {
"MaxChunkSize": 4800,
"Delimiters": [
","
],
"ChunkOverlap": 4000
}
}
{
"Response": {
"Chunks": [
{
"Content": "Slice based on separator and text length, applicable to text with strong rules."
"Index": 0
}
],
"Usage": {
"TotalTokens": 17
},
"RequestId": "eeb0d39a-8a4a-431b-a577-2595202afaa1"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
There is no error code related to the API business logic. For other error codes, please see Common Error Codes.
フィードバック