Skip to content

Interpret tagging outcome

The results of tagging, after a text analysis, are displayed in the Tagger tool window.

Note

It is necessary re-analyze a test file—or all test files—included in the module if rules or test files have changed.

This operation is performed on the on the current test file. It is possible to check the filename in the tool window title bar.

The Rule panel

The tags produced by rules are displayed in the Rule panel of the Tagger tool window, grouped by level. This means that one or more triggered rules detected a tag that is declared with TAGS.

It is possible to expand/collapse each row—representing a level—by selecting the toggle switch in the row left side or by expanding/collapsing all the rows selecting Expand All/Collapse All on the tool window toolbar.

Example

Consider the rule:

    SCOPE SENTENCE
    {
        TAGGER()
        {
            @CODE[PATTERN("\d{8}")] // Every eight digit number will be tagged as CODE.
        }

        TAGGER()
        {
            @MEDICINE[LEMMA("drug")] // every occurrence of lemma drug in a text will be tagged as MEDICINE and will be      assigned syncon ID 100012140
        }
    }

and the text:

    Ibuprofen Hs Code is 29420012.
    The use of this drug is not recommended in patients with advanced renal disease.

the rule detects tags at the same level.

Clicking the level shows the hits highlighted in light orange in the editing area.

Clicking a single tag instance shows:

  • The specific hits in the editing area, highlighted in orange.
  • The Rule Details/Tag Details panel
  • The Rules panel

The Rule Details/Tag Details panel

The Rule Details/Tag Details panel is composed of two tabs:

  • The Rule Details panel shows the hit rule.

  • The Tag Details panel that displays:

    • The hit of the tag selected in the Rule panel.
    • The possible Syncon ID.
    • The starting and ending positions in the sentence of the tag hit selected in the Rule panel.

The Rules panel

This panel displays the rule code.

The Script panel

The tags or the untags—that is the tags deletion—produced by scripts are displayed in the Script panel.

Example

Considering the following script, included in a .jr file

    // Enable this function if you need to add tags to the disambiguation

    function onTagger() {
        var count = DIS.getTokensCount();
        for (var i=0; i<count; i++) {
            var token = DIS.getToken(i);
            if (token.synId==300162) 
                DIS.tagToken(i, "HYPERCAR");
        }
    }

and the text:

The Fiat Panda was too much for me, so I had to settle for a Bugatti.

The onTagger function is called right after the tagging rules so that is possible to change the existing tags.

In this example the script tags with the HYPERCAR value all the disambiguation tokens where syncon id equals to 300162.