Training an Identification Model
Training an Identification Model
Hyperscience extracts data from documents and converts them into a machine-readable format. We support Structured, Semi-structured, and Additional documents. To learn how to differentiate between the document types, see Understand Document Types.
Requirements for training an ID model
- Model training is handled by the Trainer, which operates independently from the main application to prevent performance degradation during document processing. Learn about the trainer in our Trainer article.
- For optimal performance, the trainer requires a dedicated machine with at least 64GB of RAM and 16 CPU cores. To learn more, see Infrastructure Requirements.
- The system's default minimum requirement to run a model training is 100 documents.
- To train a new Identification model, it is generally recommended to have at least 400 training documents.
Step 1 — Sampling documents
Before uploading documents, make sure your Dataset reflects the documents you expect to process in production. Learn how to prepare your dataset in Preparing training data.
Step 2 — Build a layout, add it to a release, and assign it to a flow
Once you’ve identified the fields you want to extract, create a layout to define how those fields are captured.
Your layout determines:
- which fields are extracted
- how the model learns to identify them
Example
Consider the following insurance claim form:
This is a typical semi-structured document where key information is spread across sections and may appear in different locations depending on the format.
- Identification models are designed to extract this type of information consistently, even when layouts vary.
Step 3 — Training Data Management (TDM)
Use the tools in Training Data Management to control, manage, and adjust the ground truth of your training sets for Identification and Classification models. In this section, you will learn how to upload your data using TDM. Before you start:
- Ensure you meet the requirements outlined in Requirements for training an ID model section of this article.
- Make sure to keep 50-100 documents for testing purposes.
Ground truth is manually annotated data used to train our machine-learning models. We use a subset of this data to assess the performance of your models.
Training Data Analysis
Training Data Analysis allows you to group your training documents and receive recommendations to improve the quality of your dataset. Learn more in Training Data Analysis
Analysis results
The results show you the eligibility and importance of each document. Learn more in Training Data Management Features.
General guidelines
Once you analyze the data, you’ll be able to annotate by group. Doing so provides you with more control over the dataset. Annotating by group and by priority helps you determine which groups have more documents and which groups are underrepresented.
After annotating 2-3 documents per group, you’ll be able to use guided data labeling. This feature gives suggestions provided by the machine that will help you to annotate more quickly.
Follow the general rule for annotating: left to right, top to bottom.
Make sure to maintain consistent annotations for your fields or columns. When a single value of a field or a column appears in different sections of the document, annotate it strictly in one location to avoid confusing the model.
Always use the machine predictions when drawing the bounding box. Avoid drawing it manually.
Adjust the machine predictions ONLY if the bounding boxes are overlapping and preventing the proper extraction of the data.
Do NOT interchange fields or columns, as doing so may lead to uncertainty for the model.
If a field or a table cell is not present, do not replace it with a similar value.
If you don’t see a box made of dashed lines around a value, do NOT annotate it. If there is no such box, it means that our internal ML models are not reading any values for that field or cell.
Field Identification
- Annotate fields with Multiple Occurrences only when multiple instances of a field are present. Learn more about Multiple Occurrences in Field Identification.
- Use multiple bounding boxes when a text is logically connected. Learn more in the Multiple bounding boxes for fields section of Field Identification.
- If you don’t see a value for a field (i.e., the field is blank), do NOT annotate it.
Next steps
- Check if all training documents are eligible for training.
- Ensure you have the required number of training documents.
Step 6 - Review your flow and train your model
Once you’ve reviewed your annotations and addressed any potential anomalies, you’re ready to initiate model training.
Review the flow’s configurations:
Your system might consist of several workflows, called flows. Each flow contains blocks, representing important stages of the data-extraction process. Learn more in Flows Overview.
Run Training
Initiate a model training by clicking the Run Training button.
Step 7 — Evaluate the training results
Deploy your model
Once the model training is complete, you’ll find the candidate model in the model details page. To deploy it, click on your candidate model, then click Deploy Model.
Evaluate the performance
Use the documents you’ve chosen for testing purposes to evaluate the performance of your model. Note that, to measure the performance accurately, these documents should not be ones that were used for the training. To learn more about evaluating the model’s performance, see our Monitoring Model Performance article.
Retraining existing models
When you adjust a semi-structured layout, some of the changes require retraining your Identification Models, while others do not. Retraining ensures that the model can correctly recognize new or updated fields and tables, and helps prevent unexpected behavior in production.
When retraining is required
Field Identification Models
Retraining is required if:
- A new field is added.
- The Multiline setting for an existing field is toggled.
Table Identification Models
Retraining is required if:
- A new column has been added.
- The Multiline setting for an existing column is toggled.
Additional Considerations
If you retrain with existing training data only, new fields/columns or ones with updated Multiline setting will not be included.