SentimentSentence

class oci.ai_language.models.SentimentSentence(**kwargs)

Bases: object

Sentiment sentence object.

Methods

__init__(**kwargs) Initializes a new SentimentSentence object with values from keyword arguments.

Attributes

length Gets the length of this SentimentSentence.
offset Gets the offset of this SentimentSentence.
scores Gets the scores of this SentimentSentence.
sentiment Gets the sentiment of this SentimentSentence.
text 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.
length

Gets the length of this SentimentSentence. Length of sentence text.

Returns:The length of this SentimentSentence.
Return type:int
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
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)
sentiment

Gets the sentiment of this SentimentSentence. The highest-score sentiment for the sentence text.

Returns:The sentiment of this SentimentSentence.
Return type:str
text

Gets the text of this SentimentSentence. Sentence text.

Returns:The text of this SentimentSentence.
Return type:str