Template Design Tips
The quality of your extraction template directly affects the quality of your results. Here are proven practices.
Naming fields
Be specific
| Instead of | Use |
|---|---|
| "Date" | "Invoice Date" |
| "Amount" | "Total Amount Due" |
| "Name" | "Customer Full Name" |
| "Number" | "Purchase Order Number" |
Specific names eliminate ambiguity when the AI encounters multiple similar fields in a document.
Use consistent naming
Pick a naming convention and stick with it:
invoice_number,invoice_date,invoice_total(snake_case)Invoice Number,Invoice Date,Invoice Total(Title Case)- Avoid mixing conventions within the same template
Writing descriptions
The description field is your chance to guide the AI. Use it for ambiguous fields:
| Field | Without description | With description |
|---|---|---|
| "Amount" | AI might grab subtotal, tax, or total | "The final total amount due after all discounts and taxes, in the document's currency" |
| "Address" | AI might grab billing or shipping | "The shipping address where goods should be delivered, not the billing address" |
| "Date" | AI might grab issue date, due date, or delivery date | "The date the invoice was issued, not the payment due date" |
Choosing field types
Use the most specific type available:
| Type | When to use | What it ensures |
|---|---|---|
| Number | Financial amounts, quantities | Returns numeric value, not "USD 500" |
| Date | Any date field | Returns consistent date format |
| Boolean | Yes/no questions | Returns true/false, not "Yes"/"No" |
| Array | Lists (line items) | Returns array of items, not concatenated text |
| Object | Grouped data (address) | Returns structured nested data |
| Text | Everything else | Returns as-is |
Template iteration
- Start with Auto-detect — process a sample document with no template to see what the AI finds
- Create your template based on what fields matter to you
- Test on 2-3 documents — run extraction and review results
- Refine — add descriptions, adjust field names, change types based on results
- Scale — once results are consistent, use for batch processing
Common pitfalls
- Too many fields — the AI does better with 10-20 focused fields than 50 broad ones
- Overlapping fields — "Name" and "Full Name" in the same template confuse the AI
- No descriptions on ambiguous fields — if a field could mean two things, add a description
- Wrong types — using Text for a Number field means you get "$1,500.00" instead of
1500.00