Class: Google::Apis::LanguageV1::ClassificationCategory

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

Represents a category returned from the text classifier.

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

Returns a new instance of ClassificationCategory.


353
354
355
# File 'generated/google/apis/language_v1/classes.rb', line 353

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

Instance Attribute Details

#confidenceFloat

The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text. Corresponds to the JSON property confidence

Returns:

  • (Float)

345
346
347
# File 'generated/google/apis/language_v1/classes.rb', line 345

def confidence
  @confidence
end

#nameString

The name of the category representing the document, from the predefined taxonomy. Corresponds to the JSON property name

Returns:

  • (String)

351
352
353
# File 'generated/google/apis/language_v1/classes.rb', line 351

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


358
359
360
361
# File 'generated/google/apis/language_v1/classes.rb', line 358

def update!(**args)
  @confidence = args[:confidence] if args.key?(:confidence)
  @name = args[:name] if args.key?(:name)
end