Class: Google::Apis::LanguageV1::AnnotateTextResponse

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

Overview

The text annotations 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) ⇒ AnnotateTextResponse

Returns a new instance of AnnotateTextResponse.


322
323
324
# File 'generated/google/apis/language_v1/classes.rb', line 322

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

Instance Attribute Details

#categoriesArray<Google::Apis::LanguageV1::ClassificationCategory>

Categories identified in the input document. Corresponds to the JSON property categories


290
291
292
# File 'generated/google/apis/language_v1/classes.rb', line 290

def categories
  @categories
end

#document_sentimentGoogle::Apis::LanguageV1::Sentiment

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


295
296
297
# File 'generated/google/apis/language_v1/classes.rb', line 295

def document_sentiment
  @document_sentiment
end

#entitiesArray<Google::Apis::LanguageV1::Entity>

Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities. Corresponds to the JSON property entities


301
302
303
# File 'generated/google/apis/language_v1/classes.rb', line 301

def entities
  @entities
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)

308
309
310
# File 'generated/google/apis/language_v1/classes.rb', line 308

def language
  @language
end

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

Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. Corresponds to the JSON property sentences


314
315
316
# File 'generated/google/apis/language_v1/classes.rb', line 314

def sentences
  @sentences
end

#tokensArray<Google::Apis::LanguageV1::Token>

Tokens, along with their syntactic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_syntax. Corresponds to the JSON property tokens


320
321
322
# File 'generated/google/apis/language_v1/classes.rb', line 320

def tokens
  @tokens
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


327
328
329
330
331
332
333
334
# File 'generated/google/apis/language_v1/classes.rb', line 327

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