> ## 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 done by project administrators

> Manage field extraction training batches as an administrator: load sample images, train FlexiLayout variants, lock operator training, and import layouts.

A project administrator can train the program using training batches during project setup. When operators correct recognized documents, the corrected documents are placed into the training batches used by the administrator. The administrator can make additional changes to these batches and retrain the program if operator training does not deliver the results you want.

Training is available only if ABBYY FlexiCapture can reliably identify the company by finding the corresponding record in a database. If you have no databases but still want to use field training, you can accumulate company information by adding records to your data sets while capturing documents. For more information, see [Looking up vendors and business units in the database](/flexi-capture/invoice-reader/ir-data-set-using#addnew).

<Note>
  The actions described in this section can be performed only by the administrator or by users with permissions to set up projects in FlexiCapture for Invoices.
</Note>

To open the training batch view, 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**) on the toolbar, or click **Field Training** → **Open Field Extraction Training Batches**. This view lists all the training batches by document variant, along with important company parameters such as VATIDs, IBANs, and database IDs.

## Manage sample images used for training

Double-click a training batch, or right-click it and click **Open** on the shortcut menu, to display the list of sample images used for the corresponding FlexiLayout variant.

Each sample image can be in one of three states:

* **Unused** — Not used for training or testing this FlexiLayout variant.
* **For training** — Used for training and testing this FlexiLayout variant.
* **For testing** — Used only for testing this FlexiLayout variant.

You need only one sample image to start training a FlexiLayout variant, but we recommend having at least three images in the **For training** state.

If there are not enough sample images for training, load more by clicking **Load Images**. By default, newly added images are marked **For training**. If the images you add are not recognized automatically, force-start recognition by clicking **Recognize**.

<Steps>
  <Step title="Set the image states">
    Change the state of the images you want to use to **For training**: select the images, right-click them, and select **Set Document State → For training**. If you have not trained this document variant before, we recommend changing all the sample images to **For training**.
  </Step>

  <Step title="Check the region markup">
    Check the markup of all the regions and adjust it as necessary. This is important, because the positions of all the regions are taken into account.
  </Step>

  <Step title="Start training">
    Do one of the following:

    * Select **Field Training → Train** from the main menu.
    * Right-click anywhere in the list and select **Train** from the shortcut menu.
    * Switch to the training batch view and select **Train** from the shortcut menu of the document variant.

    Training progress is shown in the **Train Document Definition** window. The program creates a FlexiLayout variant and tests it (a process you do not see) on all documents marked **For training** and **For testing**, comparing each with the reference layout you created. If the new variant is better than the previous variant and the main FlexiLayout, it is saved and used for subsequent data capture.
  </Step>
</Steps>

<Note>
  If some sample images adversely affect training but you still want to use them for testing, change their state to **For testing**. Make sure the regions of all fields on these images are located correctly at the time of training.
</Note>

## Other document-variant actions

To perform any of these actions, right-click a document variant in the training batch view and select the command from the shortcut menu.

| Action                                             | Command                        | When to use                                                                                            |
| -------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------ |
| Export a trained FlexiLayout to FlexiLayout Studio | **Export Trained FlexiLayout** | You cannot achieve the results you want by adding or removing sample images.                           |
| Import a FlexiLayout from FlexiLayout Studio       | **Import FlexiLayout**         | You have a FlexiLayout created manually in FlexiLayout Studio for the variant.                         |
| Prohibit further training for the company          | **Lock Training by Operators** | The FlexiLayout is already trained (or created manually) and needs no more training during processing. |
| Use only the main FlexiLayout                      | **Disabled**                   | You want only the main FlexiLayout to be used when processing documents from the company.              |

## Create a new training batch

You may want to create a new training batch to train a FlexiLayout variant before operators start capturing documents.

<Steps>
  <Step title="Create the batch">
    In the training batch view, right-click an empty area and select **New Batch** from the shortcut menu.
  </Step>

  <Step title="Assign a Document Definition">
    If your project uses [more than one Document Definition](/flexi-capture/invoice-reader/ir-doc-definition), select the one to use in the **Select Document Definition** dialog box (right-click the batch and click **Change Document Definition** on the shortcut menu).
  </Step>

  <Step title="Choose the company">
    Choose the issuing company for which the training results will be used.
  </Step>

  <Step title="Add documents">
    Right-click the batch and select **Load Images** from the shortcut menu. The added documents are automatically recognized.
  </Step>

  <Step title="Check the field regions">
    Check whether the field regions were detected correctly and adjust them if necessary.
  </Step>

  <Step title="Set the image states">
    Select the documents to use for training, right-click one, and click **Set Document State → For training**.
  </Step>

  <Step title="Start training">
    Do one of the following:

    * In the main window, open the **Field Training** menu and click **Train**.
    * Right-click an empty area in the list and click **Train** on the shortcut menu.
    * Open the training batch view, right-click a FlexiLayout variant, and click **Train** on the shortcut menu.
  </Step>
</Steps>

<Note>
  Recognize documents in a batch using only the Document Definition assigned to that batch.
</Note>

Use the shortcut menu of the batch to change the company or the Document Definition associated with it. The **Clear Document Definition** command removes the associated Document Definition; batches with no Document Definition cannot be used for training.

<Note>
  Disable the **Use own recognition settings of FlexiLayout** option. This synchronizes the full-text recognition settings and speeds up document processing.
</Note>

### Import a custom FlexiLayout into the batch

To import a modified or completely new FlexiLayout to be used for one specific company:

1. In ABBYY FlexiLayout Studio, click **File** → **Export**, and in the **Export FlexiLayout** dialog box, specify the name of the file and the folder where it should be placed.
2. In ABBYY FlexiCapture, click **Train Field Extraction** → **Import FlexiLayout**.

If you are using the clustering feature, note the following limitations:

* If you create a new FlexiLayout manually, make sure it covers all possible document variants from the company — you cannot manually create a FlexiLayout for a single cluster.
* Only the FlexiLayout for the main document fields is exported. Line item fields use a separate machine learning algorithm whose results cannot be exported or modified, so no FlexiLayout can be generated or exported for them. You can still create a FlexiLayout for line item fields manually.
* Only the FlexiLayout trained for the first cluster is exported.
* After you import a new or modified FlexiLayout into a training batch:
  * Documents are no longer trained during processing.
  * Clustering is disabled for that batch.
  * The imported FlexiLayout is used to process all documents from the company, regardless of cluster.

For more information, see [Training with clustering](/flexi-capture/ir-clustering).
