Class: Google::Apis::LanguageV2::ClassificationCategory
- Inherits:
-
Object
- Object
- Google::Apis::LanguageV2::ClassificationCategory
- 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
Represents a category returned from the text classifier.
Instance Attribute Summary collapse
-
#confidence ⇒ Float
The classifier's confidence of the category.
-
#name ⇒ String
The name of the category representing the document.
-
#severity ⇒ Float
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ClassificationCategory
constructor
A new instance of ClassificationCategory.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ ClassificationCategory
Returns a new instance of ClassificationCategory.
311 312 313 |
# File 'lib/google/apis/language_v2/classes.rb', line 311 def initialize(**args) update!(**args) end |
Instance Attribute Details
#confidence ⇒ Float
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
297 298 299 |
# File 'lib/google/apis/language_v2/classes.rb', line 297 def confidence @confidence end |
#name ⇒ String
The name of the category representing the document.
Corresponds to the JSON property name
302 303 304 |
# File 'lib/google/apis/language_v2/classes.rb', line 302 def name @name end |
#severity ⇒ Float
Optional. The classifier's severity of the category. This is only present when
the ModerateTextRequest.ModelVersion is set to MODEL_VERSION_2, and the
corresponding category has a severity score.
Corresponds to the JSON property severity
309 310 311 |
# File 'lib/google/apis/language_v2/classes.rb', line 309 def severity @severity end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
316 317 318 319 320 |
# File 'lib/google/apis/language_v2/classes.rb', line 316 def update!(**args) @confidence = args[:confidence] if args.key?(:confidence) @name = args[:name] if args.key?(:name) @severity = args[:severity] if args.key?(:severity) end |