Class: Google::Apis::LanguageV1beta2::AnalyzeSentimentResponse

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/language_v1beta2/classes.rb,
lib/google/apis/language_v1beta2/representations.rb,
lib/google/apis/language_v1beta2/representations.rb

Overview

The sentiment analysis response message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AnalyzeSentimentResponse

Returns a new instance of AnalyzeSentimentResponse.



177
178
179
# File 'lib/google/apis/language_v1beta2/classes.rb', line 177

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#document_sentimentGoogle::Apis::LanguageV1beta2::Sentiment

Represents the feeling associated with the entire text or entities in the text. Next ID: 6 Corresponds to the JSON property documentSentiment



163
164
165
# File 'lib/google/apis/language_v1beta2/classes.rb', line 163

def document_sentiment
  @document_sentiment
end

#languageString

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details. Corresponds to the JSON property language

Returns:

  • (String)


170
171
172
# File 'lib/google/apis/language_v1beta2/classes.rb', line 170

def language
  @language
end

#sentencesArray<Google::Apis::LanguageV1beta2::Sentence>

The sentiment for all the sentences in the document. Corresponds to the JSON property sentences



175
176
177
# File 'lib/google/apis/language_v1beta2/classes.rb', line 175

def sentences
  @sentences
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



182
183
184
185
186
# File 'lib/google/apis/language_v1beta2/classes.rb', line 182

def update!(**args)
  @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
  @language = args[:language] if args.key?(:language)
  @sentences = args[:sentences] if args.key?(:sentences)
end