SentenceSentiment Class
- java.
lang. Object - com.
azure. ai. textanalytics. models. SentenceSentiment
- com.
public final class 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
| Constructor | Description |
|---|---|
| SentenceSentiment(String text, TextSentiment sentiment, SentimentConfidenceScores confidenceScores) |
Creates a |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Sentiment |
getConfidenceScores()
Gets the confidence score of the sentiment label. |
| int |
getLength()
Gets the length of sentence. |
| int |
getOffset()
Gets the offset of sentence. |
|
Iterable |
getOpinions()
Gets the sentence opinions of sentence sentiment. |
|
Text |
getSentiment()
Gets the text sentiment label: POSITIVE, NEGATIVE, or NEUTRAL. |
| String |
getText()
Gets the sentence text property. |
Methods inherited from java.lang.Object
Constructor Details
SentenceSentiment
public SentenceSentiment(String text, TextSentiment sentiment, SentimentConfidenceScores confidenceScores)
Creates a SentenceSentiment model that describes the sentiment analysis of sentence.
Parameters:
Method Details
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:
getLength
public int getLength()
Gets the length of sentence.
Returns:
getOffset
public int getOffset()
Gets the offset of sentence. The start position for the sentence in a document.
Returns:
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:
getSentiment
public TextSentiment getSentiment()
Gets the text sentiment label: POSITIVE, NEGATIVE, or NEUTRAL.
Returns:
getText
public String getText()
Gets the sentence text property.
Returns: