- A generic FlexiLayout, which is used to process all invoices and which may itself include two subtypes:
- A main FlexiLayout, used to detect the standard predefined invoice fields. This FlexiLayout is provided with FlexiCapture for Invoices and cannot be modified.
- An additional FlexiLayout, used to detect user-defined fields and standard invoice fields whose detection logic has been changed. This FlexiLayout is created by the user.
- FlexiLayout variants, which are used to process invoices from specific vendors. FlexiLayout variants can detect any fields defined in their respective Document Definition and can be created by the user or by FlexiCapture for Invoices when it is trained on invoices from specific vendors.
Stage 1: Match the generic FlexiLayout
Apply the main FlexiLayout
First, the program applies the main FlexiLayout. The invoice image is pre-recognized using the pre-recognition parameters specified in the Document Definition:- The languages are specified under Countries and Languages on the Document Definition Settings tab of the Document Definition Properties dialog box.
- The pre-recognition mode (Fast, Balanced, Normal, or Accurate) is specified on the FlexiLayout tab of the Document Definition Properties dialog box.
- The ID of the vendor and the ID of the business unit, if detected.
- The regions of the standard fields. For more information, see Captured fields.
Apply the additional FlexiLayout
Next, the program applies the additional FlexiLayout, if it is available in the generic FlexiLayout. The invoice image is pre-recognized using the pre-recognition parameters (the languages and the pre-recognition mode) specified in the FlexiLayout. We recommend specifying the same pre-recognition parameters in the additional FlexiLayout as in the Document Definition. In this case, the program uses the pre-recognition result obtained when applying the main FlexiLayout instead of pre-recognizing the invoice twice. If your invoices contain some unusual fields, you can specify different pre-recognition parameters in the additional FlexiLayout, but this slows down processing. As a result of applying the additional FlexiLayout, the program obtains the regions of all the fields defined in the additional FlexiLayout. These may be either standard invoice fields whose detection logic had to be changed, or additional fields not defined in the main FlexiLayout.Generate the aggregate result
Next, the program generates the aggregate result of applying the generic FlexiLayout. If the Document Definition includes an additional FlexiLayout, the program merges the results from the main FlexiLayout with those from the additional FlexiLayout at this stage. The fields are identified by their names. The result is a collection of unique fields derived from the main and additional FlexiLayouts. If there are fields with identical names in the main and additional FlexiLayout, the program uses the region from the additional FlexiLayout. This approach allows you to define new fields or change the logic of capturing any of the standard invoice fields.Stage 2: Apply FlexiLayout variants
If the program detected the vendor by applying the generic FlexiLayout in stage 1 and there is a FlexiLayout variant for this vendor, this FlexiLayout variant is applied at this stage. The pre-recognition parameters from the Document Definition are used. These are the same pre-recognition parameters that were used when matching the main FlexiLayout included in the generic FlexiLayout. Therefore, no additional pre-recognition is required. After matching the FlexiLayout variant with the invoice, the program obtains the regions of all the fields defined in the FlexiLayout variant for this specific vendor. If a FlexiLayout variant is obtained by training the program on a variety of invoices, it includes all the fields defined in the Document Definition. If a FlexiLayout variant is created manually, only those fields whose detection requires actions specific to the given vendor should be left in the variant.Stage 3: Merge the results
At this step, the results obtained by matching the generic FlexiLayout are merged with the results obtained by matching the FlexiLayout variant. If the FlexiLayout variant was obtained by training the program on a variety of invoices, it includes all the fields defined in the Document Definition. The Document Definition stores information about the fields whose regions had to be changed by the user during training, that is, the fields that were detected poorly by the generic FlexiLayout. The program uses this information to decide which field regions to take from the generic FlexiLayout and which to take from the FlexiLayout variant trained on this vendor’s invoices.The regions of the Amount fields are selected differently. When applying the generic FlexiLayout, the program specifies the level of confidence with which the regions of the Amount fields have been detected. If the regions are detected unreliably, the Total field requires verification. If there is a FlexiLayout variant trained on invoices from the given vendor, and the generic FlexiLayout fails to detect the Amount fields with a sufficient level of confidence or does not detect them at all, the regions of the Amount fields detected by the FlexiLayout variant are used. You can also configure the program to always use the regions of the Amount fields detected by the FlexiLayout variant. To do this, set the value of the
HKEY_CURRENT_USER\Software\ABBYY\FlexiCapture\12.0\DAForms\UseTrainedInvoiceAmounts registry key to true (the key is set to false by default).Example
Let us consider some of the fields defined in the Document Definition. Consider two standard invoice fields, InvoiceDate and InvoiceNumber, and two user-defined fields, CustomFieldA and CustomFieldB.- InvoiceDate and InvoiceNumber are standard fields, and the detection algorithm for these fields is specified in the main FlexiLayout included in the generic FlexiLayout.
- CustomFieldA and CustomFieldB are user-defined fields, and the detection algorithms for these fields are specified in the additional FlexiLayout included in the generic FlexiLayout.
- InvoiceNumber — This region comes from the results obtained with the main FlexiLayout.
- CustomFieldA — This region comes from the results obtained with the additional FlexiLayout.
- InvoiceDate and CustomFieldB — These regions come from the results obtained with the FlexiLayout variant generated by training the program on invoices from this vendor.
- InvoiceDate and InvoiceNumber — These regions come from the results obtained with the main FlexiLayout.
- CustomFieldA and CustomFieldB — These regions come from the results obtained with the additional FlexiLayout.
