Class Reference
%iKnow.Classification.Classifier
Server:appadmin-00044-deployment-6bf4cbc86d-9f4xc
Instance:IRIS
User:SuperUser
 
-
  [USER] >  [%iKnow] >  [Classification] >  [Classifier]
Private  Storage

deprecatedabstract class %iKnow.Classification.Classifier extends %RegisteredObject

The InterSystems IRIS NLP iKnow technology is now deprecated. Please see the product documentation for more detail.

This is the superclass for executable Text Categorization models. Upon compiling a subclass of this class, the required internal code will be generated to support the class' main methods %Categorize and %CategorizeText. To invoke a Text Categorization model on free text:

set tClassifier = ##class(User.MyClassifier).%New()
write tClassifier.%CategorizeText(.tCategories, "The helicopter was not flying at a sufficiently high altitude ...")
zwrite tCategories

To invoke it on a source in an iKnow domain:

set tClassifier = ##class(User.MyClassifier).%New("iKnow", [domain name])
write tClassifier.%Categorize(.tCategories, tSourceId)
zwrite tCategories

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
32


Summary

Methods
%AddToSaveSet %Categorize %CategorizeSQL %CategorizeText
%ClassIsLatestVersion %ClassName %ConstructClone %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %Extends %GetCategories
%GetParameter %GetTerms %IsA %IsModified
%New %NormalizeObject %ObjectModified %OriginalNamespace
%PackageName %RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject


Methods

• method %Categorize(Output pCategories, pSourceId As %Integer, pMode As %String = "", pDomainSpec As %String = "") as %Status

This method runs the Text Categorization model defined in Classifier against the document identified by pSourceId. When this method returns, pCategories will contain all candidate categories for this document, sorted by decreasing score: pCategories(n) = $lb([category name], [score]) The entry with the highest score (pCategories(1)) is this model's best prediction.

If this Classifier instance has not been initialized with a reference to an iKnow or other domain, supply pMode="iKnow" and the domain name as pDomainSpec to point this classifier to the right location.

• classmethod %CategorizeSQL(pText As %String = "", pConfig As %String = "", Output pSC As %String = "") as %String [ SQLProc = ]
Static method to categorize a text fragment, returning the most likely category the text belongs to. See also %CategorizeText
• method %CategorizeText(Output pCategories, pText As %String = "", pConfig As %String = "") as %Status

This method runs the Text Categorization model defined in Classifier against the free text pText. When this method returns, pCategories will contain all candidate categories for this document, sorted by decreasing score: pCategories(n) = $lb([category name], [score]) The entry with the highest score (pCategories(1)) is this model's best prediction.

Optionally a %iKnow.Configuration's name can be passed in through pConfig to override the default configuration to use when indexing the text, for example to use a language model other than the default English (or automatically detect the right language to use).

• classmethod %GetCategories(Output pCategories) as %Status
Returns an array containing the categories specified in this classifier: pTerms(n) = $lb(name, description, recordCount, spec)
• classmethod %GetTerms(Output pTerms) as %Status
Returns an array containing the terms specified in this classifier: pTerms(n) = $lb(stringRepresentation, type, negationPolicy, countPolicy, displayName)


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.