Skip to main content
Extraction scripts can improve results when used alongside an NLP model. Use them when:
  • You need to extract entities from a table.
  • You do not have enough sample documents to train your NLP model.
  • You are not satisfied with extraction quality on some fields.
Extraction scripts let you:
  • Identify text spans that match a regular expression, words or phrases from a user dictionary (in any inflected form), or a built-in NER object.
  • Run queries on text and text spans, where search words may occur in any inflected form.
  • Save identified text spans into document fields.
  • Extract addresses and their components from documents.

Built-in NER objects

Address components: NerZipCode (ZIP code), NerCountry (country), NerState (state), NerCity (city), and NerStreet (street).

Create an extraction script

1

Open the section properties

Open the Document Definition editor, right-click a document section, click Properties, and click the NLP tab.
2

Create the script

Under Extraction Scripts, click Create.
3

Load a dictionary or edit the script

In the Extraction Script dialog box, click Load to load a user dictionary, or click Edit to open the script editor. User dictionaries must be encoded in UTF-8 with BOM, or in ANSI.

Extract address components from a document

1

Specify the address area

Specify the part of the document that contains the address. Restrict the search area with a FlexiLayout field and use that area as the source for the extraction script. For more information, see Search constraints.
2

Apply the extraction script

Apply the appropriate script. You can search for address components in the entire field or in part of a field.
An address contains at most one instance of each component (ZIP code, country, state, city, and street), but a script may return several. The more precisely you define the search area, the fewer instances are returned. When you use the ParseAddressInPosition( resultCollectionNamePrefix : string, startPos : int, endPos : int ) or ParseAddressInSpan( resultCollectionNamePrefix : string, span : IInterval ) method to parse an address, each word in the detected components receives the following attributes during indexing, which you can then use in XML queries:
  1. The collection name, in the format [resultCollectionNamePrefix]_[NerTypeOfComponent].
  2. The resultCollectionNamePrefix prefix.
  3. The type of the NER object.
For a sample XML address extraction query, see Query language.
You can currently extract components only from German and US addresses.