Class CategorizerResult

java.lang.Object
com.basistech.rosette.dm.BaseAttribute
com.basistech.rosette.dm.CategorizerResult
All Implemented Interfaces:
Serializable

public class CategorizerResult extends BaseAttribute implements 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 CategorizerResults. 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:
  • Method Details

    • getLabel

      public String getLabel()
      Returns the label of this result.
      Returns:
      the label of this result
    • getScore

      public Double getScore()
      Returns the raw score of this result. The meaning of this value is not documented. Typical users should use getConfidence() instead.
      Returns:
      the raw score of this result
    • getConfidence

      public Double 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

      public List<String> 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

      public Map<String,Double> 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 class BaseAttribute