SentenceSentiment Class

SentenceSentiment contains the predicted sentiment and confidence scores for each individual sentence in the document.

New in version v3.1: The offset, length, and mined_opinions properties.

Inheritance
azure.ai.textanalytics._models.DictMixin
SentenceSentiment

Constructor

SentenceSentiment(**kwargs)

Variables

text
str

The sentence text.

sentiment
str

The predicted Sentiment for the sentence. Possible values include: 'positive', 'neutral', 'negative'

confidence_scores
SentimentConfidenceScores

The sentiment confidence score between 0 and 1 for the sentence for all labels.

length
int

The sentence text length. This value depends on the value of the string_index_type parameter set in the original request, which is UnicodeCodePoints by default.

offset
int

The sentence text offset from the start of the document. The value depends on the value of the string_index_type parameter set in the original request, which is UnicodeCodePoints by default.

mined_opinions
list[MinedOpinion]

The list of opinions mined from this sentence. For example in the sentence "The food is good, but the service is bad", we would mine the two opinions "food is good" and "service is bad". Only returned if show_opinion_mining is set to True in the call to analyze_sentiment and api version is v3.1 and up.