Interpret tagging outcome
Introduction
The results of tagging—both by rules and script—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 current test file. It is possible to check the filename in the tool window title bar.
Tagging by rules
The Tags panel
Tags produced by rules are displayed in the Tags panel on the left 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.
Consider these tags and rules:
TAGS
{
@CODE,
@MEDICINE
}
...
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 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 all the hits highlighted in the editing area.
Clicking a single tag instance shows:
- The specific hits highlighted in the editing area (if the text file is opened).
- The updated Rule Details/Tag Details panels.
- The updated rule preview panel on the right.
The Rule Details/Tag Details panels
The Rule Details/Tag Details panel is composed of two sub-panels:
-
The Rule Details sub-panel that shows the hit rule.
-
The Tag Details sub-panel that displays:
- The hit of the tag selected in the Tags panel.
- The possible Syncon ID.
- The starting and ending positions in the sentence of the tag hit selected in the Tags panel.
The Rules panel
This panel displays the rule code.
Tagging by script
Tags produced by scripting functions are also displayed in the Tags panel on the left of the Tagger tool window.
With this code:
function onTagger() {
DIS.tagToken(10, "BODY_PART");
}
applied to this text:
The patient has a contusion on the back of her head.
You will get in the Tagger tool window:
As you can see, the token head was tagged with the BODY_PART tag thanks to the onTagger
function.
You can recognize a tag by script thanks to the red gear icon .
Clicking a single tag instance shows:
- The specific hits highlighted in the editing area (if the text file is opened).
- The updated Tag Details sub-panel.
- The updated rule preview panel on the right.
Note
The Rule Details sub-panel is empty when dealing with tags by script.
The Tag Details sub-panel displays:
- The hit of the tag selected in the Tags panel.
- The possible Syncon ID.
- The starting and ending positions in the sentence of the tag hit selected in the Tags panel.
The rule preview panel on the right only states that your tag is made by script.