CATEGORY
- Last Updated: May 13, 2026
- 2 minute read
- Semaphore
- Documentation
The CATEGORY rule defines output information (a categorisation) for CS.
If the score of the rule is greater than the threshold for the classification then the class, name, (optionally ID) and score are added to the classification output
Score calculation
Scores the combined scores of its children
Evidence calculation
The evidence is the union of all its children’s evidence.
Attribute information
- any common attribute
- CLASS - sets the class for the category firing
- ID - sets the id for the category firing
- NAME - sets the name for the category firing
- REGEX (deprecated 4.0)
- SUPERCLASS
- TEMPLATE (deprecated 4.0)
Children restrictions
Any rule other than those restricted to a specific parent Essentially the CATEGORY rule and its children define the complete set of rules for that categorisation.
The CATEGORY rule is generally used for clarity of expression but from CS perspective it is simply a COMBINE rule with the CATEGORY attribute set. This means that if the CATEGORY rule has multiple direct children it aggregates the score in the same way as a bare COMBINE rule would.
Example
The following document
Jean-Claude Trichet announced today a rise of 1/2 point in interest rates.
In a separate intervention the governor of the European Central Bank announced that the
institution will keep a firm handle on inflation.
Evaluated against the following rulebase fragment
<category class="test" name="category1">
<text data="Jean-Claude Trichet" />
</category>
Will return
....
<META NAME="test" value="category1" score="1.00" />
....
NB for various historical reasons the CLASS attribute for the category provides the name attribute for the META in the output whilst the NAME attribute provides the value attribute.
Whilst it would be more obvious to have a “name” and “value” attribute for the category rule changing this now would create too many opportunities for confusion so has remained with the older class/name attributes which are then output as name/value to be consistent with other meta data.
NB2 The rulebase above is identical to
<combine category="1" class="test" name="category1">
<text data="Jean-Claude Trichet" />
</combine>
Which in a way is a better way of expressing the rules behaviour (since the fact of being a category is orthogonal to the type of rule used) and so is better expressed by using an attribute. However the use of the category rule is so widespread and accepted that it may make your intention be more obvious to others (and slightly less typing) to do that instead.