Class SentenceSentiment

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

public final class SentenceSentiment extends Object
The SentenceSentiment model that contains a sentiment label of a sentence, confidence scores of the sentiment label, sentence opinions, and offset of sentence within a document.
  • Constructor Details

    • SentenceSentiment

      public SentenceSentiment(String text, TextSentiment sentiment, SentimentConfidenceScores confidenceScores)
      Creates a SentenceSentiment model that describes the sentiment analysis of sentence.
      Parameters:
      text - The sentence text.
      sentiment - The sentiment label of the sentence.
      confidenceScores - The sentiment confidence score (Softmax score) between 0 and 1, for each sentiment label. Higher values signify higher confidence.
  • Method Details

    • getText

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

      public TextSentiment getSentiment()
      Gets the text sentiment label: POSITIVE, NEGATIVE, or NEUTRAL.
      Returns:
      The TextSentiment.
    • 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.
      Returns:
      The SentimentConfidenceScores.
    • getOpinions

      public IterableStream<SentenceOpinion> getOpinions()
      Gets the sentence opinions of sentence sentiment. This is only returned if you pass the opinion mining parameter to the analyze sentiment APIs.
      Returns:
      The sentence opinions of sentence sentiment.
    • getOffset

      public int getOffset()
      Gets the offset of sentence. The start position for the sentence in a document.
      Returns:
      The offset of sentence.
    • getLength

      public int getLength()
      Gets the length of sentence.
      Returns:
      The length of sentence.