Add a table for entity extraction
Since the Natural Language Processing engine returns a lot of data, you may want to extract specific parts of that data for your needs. You can do this by returning the entity information in tabular format so that instead of just the entity name, you also have the confidence, type, and sentiment information.
You can add a table entity for extraction by following these steps:
- Open your project in Transformation Designer.
- Add a Named Entity Locator and open its properties.
-
On the
General tab, from the
Extraction Mode, select
Table field.
The Table model field is highlighted in red indicating that it is mandatory.
-
Click
Table Models
The Project Settings window is displayed with the Tables tab.
-
Add the following four fields to the
Column Pool.
The following names are suggestions only. If you would prefer to use other column names, ensure that these are mapped correctly later in this procedure.
-
EntityName
-
EntityConfidence
-
EntityType
-
Sentiment
-
-
Create a
Table Model called
Entities
or something similar, and then click OK.The table model is opened so that you can select the columns.
-
Add the four columns that you created earlier to your table model and then click
Close.
You are returned to the Project Settings - Tables tab and your new table model is listed.
-
Click
OK to close the
Project Settings window.
The Properties of Named Entity Locator window is displayed.
- From the Table model list, select your newly created table model.
- For each of the fields, map a corresponding table model column.
-
If you want to return all results, this is all that is necessary. If you want to further refine the results, add one
or more filters as follows.
- Optionally, to filter the results by entity type, select a value from the Entity Type column list. Alternatively, if you are using a custom entity file, type the name of that entity type into the Entity Type column field.
- Optionally, to filter the results by confidence, increase or decrease the Confidence Threshold.
- Optionally, to filter the results by sentiment, select a value from the list of sentiment options.
-
Keeping the
Properties of Named Entity Locator window open, select a test document and perform
Extraction.
Extraction is performed and the results are part of the test document.
- Save any changes to your test documents.
-
Back in the
Properties of Named Entity Locator window, click
Test.
The results are displayed in the Test tab.
-
When you are happy with your test results, map the table field to a field on the
Validation
form or create a script to deal with the results.
For more information on scripts refer to the Help for Kofax TotalAgility Scripting.