Class TargetSentiment

java.lang.Object
com.azure.ai.textanalytics.models.TargetSentiment

public final class TargetSentiment extends Object
The TargetSentiment model.
  • Constructor Details

    • TargetSentiment

      public TargetSentiment()
  • Method Details

    • getText

      public String getText()
      Gets the target text property.
      Returns:
      The text value.
    • getSentiment

      public TextSentiment getSentiment()
      Gets the target text sentiment label: POSITIVE, NEGATIVE, MIXED. TextSentiment has NEUTRAL sentiment type additionally, but target sentiment can only be POSITIVE, NEGATIVE, or MIXED.
      Returns:
      The sentiment value.
    • getOffset

      public int getOffset()
      Gets the target text offset from the start of document.
      Returns:
      The target text offset from the start of document.
    • getLength

      public int getLength()
      Gets the length of target text.
      Returns:
      The length of target text.
    • getConfidenceScores

      public SentimentConfidenceScores getConfidenceScores()
      Gets the confidence score of the sentiment label. All score values sum up to 1, the higher the score, the higher the confidence in the sentiment. AspectSentiment only has positive or negative confidence score value because there is no neutral sentiment label in the AspectSentiment.
      Returns:
      The SentimentConfidenceScores.