Class: Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/documentai/v1beta3/document_schema.rb

Overview

EntityType is the wrapper of a label of the corresponding model with detailed attributes and limitations for entity-based processors. Multiple types can also compose a dependency tree to represent nested types.

Defined Under Namespace

Classes: EnumValues, Property

Instance Attribute Summary collapse

Instance Attribute Details

#base_types::Array<::String>

Returns The entity type that this type is derived from. For now, one and only one should be set.

Returns:

  • (::Array<::String>)

    The entity type that this type is derived from. For now, one and only one should be set.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'proto_docs/google/cloud/documentai/v1beta3/document_schema.rb', line 148

class EntityType
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines the a list of enum values.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     The individual values that this enum values type can include.
  class EnumValues
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines properties that can be part of the entity type.
  # @!attribute [rw] name
  #   @return [::String]
  #     The name of the property.  Follows the same guidelines as the
  #     EntityType name.
  # @!attribute [rw] value_type
  #   @return [::String]
  #     A reference to the value type of the property.  This type is subject
  #     to the same conventions as the `Entity.base_types` field.
  # @!attribute [rw] occurrence_type
  #   @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType]
  #     Occurrence type limits the number of instances an entity type appears
  #     in the document.
  # @!attribute [rw] property_metadata
  #   @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata]
  #     Any additional metadata about the property can be added here.
  class Property
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Types of occurrences of the entity type in the document.  This
    # represents the number of instances of instances of an entity, not
    # number of mentions of an entity.  For example, a bank statement may
    # only have one `account_number`, but this account number may be
    # mentioned in several places on the document.  In this case the
    # 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
    # on the other hand, we expect a bank statement to contain the status of
    # multiple different accounts for the customers, the occurrence type will
    # be set to `REQUIRED_MULTIPLE`.
    module OccurrenceType
      # Unspecified occurrence type.
      OCCURRENCE_TYPE_UNSPECIFIED = 0

      # There will be zero or one instance of this entity type.  The same
      # entity instance may be mentioned multiple times.
      OPTIONAL_ONCE = 1

      # The entity type will appear zero or multiple times.
      OPTIONAL_MULTIPLE = 2

      # The entity type will only appear exactly once.  The same
      # entity instance may be mentioned multiple times.
      REQUIRED_ONCE = 3

      # The entity type will appear once or more times.
      REQUIRED_MULTIPLE = 4
    end
  end
end

#display_name::String

Returns User defined name for the type.

Returns:

  • (::String)

    User defined name for the type.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'proto_docs/google/cloud/documentai/v1beta3/document_schema.rb', line 148

class EntityType
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines the a list of enum values.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     The individual values that this enum values type can include.
  class EnumValues
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines properties that can be part of the entity type.
  # @!attribute [rw] name
  #   @return [::String]
  #     The name of the property.  Follows the same guidelines as the
  #     EntityType name.
  # @!attribute [rw] value_type
  #   @return [::String]
  #     A reference to the value type of the property.  This type is subject
  #     to the same conventions as the `Entity.base_types` field.
  # @!attribute [rw] occurrence_type
  #   @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType]
  #     Occurrence type limits the number of instances an entity type appears
  #     in the document.
  # @!attribute [rw] property_metadata
  #   @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata]
  #     Any additional metadata about the property can be added here.
  class Property
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Types of occurrences of the entity type in the document.  This
    # represents the number of instances of instances of an entity, not
    # number of mentions of an entity.  For example, a bank statement may
    # only have one `account_number`, but this account number may be
    # mentioned in several places on the document.  In this case the
    # 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
    # on the other hand, we expect a bank statement to contain the status of
    # multiple different accounts for the customers, the occurrence type will
    # be set to `REQUIRED_MULTIPLE`.
    module OccurrenceType
      # Unspecified occurrence type.
      OCCURRENCE_TYPE_UNSPECIFIED = 0

      # There will be zero or one instance of this entity type.  The same
      # entity instance may be mentioned multiple times.
      OPTIONAL_ONCE = 1

      # The entity type will appear zero or multiple times.
      OPTIONAL_MULTIPLE = 2

      # The entity type will only appear exactly once.  The same
      # entity instance may be mentioned multiple times.
      REQUIRED_ONCE = 3

      # The entity type will appear once or more times.
      REQUIRED_MULTIPLE = 4
    end
  end
end

#entity_type_metadata::Google::Cloud::DocumentAI::V1beta3::EntityTypeMetadata

