DocumentSentiment Class
- java.
lang. Object - com.
azure. ai. textanalytics. models. DocumentSentiment
- com.
public final class DocumentSentiment
The DocumentSentiment model that contains sentiment label of a document, confidence score of the sentiment label, and a list of SentenceSentiment.
Constructor Summary
| Constructor | Description |
|---|---|
| DocumentSentiment(TextSentiment sentiment, SentimentConfidenceScores confidenceScores, IterableStream<SentenceSentiment> sentences, IterableStream<TextAnalyticsWarning> warnings) |
Creates a |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Sentiment |
getConfidenceScores()
Gets the sentiment confidence score (Softmax score) between 0 and 1, for each sentiment label. |
|
Iterable |
getSentences()
Gets a list of sentence sentiments. |
|
Text |
getSentiment()
Gets the text sentiment label: POSITIVE, NEGATIVE, NEUTRAL, or MIXED. |
|
Iterable |
getWarnings()
Gets the IterableStream<T> of TextAnalyticsWarning. |
Methods inherited from java.lang.Object
Constructor Details
DocumentSentiment
public DocumentSentiment(TextSentiment sentiment, SentimentConfidenceScores confidenceScores, IterableStream<SentenceSentiment> sentences, IterableStream<TextAnalyticsWarning> warnings)
Creates a DocumentSentiment model that describes the sentiment of the document.
Parameters:
Method Details
getConfidenceScores
public SentimentConfidenceScores getConfidenceScores()
Gets the sentiment confidence score (Softmax score) between 0 and 1, for each sentiment label. Higher values signify higher confidence.
Returns:
getSentences
public IterableStream<SentenceSentiment> getSentences()
Gets a list of sentence sentiments.
Returns:
getSentiment
public TextSentiment getSentiment()
Gets the text sentiment label: POSITIVE, NEGATIVE, NEUTRAL, or MIXED.
Returns:
getWarnings
public IterableStream<TextAnalyticsWarning> getWarnings()
Gets the IterableStream<T> of TextAnalyticsWarning.
Returns: