Class DocumentSentiment
- java.lang.Object
-
- com.azure.ai.textanalytics.models.DocumentSentiment
-
public final class DocumentSentiment extends Object
TheDocumentSentiment
model that contains sentiment label of a document, confidence score of the sentiment label, and a list ofSentenceSentiment
.
-
-
Constructor Summary
Constructors Constructor Description DocumentSentiment(TextSentiment sentiment, SentimentConfidenceScores confidenceScores, com.azure.core.util.IterableStream<SentenceSentiment> sentences, com.azure.core.util.IterableStream<TextAnalyticsWarning> warnings)
Creates aDocumentSentiment
model that describes the sentiment of the document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SentimentConfidenceScores
getConfidenceScores()
Gets the sentiment confidence score (Softmax score) between 0 and 1, for each sentiment label.com.azure.core.util.IterableStream<SentenceSentiment>
getSentences()
Gets a list of sentence sentiments.TextSentiment
getSentiment()
Gets the text sentiment label: POSITIVE, NEGATIVE, NEUTRAL, or MIXED.com.azure.core.util.IterableStream<TextAnalyticsWarning>
getWarnings()
Gets theIterableStream
ofText Analytics warnings
.
-
-
-
Constructor Detail
-
DocumentSentiment
public DocumentSentiment(TextSentiment sentiment, SentimentConfidenceScores confidenceScores, com.azure.core.util.IterableStream<SentenceSentiment> sentences, com.azure.core.util.IterableStream<TextAnalyticsWarning> warnings)
Creates aDocumentSentiment
model that describes the sentiment of the document.- Parameters:
sentiment
- The sentiment label of the document.confidenceScores
- The sentiment confidence score (Softmax score) between 0 and 1, for each sentiment label. Higher values signify higher confidence.sentences
- AnIterableStream
of sentence sentiments.warnings
- AnIterableStream
ofTextAnalyticsWarning
.
-
-
Method Detail
-
getSentiment
public TextSentiment getSentiment()
Gets the text sentiment label: POSITIVE, NEGATIVE, NEUTRAL, or MIXED.- Returns:
- The
TextSentiment
.
-
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:
- The
SentimentConfidenceScores
.
-
getSentences
public com.azure.core.util.IterableStream<SentenceSentiment> getSentences()
Gets a list of sentence sentiments.- Returns:
- A list of sentence sentiments.
-
getWarnings
public com.azure.core.util.IterableStream<TextAnalyticsWarning> getWarnings()
Gets theIterableStream
ofText Analytics warnings
.- Returns:
- An
IterableStream
ofTextAnalyticsWarning
.
-
-