你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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.

Constructor

SentenceSentiment(**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 sentence for all labels.

confidence_scores: SentimentConfidenceScores

length

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.

length: int

mined_opinions

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.

mined_opinions: List[MinedOpinion] | None = None

offset

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.

offset: int

sentiment

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

sentiment: str

text

The sentence text.

text: str