Eduction components allow you to extract attributes from a single match. The attributes are called components because they are the components of a match.
Eduction does not extract components by default.
For example, with sentiment analysis, you can match the phrase Their service is fantastic as conveying positive sentiment. Howeever, by default, Eduction does not break the phrase down to identify service as the subject matter, and fantastic as the adjective that describes the subject.
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.
The English Eduction sentiment analysis grammar has the TOPIC
, SENTIMENT
, POSITIVE
, and NEGATIVE
components defined. You can use these components by configuring Eduction 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 have components defined, 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.
To use the components defined in the Eduction grammar, you must configure Eduction with:
OutputSimpleMatchInfo
set to False
. See OutputSimpleMatchInfo.
EnableComponents
set to True
. See EnableComponents.
the EntityComponentField
for the entity. See EntityComponentFieldN.
In the Eduction 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.
|