> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Training during invoice capture

> Train ABBYY FlexiCapture for Invoices during capture by marking correct field regions on sample invoices to create a FlexiLayout variant per vendor.

If you are not satisfied with the quality of data that FlexiCapture for Invoices automatically extracts, you can train the program while capturing invoices. You do this by marking the correct location of fields on a few sample images of an invoice type. The program then creates a FlexiLayout Variant and uses it when processing new invoices of that type.

<Info>
  Training during invoice capture must be enabled by the Administrator.
</Info>

## Train the program during invoice capture

<Steps>
  <Step title="Collect and input a batch of invoices">
    Collect a batch of invoices (for example, invoices received during the past month) and begin inputting them. For more information, see [How to capture invoices](/flexi-capture/invoice-reader/ir-invoices-input).
  </Step>

  <Step title="Let the program recognize and check the invoices">
    After input, the documents are automatically recognized (if the Administrator enabled this option) and checked using rules.
  </Step>

  <Step title="Open an invoice that needs correction">
    If an invoice's status is other than **Valid**, or you have other reasons to believe the program failed to find fields or located them incorrectly, open the invoice in the document editor.
  </Step>

  <Step title="Mark up the field regions">
    Correct the field regions on the three sample images of this invoice type. You can do this in several ways:

    * Place the mouse pointer in a field on the data form, find the corresponding region on the image (highlighted in blue), and click it (or draw a rectangle with the mouse).
    * Position the mouse pointer over a region on the image (highlighted in blue), click it (or draw the region), and then select the corresponding field from the drop-down list that opens.
    * Adjust a region by moving its boundaries with the mouse.
    * Delete an incorrectly located region: position the pointer over its rectangle and, when a red cross appears in the top-right corner, click the cross. Then create a new region for the field in the correct location.
    * On the data form, start typing a value into a field. A drop-down list shows the words captured from the image that resemble what you are typing. Select the right word, and the position of that word on the image becomes the field's region.
  </Step>

  <Step title="Let training run after export">
    After export, all documents move to the **Training** stage by default, and training starts automatically (the **Train Document Definition** window opens). The program either creates a FlexiLayout Variant for this document type or prompts you to add more sample images — in which case, select the next document and return to the markup step.

    Once the FlexiLayout Variant is trained, it is used for the next invoice from the same vendor. During recognition, the field regions are matched against the invoice image using what the program learned through training.
  </Step>

  <Step title="Verify the results">
    Add a few more invoices from the same vendor and recognize them, then open each one in the document editor to check that the regions are marked up correctly. If all regions are correct, no more training is required.
  </Step>
</Steps>

If you are not satisfied with the results, continue training on the vendor's invoices by repeating the markup and training steps.

## How training is organized by vendor

Training is performed separately on each type of document, and invoices from a single vendor are considered to belong to a single type. If the vendor on an invoice is determined incorrectly, that invoice is assigned to the wrong document type during training.

If the vendor was not determined, select a vendor from the database. If you cannot find the right vendor, type the data from the image into the fields of the **Vendor** group and save the changes to the database by clicking **Save Changes**.

Depending on your project's settings, you may also have to specify the vendor's unique ID to let the program train on that invoice. To do this, type the unique ID in the **VATID** field (this field may have a different name in some project localizations). The **VATID** is a unique identification number assigned to companies for value-added tax purposes.
