Preparing training data
Preparing training data
Published on Jun 8, 2026
8 minute(s) read
The quality of your Training Data directly affects how well your Identification model performs. Before training a model, prepare a Dataset that accurately represents the documents you expect to process in production.
While you'll first create a Semi-structured Layout to upload documents in Training Data Management (TDM), the quality, diversity, and consistency of your training data have the greatest impact on model performance.
In this step, you'll prepare a representative dataset that reflects the document patterns, formats, and edge cases your model is expected to process.
Choose representative documents
Selecting the right documents is the most important part of preparing your training data. A representative dataset allows the model to learn patterns that reflect the documents it will process in production.
Identify your document types
Start by identifying the document types (e.g., invoices, paystubs, claim forms):
- Determine the main document patterns (e.g., structures, fields, tables)
- Ensure that the fields or tables you need to extract are present in these documents.
Document distribution
Your training data should reflect the real distribution of documents you expect to process.
Include examples from the document types you expect to process with this model
- For Field Identification models: include at least 15 documents per type.
- For Table Identification models: include at least 20 documents per type.
- If your use case includes multiple formats (e.g., different Vendors/suppliers), include enough examples for each.
Ensure documents contain the required data
Your documents must support the data you want to extract.
- Ensure that every field you want to extract appears in your dataset.
- Include enough examples of each field across documents.
- If documents with missing information are expected in production, include representative examples in your training dataset. This helps the model learn patterns that reflect production data.
- For multi-page documents, ensure all pages are included. The order of pages in your training data should reflect how documents are received in production.
Ensure dataset diversity
Your training dataset should reflect the range of document patterns your model will encounter in production. Including diverse examples helps the model generalize and perform consistently across different document formats.
Include diverse document patterns
Documents of the same type may differ in how they present information. That’s why it is important to include documents where:
- fields appear in different locations
- sections are arranged differently
- tables vary in size.
Capture differences in labels and formatting
Include documents with patterns such as:
- different field labels (e.g., “Invoice No” vs “Invoice ID”)
- different date or number formats
Handle edge cases
Not all documents should be treated equally. Some documents differ significantly from the main dataset and can negatively impact model performance if included without consideration.
Identify edge cases
Review your dataset and look for documents that do not follow the common structure. Edge cases may include:
- documents with completely different layouts
- documents where key fields appear in unusual locations
- documents with missing or inconsistent structure
Decide whether to include or exclude them
Once identified, decide how to handle each edge case.
- Prioritize document types that best represent your production data.
- Exclude them if they are rare or not relevant to your use case.
Avoid mixing incompatible patterns
Identification models can learn document patterns. However, documents that differ significantly from the main dataset may require a different approach.
Clean your dataset
Before using your documents for training, remove any data that could negatively impact model performance. Low-quality or irrelevant documents can introduce noise and reduce the model’s ability to learn consistent patterns.
Remove low-quality documents
Exclude documents that are difficult to read or poorly formatted.
- distorted or skewed scans
- pixelated or low-resolution images
Remove duplicates
- Avoid including identical documents, such as repeated samples of the same document.
Exclude irrelevant documents
Remove documents that do not match your use case:
- documents containing unrelated information
- documents outside the intended document type
Prepare a testing set
Before training your model, set aside a portion of your documents for evaluation. A testing set allows you to measure model performance accurately after training.
Reserve documents for testing
Select a subset of your dataset to use only for evaluation. Set aside 50–100 documents for testing:
- Ensure the testing documents reflect your production data.
Keep training and testing data separate
Avoid using the same documents for both training and evaluation.
Ensure representative coverage
Your testing set should mirror the variability of your dataset:
- Include all relevant document types.
Common issues
Using too few documents
Training with a small dataset limits the model’s ability to learn patterns and generalize to new documents.
Unbalanced representation of document types
Avoid over-representing a single document type, vendor, or format.
Ignoring layout patterns/formats
Training on a limited set of formats can lead to poor performance when new patterns/formats are introduced.
Including low-quality or noisy documents
Distorted, skewed, or low-resolution documents can negatively impact both annotation and training.
Including irrelevant or incomplete documents
Documents that are missing key fields or contain unrelated information can introduce noise into the dataset.