Documentation
How to extract information from Invoice using SoceTonAI Script OCRΒΆ
In this guide, Iβll show how to use SoceTonAI Script OCR to automatically extract key information from a Invoice. We begin by collecting the API credentials from soceton.com, then create a YAML script that instructs the OCR engine to read the information we need (YAML is provided at the end of this document). Finally, we send a read request to api.soceton.com to retrieve the structured output.
YAML that I am using for this requestΒΆ
document_type: Receipt
description: "Extract key information from Receipt using OCR"
development: true
return_ocr_output: false
return_full_text: false
fields:
- name: invoice_no
label: "Invoice No"
find:
type: text
keywords:
- keyword: "Invoice"
index: 0
position_of_value: [1, -1, 5, 18]
words: 5
debug: false
returns:
- keywords
- words
- position
- name: date
label: "Date"
find:
type: text
keywords:
- keyword: "Date"
index: 0
next_keyword_position: [ 1, -1, 1, 3 ]
- keyword: ":"
position_of_value: [1, -1, 4, 10]
words: 10
debug: false
returns:
- keywords
- words
- position
- name: due
label: "Due"
find:
type: text
keywords:
- keyword: "Due"
index: 0
next_keyword_position: [ 1, -1, 1, 3 ]
- keyword: ":"
position_of_value: [1, -1, 3, 10]
words: 10
debug: false
returns:
- keywords
- words
- position
- name: payment_info
label: "Payment Info"
find:
type: text
keywords:
- keyword: "Payment"
index: 0
next_keyword_position: [ 1, -1, 1, 10 ]
- keyword: "Info"
position_of_value: [5, 0.5, -1, 10]
debug: false
returns:
- keywords
- words
- position
- name: bill_to
label: "Bill To"
find:
type: text
keywords:
- keyword: "Bill"
index: 0
next_keyword_position: [ 1, -1, 1, 10 ]
- keyword: "To"
position_of_value: [10, 0.5, -1, 15]
debug: false
returns:
- keywords
- words
- position
- name: purchases
label: "Purchase Table"
find:
type: table
row_orientation: horizontal
y_tolerance: 0.01
debug: false
headers:
- header:
- keyword: "#"
- header:
- keyword: "Description"
- header:
- keyword: "Qty"
- header:
- keyword: "Unit"
- keyword: "Price"
- keyword: "(USD)"
- header:
- keyword: "Amount"
- keyword: "(USD)"
returns:
- headers
- column_words
- name: summary
label: "Summary Table"
find:
type: table
row_orientation: vertical
y_tolerance: 0.01
debug: true
headers:
- header:
- keyword: "Subtotal"
- header:
- keyword: "Sales"
- keyword: "Tax"
- keyword: "(5%)"
- header:
- keyword: "Total"
returns:
- headers
- column_words
The imageΒΆ
InΒ [1]:
from PIL import Image
import json
img = Image.open("dummies/images/invoice-1_0.jpg")
img = img.convert("RGB")
img
Out[1]:
Sending the requestΒΆ
InΒ [2]:
import requests
from config import SOCETONAI_API_SECRET, SOCETONAI_API_KEY
def generate_result(url, image_path, rules_path, headers):
data = {}
files = {
"doc": open(image_path, "rb"),
"rules": open(rules_path, "r", encoding="utf-8")
}
response = requests.post(url, data=data, headers=headers, files=files)
return response
result = generate_result(
"https://api.soceton.com/script-ocr/read",
"dummies/images/invoice-1_0.jpg",
"dummies/ymls/invoice-1_0.yml", {
"X-API-KEY": SOCETONAI_API_KEY,
"X-API-SECRET": SOCETONAI_API_SECRET
})
result = result.json()
values = {}
for k in result["result"].keys():
try:
values[k] = result["result"][k]["value"]
except Exception as e:
print(k, ":", e)
print(json.dumps(values, indent=4))
{
"invoice_no": "# INV - 2025-001",
"date": "2025-02-01",
"due": "2025-02-15",
"payment_info": "Account : 9876543210 Bank : Example Bank Terms : Net 14",
"bill_to": "Client Example Co. Attn : Jane Client 221 Demo Lane Sampletown , ST 12345",
"purchases": [
[
"1",
"2",
"3"
],
[
"Custom OCR integration ( one - time )",
"Monthly hosting & support ( Jan 2025 )",
"Training dataset labeling ( 200 images )"
],
[
"1",
"1",
"1"
],
[
"$ 1,500.00",
"$ 120.00",
"$ 350.00"
],
[
"$ 1,500.00",
"$ 120.00",
"$ 350.00"
]
],
"summary": [
[
"$ 1,970.00"
],
[
"$ 98.50"
],
[
"$ 2,068.50"
]
]
}
Annotating the result on the image (Optional)ΒΆ
Keywords are in green, value positions are in blue, and value words are in red.
InΒ [3]:
import random
import numpy as np
import cv2
w, h = img.size
img_copy = np.asarray(img).copy()
def annotate_value(key):
try:
thickness = 2
color = (0, 0, 255)
position = result["result"][key]["position"]
top, left, bottom, right = int(position["top"] * h), int(position["left"] * w), int(position["bottom"] * h), int(position["right"] * w)
cv2.rectangle(img_copy, (left, top), (right, bottom), color, thickness)
except KeyError:
pass
try:
thickness = 2
color = (0, 255, 0)
for keyword in result["result"][key]["keywords"]:
y1, x1, y2, x2 = int(keyword["y1"] * h), int(keyword["x1"] * w), int(keyword["y2"] * h), int(keyword["x2"] * w)
cv2.rectangle(img_copy, (x1, y1), (x2, y2), color, thickness)
except KeyError:
pass
try:
thickness = 2
color = (255, 0, 0)
for word in result["result"][key]["words"]:
y1, x1, y2, x2 = int(word["y1"] * h), int(word["x1"] * w), int(word["y2"] * h), int(word["x2"] * w)
cv2.rectangle(img_copy, (x1, y1), (x2, y2), color, thickness)
except KeyError:
pass
try:
thickness = 2
color = (0, 0, random.choice([50, 100, 150, 200, 250]))
for word in result["result"][key]["headers"]:
y1, x1, y2, x2 = int(word["y1"] * h), int(word["x1"] * w), int(word["y2"] * h), int(word["x2"] * w)
cv2.rectangle(img_copy, (x1, y1), (x2, y2), color, thickness)
thickness = 2
for words in result["result"][key]["column_words"]:
for word in words:
y1, x1, y2, x2 = int(word["y1"] * h), int(word["x1"] * w), int(word["y2"] * h), int(word["x2"] * w)
cv2.rectangle(img_copy, (x1, y1), (x2, y2), color, thickness)
except KeyError:
pass
for k in result["result"].keys():
annotate_value(k)
Image.fromarray(img_copy)
Out[3]:
Printing the valuesΒΆ
InΒ [4]:
print(json.dumps(result, indent=4))
{
"success": true,
"result": {
"invoice_no": {
"value": "# INV - 2025-001",
"keywords": [
{
"page_idx": 0,
"block_idx": 11,
"line_idx": 0,
"word_idx": 0,
"value": "Invoice",
"confidence": 0.9682112336158752,
"x1": 0.7731397459165155,
"y1": 0.0572894399315947,
"x2": 0.822746521476104,
"y2": 0.0645575032064985
}
],
"words": [
{
"page_idx": 0,
"block_idx": 11,
"line_idx": 0,
"word_idx": 1,
"value": "#",
"confidence": 0.9795902967453004,
"x1": 0.8269812462189957,
"y1": 0.0572894399315947,
"x2": 0.8342407743496673,
"y2": 0.0645575032064985
},
{
"page_idx": 0,
"block_idx": 11,
"line_idx": 0,
"word_idx": 2,
"value": "INV",
"confidence": 0.9788992404937744,
"x1": 0.8348457350272233,
"y1": 0.0572894399315947,
"x2": 0.8584392014519057,
"y2": 0.0645575032064985
},
{
"page_idx": 0,
"block_idx": 11,
"line_idx": 0,
"word_idx": 3,
"value": "-",
"confidence": 0.9815400838851928,
"x1": 0.8572292800967937,
"y1": 0.0572894399315947,
"x2": 0.8626739261947973,
"y2": 0.0645575032064985
},
{
"page_idx": 0,
"block_idx": 11,
"line_idx": 0,
"word_idx": 4,
"value": "2025-001",
"confidence": 0.9851905107498168,
"x1": 0.8620689655172413,
"y1": 0.0572894399315947,
"x2": 0.9189352692075016,
"y2": 0.0645575032064985
}
],
"position": {
"top": 0.0500213766566909,
"left": 0.8085731570305074,
"bottom": 0.0718255664814023,
"right": 0.9503068014864747
}
},
"date": {
"value": "2025-02-01",
"keywords": [
{
"page_idx": 0,
"block_idx": 12,
"line_idx": 0,
"word_idx": 0,
"value": "Date",
"confidence": 0.9908229112625122,
"x1": 0.8112522686025408,
"y1": 0.0756733646857631,
"x2": 0.8463399879007865,
"y2": 0.0820863616930312
},
{
"page_idx": 0,
"block_idx": 12,
"line_idx": 0,
"word_idx": 1,
"value": ":",
"confidence": 0.9668490886688232,
"x1": 0.8112522686025408,
"y1": 0.0756733646857631,
"x2": 0.8463399879007865,
"y2": 0.0820863616930312
}
],
"words": [
{
"page_idx": 0,
"block_idx": 12,
"line_idx": 0,
"word_idx": 2,
"value": "2025-02-01",
"confidence": 0.9899516701698304,
"x1": 0.8499697519661222,
"y1": 0.0756733646857631,
"x2": 0.9189352692075016,
"y2": 0.0820863616930312
}
],
"position": {
"top": 0.06926036767849501,
"left": 0.8463399879007865,
"bottom": 0.08849935870029929,
"right": 0.9340592861464005
}
},
"due": {
"value": "2025-02-15",
"keywords": [
{
"page_idx": 0,
"block_idx": 13,
"line_idx": 0,
"word_idx": 0,
"value": "Due",
"confidence": 0.9670329689979552,
"x1": 0.8166969147005445,
"y1": 0.0927746900384779,
"x2": 0.8451300665456746,
"y2": 0.1004702864471996
},
{
"page_idx": 0,
"block_idx": 13,
"line_idx": 0,
"word_idx": 1,
"value": ":",
"confidence": 0.9569594860076904,
"x1": 0.8166969147005445,
"y1": 0.0927746900384779,
"x2": 0.8451300665456746,
"y2": 0.1004702864471996
}
],
"words": [
{
"page_idx": 0,
"block_idx": 13,
"line_idx": 0,
"word_idx": 2,
"value": "2025-02-15",
"confidence": 0.9872326850891112,
"x1": 0.8499697519661222,
"y1": 0.0927746900384779,
"x2": 0.9195402298850576,
"y2": 0.1000427533133817
}
],
"position": {
"top": 0.08507909362975619,
"left": 0.8451300665456746,
"bottom": 0.10816588285592131,
"right": 0.9399072393627748
}
},
"payment_info": {
"value": "Account : 9876543210 Bank : Example Bank Terms : Net 14",
"keywords": [
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 0,
"word_idx": 0,
"value": "Payment",
"confidence": 0.9898968935012816,
"x1": 0.6545674531155475,
"y1": 0.1470713980333476,
"x2": 0.7459165154264973,
"y2": 0.1573321932449765
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 0,
"word_idx": 1,
"value": "Info",
"confidence": 0.9904871582984924,
"x1": 0.6545674531155475,
"y1": 0.1470713980333476,
"x2": 0.7459165154264973,
"y2": 0.1573321932449765
}
],
"words": [
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 0,
"word_idx": 2,
"value": "Account",
"confidence": 0.9788854718208312,
"x1": 0.6533575317604355,
"y1": 0.162035057716973,
"x2": 0.705384150030248,
"y2": 0.1697306541256947
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 0,
"word_idx": 3,
"value": ":",
"confidence": 0.9569120407104492,
"x1": 0.705384150030248,
"y1": 0.162035057716973,
"x2": 0.7084089534180278,
"y2": 0.1693031209918768
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 0,
"word_idx": 4,
"value": "9876543210",
"confidence": 0.9912145733833312,
"x1": 0.7126436781609196,
"y1": 0.1611799914493373,
"x2": 0.7894736842105263,
"y2": 0.1693031209918768
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 0,
"value": "Bank",
"confidence": 0.9855659008026124,
"x1": 0.6551724137931034,
"y1": 0.1761436511329628,
"x2": 0.6866303690260133,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 1,
"value": ":",
"confidence": 0.9696856141090392,
"x1": 0.6866303690260133,
"y1": 0.1761436511329628,
"x2": 0.6896551724137931,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 2,
"value": "Example",
"confidence": 0.9906266331672668,
"x1": 0.6944948578342408,
"y1": 0.1761436511329628,
"x2": 0.7483363581367211,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 3,
"value": "Bank",
"confidence": 0.9926109313964844,
"x1": 0.7519661222020568,
"y1": 0.1761436511329628,
"x2": 0.7840290381125227,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 4,
"value": "Terms",
"confidence": 0.9857190251350404,
"x1": 0.6545674531155475,
"y1": 0.1898247114151346,
"x2": 0.6938898971566848,
"y2": 0.1966652415562206
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 5,
"value": ":",
"confidence": 0.9597041010856628,
"x1": 0.6944948578342408,
"y1": 0.1898247114151346,
"x2": 0.6975196612220206,
"y2": 0.1966652415562206
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 6,
"value": "Net",
"confidence": 0.9893885254859924,
"x1": 0.7023593466424682,
"y1": 0.1898247114151346,
"x2": 0.7247428917120388,
"y2": 0.1966652415562206
},
{
"page_idx": 0,
"block_idx": 14,
"line_idx": 1,
"word_idx": 7,
"value": "14",
"confidence": 0.9887345433235168,
"x1": 0.7283726557773744,
"y1": 0.1898247114151346,
"x2": 0.7422867513611615,
"y2": 0.1966652415562206
}
],
"position": {
"top": 0.15220179563916203,
"left": 0.6415175870711262,
"bottom": 0.20863616930312098,
"right": 0.8764151758707113
}
},
"bill_to": {
"value": "Client Example Co. Attn : Jane Client 221 Demo Lane Sampletown , ST 12345",
"keywords": [
{
"page_idx": 0,
"block_idx": 1,
"line_idx": 0,
"word_idx": 0,
"value": "Bill",
"confidence": 0.98428612947464,
"x1": 0.0925589836660617,
"y1": 0.1483539974348012,
"x2": 0.132486388384755,
"y2": 0.1551945275758871
},
{
"page_idx": 0,
"block_idx": 1,
"line_idx": 0,
"word_idx": 1,
"value": "To",
"confidence": 0.958657443523407,
"x1": 0.0925589836660617,
"y1": 0.1483539974348012,
"x2": 0.132486388384755,
"y2": 0.1551945275758871
}
],
"words": [
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 0,
"word_idx": 0,
"value": "Client",
"confidence": 0.9901826977729796,
"x1": 0.0913490623109497,
"y1": 0.1611799914493373,
"x2": 0.1282516636418632,
"y2": 0.1705857203933304
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 0,
"word_idx": 1,
"value": "Example",
"confidence": 0.9888450503349304,
"x1": 0.132486388384755,
"y1": 0.1611799914493373,
"x2": 0.1863278886872353,
"y2": 0.1710132535271483
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 0,
"word_idx": 2,
"value": "Co.",
"confidence": 0.9511209726333618,
"x1": 0.1899576527525711,
"y1": 0.1616075245831552,
"x2": 0.2105263157894736,
"y2": 0.1710132535271483
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 1,
"word_idx": 0,
"value": "Attn",
"confidence": 0.9912846088409424,
"x1": 0.0913490623109497,
"y1": 0.1761436511329628,
"x2": 0.1167574107683,
"y2": 0.1846943138093202
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 1,
"word_idx": 1,
"value": ":",
"confidence": 0.9837061762809752,
"x1": 0.1185722928009679,
"y1": 0.1761436511329628,
"x2": 0.1215970961887477,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 1,
"word_idx": 2,
"value": "Jane",
"confidence": 0.9929994344711304,
"x1": 0.1240169388989715,
"y1": 0.1761436511329628,
"x2": 0.1518451300665456,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 1,
"word_idx": 3,
"value": "Client",
"confidence": 0.989711344242096,
"x1": 0.1560798548094374,
"y1": 0.175288584865327,
"x2": 0.1929824561403508,
"y2": 0.1842667806755023
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 2,
"word_idx": 0,
"value": "221",
"confidence": 0.981726884841919,
"x1": 0.0913490623109497,
"y1": 0.1898247114151346,
"x2": 0.1131276467029643,
"y2": 0.1966652415562206
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 2,
"word_idx": 1,
"value": "Demo",
"confidence": 0.9927502870559692,
"x1": 0.1191772534785239,
"y1": 0.1898247114151346,
"x2": 0.1560798548094374,
"y2": 0.1966652415562206
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 2,
"word_idx": 2,
"value": "Lane",
"confidence": 0.9796392917633056,
"x1": 0.160919540229885,
"y1": 0.1898247114151346,
"x2": 0.190562613430127,
"y2": 0.1966652415562206
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 3,
"word_idx": 0,
"value": "Sampletown",
"confidence": 0.9854753017425536,
"x1": 0.0913490623109497,
"y1": 0.2022231722958529,
"x2": 0.1699939503932244,
"y2": 0.2120564343736639
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 3,
"word_idx": 1,
"value": ",",
"confidence": 0.9518262147903442,
"x1": 0.1699939503932244,
"y1": 0.2026507054296708,
"x2": 0.1736237144585602,
"y2": 0.2112013681060282
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 3,
"word_idx": 2,
"value": "ST",
"confidence": 0.9144322872161864,
"x1": 0.1772534785238959,
"y1": 0.2022231722958529,
"x2": 0.1929824561403508,
"y2": 0.2112013681060282
},
{
"page_idx": 0,
"block_idx": 2,
"line_idx": 3,
"word_idx": 3,
"value": "12345",
"confidence": 0.9824692010879515,
"x1": 0.1960072595281306,
"y1": 0.201795639162035,
"x2": 0.234119782214156,
"y2": 0.2112013681060282
}
],
"position": {
"top": 0.15177426250534415,
"left": 0.08257713248638839,
"bottom": 0.22359982898674585,
"right": 0.2822141560798548
}
},
"purchases": {
"columns": [
"#",
"Description",
"Qty",
"Unit Price ( USD )",
"Amount ( USD )"
],
"value": [
[
"1",
"2",
"3"
],
[
"Custom OCR integration ( one - time )",
"Monthly hosting & support ( Jan 2025 )",
"Training dataset labeling ( 200 images )"
],
[
"1",
"1",
"1"
],
[
"$ 1,500.00",
"$ 120.00",
"$ 350.00"
],
[
"$ 1,500.00",
"$ 120.00",
"$ 350.00"
]
],
"headers": [
{
"page_idx": 0,
"block_idx": 3,
"line_idx": 0,
"word_idx": 0,
"value": "#",
"confidence": 0.9605349898338318,
"x1": 0.0901391409558378,
"y1": 0.2556648140230868,
"x2": 0.0980036297640653,
"y2": 0.2620778110303549
},
{
"page_idx": 0,
"block_idx": 4,
"line_idx": 0,
"word_idx": 0,
"value": "Description",
"confidence": 0.9905518889427184,
"x1": 0.1578947368421052,
"y1": 0.254809747755451,
"x2": 0.234724742891712,
"y2": 0.264643009833262
},
{
"page_idx": 0,
"block_idx": 15,
"line_idx": 0,
"word_idx": 0,
"value": "Qty",
"confidence": 0.9542931914329528,
"x1": 0.5789473684210527,
"y1": 0.2556648140230868,
"x2": 0.603750756200847,
"y2": 0.264643009833262
},
{
"page_idx": 0,
"block_idx": 16,
"line_idx": 0,
"word_idx": 0,
"value": "Unit Price ( USD )",
"confidence": 0.9692346215248108,
"x1": 0.6793708408953418,
"y1": 0.2488242838820008,
"x2": 0.7453115547489413,
"y2": 0.2706284737067123
},
{
"page_idx": 0,
"block_idx": 17,
"line_idx": 0,
"word_idx": 0,
"value": "Amount ( USD )",
"confidence": 0.9799448549747467,
"x1": 0.8052026618269812,
"y1": 0.254809747755451,
"x2": 0.9007864488808228,
"y2": 0.2642154766994442
}
],
"column_words": [
[
{
"page_idx": 0,
"block_idx": 5,
"line_idx": 0,
"word_idx": 0,
"value": "1",
"confidence": 0.9813882112503052,
"x1": 0.0907441016333938,
"y1": 0.2907225309961522,
"x2": 0.0955837870538415,
"y2": 0.2971355280034202
},
{
"page_idx": 0,
"block_idx": 7,
"line_idx": 0,
"word_idx": 0,
"value": "2",
"confidence": 0.9823623299598694,
"x1": 0.0895341802782819,
"y1": 0.3185121846943138,
"x2": 0.0980036297640653,
"y2": 0.3249251817015818
},
{
"page_idx": 0,
"block_idx": 9,
"line_idx": 0,
"word_idx": 0,
"value": "3",
"confidence": 0.9767723083496094,
"x1": 0.0895341802782819,
"y1": 0.3467293715262933,
"x2": 0.0967937084089534,
"y2": 0.3527148353997434
}
],
[
{
"page_idx": 0,
"block_idx": 6,
"line_idx": 0,
"word_idx": 0,
"value": "Custom OCR integration ( one - time )",
"confidence": 0.9784572646021843,
"x1": 0.1566848154869933,
"y1": 0.2902949978623343,
"x2": 0.3805202661826981,
"y2": 0.2992731936725096
},
{
"page_idx": 0,
"block_idx": 8,
"line_idx": 0,
"word_idx": 0,
"value": "Monthly hosting & support ( Jan 2025 )",
"confidence": 0.9594863131642342,
"x1": 0.1572897761645493,
"y1": 0.3180846515604959,
"x2": 0.3950393224440411,
"y2": 0.3270628473706712
},
{
"page_idx": 0,
"block_idx": 10,
"line_idx": 0,
"word_idx": 0,
"value": "Training dataset labeling ( 200 images )",
"confidence": 0.9801343253680638,
"x1": 0.1572897761645493,
"y1": 0.3463018383924754,
"x2": 0.4010889292196007,
"y2": 0.3552800342026507
}
],
[
{
"page_idx": 0,
"block_idx": 18,
"line_idx": 0,
"word_idx": 0,
"value": "1",
"confidence": 0.9745468497276306,
"x1": 0.6485178463399879,
"y1": 0.2907225309961522,
"x2": 0.6539624924379915,
"y2": 0.2967079948696024
},
{
"page_idx": 0,
"block_idx": 21,
"line_idx": 0,
"word_idx": 0,
"value": "1",
"confidence": 0.984572410583496,
"x1": 0.647912885662432,
"y1": 0.3185121846943138,
"x2": 0.6527525710828797,
"y2": 0.3249251817015818
},
{
"page_idx": 0,
"block_idx": 24,
"line_idx": 0,
"word_idx": 0,
"value": "1",
"confidence": 0.9833016991615297,
"x1": 0.6485178463399879,
"y1": 0.3467293715262933,
"x2": 0.6539624924379915,
"y2": 0.3527148353997434
}
],
[
{
"page_idx": 0,
"block_idx": 19,
"line_idx": 0,
"word_idx": 0,
"value": "$ 1,500.00",
"confidence": 0.9830027222633362,
"x1": 0.720508166969147,
"y1": 0.2907225309961522,
"x2": 0.7816091954022989,
"y2": 0.2984181274048739
},
{
"page_idx": 0,
"block_idx": 22,
"line_idx": 0,
"word_idx": 0,
"value": "$ 120.00",
"confidence": 0.9846771657466888,
"x1": 0.7320024198427102,
"y1": 0.3185121846943138,
"x2": 0.7810042347247429,
"y2": 0.3249251817015818
},
{
"page_idx": 0,
"block_idx": 25,
"line_idx": 0,
"word_idx": 0,
"value": "$ 350.00",
"confidence": 0.9843766987323762,
"x1": 0.7320024198427102,
"y1": 0.3463018383924754,
"x2": 0.7810042347247429,
"y2": 0.3531423685335613
}
],
[
{
"page_idx": 0,
"block_idx": 20,
"line_idx": 0,
"word_idx": 0,
"value": "$ 1,500.00",
"confidence": 0.9842793941497803,
"x1": 0.8469449485783425,
"y1": 0.2898674647285164,
"x2": 0.9080459770114944,
"y2": 0.2984181274048739
},
{
"page_idx": 0,
"block_idx": 23,
"line_idx": 0,
"word_idx": 0,
"value": "$ 120.00",
"confidence": 0.9846080243587494,
"x1": 0.8584392014519057,
"y1": 0.3185121846943138,
"x2": 0.9080459770114944,
"y2": 0.3249251817015818
},
{
"page_idx": 0,
"block_idx": 26,
"line_idx": 0,
"word_idx": 0,
"value": "$ 350.00",
"confidence": 0.9847018420696259,
"x1": 0.8584392014519057,
"y1": 0.3467293715262933,
"x2": 0.9074410163339384,
"y2": 0.3535699016673792
}
]
]
},
"summary": {
"columns": [
"Subtotal",
"Sales Tax ( 5 % )",
"Total"
],
"value": [
[
"$ 1,970.00"
],
[
"$ 98.50"
],
[
"$ 2,068.50"
]
],
"headers": [
{
"page_idx": 0,
"block_idx": 27,
"line_idx": 0,
"word_idx": 0,
"value": "Subtotal",
"confidence": 0.9879099130630492,
"x1": 0.5837870538415003,
"y1": 0.3822146216331766,
"x2": 0.6406533575317604,
"y2": 0.3903377511757161
},
{
"page_idx": 0,
"block_idx": 28,
"line_idx": 0,
"word_idx": 0,
"value": "Sales Tax ( 5 % )",
"confidence": 0.9821668366591135,
"x1": 0.5837870538415003,
"y1": 0.410431808465156,
"x2": 0.6739261947973382,
"y2": 0.4194100042753313
},
{
"page_idx": 0,
"block_idx": 29,
"line_idx": 0,
"word_idx": 0,
"value": "Total",
"confidence": 0.989125907421112,
"x1": 0.5837870538415003,
"y1": 0.4399315946985891,
"x2": 0.617059891107078,
"y2": 0.4463445917058572
}
],
"column_words": [
[
{
"page_idx": 0,
"block_idx": 33,
"line_idx": 0,
"word_idx": 0,
"value": "$ 1,970.00",
"confidence": 0.9862955212593079,
"x1": 0.8457350272232305,
"y1": 0.3826421547669944,
"x2": 0.9062310949788264,
"y2": 0.3911928174433519
}
],
[
{
"page_idx": 0,
"block_idx": 34,
"line_idx": 0,
"word_idx": 0,
"value": "$ 98.50",
"confidence": 0.9797139167785645,
"x1": 0.8650937689050212,
"y1": 0.4117144078666097,
"x2": 0.9068360556563824,
"y2": 0.4181274048738777
}
],
[
{
"page_idx": 0,
"block_idx": 35,
"line_idx": 0,
"word_idx": 0,
"value": "$ 2,068.50",
"confidence": 0.9863838851451874,
"x1": 0.8451300665456746,
"y1": 0.4395040615647713,
"x2": 0.9068360556563824,
"y2": 0.4476271911073108
}
]
]
}
}
}