Returns Metadata for the entity type.

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'proto_docs/google/cloud/documentai/v1beta3/document_schema.rb', line 148

class EntityType
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines the a list of enum values.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     The individual values that this enum values type can include.
  class EnumValues
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines properties that can be part of the entity type.
  # @!attribute [rw] name
  #   @return [::String]
  #     The name of the property.  Follows the same guidelines as the
  #     EntityType name.
  # @!attribute [rw] value_type
  #   @return [::String]
  #     A reference to the value type of the property.  This type is subject
  #     to the same conventions as the `Entity.base_types` field.
  # @!attribute [rw] occurrence_type
  #   @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType]
  #     Occurrence type limits the number of instances an entity type appears
  #     in the document.
  # @!attribute [rw] property_metadata
  #   @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata]
  #     Any additional metadata about the property can be added here.
  class Property
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Types of occurrences of the entity type in the document.  This
    # represents the number of instances of instances of an entity, not
    # number of mentions of an entity.  For example, a bank statement may
    # only have one `account_number`, but this account number may be
    # mentioned in several places on the document.  In this case the
    # 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
    # on the other hand, we expect a bank statement to contain the status of
    # multiple different accounts for the customers, the occurrence type will
    # be set to `REQUIRED_MULTIPLE`.
    module OccurrenceType
      # Unspecified occurrence type.
      OCCURRENCE_TYPE_UNSPECIFIED = 0

      # There will be zero or one instance of this entity type.  The same
      # entity instance may be mentioned multiple times.
      OPTIONAL_ONCE = 1

      # The entity type will appear zero or multiple times.
      OPTIONAL_MULTIPLE = 2

      # The entity type will only appear exactly once.  The same
      # entity instance may be mentioned multiple times.
      REQUIRED_ONCE = 3

      # The entity type will appear once or more times.
      REQUIRED_MULTIPLE = 4
    end
  end
end

#enum_values::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::EnumValues

Returns If specified, lists all the possible values for this entity. This should not be more than a handful of values. If the number of values is >10 or could change frequently use the EntityType.value_ontology field and specify a list of all possible values in a value ontology file.

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'proto_docs/google/cloud/documentai/v1beta3/document_schema.rb', line 148

class EntityType
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines the a list of enum values.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     The individual values that this enum values type can include.
  class EnumValues
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines properties that can be part of the entity type.
  # @!attribute [rw] name
  #   @return [::String]
  #     The name of the property.  Follows the same guidelines as the
  #     EntityType name.
  # @!attribute [rw] value_type
  #   @return [::String]
  #     A reference to the value type of the property.  This type is subject
  #     to the same conventions as the `Entity.base_types` field.
  # @!attribute [rw] occurrence_type
  #   @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType]
  #     Occurrence type limits the number of instances an entity type appears
  #     in the document.
  # @!attribute [rw] property_metadata
  #   @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata]
  #     Any additional metadata about the property can be added here.
  class Property
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Types of occurrences of the entity type in the document.  This
    # represents the number of instances of instances of an entity, not
    # number of mentions of an entity.  For example, a bank statement may
    # only have one `account_number`, but this account number may be
    # mentioned in several places on the document.  In this case the
    # 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
    # on the other hand, we expect a bank statement to contain the status of
    # multiple different accounts for the customers, the occurrence type will
    # be set to `REQUIRED_MULTIPLE`.
    module OccurrenceType
      # Unspecified occurrence type.
      OCCURRENCE_TYPE_UNSPECIFIED = 0

      # There will be zero or one instance of this entity type.  The same
      # entity instance may be mentioned multiple times.
      OPTIONAL_ONCE = 1

      # The entity type will appear zero or multiple times.
      OPTIONAL_MULTIPLE = 2

      # The entity type will only appear exactly once.  The same
      # entity instance may be mentioned multiple times.
      REQUIRED_ONCE = 3

      # The entity type will appear once or more times.
      REQUIRED_MULTIPLE = 4
    end
  end
end

#name::String

Returns Name of the type. It must be unique within the schema file and cannot be a "Common Type". The following naming conventions are used:

  • Use snake_casing.
  • Name matching is case-sensitive.
  • Maximum 64 characters.
  • Must start with a letter.
  • Allowed characters: ASCII letters [a-z0-9_-]. (For backward compatibility internal infrastructure and tooling can handle any ascii character.)
  • The / is sometimes used to denote a property of a type. For example line_item/amount. This convention is deprecated, but will still be honored for backward compatibility.

