Class: Google::Cloud::Language::Annotation::Sentiment
- Inherits:
-
Object
- Object
- Google::Cloud::Language::Annotation::Sentiment
- Defined in:
- lib/google/cloud/language/annotation.rb
Overview
Represents the result of sentiment analysis.
Instance Attribute Summary collapse
-
#language ⇒ String
readonly
The language of the document (if not specified, the language is automatically detected).
-
#magnitude ⇒ Float
readonly
A non-negative number in the [0, +inf] range, which represents the absolute magnitude of sentiment regardless of polarity (positive or negative).
-
#polarity ⇒ Float
readonly
Polarity of the sentiment in the [-1.0, 1.0] range.
Instance Attribute Details
#language ⇒ String (readonly)
The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are supported.
597 598 599 |
# File 'lib/google/cloud/language/annotation.rb', line 597 def language @language end |
#magnitude ⇒ Float (readonly)
A non-negative number in the [0, +inf] range, which represents the absolute magnitude of sentiment regardless of polarity (positive or negative).
597 598 599 |
# File 'lib/google/cloud/language/annotation.rb', line 597 def magnitude @magnitude end |
#polarity ⇒ Float (readonly)
Polarity of the sentiment in the [-1.0, 1.0] range. Larger numbers represent more positive sentiments.
597 598 599 |
# File 'lib/google/cloud/language/annotation.rb', line 597 def polarity @polarity end |