Package com.basistech.rosette.dm
Class CategorizerResult
java.lang.Object
com.basistech.rosette.dm.BaseAttribute
com.basistech.rosette.dm.CategorizerResult
- All Implemented Interfaces:
Serializable
Associates a label with a document. Various applications may generate
these labels. For an article about Michael Jordan, a categorzier might
produce a label like "SPORTS", and sentiment analyzer might produce
"neg", "neu", "pos", while a topic generator might produce "basketball",
"bulls", "chicago". Applications typically produce a ranked list of
CategorizerResult
s. Each result has a label. Optional fields
include confidence, an explanation set, and per-feature scores. This
result is currently used for document categorization, sentiment analysis,
and topic generation.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder for classifier results. -
Field Summary
Fields inherited from class com.basistech.rosette.dm.BaseAttribute
extendedProperties
-
Method Summary
Modifier and TypeMethodDescriptionReturns the confidence this result.Returns a list of the N highest positive features that contributed to the categorization (the 'explanation set'), ordered by descending score.getLabel()
Returns the label of this result.Returns a map of feature string to raw score for this result.getScore()
Returns the raw score of this result.protected com.google.common.base.MoreObjects.ToStringHelper
Methods inherited from class com.basistech.rosette.dm.BaseAttribute
getExtendedProperties, listOrNull, setExtendedProperty, toString
-
Method Details
-
getLabel
Returns the label of this result.- Returns:
- the label of this result
-
getScore
Returns the raw score of this result. The meaning of this value is not documented. Typical users should usegetConfidence()
instead.- Returns:
- the raw score of this result
-
getConfidence
Returns the confidence this result. If confidence calculations were enabled, the value returned will be in the range [0.0, 1.0]. Otherwise null will be returned.- Returns:
- the confidence of this result
-
getExplanationSet
Returns a list of the N highest positive features that contributed to the categorization (the 'explanation set'), ordered by descending score. Returns null explanations are disabled. The value of N is determined by the calling Categorizer.- Returns:
- the explanation set
-
getPerFeatureScores
Returns a map of feature string to raw score for this result. The meaning of a score is not documented. This is an expert-level feature used for debugging and error analysis.- Returns:
- the per-feature scores
-
toStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()- Overrides:
toStringHelper
in classBaseAttribute
-