AssessmentSentiment Class

AssessmentSentiment contains the predicted sentiment, confidence scores and other information about an assessment given about a particular target. For example, in the sentence "The food is good", the assessment of the target 'food' is 'good'.

Inheritance
azure.ai.textanalytics._dict_mixin.DictMixin
AssessmentSentiment

Constructor

AssessmentSentiment(**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 assessment for 'positive' and 'negative' labels. It's score for 'neutral' will always be 0

confidence_scores: SentimentConfidenceScores

is_negated

Whether the value of the assessment is negated. For example, in "The food is not good", the assessment "good" is negated.

is_negated: bool

length

The assessment 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 assessment 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 assessment. Possible values include 'positive', 'mixed', and 'negative'.

sentiment: str

text

The assessment text.

text: str