> ## 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 ABBYY FlexiCapture for Invoices

> Train ABBYY FlexiCapture for Invoices on documents with unusual layouts or custom fields, creating FlexiLayout variants that improve field detection.

You can improve the quality of data capture by training FlexiCapture for Invoices. The administrator, or operators with sufficient permissions, can train the program either before or while processing documents.

Training is available only for the following kinds of images and cases:

* Images on which fields cannot be reliably detected by the pre-configured Document Definition.
* The user needs to extract data from fields not defined in the default Document Definitions.

## When training may be required

* **Field location varies among documents of the same type.** In a stream of documents of the same type, unusual documents may appear where field locations differ from the standard document. If FlexiCapture for Invoices cannot reliably detect fields on such documents, the user can indicate the correct field locations and the program learns how to detect them.

  **Note:** The exact document layout depends on the issuing company. For this reason, documents from different companies are treated as different variants, and FlexiCapture for Invoices self-trains separately on each document variant.
* **The user needs to extract fields not defined by default.** Apart from the main and additional fields supported by default, the user may need to capture data from fields not yet known to the program. To do this, create custom fields in the Document Definition and specify their locations on document images.

## How training works

<Steps>
  <Step title="Add and verify sample documents">
    During normal processing or in a special training mode, the user adds document images to train the program. The added documents are automatically recognized and submitted for verification. The user corrects field locations where required, creating a reference layout.
  </Step>

  <Step title="Documents accumulate in a training batch">
    Each trained document is placed into the training batch created for its document variant. Once the first document is added for a variant, the program starts accumulating documents in that batch. The administrator can view all document variants and their training batches by clicking <img src="https://mintcdn.com/abbyy/IFr-A2MDVJd80FDs/images/flexi-capture/DocVariantsButton.png?fit=max&auto=format&n=IFr-A2MDVJd80FDs&q=85&s=83762cc174be930546e05af50a27f2be" alt="" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="23" height="23" data-path="images/flexi-capture/DocVariantsButton.png" /> **Open Field Extraction Training Batches**.
  </Step>

  <Step title="Training starts">
    Training begins once a training batch contains at least one document. If clustering is used, a separate FlexiLayout is created for each cluster; otherwise, one is created for each company. For more information, see [Training with clustering](/flexi-capture/ir-clustering).
  </Step>

  <Step title="A FlexiLayout variant is created">
    Training creates a FlexiLayout variant, used for all documents that belong to the variant — for example, invoices from a particular vendor or purchase orders from a particular customer.
  </Step>

  <Step title="The variant is tested">
    Once training completes, the program automatically tests the FlexiLayout variant on all the sample documents. It compares the recognition results with the reference layout to establish the variant's quality. (The main FlexiLayout, used when no training has been done, is measured the same way.)
  </Step>

  <Step title="The best variant is kept">
    The program compares the new variant's quality with the previous variant and the main FlexiLayout:

    * If the new variant is better, it is saved and used to process this document variant.
    * If the new variant is worse, it is not saved, and the user sees a message in the **Train Document Definition** window.
  </Step>
</Steps>

## What the administrator can do

If an operator cannot achieve sufficient accuracy through training, the administrator can click <img src="https://mintcdn.com/abbyy/IFr-A2MDVJd80FDs/images/flexi-capture/DocVariantsButton.png?fit=max&auto=format&n=IFr-A2MDVJd80FDs&q=85&s=83762cc174be930546e05af50a27f2be" alt="" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="23" height="23" data-path="images/flexi-capture/DocVariantsButton.png" /> **Open Field Extraction Training Batches** and continue training. The administrator can also:

* Add or remove document images used for training.
* Create new training batches.
* Add document images that are used only for testing the trained FlexiLayout variant, not for training.
* Export the trained FlexiLayout variant to ABBYY FlexiLayout Studio, or import another FlexiLayout from it.

Once the accuracy is achieved, the administrator can prohibit operator training for the given document variant.

## Related topics

* [Training while processing documents](/flexi-capture/invoice-reader/ir-training-during-setup)
* [Training done by project administrators](/flexi-capture/invoice-reader/ir-training-doc-variants)
