Skip to content

Work with extraction rules

Steps

1

Create an extraction rule using smart completion

Open a rules file.

Now start writing manually the various elements that are needed to build an extraction rule.

Notice that the system will automatically prompt you the possible variants to complete the word as soon as you start typing, as well as automatically close brackets once you open them.

2

Use the SYNCON attribute in your extraction rule

Place the cursor inside the square brackets of the extraction rule.

Use the keyboard shortcut `Ctrl+Shift+S` to open the Knowledge Graph tool window (or open the Knowledge Graph via the related tool window).

Type the concept you are looking for in the search box. Double click the syncon you wish to enter in your rule.

Select Commit at the bottom-right of the Knowledge Graph tool window to send the syncon to your rule.

Now build the project and analyze a document. You can check the results in the Extraction tool window at the bottom. Click extraction records to see the highlighted entities in the text.

With the `SYNCON` attribute all the lemmas that express a specific concept will be retrieved

3

Use the ANCESTOR attribute in your extraction rule

You can copy and paste previous rules and modify the linguistic condition within to quickly create a new rule.

Use the `ANCESTOR` attribute for this rule—you can use the keyboard shortcut `Ctrl+Shift+A` which will open up the Knowledge Graph tool window automatically (or open the Knowledge Graph via the related tool window).

Type the concept you are looking for in the search box. Double click the ancestor you wish to enter in your rule.

Select Commit at the bottom-right of the Knowledge Graph tool window to send the ancestor to your rule.

NOTE: if you did not open the Knowledge Graph using the shortcut you will have to change the attribute from `SYNCON` to `ANCESTOR` in the menu beside the Commit button.

Now build the project and analyze a document. You can check the results in the Extraction tool window at the bottom. Click on the single extraction records to see the highlighted entities in the text.

The `ANCESTOR` attribute will not only retrieve the concepts belonging to the selected syncon, but also the children that are part of its semantic chain in the Knowledge Graph.

4

Apply your extraction rules to test documents and see results

Move to the top-right side of the screen, select Analyze All Documents and choose a name for your report.

Now open the Report tool window and you will find your analysis report. Select it and in the bottom part of the tool window you will see the list of the analyzed documents with information about the results. You can filter the results and leave for example only the information about extraction.

Open the documents by double clicking on them and check the extraction results in the Extraction tool window at the bottom.