Share via


DocumentSentiment Class

  • java.lang.Object
    • com.azure.ai.textanalytics.models.DocumentSentiment

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 DocumentSentiment model that describes the sentiment of the document.

Method Summary

Modifier and Type Method and Description
SentimentConfidenceScores getConfidenceScores()

Gets the sentiment confidence score (Softmax score) between 0 and 1, for each sentiment label.

IterableStream<SentenceSentiment> getSentences()

Gets a list of sentence sentiments.

TextSentiment getSentiment()

Gets the text sentiment label: POSITIVE, NEGATIVE, NEUTRAL, or MIXED.

IterableStream<TextAnalyticsWarning> 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:

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 - An IterableStream<T> of sentence sentiments.

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:

A list of sentence sentiments.

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:

Applies to