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

# NLP モデルの作成

> FlexiCapture Document Definition Editor で、各モデルに必要な文書フィールドを含むセグメンテーションおよびエンティティ抽出 NLP モデルを作成します。

**文書フィールドの作成**

抽出する各エンティティに対応するフィールドを、Document Definition に作成する必要があります。フィールドを作成するには、次の手順を実行します。

1. Document Definition Editor で Document Section 名を右クリックし、**Create Field** を選択します。

2. Text field を作成します。

3. \[General] タブで、\[Can have region] オプションを選択します。

4. \[Name] field に、フィールド名 (例: *PreambleSegment*) を指定します。
   **重要!**  フィールド名にはスペースや英字以外の文字を含めることはできません。また、数字で始めることもできません。

<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="ABBYY FlexiCapture Document Definition Editor の field の Properties ダイアログの [General] タブのスクリーンショット。field 名は PreambleSegment で、[Can have region] オプションと [Text segment] オプションが選択されています。" width="782" height="738" data-path="images/flexi-capture/NLP_general_properties.png" />
</Frame>

エンティティごとに、上記の手順を繰り返します。

<Note>
  セグメンテーションを使用する場合は、各セグメントごとに個別の Text field を作成する必要があります。
</Note>

エンティティを抽出する各セグメントについて、次の操作を行います。

* 繰り返しグループ内に、非繰り返しフィールドを作成します。
* field properties で、\[Text segment] オプションを選択します。
* セグメントの開始位置と終了位置が異なるページにまたがる場合は、\[Allow multiple regions] オプションを選択します。

<a id="segmentation" />**セグメンテーション NLP モデルの作成**

セグメンテーションにより、エンティティ抽出の精度と速度が向上します。セグメンテーションは必須ではありません。文書をセグメント化するには、専用の NLP モデルが必要です。
**重要!**  document section ごとに使用できるセグメンテーションモデルは 1 つだけです。

セグメンテーションモデルを作成するには、次の手順を実行します。

1. Document Definition Editor で、Document Section 名を右クリックします。

2. \[Properties....] を選択します。

3. 開いたダイアログで \[NLP] タブをクリックし、\[Create....] をクリックします。

4. \[Name] field に、セグメンテーションモデルの名前 (例: *SegmentationModel*) を指定します。

5. \[**Model type**] field で、\[Segmentation] を選択します。

6. \[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="ABBYY FlexiCapture の Document Section Properties の [NLP] タブにある [New NLP Model] ダイアログのスクリーンショット。モデル名は SegmentationModel で、[Source] は Section、[Model type] は Segmentation、[Language] は English に設定されています。" width="782" height="738" data-path="images/flexi-capture/NLP_newmodel.png" />
   </Frame>

7. \[Next....] をクリックします。

8. 開いたダイアログで、セグメントの抽出先となるすべてのフィールドを指定します。

9. **OK** をクリックします。

セグメンテーションモデルを作成したら、いくつかのサンプル文書を使ってそのモデルを[学習](/ja/flexi-capture/nlp-training)させる必要があります。

<Note>
  \[Allow training] オプションを使用すると、文書処理中に NLP モデルを学習させることができます。field extraction training batch を使用して field extraction を学習させると、NLP モデルも学習されます。学習結果は無効にすることも削除することもできます。学習結果を無効にするには、training batch を右クリックし、shortcut menu で \[Disabled] 項目を選択します。学習結果を削除するには、training batch を右クリックし、shortcut menu で \[Delete] 項目を選択します。
</Note>

**エンティティ抽出 NLP モデルの作成**

エンティティを抽出するには、手動でマークアップした文書で学習済みのエンティティ抽出 NLP モデルが必要です。NLP モデルを作成するには、次の手順を実行します。

1. Document Definition Editor で document section のプロパティを開き、\[NLP] タブをクリックします。
2. \[Create....] をクリックします。
3. NLP モデルの \[Name] を指定します (例: *EntitiesExtraction*) 。
4. データソースとして、section (セグメンテーションを使用しない場合) または segment (セグメンテーションを使用する場合) を選択します。
5. \[Model type] field で、\[Extraction] を選択します。
6. \[Language] リストで、必要な言語を選択します。
7. \[Next....] をクリックします。
8. 選択した document section または segment から抽出される結果フィールドを選択します。

エンティティを抽出する各 document segment または section について、手順 1 ～ 9 を繰り返します。

1. **Document Definition >** \[Save] をクリックして、Document Definition を保存します。
2. **Document Definition >** \[Close] をクリックして、Document Definition editor を閉じます。
3. **Document Definition >** \[Publish] をクリックして、Document Definition を公開します。

エンティティ抽出 NLP モデルを作成したら、いくつかのサンプル文書を使ってそのモデルを[学習](/ja/flexi-capture/nlp-training)させる必要があります。

<Note>
  \[Allow training] オプションを使用すると、文書処理中に NLP モデルを学習させることができます。field extraction training batch を使用して field extraction を学習させると、NLP モデルも学習されます。学習結果は無効にすることも削除することもできます。学習結果を無効にするには、batch を右クリックし、shortcut menu で \[Disabled] 項目を選択します。学習結果を削除するには、batch を右クリックし、shortcut menu で \[Delete] 項目を選択します。
</Note>
