Class: Google::Cloud::Language::Annotation::Sentence::Sentiment
- Inherits:
-
Object
- Object
- Google::Cloud::Language::Annotation::Sentence::Sentiment
- Defined in:
- lib/google/cloud/language/annotation.rb
Overview
Represents the result of sentiment analysis.
Instance Attribute Summary collapse
-
#magnitude ⇒ Float
readonly
A non-negative number in the [0, +inf] range, which represents the overall strength of emotion regardless of score (positive or negative).
-
#score ⇒ Float
readonly
The overall emotional leaning of the text in the [-1.0, 1.0] range.
Instance Attribute Details
#magnitude ⇒ Float (readonly)
A non-negative number in the [0, +inf] range, which represents the overall strength of emotion regardless of score (positive or negative). Unlike score, magnitude is not normalized; each expression of emotion within the text (both positive and negative) contributes to the text's magnitude (so longer text blocks may have greater magnitudes).
485 486 487 |
# File 'lib/google/cloud/language/annotation.rb', line 485 def magnitude @magnitude end |
#score ⇒ Float (readonly)
The overall emotional leaning of the text in the [-1.0, 1.0] range. Larger numbers represent more positive sentiments.
485 486 487 |
# File 'lib/google/cloud/language/annotation.rb', line 485 def score @score end |