Key Value Extraction (Invoices)
Key value extraction can be used to identify values for predefined keys in an invoice. For example, if an invoice includes a vendor name, total, and invoice ID, Document Understanding can identify these values and return them as a key value pair.
The supported features are:
- Extract values for predefined key value pairs
- Bounding polygons
- Confidence score
The supported fields are:
Field | Description |
---|---|
CustomerName | Name of invoiced customer. |
CustomerId | Customer reference identifier. |
PurchaseOrder | Purchase order number. |
InvoiceId | Identifier for the specific invoice. |
InvoiceDate | Date of issue on the invoice. |
DueDate | Date when payment is due on this invoice. |
VendorName | Name of vendor. |
VendorAddress | Vendor mailing address. |
VendorAddressRecipient | Name referenced with the VendorAddress. |
CustomerAddress | Mailing address for the Customer. |
CustomerAddressRecipient | Name referenced with the CustomerAddress. |
BillingAddress | Explicit billing address for the customer. |
BillingAddressRecipient | Name referenced with the BillingAddress. |
ShippingAddress | Explicit shipping address for the customer. |
ShippingAddressRecipient | Name referenced with the ShippingAddress. |
PaymentTerm | The terms of payment for the invoice. |
Subtotal | Subtotal field identified on this invoice. |
TotalTax | Total tax value identified on this invoice. |
InvoiceTotal | Total charge amount associated with the invoice. |
AmountDue | Total amount due to the vendor. |
ServiceAddress | Explicit service address or property address for the customer. |
ServiceAddressRecipient | Name referenced with the ServiceAddress. |
RemittanceAddress | Explicit remittance or payment address for the customer. |
RemittanceAddressRecipient | Name referenced with the RemittanceAddress. |
ShippingCost | Total shipping or shipping and handling costs associated with an invoice. |
ServiceStartDate | First date for the service period. |
ServiceEndDate | End date for the service period. |
PreviousUnpaidBalance | Explicit previously unpaid balance. |
The supported line items are:
Line Item | Description |
---|---|
Items | Concatenation of all other line item values (that is, the entire line of the line item). |
Name | The name listed for a product or service, for example, t-shirt. |
Amount | The amount of the line item. |
Description | The text description for the invoice line item, for example, men's rayon shirt, sizes small, medium, and large. |
Quantity | The quantity for this invoice line item. |
UnitPrice | The price per item identified on the invoice. |
ProductCode | Product code, product number, or SKU referenced in the line item. For example, 123456. |
Unit | The unit of the line item, for example, kg, lb. |
Tax | Tax explicitly referenced on the line item. |
Date | Date corresponding to each line item. |
Key Value Extraction (Invoice) Example
An example of the use of key value extraction from an invoice in Document Understanding.
- Input document
- API Request:
{ "processorConfig": { "processorType": "GENERAL", "features": [ { "featureType": "KEY_VALUE_EXTRACTION" }, "documentType": "INVOICE" }, "inputLocation": { "sourceType": "OBJECT_STORAGE_LOCATIONS", "objectLocations": [ { "source": "OBJECT_STORAGE", "namespaceName": "", "bucketName": "", "objectName": "" } ] }, "compartmentId": "", "outputLocation": { "namespaceName": "", "bucketName": "", "prefix": "" } }
- Output:
- API Response:
{ "documentMetadata": { "pageCount": 1, "mimeType": "image/png" }, "pages": [ { "pageNumber": 1, "dimensions": { "width": 1372, "height": 1732, "unit": "PIXEL" }, "documentFields": [ { "fieldType": "KEY_VALUE", "fieldLabel": { "name": "VendorAddress", "confidence": 0.99862003 }, "fieldValue": { "valueType": "STRING", "text": "657 Clifford Street Allentown, PA", "boundingPolygon": { "normalizedVertices": [ { "x": 0.08454810495626822, "y": 0.10219399538106236 }, { "x": 0.21793002915451895, "y": 0.10219399538106236 }, { "x": 0.21793002915451895, "y": 0.13048498845265588 }, { "x": 0.08454810495626822, "y": 0.13048498845265588 } ] }, "wordIndexes": [ 3, 4, 5, 9, 10 ], "value": "657 Clifford Street Allentown, PA" } }, { "fieldType": "LINE_ITEM_GROUP", "fieldLabel": { "name": "Items" }, "fieldValue": { "valueType": "ARRAY", "items": [ { "fieldType": "LINE_ITEM", "fieldValue": { "valueType": "ARRAY", "text": "1 Cable165XZ3654681 12.75 $12.75", "items": [ { "fieldType": "LINE_ITEM_FIELD", "fieldLabel": { "name": "Quantity", "confidence": 0.9989789 }, "fieldValue": { "valueType": "NUMBER", "text": "1", "boundingPolygon": { "normalizedVertices": [ { "x": 0.39941690962099125, "y": 0.5075057736720554 }, { "x": 0.39941690962099125, "y": 0.5184757505773672 }, { "x": 0.24927113702623907, "y": 0.5184757505773672 } ] }, "wordIndexes": [ 68 ], "value": "Cable165XZ3654681" } }, { "fieldType": "LINE_ITEM_FIELD", "fieldLabel": { "name": "UnitPrice", "confidence": 0.9375645 }, "fieldValue": { "valueType": "NUMBER", "text": "12.75", "boundingPolygon": { "normalizedVertices": [ { "x": 0.7594752186588921, "y": 0.50635103926097 }, { "x": 0.8024781341107872, "y": 0.50635103926097 }, { "x": 0.8024781341107872, "y": 0.5196304849884527 }, { "x": 0.7594752186588921, "y": 0.5196304849884527 } ] }, "wordIndexes": [ 69 ], "value": 12.75 } }, ] } } ] } } ] } ], }