Class: Google::Apis::LanguageV2::AnnotateTextRequestFeatures

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) ⇒ AnnotateTextRequestFeatures

Returns a new instance of AnnotateTextRequestFeatures.



213
214
215
# File 'lib/google/apis/language_v2/classes.rb', line 213

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

Instance Attribute Details

#classify_textBoolean Also known as: classify_text?

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

Returns:

  • (Boolean)


192
193
194
# File 'lib/google/apis/language_v2/classes.rb', line 192

def classify_text
  @classify_text
end

#extract_document_sentimentBoolean Also known as: extract_document_sentiment?

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

Returns:

  • (Boolean)


198
199
200
# File 'lib/google/apis/language_v2/classes.rb', line 198

def extract_document_sentiment
  @extract_document_sentiment
end

#extract_entitiesBoolean Also known as: extract_entities?

Optional. Extract entities. Corresponds to the JSON property extractEntities

Returns:

  • (Boolean)


204
205
206
# File 'lib/google/apis/language_v2/classes.rb', line 204

def extract_entities
  @extract_entities
end

#moderate_textBoolean Also known as: moderate_text?

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

Returns:

  • (Boolean)


210
211
212
# File 'lib/google/apis/language_v2/classes.rb', line 210

def moderate_text
  @moderate_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



218
219
220
221
222
223
# File 'lib/google/apis/language_v2/classes.rb', line 218

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