Class: Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1beta2DocumentLabel

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

Overview

Label attaches schema information and/or other metadata to segments within a Document. Multiple Labels on a single field can denote either different labels, different instances of the same label created at different times, or some combination of both.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1beta2DocumentLabel

Returns a new instance of GoogleCloudDocumentaiV1beta2DocumentLabel.

[View source]

8072
8073
8074
# File 'lib/google/apis/documentai_v1/classes.rb', line 8072

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

Instance Attribute Details

#automl_modelString

Label is generated AutoML model. This field stores the full resource name of the AutoML model. Format: projects/project-id/locations/location-id/ models/model-id` Corresponds to the JSON propertyautomlModel`

Returns:

  • (String)

8059
8060
8061
# File 'lib/google/apis/documentai_v1/classes.rb', line 8059

def automl_model
  @automl_model
end

#confidenceFloat

Confidence score between 0 and 1 for label assignment. Corresponds to the JSON property confidence

Returns:

  • (Float)

8064
8065
8066
# File 'lib/google/apis/documentai_v1/classes.rb', line 8064

def confidence
  @confidence
end

#nameString

Name of the label. When the label is generated from AutoML Text Classification model, this field represents the name of the category. Corresponds to the JSON property name

Returns:

  • (String)

8070
8071
8072
# File 'lib/google/apis/documentai_v1/classes.rb', line 8070

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

8077
8078
8079
8080
8081
# File 'lib/google/apis/documentai_v1/classes.rb', line 8077

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