Named Entity Recognition 25.4
Named Entity Recognition User and Programming Guide

# Components

Named Entity Recognition components allow you to extract attributes from a single match. The attributes are called components because they are the components of a match.

For example, sentiment analysis can match the phrase Their service is fantastic as conveying positive sentiment. Components can then break this phrase down to identify service as the subject matter, and fantastic as the adjective that describes the subject.

Named Entity Recognition does not extract components by default.

To use components, you must include components in the grammar that you want to use, and turn on components at run time. You must also configure some additional parameters. See Configure Components.

## When to Use Components

The English Named Entity Recognition sentiment analysis grammar defines components for `TOPIC`, `SENTIMENT`, `POSITIVE`, and `NEGATIVE`. You can use these components by configuring Named Entity Recognition accordingly.

Components are useful when the information that you want to match has an underlying pattern that you want to preserve.

For example, you might use components to extract data from tables and return it in a suitable format. For an example, see EntityComponentFieldN.

NOTE: Most of the standard grammars do not define components, because these grammars are mainly dictionaries or basic patterns that you can use to build more complex patterns. You might want to define components when you reference these basic entities in your patterns for custom grammars.

## Configure Components

To use the components defined in the Named Entity Recognition grammar, you must configure Named Entity Recognition with:

- `EnableComponents` set to `True`. See EnableComponents.

- the `EntityComponentField` for the entity. See EntityComponentFieldN.

## Define the Components

In the Named Entity Recognition grammar, you define components by using the extension operator `(?A=ComponentName:Pattern)` (see Regular Expressions). Consider the following example entity:

    <entity name=test>
       <pattern>(?A=SUBJECT:(?A^noun)) is (?A=SENTIMENT:(?A^adjective))</pattern>
    </entity>

In this example, an earlier part of the grammar might define the `noun` entity to match nouns such as service and facility, and the `adjective` entity to match descriptions such as fantastic and appalling. This `test` entity then matches the phrase service is fantastic, and returns the `SUBJECT` component with the text service, and the `SENTIMENT` component with the text fantastic.

Copyright 2013-2025 Open Text
Version 25.4 | Last updated October 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Named Entity Recognition 25.4

Topic Title: Components