> ## 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.

# Create NLP models

> Create segmentation and entity extraction NLP models in the FlexiCapture Document Definition Editor, including the document fields each model requires.

## Create document fields

For every entity you want to extract, create a corresponding field in the Document Definition.

<Steps>
  <Step title="Add a field">
    In the Document Definition Editor, right-click the document section name and select **Create Field**.
  </Step>

  <Step title="Make it a Text field">
    Create a **Text** field.
  </Step>

  <Step title="Enable a region">
    On the **General** tab, select **Can have region**.
  </Step>

  <Step title="Name the field">
    In the **Name** field, enter a name (for example, `PreambleSegment`). Field names must not contain spaces or non-English characters, and must not start with a number.
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/abbyy/mpS3pcxC_lkohQUS/images/flexi-capture/NLP_general_properties.png?fit=max&auto=format&n=mpS3pcxC_lkohQUS&q=85&s=3a29740e7619292c35f900783e8b9657" alt="Screenshot of the General tab of the field Properties dialog box in the ABBYY FlexiCapture Document Definition Editor, with the field named PreambleSegment and the Can have region and Text segment options selected." width="782" height="738" data-path="images/flexi-capture/NLP_general_properties.png" />
</Frame>

Repeat these steps for each entity. If you use segmentation, create a separate text field for each segment: create a non-repeating field in a repeating group, select **Text segment** in the field properties, and select **Allow multiple regions** if a segment can begin and end on different pages.

<a id="segmentation" />

## Create a segmentation model

Segmentation improves the accuracy and speed of entity extraction and is optional. It requires a dedicated NLP model, and you can have only one segmentation model per document section.

<Steps>
  <Step title="Open the section properties">
    In the Document Definition Editor, right-click the document section name and select **Properties**. On the **NLP** tab, click **Create**.
  </Step>

  <Step title="Name the model and set its type">
    In the **Name** field, enter a name (for example, `SegmentationModel`). Set **Model type** to **Segmentation**, and select the required **Language**.

    <Frame>
      <img src="https://mintcdn.com/abbyy/mpS3pcxC_lkohQUS/images/flexi-capture/NLP_newmodel.png?fit=max&auto=format&n=mpS3pcxC_lkohQUS&q=85&s=db569c529e81b00d62cb7ad9d5fef58e" alt="Screenshot of the New NLP Model dialog box on the NLP tab of the Document Section Properties in ABBYY FlexiCapture, with the model named SegmentationModel, the Source set to Section, the Model type set to Segmentation, and the Language set to English." width="782" height="738" data-path="images/flexi-capture/NLP_newmodel.png" />
    </Frame>
  </Step>

  <Step title="Choose the segment fields">
    Click **Next**, specify the fields the segments will be extracted into, and click **OK**.
  </Step>
</Steps>

After you create a segmentation model, [train it](/flexi-capture/nlp-training) on sample documents.

## Create an entity extraction model

To extract entities, you need an entity extraction NLP model trained on manually marked-up documents.

<Steps>
  <Step title="Open the section properties">
    In the Document Definition Editor, open the document section properties, click the **NLP** tab, and click **Create**.
  </Step>

  <Step title="Name the model and set its type">
    Enter a **Name** (for example, `EntitiesExtraction`). For the data source, select a section (if you do not use segmentation) or a segment (if you do). Set **Model type** to **Extraction**, and select the required **Language**.
  </Step>

  <Step title="Choose the result fields">
    Click **Next** and choose the result fields to extract from the selected section or segment.
  </Step>
</Steps>

Repeat these steps for each document segment or section from which entities should be extracted. Then save your Document Definition (**Document Definition → Save**), close it (**Document Definition → Close**), and publish it (**Document Definition → Publish**).

After you create an entity extraction model, [train it](/flexi-capture/nlp-training) on sample documents.

<Info>
  The **Allow training** option lets you train an NLP model during document processing: the model is trained when you train field extraction using a field extraction training batch. To disable or delete training results, right-click the training batch and select **Disabled** or **Delete** on the shortcut menu.
</Info>
