Skip to main content
For tasks that have completed extraction, you can use the extract specific fields API to extract additional fields or re-extract individual existing fields for the task. This API returns the complete extraction results of all fields.

Features

  • Extract Additional Fields: Add new field extraction for tasks that have completed extraction
  • Re-extract Fields: Re-extract existing fields, which can be used to correct or optimize extraction results
  • Support Table Fields: Can extract specific fields from tables
  • Return Complete Results: Returns complete extraction results of all fields, with the same structure as /api/app-api/sip/platform/v2/file/fetch

Field Extraction Rules

The API adopts different extraction strategies based on whether the field exists in the original classification configuration:

Additional Fields (Fields Not in Original Results)

For fields that do not exist in the original extraction results (additional fields), the system will use the prompt provided in the request for extraction:
  • If a prompt is provided in the request, it will be used to guide field extraction
  • If no prompt is provided in the request, the default extraction logic will be used
Use Case: When you need to extract new fields for documents that are not defined in the classification configuration.

Configured Fields (Fields Already in Original Classification)

For fields that already exist in the original classification configuration, the system will prioritize using the settings from the classification configuration for extraction:
  • Use the prompt from the classification configuration (if configured)
  • Apply post-processing rules from the classification configuration
  • Ignore the prompt parameter passed in the request
Use Case: Re-extracting existing fields to ensure unified classification configuration rules are used, maintaining consistency in extraction results.

Usage Recommendations

  • Extract New Fields: Provide a prompt in the request, and the system will use that prompt for extraction
  • Re-extract Existing Fields: Simply specify the key, and the system will automatically use the rules from the classification configuration; no need to provide a prompt in the request

API Endpoint

Endpoint: POST /api/app-api/sip/platform/v2/file/extract_fields Request Parameters:

Field Structure

ExtractFieldReqVO:
Table Structure:

Example Code

Request Examples

Extract Basic Fields Only

Extract Table Fields Only

Extract Both Basic Fields and Table Fields

Return Data Example

Notes

  1. Task Status: This API is only applicable to tasks that have completed extraction (recognition_status is 1 or 2)
  2. Field Name: The key field name needs to match the field name in the configured field template (for configured fields) or use a custom name (for additional fields)
  3. Field Hint (prompt):
    • For additional fields (not in original results), prompt will take effect and can be used to guide extraction logic
    • For configured fields (already in original classification), prompt will be ignored, and the system will use rules from the classification configuration
  4. Return Results: The API returns complete extraction results of all fields, including previously extracted fields and newly extracted fields
  5. Table Name: The name in tables needs to match the actual table name in the document