-
Notifications
You must be signed in to change notification settings - Fork 19
Modeling Certainty Attribute
The certainty attribute is special in the sense that it can have a certainty level, a value from '0' to '9', with the former expressing low certainty, the latter high certainty. That level, if any, is part of the certainty attribute data that is emitted by the iKnow engine.
The level is assigned in the lexreps.csv file, in the meta-data field (second), and expressed with "c=", 'c' for certainty level. A few examples:
;c=0;arguably;;ENAdv;ENAdvmandeg;SCertainty;
;c=9;absolutely;;ENAdv;ENAdvmandeg;SCertainty;
The User Dictionary can be used to assign a certainty level to a lexrep:
@suggests,UDCertainty,c=0
Two language independent labels have been created to handle certainty:
";1,$;UDCertainty;typeAttribute;;0;"
";;SCertainty;typeAttribute;general attribute for certainty;0;;Entity(Certainty)"
The former is a User Dictionary label, the latter is the internal Certainty label, tagging "certainty" to lexreps. Both labels are generated by the engine, the phase numbers for "SCertainty" will automatically be collected from the rule input patterns.
The rule input pattern can express a lexrep metadata condition:
UDCertainty(c<4)|+SCertainty : fires if first lexrep's certainty level is lower than 4
UDCertainty(c<=4)|+SCertainty : fires if first lexrep's certainty level is lower or equals 4
UDCertainty(c=4)|+SCertainty : fires if first lexrep's certainty level equals 4
UDCertainty(c>=4)|+SCertainty : fires if first lexrep's certainty level is greater or equals 4
UDCertainty(c>4)|+SCertainty : fires if first lexrep's certainty level is greater than 4
SCertainty(c<5)|SCertainty(c>=5);*(c-4)|-SCertainty; : if rule fires, subtract 4 from certainty level of first lexrep
SCertainty(c<5)|SCertainty(c>=5);*(c=4)|-SCertainty; : if rule fires, set certainty level to 4 of first lexrep
SCertainty(c<5)|SCertainty(c>=5);*(c+4)|-SCertainty; : if rule fires, add 4 to certainty level of first lexrep
If label "SCertainty" is assigned to a lexrep with no certainty level, it will get a '0' level. If the label is removed, the certainty level will also be removed. The limits of the certainty level are [0-9], if any addition/subtraction operation exceeds these limits, the limits will be applied.
When 2 lexreps are merged, the type of Join determines by default whether the level of the first or the second element is kept.
SCertainty|SCertainty;*|Join; -> level of first lexrep is kept
SCertainty|SCertainty;JoinReverse|*; -> level of second lexrep is kept
SCertainty(c<5)|SCertainty(c>=5);^SCertainty(c-3)|Join; -> level of first lexrep is decreased by 3 and applied to the merged lexrep