Class: Google::Apis::LanguageV1beta1::AnalyzeSentimentResponse

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

Overview

The sentiment analysis response message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ AnalyzeSentimentResponse

Returns a new instance of AnalyzeSentimentResponse



356
357
358
# File 'generated/google/apis/language_v1beta1/classes.rb', line 356

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

Instance Attribute Details

#document_sentimentGoogle::Apis::LanguageV1beta1::Sentiment

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



354
355
356
# File 'generated/google/apis/language_v1beta1/classes.rb', line 354

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. Corresponds to the JSON property language

Returns:

  • (String)


343
344
345
# File 'generated/google/apis/language_v1beta1/classes.rb', line 343

def language
  @language
end

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

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



348
349
350
# File 'generated/google/apis/language_v1beta1/classes.rb', line 348

def sentences
  @sentences
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



361
362
363
364
365
# File 'generated/google/apis/language_v1beta1/classes.rb', line 361

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