SentimentSentence¶
- class oci.ai_language.models.SentimentSentence(**kwargs)¶
Bases:
objectSentiment sentence object.
Methods:
__init__(**kwargs)Initializes a new SentimentSentence object with values from keyword arguments.
Attributes:
Gets the length of this SentimentSentence.
Gets the offset of this SentimentSentence.
Gets the scores of this SentimentSentence.
Gets the sentiment of this SentimentSentence.
Gets the text of this SentimentSentence.
- __init__(**kwargs)¶
Initializes a new SentimentSentence object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):
- Parameters
offset (int) – The value to assign to the offset property of this SentimentSentence.
length (int) – The value to assign to the length property of this SentimentSentence.
text (str) – The value to assign to the text property of this SentimentSentence.
sentiment (str) – The value to assign to the sentiment property of this SentimentSentence.
scores (dict(str, float)) – The value to assign to the scores property of this SentimentSentence.
- property length¶
Gets the length of this SentimentSentence. Length of sentence text.
- Returns
The length of this SentimentSentence.
- Return type
int
- property offset¶
Gets the offset of this SentimentSentence. The number of Unicode code points preceding this entity in the submitted text.
- Returns
The offset of this SentimentSentence.
- Return type
int
- property scores¶
Gets the scores of this SentimentSentence. Scores or confidences for each sentiment. Example: {“positive”: 1.0, “negative”: 0.0}
- Returns
The scores of this SentimentSentence.
- Return type
dict(str, float)
- property sentiment¶
Gets the sentiment of this SentimentSentence. The highest-score sentiment for the sentence text.
- Returns
The sentiment of this SentimentSentence.
- Return type
str
- property text¶
Gets the text of this SentimentSentence. Sentence text.
- Returns
The text of this SentimentSentence.
- Return type
str