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._dict_mixin.DictMixin
TargetSentiment

Constructor

TargetSentiment(**kwargs: Any)

Methods

get
has_key
items
keys
update
values

get

get(key: str, default: Any | None = None) -> Any

Parameters

Name Description
key
Required
default
Default value: None

has_key

has_key(k: str) -> bool

Parameters

Name Description
k
Required

items

items() -> Iterable[Tuple[str, Any]]

keys

keys() -> Iterable[str]

update

update(*args: Any, **kwargs: Any) -> None

values

values() -> Iterable[Any]

Attributes

confidence_scores

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

confidence_scores: SentimentConfidenceScores

length

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.

length: int

offset

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.

offset: int

sentiment

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

sentiment: str

text

The text value of the target.

text: str