FlexiCapture for Invoices lets you extract invoice fields for which no predefined data types are available, and change the way any field is extracted.
There are several ways to do this:
You can use any one of these solutions, or combine them. For example, you can add a new field to an additional Document Definition that is applied to invoices from all vendors, train the program to recognize the new field on invoices from some vendors, and create a FlexiLayout variant for the other vendors.
For more information about how multiple FlexiLayouts are applied, see How results from different FlexiLayouts are merged.
Create an additional FlexiLayout
Any FlexiLayout created in ABBYY FlexiLayout Studio can be used as an additional FlexiLayout in FlexiCapture for Invoices.
To extract a new type of field, create a new block with a unique name in a FlexiLayout and define the logic for finding it on images. When this FlexiLayout is added to a Document Definition, a new field with the same name as the new block in the FlexiLayout is created.
If the name of the block in the additional FlexiLayout is the same as the name of a standard field in the Document Definition, the additional FlexiLayout is used to extract the block.
To add a FlexiLayout to a Document Definition:
Open the Document Definitions dialog box
Click Document Definitions… on the Project menu.
Edit the Document Definition
In the dialog box that opens, select a Document Definition and click the Edit… button.
Open the Document Definition properties
Click Document Definition Properties… on the Document Definition menu.
Open the FlexiLayout tab
Click the FlexiLayout tab in the dialog box that opens.
Load the FlexiLayout
Click the Load… button in the Additional FlexiLayout options group and specify the path to the FlexiLayout file in the dialog box that opens (FlexiLayout files have the .afl extension).
ABBYY FlexiLayout Studio has several features for developing additional FlexiLayouts for invoices:
- You can find the IDs of the vendor and the business unit of an invoice and reference a data set in a Document Definition.
- You can specify the positions of elements relative to fields that may be detected when the main FlexiLayout is applied.
- You can parametrize the FlexiLayout using an XML file, which lets you store and edit complex lists of keywords and other FlexiLayout parameters without editing the FlexiLayout or the Document Definition.
For more information about the special features of ABBYY FlexiLayout Studio, see Special features of ABBYY FlexiLayout Studio for creating additional FlexiLayouts.
Develop a FlexiLayout variant for a specific vendor
FlexiCapture for Invoices lets you use a separate FlexiLayout variant when processing invoices from a specific vendor. This additional FlexiLayout variant can be created automatically using training. If you are not satisfied with the variant, you can open it in ABBYY FlexiLayout Studio and manually change the field search algorithm.
Enable and apply training
To enable the training feature in the Document Definition editor:
Open the Document Definition settings
Open Document Definition Properties… → Document Definition Settings.
Edit the additional fields and features
Click Edit… in the Additional Fields and Features group.
Enable training
Select Training during invoice processing.
You can train both existing fields and new ones. To apply the training feature:
Add an invoice
Add at least one invoice from the vendor to a batch.
Recognize it
Recognize the invoice.
Verify the vendor
Make sure the program determines the vendor correctly. If it does not, specify the right vendor manually.
Mark the field
Change the location of the field you want to train, or designate its region.
Train
Select the invoice and click Train. A Training batch is created.
Training begins after the first recognized invoice, but for better quality you need to provide the program with at least three sample images that contain this field.
Review and edit the training batch
An Administrator can review and modify the Training batch created as a result of Operator-driven training:
Open the training batch view
Click the
Open Field Extraction Training Batches button on the toolbar to switch to the training batch view. The training batch contains sample batches from a specific vendor, which are used to train the FlexiLayout for this vendor.Then decide whether to use automatic training or edit the FlexiLayout variant manually:
- For automatic training, add a few more sample invoices to the batch (at least three recommended) and specify the field regions. For more information, see Training done by project administrators.
- To edit the FlexiLayout variant manually, continue with the following steps.
Export the trained FlexiLayout
Export a FlexiLayout variant that contains images from the training batch and the FlexiLayout created during training to ABBYY FlexiLayout Studio. Either:
- Click Training → Export Trained FlexiLayout… on the Project menu, or
- Right-click the batch and select Export Trained FlexiLayout… from the shortcut menu.
Open the project in FlexiLayout Studio
Open the project you created in ABBYY FlexiLayout Studio.Blocks in the FlexiLayout correspond to fields in the Document Definition. All blocks involved in the training have the
icon, which indicates that the algorithm for extracting a block has been generated automatically.Making changes to the FlexiLayout causes the program to consider these blocks to have been created manually. When the Document Definition is applied, the program has to choose the FlexiLayout from which it picks the field’s region, and manually created blocks always have higher priority. For more information, see How results from different FlexiLayouts are merged.Because of this, remove the blocks whose search algorithm you do not want to change. These blocks are still present in the main FlexiLayout, so they are still extracted when the Document Definition is applied. For example, to specify a custom algorithm for the InvoiceDate and MyField blocks, leave these blocks in the FlexiLayout and delete all the others.You cannot create new fields in a Document Definition for a specific vendor by simply adding a new block to a FlexiLayout. Blocks in a FlexiLayout variant that do not correspond to a field in a Document Definition cause an error when processing invoices from the vendor. To extract a new field from invoices from a specific vendor, create the field in the Document Definition first (see Train a Document Definition for a specific vendor). Specify the search algorithm
Specify the search algorithm used to find the blocks using the standard tools of ABBYY FlexiLayout Studio.
Export to an .afl file
Export the FlexiLayout variant to an .afl file by clicking Export… on the File menu.
Import the FlexiLayout
In FlexiCapture, click the
Open Field Extraction Training Batches button on the toolbar to switch to the testing batch view. Then import the FlexiLayout. Either:
- Click Training → Import FlexiLayout… on the Project menu, or
- Right-click the batch and click Import FlexiLayout… on the shortcut menu.
Specify the path to the .afl file you created in the previous step. Recognize sample invoices
Recognize sample invoices from the vendor. The operation’s log contains messages about which field regions were selected from the FlexiLayout variant for the vendor.
Check the results
Check the processed documents by opening them in an editor.
Train a Document Definition for a specific vendor
To create a new field:
Create the field
In the Document Definition editor, select Edit → Create Field (or right-click in the list of fields). Select a field type.
Name the field
In the Properties dialog box, enter a name for the additional field and select the Can have region option.
A new field with the name you specified appears on the data form and in the list of fields.
Now train the program to capture data from this field. Training is done separately for each vendor. For more information, see Training during invoice capture.