This topic describes the syntax of the Tongyi Data Mining information extraction API and provides a request example.
Request syntax
Request parameters
Name | Type | Required | Description | Example value |
|---|---|---|---|---|
capabilityType | string | Yes | The capability type. Bidding document extraction: BID_EXTRACTION. Resume extraction: RESUME_EXTRACTION. Entity extraction: ENTITY_EXTRACTION. | ENTITY_EXTRACTION |
userPrompt | string | Yes | The prompt. | You are an AI assistant that specializes in named entity recognition (NER). Your task is to accurately extract all names of people, places, and organizations from the given text and organize them in the specified dictionary format. |
fileIdList | array | Yes | The list of document IDs. | [ "file_zhiwen_XXX" ] |
stream | boolean | Yes | Specifies whether to return the response in a stream. | true |
Response parameters
Name | Type | Description |
|---|---|---|
output | object | |
-choices | array | |
-finishReason | string | Termination reason |
-message | object | The message body. |
-role | string | The role. |
-content | string | The message content. |
requestId | string | The request ID. |
usage | object | Information about token usage. |
-inputTokens | int | The number of input tokens. |
-outputTokens | int | The number of output tokens. |
-totalTokens | int | The total number of tokens. |
Examples
Call example
Normal response example
JSON format