IRISLIB database
Classifier Class Reference
Inheritance diagram for Classifier:
Collaboration diagram for Classifier:

Private Member Functions

_.Library.Status Categorize (pCategories, _.Library.Integer pSourceId, _.Library.String pMode, _.Library.String pDomainSpec)
 
_.Library.Status CategorizeText (pCategories, _.Library.String pText, _.Library.String pConfig)
 

Static Private Member Functions

_.Library.String CategorizeSQL (_.Library.String pText, _.Library.String pConfig, _.Library.String pSC)
 Static method to categorize a text fragment, returning the most likely category the text belongs to. More...
 
_.Library.Status GetCategories (pCategories)
 Returns an array containing the categories specified in this classifier: More...
 
_.Library.Status GetTerms (pTerms)
 Returns an array containing the terms specified in this classifier: More...
 

Additional Inherited Members

- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

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 <method>Categorize</method> and <method>CategorizeText</method>. 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

Member Function Documentation

◆ Categorize()

_.Library.Status Categorize (   pCategories,
_.Library.Integer  pSourceId,
_.Library.String  pMode,
_.Library.String  pDomainSpec 
)
private

This method runs the Text Categorization model defined in <xdata>Classifier</xdata> 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.

◆ CategorizeSQL()

_.Library.String CategorizeSQL ( _.Library.String  pText,
_.Library.String  pConfig,
_.Library.String  pSC 
)
staticprivate

Static method to categorize a text fragment, returning the most likely category the text belongs to.

See also <method>CategorizeText</method>

◆ CategorizeText()

_.Library.Status CategorizeText (   pCategories,
_.Library.String  pText,
_.Library.String  pConfig 
)
private

This method runs the Text Categorization model defined in <xdata>Classifier</xdata> 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 <class>iKnow.Configuration</class>'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).

◆ GetCategories()

_.Library.Status GetCategories (   pCategories)
staticprivate

Returns an array containing the categories specified in this classifier:

   pTerms(n) = $lb(name, description, recordCount, spec)

◆ GetTerms()

_.Library.Status GetTerms (   pTerms)
staticprivate

Returns an array containing the terms specified in this classifier:

   pTerms(n) = $lb(stringRepresentation, type, negationPolicy, countPolicy, displayName)