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

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

Overview

Represents a category returned from the text classifier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ClassificationCategory

Returns a new instance of ClassificationCategory.



415
416
417
# File 'lib/google/apis/language_v1/classes.rb', line 415

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)


408
409
410
# File 'lib/google/apis/language_v1/classes.rb', line 408

def confidence
  @confidence
end

#nameString

The name of the category representing the document. Corresponds to the JSON property name

Returns:

  • (String)


413
414
415
# File 'lib/google/apis/language_v1/classes.rb', line 413

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



420
421
422
423
# File 'lib/google/apis/language_v1/classes.rb', line 420

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