Best Practices: Field Names and Prompt Crafting
Best Practices: Field Names and Prompt Crafting
Best Practices: Field Names and Prompt Crafting
Before manually tuning your extractor, check out the Composer optimizer which can automatically improve your field descriptions and extraction rules using Extend’s AI agent. After running Composer, refer to these best practices for additional manual refinements and edge cases.
Field names are an important part of extend’s extraction model, so keep some of these guidelines in mind:
Write clear, direct, and detailed descriptions
“The unique invoice number printed at the top of the document. For extend invoices, this will often appear with the prefix EX_.”
“Invoice number”
Include extra context:
* Formatting can be suggested in field descriptions, but we often recommend implementing custom logic on your own platform.
For complete details on all available field types and their configurations, see the Custom Field Types documentation.
Choosing the right field type for your data structure can help improve accuracy.
When to use arrays:
Other custom field types:
date - For date/time values with automatic ISO format conversioncurrency - For monetary amounts with amount and currency codesignature - For signature detection with printed name, date, and signing statusUnified vs Multiple Extractors
One of the most common questions is whether to create one unified extractor or multiple specialized extractors for a document type.
Use a unified extractor when:
Use multiple extractors when:
Effective prompt engineering is crucial for maximizing both extraction coverage and accuracy. Every extractor will have some unique nuance to it, but these tips should provide a solid foundation to build on.
Be Clear, Direct, and Contextual
Write prompts as if explaining to a new employee with no context about the business or document. Include what the data will be used for and provide clear examples.
Example:
For complex extractions, use sequential instructions:
Vague Instructions:
“Extract important information”
“Extract the invoice number located at one of the top corners of the document.”
Missing Context:
“Extract the date”
“Extract the invoice date (when the invoice was issued), not the due date or any other dates in the document”
Inconsistent Formatting:
“Extract total amount. Use dollar sign.”
“Extract the total amount in the format it appears in the document (e.g., ‘$1,250.00’ or ‘1250.00’). Include currency symbols and decimal places exactly as shown”