Class: Google::Apis::LanguageV1beta2::AnnotateTextResponse

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 text annotations response message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AnnotateTextResponse

Returns a new instance of AnnotateTextResponse.



387
388
389
# File 'lib/google/apis/language_v1beta2/classes.rb', line 387

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

Instance Attribute Details

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

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



350
351
352
# File 'lib/google/apis/language_v1beta2/classes.rb', line 350

def categories
  @categories
end

#document_sentimentGoogle::Apis::LanguageV1beta2::Sentiment

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



355
356
357
# File 'lib/google/apis/language_v1beta2/classes.rb', line 355

def document_sentiment
  @document_sentiment
end

#entitiesArray<Google::Apis::LanguageV1beta2::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



361
362
363
# File 'lib/google/apis/language_v1beta2/classes.rb', line 361

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)


368
369
370
# File 'lib/google/apis/language_v1beta2/classes.rb', line 368

def language
  @language
end

#moderation_categoriesArray<Google::Apis::LanguageV1beta2::ClassificationCategory>

Harmful and sensitive categories identified in the input document. Corresponds to the JSON property moderationCategories



373
374
375
# File 'lib/google/apis/language_v1beta2/classes.rb', line 373

def moderation_categories
  @moderation_categories
end

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

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



379
380
381
# File 'lib/google/apis/language_v1beta2/classes.rb', line 379

def sentences
  @sentences
end

#tokensArray<Google::Apis::LanguageV1beta2::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



385
386
387
# File 'lib/google/apis/language_v1beta2/classes.rb', line 385

def tokens
  @tokens
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



392
393
394
395
396
397
398
399
400
# File 'lib/google/apis/language_v1beta2/classes.rb', line 392

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)
  @moderation_categories = args[:moderation_categories] if args.key?(:moderation_categories)
  @sentences = args[:sentences] if args.key?(:sentences)
  @tokens = args[:tokens] if args.key?(:tokens)
end