Class: Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentEntity

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

Overview

An entity that could be a phrase in the text or a property that belongs to the document. It is a known entity type, such as a person, an organization, or location.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1DocumentEntity

Returns a new instance of GoogleCloudDocumentaiV1DocumentEntity.



1477
1478
1479
# File 'lib/google/apis/documentai_v1/classes.rb', line 1477

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

Instance Attribute Details

#confidenceFloat

Optional. Confidence of detected Schema entity. Range [0, 1]. Corresponds to the JSON property confidence

Returns:

  • (Float)


1409
1410
1411
# File 'lib/google/apis/documentai_v1/classes.rb', line 1409

def confidence
  @confidence
end

#idString

Optional. Canonical id. This will be a unique value in the entity list for this document. Corresponds to the JSON property id

Returns:

  • (String)


1415
1416
1417
# File 'lib/google/apis/documentai_v1/classes.rb', line 1415

def id
  @id
end

#mention_idString

Optional. Deprecated. Use id field instead. Corresponds to the JSON property mentionId

Returns:

  • (String)


1420
1421
1422
# File 'lib/google/apis/documentai_v1/classes.rb', line 1420

def mention_id
  @mention_id
end

#mention_textString

Optional. Text value in the document e.g. 1600 Amphitheatre Pkwy. If the entity is not present in the document, this field will be empty. Corresponds to the JSON property mentionText

Returns:

  • (String)


1426
1427
1428
# File 'lib/google/apis/documentai_v1/classes.rb', line 1426

def mention_text
  @mention_text
end

#non_presentBoolean Also known as: non_present?

Optional. This attribute indicates that the processing didn't actually identify this entity, but a confidence score was assigned that represent the potential that this could be a false negative. A non-present entity should have an empty mention_text and text_anchor. Corresponds to the JSON property nonPresent

Returns:

  • (Boolean)


1434
1435
1436
# File 'lib/google/apis/documentai_v1/classes.rb', line 1434

def non_present
  @non_present
end

#normalized_valueGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentEntityNormalizedValue

Parsed and normalized entity value. Corresponds to the JSON property normalizedValue



1440
1441
1442
# File 'lib/google/apis/documentai_v1/classes.rb', line 1440

def normalized_value
  @normalized_value
end

#page_anchorGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentPageAnchor

Referencing the visual context of the entity in the Document.pages. Page anchors can be cross-page, consist of multiple bounding polygons and optionally reference specific layout element types. Corresponds to the JSON property pageAnchor



1447
1448
1449
# File 'lib/google/apis/documentai_v1/classes.rb', line 1447

def page_anchor
  @page_anchor
end

#propertiesArray<Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentEntity>

Optional. Entities can be nested to form a hierarchical data structure representing the content in the document. Corresponds to the JSON property properties



1453
1454
1455
# File 'lib/google/apis/documentai_v1/classes.rb', line 1453

def properties
  @properties
end

#provenanceGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentProvenance

Structure to identify provenance relationships between annotations in different revisions. Corresponds to the JSON property provenance



1459
1460
1461
# File 'lib/google/apis/documentai_v1/classes.rb', line 1459

def provenance
  @provenance
end

#redactedBoolean Also known as: redacted?

Optional. Whether the entity will be redacted for de-identification purposes. Corresponds to the JSON property redacted

Returns:

  • (Boolean)


1464
1465
1466
# File 'lib/google/apis/documentai_v1/classes.rb', line 1464

def redacted
  @redacted
end

#text_anchorGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1DocumentTextAnchor

Text reference indexing into the Document.text. Corresponds to the JSON property textAnchor



1470
1471
1472
# File 'lib/google/apis/documentai_v1/classes.rb', line 1470

def text_anchor
  @text_anchor
end

#typeString

Required. Entity type from a schema e.g. Address. Corresponds to the JSON property type

Returns:

  • (String)


1475
1476
1477
# File 'lib/google/apis/documentai_v1/classes.rb', line 1475

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
# File 'lib/google/apis/documentai_v1/classes.rb', line 1482

def update!(**args)
  @confidence = args[:confidence] if args.key?(:confidence)
  @id = args[:id] if args.key?(:id)
  @mention_id = args[:mention_id] if args.key?(:mention_id)
  @mention_text = args[:mention_text] if args.key?(:mention_text)
  @non_present = args[:non_present] if args.key?(:non_present)
  @normalized_value = args[:normalized_value] if args.key?(:normalized_value)
  @page_anchor = args[:page_anchor] if args.key?(:page_anchor)
  @properties = args[:properties] if args.key?(:properties)
  @provenance = args[:provenance] if args.key?(:provenance)
  @redacted = args[:redacted] if args.key?(:redacted)
  @text_anchor = args[:text_anchor] if args.key?(:text_anchor)
  @type = args[:type] if args.key?(:type)
end