Skip to content

TAG

TAG transformation turns the extracted field values into previously defined tags.

For example, consider this template and this tag list used to tag extraction values related to the PETS field.

TEMPLATE(ANIMALS)
{
    @PETS,
    @SEA_ANIMALS,
    @BIRDS,
    @WILD_ANIMALS
}

TAGS
{
    @DOG,
    @CAT
}

With the following tag and tag-based extraction rules:

SCOPE SENTENCE
{
    TAGGER(1)
    {
        @DOG[ANCESTOR(100000144)]//@SYN: #100000144# [dog]
    }
}

SCOPE SENTENCE
{
    IDENTIFY(ANIMALS)
    {
        @PETS[TAG(DOG)]|[TAG]
    }
}

applied to this text:

I have a beautiful rottweiler and a doberman.

you will get this record:

Template: ANIMALS

Field Value
@PETS DOG

The extracted values—rottweiler and doberman—were turned into their previously defined tag.

Warning

If you use the TAG transformation option on untagged elements, you will get a value extracted to its base form.

If two or more tags overlap on the same token(s), all will be extracted by the TAG transformation, comma-separated.

Note

If you wish to clean your tag-normalized extraction from unwanted tags, please refer to the built-in winnerTag function explained in the SCRIPT transformation page to find an example.

The syntax of the TAG transformation option is the following:

SCOPE scopeOption
{
    IDENTIFY(templateName)
    {
        @field[attribute]|[TAG]
    }
}