Returns:

  • (::String)

    Name of the type. It must be unique within the schema file and cannot be a "Common Type". The following naming conventions are used:

    • Use snake_casing.
    • Name matching is case-sensitive.
    • Maximum 64 characters.
    • Must start with a letter.
    • Allowed characters: ASCII letters [a-z0-9_-]. (For backward compatibility internal infrastructure and tooling can handle any ascii character.)
    • The / is sometimes used to denote a property of a type. For example line_item/amount. This convention is deprecated, but will still be honored for backward compatibility.


148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'proto_docs/google/cloud/documentai/v1beta3/document_schema.rb', line 148

class EntityType
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines the a list of enum values.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     The individual values that this enum values type can include.
  class EnumValues
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines properties that can be part of the entity type.
  # @!attribute [rw] name
  #   @return [::String]
  #     The name of the property.  Follows the same guidelines as the
  #     EntityType name.
  # @!attribute [rw] value_type
  #   @return [::String]
  #     A reference to the value type of the property.  This type is subject
  #     to the same conventions as the `Entity.base_types` field.
  # @!attribute [rw] occurrence_type
  #   @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType]
  #     Occurrence type limits the number of instances an entity type appears
  #     in the document.
  # @!attribute [rw] property_metadata
  #   @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata]
  #     Any additional metadata about the property can be added here.
  class Property
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Types of occurrences of the entity type in the document.  This
    # represents the number of instances of instances of an entity, not
    # number of mentions of an entity.  For example, a bank statement may
    # only have one `account_number`, but this account number may be
    # mentioned in several places on the document.  In this case the
    # 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
    # on the other hand, we expect a bank statement to contain the status of
    # multiple different accounts for the customers, the occurrence type will
    # be set to `REQUIRED_MULTIPLE`.
    module OccurrenceType
      # Unspecified occurrence type.
      OCCURRENCE_TYPE_UNSPECIFIED = 0

      # There will be zero or one instance of this entity type.  The same
      # entity instance may be mentioned multiple times.
      OPTIONAL_ONCE = 1

      # The entity type will appear zero or multiple times.
      OPTIONAL_MULTIPLE = 2

      # The entity type will only appear exactly once.  The same
      # entity instance may be mentioned multiple times.
      REQUIRED_ONCE = 3

      # The entity type will appear once or more times.
      REQUIRED_MULTIPLE = 4
    end
  end
end

#properties::Array<::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property>

Returns Description the nested structure, or composition of an entity.

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'proto_docs/google/cloud/documentai/v1beta3/document_schema.rb', line 148

class EntityType
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines the a list of enum values.
  # @!attribute [rw] values
  #   @return [::Array<::String>]
  #     The individual values that this enum values type can include.
  class EnumValues
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines properties that can be part of the entity type.
  # @!attribute [rw] name
  #   @return [::String]
  #     The name of the property.  Follows the same guidelines as the
  #     EntityType name.
  # @!attribute [rw] value_type
  #   @return [::String]
  #     A reference to the value type of the property.  This type is subject
  #     to the same conventions as the `Entity.base_types` field.
  # @!attribute [rw] occurrence_type
  #   @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema::EntityType::Property::OccurrenceType]
  #     Occurrence type limits the number of instances an entity type appears
  #     in the document.
  # @!attribute [rw] property_metadata
  #   @return [::Google::Cloud::DocumentAI::V1beta3::PropertyMetadata]
  #     Any additional metadata about the property can be added here.
  class Property
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Types of occurrences of the entity type in the document.  This
    # represents the number of instances of instances of an entity, not
    # number of mentions of an entity.  For example, a bank statement may
    # only have one `account_number`, but this account number may be
    # mentioned in several places on the document.  In this case the
    # 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
    # on the other hand, we expect a bank statement to contain the status of
    # multiple different accounts for the customers, the occurrence type will
    # be set to `REQUIRED_MULTIPLE`.
    module OccurrenceType
      # Unspecified occurrence type.
      OCCURRENCE_TYPE_UNSPECIFIED = 0

      # There will be zero or one instance of this entity type.  The same
      # entity instance may be mentioned multiple times.
      OPTIONAL_ONCE = 1

      # The entity type will appear zero or multiple times.
      OPTIONAL_MULTIPLE = 2

      # The entity type will only appear exactly once.  The same
      # entity instance may be mentioned multiple times.
      REQUIRED_ONCE = 3

      # The entity type will appear once or more times.
      REQUIRED_MULTIPLE = 4
    end
  end
end