class Google::Apis::LanguageV1beta1::Sentiment
Represents the feeling associated with the entire text or entities in the text.
Attributes
magnitude[RW]
A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative). Corresponds to the JSON property `magnitude` @return [Float]
polarity[RW]
DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at cloud.google.com/natural-language/docs for more information. Corresponds to the JSON property `polarity` @return [Float]
score[RW]
Sentiment
score between -1.0 (negative sentiment) and 1.0 (positive sentiment). Corresponds to the JSON property `score` @return [Float]
Public Class Methods
new(**args)
click to toggle source
# File lib/google/apis/language_v1beta1/classes.rb, line 599 def initialize(**args) update!(**args) end
Public Instance Methods
update!(**args)
click to toggle source
Update properties of this object
# File lib/google/apis/language_v1beta1/classes.rb, line 604 def update!(**args) @magnitude = args[:magnitude] if args.key?(:magnitude) @polarity = args[:polarity] if args.key?(:polarity) @score = args[:score] if args.key?(:score) end