Class: Google::Apis::LanguageV2::Features

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

Overview

All available features. Setting each one to true will enable that specific analysis for the input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Features

Returns a new instance of Features.



491
492
493
# File 'lib/google/apis/language_v2/classes.rb', line 491

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

Instance Attribute Details

#classify_text ⇒ Boolean Also known as: classify_text?

Optional. Classify the full document into categories. Corresponds to the JSON property classifyText

Returns:

  • (Boolean)


470
471
472
# File 'lib/google/apis/language_v2/classes.rb', line 470

def classify_text
  @classify_text
end

#extract_document_sentiment ⇒ Boolean Also known as: extract_document_sentiment?

Optional. Extract document-level sentiment. Corresponds to the JSON property extractDocumentSentiment

Returns:

  • (Boolean)


476
477
478
# File 'lib/google/apis/language_v2/classes.rb', line 476

def extract_document_sentiment
  @extract_document_sentiment
end

#extract_entities ⇒ Boolean Also known as: extract_entities?

Optional. Extract entities. Corresponds to the JSON property extractEntities

Returns:

  • (Boolean)


482
483
484
# File 'lib/google/apis/language_v2/classes.rb', line 482

def extract_entities
  @extract_entities
end

#moderate_text ⇒ Boolean Also known as: moderate_text?

Optional. Moderate the document for harmful and sensitive categories. Corresponds to the JSON property moderateText

Returns:

  • (Boolean)


488
489
490
# File 'lib/google/apis/language_v2/classes.rb', line 488

def moderate_text
  @moderate_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



496
497
498
499
500
501
# File 'lib/google/apis/language_v2/classes.rb', line 496

def update!(**args)
  @classify_text = args[:classify_text] if args.key?(:classify_text)
  @extract_document_sentiment = args[:extract_document_sentiment] if args.key?(:extract_document_sentiment)
  @extract_entities = args[:extract_entities] if args.key?(:extract_entities)
  @moderate_text = args[:moderate_text] if args.key?(:moderate_text)
end