TargetSentiment Class

TargetSentiment contains the predicted sentiment, confidence scores and other information about a key component of a product/service. For example in "The food at Hotel Foo is good", "food" is an key component of "Hotel Foo".

Inheritance
azure.ai.textanalytics._models.DictMixin
TargetSentiment

Constructor

TargetSentiment(**kwargs)

Variables

text
str

The text value of the target.

sentiment
str

The predicted Sentiment for the target. Possible values include 'positive', 'mixed', and 'negative'.

confidence_scores
SentimentConfidenceScores

The sentiment confidence score between 0 and 1 for the target for 'positive' and 'negative' labels. It's score for 'neutral' will always be 0

length
int

The target 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 target 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.