Class SentenceSentiment
java.lang.Object
com.azure.ai.textanalytics.models.SentenceSentiment
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 Summary
ConstructorDescriptionSentenceSentiment
(String text, TextSentiment sentiment, SentimentConfidenceScores confidenceScores) Creates aSentenceSentiment
model that describes the sentiment analysis of sentence. -
Method Summary
Modifier and TypeMethodDescriptionGets the confidence score of the sentiment label.int
Gets the length of sentence.int
Gets the offset of sentence.Gets the sentence opinions of sentence sentiment.Gets the text sentiment label: POSITIVE, NEGATIVE, or NEUTRAL.getText()
Gets the sentence text property.
-
Constructor Details
-
SentenceSentiment
public SentenceSentiment(String text, TextSentiment sentiment, SentimentConfidenceScores confidenceScores) Creates aSentenceSentiment
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
Gets the sentence text property.- Returns:
- The text property value.
-
getSentiment
Gets the text sentiment label: POSITIVE, NEGATIVE, or NEUTRAL.- Returns:
- The
TextSentiment
.
-
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
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.
-