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.



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

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)


468
469
470
# File 'lib/google/apis/language_v2/classes.rb', line 468

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)


474
475
476
# File 'lib/google/apis/language_v2/classes.rb', line 474

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)


480
481
482
# File 'lib/google/apis/language_v2/classes.rb', line 480

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)


486
487
488
# File 'lib/google/apis/language_v2/classes.rb', line 486

def moderate_text
  @moderate_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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