diff --git a/web/README.md b/web/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a15d65617414529f6108bd3ab81f88ac88455853 --- /dev/null +++ b/web/README.md @@ -0,0 +1,44 @@ +# SumProof web interface + +Next.js 15 + TypeScript + Tailwind CSS, deployable for free on Vercel as a static site. + +**App** (for everyday users) + +| Screen | What it does | +|---|---| +| Scan receipt (`/`) | Upload a photo (needs the live reader) or pick a sample; plain-language result, editable fields, live checks, save / flag / CSV | +| Receipt inbox (`/queue/`) | The 100 sample receipts with status, filters and CSV export | +| Filing search (`/search/`) | 150 FinanceBench questions: top evidence pages and a page viewer with highlights | + +**Under the hood** (for technical readers) + +| Screen | What it does | +|---|---| +| Model results (`/results/`) | Headline results, retrieval ladder, training curve, vector-store benchmark | +| Before vs after (`/receipts/`) | Each test receipt: fine-tuned vs before fine-tuning vs human label, and how the checker picked its reading | +| Compare search methods (`/compare/`) | The same question under BM25, dense, hybrid, routing and reranking, side by side | + +**Live reading.** The scan page calls the FastAPI reader (`python -m sumproof.api`, see `scripts/serve.sh`) when the site runs on localhost, or at `NEXT_PUBLIC_SUMPROOF_API` when that is set at build time. Without it, the page offers the samples only, so the public site never contacts a visitor's machine. + +The accounting checker runs in the browser (`src/lib/consistency.ts`), a port of the Python checker; `node scripts/parity.ts` confirms they agree on all 277 rule results of the test set. + +## Data + +`public/data/` is generated from the evaluation outputs, never edited by hand: + +```bash +python -m sumproof.export_web # from the repository root +``` + +## Run + +```bash +npm install +npm run dev # http://localhost:3000 +npm run build # static site in out/ +``` + +## Deploy on Vercel + +Import the GitHub repository, set **Root Directory** to `web`, keep the Next.js preset, and deploy. The site is fully static (`output: "export"`), so the free Hobby plan is enough. + diff --git a/web/public/data/receipts.json b/web/public/data/receipts.json new file mode 100644 index 0000000000000000000000000000000000000000..da1dc4c6436043e5ac57d615a7cb13c91cc74a77 --- /dev/null +++ b/web/public/data/receipts.json @@ -0,0 +1 @@ +[{"id": 0, "image": "receipts/0.webp", "pred": {"items": [{"name": "- TICKET CP", "qty": "2", "unit_price": "60.000", "amount": "60.000"}], "subtotal": "60.000", "tax": "5.455", "total": "60.000", "card": "60.000"}, "gold": {"items": [{"name": "-TICKET CP", "qty": "2", "amount": "60.000"}], "subtotal": "60.000", "discount": "-60.000", "tax": "5.455", "total": "60.000", "card": "60.000"}, "zeroshot": {"items": [{"name": "TICKET CP", "qty": "2", "unit_price": "60.000", "amount": "60.000"}], "subtotal": "60.000", "discount": "60.000", "service": "60.000", "tax": "5.455", "total": "60.000"}, "flagged": true, "exact": false, "checks": [{"name": "line_0", "passed": false, "expected": 120000.0, "found": 60000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 60000.0, "found": 60000.0}, {"name": "summary_total", "passed": true, "expected": 65455.0, "found": 60000.0}, {"name": "card_total", "passed": true, "expected": 60000.0, "found": 60000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.5, "logprob": -0.0556, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.1328, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0701, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.05, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0564, "chosen": true}]}, {"id": 1, "image": "receipts/1.webp", "pred": {"items": [{"name": "J.STB PROMO", "amount": "17500"}, {"name": "Y.B.BAT", "amount": "46000"}, {"name": "Y.BASO PROM", "amount": "27500"}], "total": "91000", "cash": "91000"}, "gold": {"items": [{"name": "J.STB PROMO", "amount": "17500"}, {"name": "Y.B.BAT", "amount": "46000"}, {"name": "Y.BASO PROM", "amount": "27500"}], "total": "91000", "cash": "91000"}, "zeroshot": {"items": [{"name": "J.STB PROMO", "qty": "1", "unit_price": "17500", "amount": "17500"}, {"name": "Y.B.BAT", "qty": "1", "unit_price": "46000", "amount": "46000"}, {"name": "Y.BASO PROM", "qty": "1", "unit_price": "27500", "amount": "27500"}], "subtotal": "91000", "total": "91000", "cash": "91000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 91000.0, "found": 91000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0019, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0019, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0019, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0019, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0019, "chosen": false}]}, {"id": 2, "image": "receipts/2.webp", "pred": {"items": [{"name": "JASMINE MT (L)", "qty": "1", "amount": "24,000"}, {"name": "COCONUT JELLY (L)", "amount": "4,000"}], "subtotal": "28,000", "total": "28,000", "cash": "100,000", "change": "72,000"}, "gold": {"items": [{"name": "JASMINE MT ( L )", "qty": "1", "amount": "24,000"}], "subtotal": "28,000", "total": "28,000", "cash": "100,000", "change": "72,000"}, "zeroshot": {"items": [{"name": "JASMINE MT (L)", "qty": "1", "unit_price": "24.000", "amount": "24.000"}, {"name": "COCONUT JELLY (L)", "qty": "1", "unit_price": "4.000", "amount": "4.000"}], "subtotal": "28.000", "total": "28.000", "cash": "100.000", "change": "72.000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 28000.0, "found": 28000.0}, {"name": "cash_change", "passed": true, "expected": 28000.0, "found": 28000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.5, "logprob": -0.0407, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.052, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.052, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0407, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0356, "chosen": true}]}, {"id": 3, "image": "receipts/3.webp", "pred": {"items": [{"name": "DONAT GULA", "qty": "1X", "unit_price": "@11000", "amount": "11,000"}], "subtotal": "11,000", "total": "11,000", "cash": "11,000"}, "gold": {"items": [{"name": "DONAT GULA", "qty": "1X", "unit_price": "@11000", "amount": "11,000"}], "subtotal": "11,000", "total": "11,000", "cash": "11,000"}, "zeroshot": {"items": [{"name": "DONAT GULA", "qty": "1", "unit_price": "11000", "amount": "11,000"}], "subtotal": "11,000", "total": "11,000", "cash": "11,000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 11000.0, "found": 11000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 11000.0, "found": 11000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0285, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0285, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}]}, {"id": 4, "image": "receipts/4.webp", "pred": {"items": [{"name": "ICE BLACKCOFFEE", "qty": "2", "amount": "82,000"}, {"name": "AVOCADO COFFEE", "qty": "1", "amount": "61,000"}, {"name": "CHIKEN KATSU FF", "qty": "1", "amount": "51,000"}], "subtotal": "194,000", "discount": "19,400", "total": "174,600", "cash": "200,000", "change": "25,400"}, "gold": {"items": [{"name": "ICE BLACKCOFFE", "qty": "2", "amount": "82,000"}, {"name": "AVOCADO COFFEE", "qty": "1", "amount": "61,000"}, {"name": "CHIKEN KATSU FF", "qty": "1", "amount": "51,000"}], "subtotal": "194,000", "discount": "19,400", "total": "174,600", "cash": "200,000", "change": "25,400"}, "zeroshot": {"items": [{"name": "ICE BLACKCOFFEE", "qty": "2", "unit_price": "82,000", "amount": "82,000"}, {"name": "AVOCADO COFFEE", "qty": "1", "unit_price": "61,000", "amount": "61,000"}, {"name": "CHIKEN KATSU FF", "qty": "1", "unit_price": "51,000", "amount": "51,000"}], "subtotal": "194,000", "discount": "19,400", "total": "174,600", "cash": "200,000", "change": "25,400"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 194000.0, "found": 194000.0}, {"name": "summary_total", "passed": true, "expected": 174600.0, "found": 174600.0}, {"name": "cash_change", "passed": true, "expected": 174600.0, "found": 174600.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0092, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0092, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0092, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0092, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0092, "chosen": false}]}, {"id": 5, "image": "receipts/5.webp", "pred": {"items": [{"name": "TRAD KY TOAST CARTE", "qty": "1.00", "amount": "28.182"}], "subtotal": "28.182", "tax": "2.818", "total": "31.000", "cash": "31.000"}, "gold": {"items": [{"name": "TRAD KY TOAST CARTE", "amount": "28.182"}], "subtotal": "28.182", "tax": "2.818", "total": "31.000", "cash": "31.000"}, "zeroshot": {"items": [{"name": "TRAD KY TOAST CARTE", "qty": "1.00", "unit_price": "28.182", "amount": "28.182"}], "subtotal": "28.182", "discount": "2.818", "service": "PB-1 10%", "total": "31.000", "cash": "31.000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 28182.0, "found": 28182.0}, {"name": "summary_total", "passed": true, "expected": 31000.0, "found": 31000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.014, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0154, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0154, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.014, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0154, "chosen": false}]}, {"id": 6, "image": "receipts/6.webp", "pred": {"items": [{"name": "EGG TART", "qty": "1", "amount": "13,000"}, {"name": "SHOCO CUS'ARD PASTRY", "qty": "2", "amount": "24,000"}, {"name": "REDBEAN BREAD", "qty": "1", "amount": "9,000"}], "total": "46,000", "cash": "50,000", "change": "4,000"}, "gold": {"items": [{"name": "EGG TART", "qty": "1", "amount": "13,000"}, {"name": "CHOCO CUS ARD PASTRY", "qty": "2", "amount": "24,000"}, {"name": "REDBEAN BREAD", "qty": "1", "amount": "9,000"}], "total": "46,000", "cash": "50,000", "change": "4,000"}, "zeroshot": {"items": [{"name": "EGG TART", "qty": "1", "unit_price": "13,000", "amount": "13,000"}, {"name": "SHOCO CUSTARD PASTRY", "qty": "2", "unit_price": "24,000", "amount": "24,000"}, {"name": "REDBEAN BREAD", "qty": "1", "unit_price": "9,000", "amount": "9,000"}], "subtotal": "46,000", "total": "46,000", "cash": "50,000", "change": "4,000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 46000.0, "found": 46000.0}, {"name": "cash_change", "passed": true, "expected": 46000.0, "found": 46000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0182, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0169, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0169, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0169, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0169, "chosen": false}]}, {"id": 7, "image": "receipts/7.webp", "pred": {"items": [{"name": "Kupon 15", "amount": "100,000"}, {"name": "ADD CHICKEN BOX", "amount": "909"}], "subtotal": "100,909", "tax": "10,091", "total": "111,000", "cash": "Rp. 111,000"}, "gold": {"items": [{"name": "Kupon 15", "amount": "100,000"}], "subtotal": "100,909", "tax": "10,091", "total": "111,000", "cash": "Rp. 111,000"}, "zeroshot": {"items": [{"name": "ADD CHICKEN BOX", "qty": "1", "unit_price": "909", "amount": "909"}], "subtotal": "100,909", "service": "PBI (10%)", "tax": "10,091", "total": "111,000", "cash": "Rp.111,000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 100909.0, "found": 100909.0}, {"name": "summary_total", "passed": true, "expected": 111000.0, "found": 111000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0216, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0216, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0216, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0216, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0598, "chosen": false}]}, {"id": 8, "image": "receipts/8.webp", "pred": {"items": [{"name": "[REG] BLACK SAKURA", "qty": "1", "amount": "45,455"}, {"name": "COOKIE DOH SAUCES", "qty": "1", "amount": "0"}, {"name": "NATA DE COCO", "qty": "1", "amount": "0"}], "subtotal": "45,455", "tax": "4,545", "total": "50,000", "card": "50,000"}, "gold": {"items": [{"name": "[REG] BLACK SAKURA", "qty": "1", "amount": "45,455"}], "subtotal": "45,455", "tax": "4,545", "total": "50,000", "card": "50,000"}, "zeroshot": {"items": [{"name": "[REG] BLACK SAKURA", "qty": "1", "unit_price": "45,455", "amount": "45,455"}, {"name": "COOKIE DOH SAUCES", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "NATA DE COCO", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "45,455", "discount": "4,545", "service": "0", "tax": "0", "total": "50,000", "card": "50,000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 45455.0, "found": 45455.0}, {"name": "summary_total", "passed": true, "expected": 50000.0, "found": 50000.0}, {"name": "card_total", "passed": true, "expected": 50000.0, "found": 50000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0053, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0053, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0275, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0053, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0053, "chosen": false}]}, {"id": 9, "image": "receipts/9.webp", "pred": {"items": [{"name": "Bumbu Kaldu Ayam", "qty": "1", "unit_price": "36000", "amount": "36000"}], "total": "36000", "cash": "50000", "change": "14000"}, "gold": {"items": [{"name": "Bumbu Kaldu Ayam 1", "unit_price": "36000", "amount": "36000"}], "subtotal": "36000", "cash": "50000", "change": "14000"}, "zeroshot": {"items": [{"name": "Bumbu Kaldu Ayam 1", "qty": "36000", "unit_price": "36000", "amount": "36000"}], "subtotal": "36000", "discount": "0%", "total": "50000", "cash": "50000", "change": "14000"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 36000.0, "found": 36000.0}, {"name": "items_sum_total", "passed": true, "expected": 36000.0, "found": 36000.0}, {"name": "cash_change", "passed": true, "expected": 36000.0, "found": 36000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0402, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0402, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0419, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0521, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0402, "chosen": false}]}, {"id": 10, "image": "receipts/10.webp", "pred": {"items": [{"name": "CINNAMON SUGAR", "qty": "1 x", "unit_price": "17,000", "amount": "17,000"}], "subtotal": "17,000", "total": "17,000", "cash": "20,000", "change": "3,000"}, "gold": {"items": [{"name": "CINNAMON SUGAR", "qty": "1 x", "unit_price": "17,000", "amount": "17,000"}], "subtotal": "17,000", "total": "17,000", "cash": "20,000", "change": "3,000"}, "zeroshot": {"items": [{"name": "CINNAMON SUGAR", "qty": "1", "unit_price": "17,000", "amount": "17,000"}], "subtotal": "17,000", "total": "17,000", "cash": "20,000", "change": "3,000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 17000.0, "found": 17000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 17000.0, "found": 17000.0}, {"name": "cash_change", "passed": true, "expected": 17000.0, "found": 17000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}]}, {"id": 11, "image": "receipts/11.webp", "pred": {"items": [{"name": "BANABERRY FRESH CREAM OAK", "qty": "1", "amount": "230,000"}], "total": "230,000", "cash": "230,000", "change": "0"}, "gold": {"items": [{"name": "BANABERRY FRESH CREAM CAK", "qty": "1", "amount": "230,000"}], "total": "230,000", "cash": "230,000", "change": "0"}, "zeroshot": {"items": [{"name": "BANABERRY FRESH CREAM OAK", "qty": "1", "unit_price": "230,000", "amount": "230,000"}], "subtotal": "230,000", "total": "230,000", "cash": "230,000", "change": "0"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 230000.0, "found": 230000.0}, {"name": "cash_change", "passed": true, "expected": 230000.0, "found": 230000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0039, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0039, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0039, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0039, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0039, "chosen": false}]}, {"id": 12, "image": "receipts/12.webp", "pred": {"items": [{"name": "BLUS WANITA", "qty": "1", "unit_price": "@120,000", "amount": "120,000"}, {"name": "SHOPPING BAG", "qty": "1", "unit_price": "@880", "amount": "0"}], "total": "120,000", "change": "0", "card": "120,000"}, "gold": {"items": [{"name": "BLUS WANITA", "qty": "1", "unit_price": "@120,000", "amount": "120,000"}, {"name": "SHOPPING BAG", "qty": "1", "unit_price": "@880", "amount": "0"}], "total": "120,000", "change": "0", "card": "120,000"}, "zeroshot": {"items": [{"name": "BLUS WANITA", "qty": "1", "unit_price": "120,000", "amount": "120,000"}, {"name": "SHOPPING BAG", "qty": "1", "unit_price": "880", "amount": "0"}], "subtotal": "120,000", "discount": "0%", "service": "0", "tax": "0", "total": "120,000", "cash": "0", "change": "0", "card": "120,000"}, "flagged": true, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 120000.0, "found": 120000.0}, {"name": "line_1", "passed": false, "expected": 880.0, "found": 0.0}, {"name": "items_sum_total", "passed": true, "expected": 120000.0, "found": 120000.0}, {"name": "card_total", "passed": true, "expected": 120000.0, "found": 120000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.75, "logprob": -0.0189, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0189, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0189, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0189, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0189, "chosen": false}]}, {"id": 13, "image": "receipts/13.webp", "pred": {"items": [{"name": "BASO KUAH", "qty": "1", "unit_price": "43.636", "amount": "43.636"}, {"name": "A.MINERAL GELAS", "qty": "1", "unit_price": "3.000", "amount": "3,000"}], "subtotal": "46.636", "tax": "4.664", "total": "51,300", "cash": "52,000", "change": "700"}, "gold": {"items": [{"name": "BASO KUAH", "qty": "1", "unit_price": "43.636", "amount": "43.636"}, {"name": "A.MINERAL GELAS", "qty": "1", "unit_price": "3,000", "amount": "3,000"}], "subtotal": "46.636", "tax": "4.664", "total": "51.300", "cash": "52.000", "change": "700"}, "zeroshot": {"items": [{"name": "BASO KUAH", "qty": "1", "unit_price": "43.636", "amount": "43.636"}, {"name": "A.MINERAL GELAS", "qty": "1", "unit_price": "3.000", "amount": "3.000"}], "subtotal": "46.636", "discount": "0.00", "service": "0.00", "tax": "4.66", "total": "51.300", "cash": "52.000", "change": "700"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 43636.0, "found": 43636.0}, {"name": "line_1", "passed": true, "expected": 3000.0, "found": 3000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 46636.0, "found": 46636.0}, {"name": "summary_total", "passed": true, "expected": 51300.0, "found": 51300.0}, {"name": "cash_change", "passed": true, "expected": 51300.0, "found": 51300.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.8, "logprob": -0.0367, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.8, "logprob": -0.0319, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0558, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0401, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0415, "chosen": false}]}, {"id": 14, "image": "receipts/14.webp", "pred": {"items": [{"name": "RedVelvet Cheese Slc", "qty": "1", "amount": "38,000"}, {"name": "Chicken Baked Rice", "qty": "1", "amount": "55,000"}, {"name": "Fish n Chips", "qty": "1", "amount": "65,000"}, {"name": "Mushroom Soup", "qty": "1", "amount": "35,000"}, {"name": "Chamomile", "qty": "1", "amount": "25,000"}, {"name": "Iced Tea", "qty": "1", "amount": "20,000"}], "subtotal": "238,000", "service": "17,850", "tax": "25,585", "total": "281,435", "cash": "200,000", "change": "18,565"}, "gold": {"items": [{"name": "RedVelvet Cheese Slc", "qty": "1", "amount": "38,000"}, {"name": "Chicken Baked Rice", "qty": "1", "amount": "55,000"}, {"name": "Fish n Chips", "qty": "1", "amount": "65,000"}, {"name": "Mushroom Soup", "qty": "1", "amount": "35,000"}, {"name": "Chamomile", "qty": "1", "amount": "25,000"}, {"name": "Iced Tea", "qty": "1", "amount": "20,000"}], "subtotal": "238,000", "service": "17,850", "tax": "25,585", "total": "281,435", "cash": "200,000", "change": "18,565"}, "zeroshot": {"items": [{"name": "RedVelvet Cheese Slic", "qty": "1", "unit_price": "38,000", "amount": "38,000"}, {"name": "Chicken Baked Rice", "qty": "1", "unit_price": "55,000", "amount": "55,000"}, {"name": "Fish n Chips", "qty": "1", "unit_price": "65,000", "amount": "65,000"}, {"name": "Mushroom Soup", "qty": "1", "unit_price": "35,000", "amount": "35,000"}, {"name": "Chamomile", "qty": "1", "unit_price": "25,000", "amount": "25,000"}, {"name": "Iced Tea", "qty": "1", "unit_price": "20,000", "amount": "20,000"}], "subtotal": "238,000", "discount": "100,000", "service": "17,850", "tax": "25,585", "total": "281,435", "cash": "200,000", "change": "18,565"}, "flagged": true, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 238000.0, "found": 238000.0}, {"name": "summary_total", "passed": true, "expected": 281435.0, "found": 281435.0}, {"name": "cash_change", "passed": false, "expected": 181435.0, "found": 281435.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0102, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0102, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0129, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0102, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0102, "chosen": false}]}, {"id": 15, "image": "receipts/15.webp", "pred": {"items": [{"name": "Lemon Tea (L)", "qty": "1", "amount": "25.000"}, {"name": "Caramel Small", "qty": "1", "amount": "38.000"}], "total": "63.000", "cash": "70.000", "change": "7.000"}, "gold": {"items": [{"name": "Lemon Tea (L)", "qty": "1", "amount": "25.000"}, {"name": "Caramel Small", "qty": "1", "amount": "38.000"}], "total": "63.000", "cash": "70.000", "change": "7.000"}, "zeroshot": {"items": [{"name": "Lemon Tea (L)", "qty": "1", "unit_price": "25.000", "amount": "25.000"}, {"name": "Caramel Small", "qty": "1", "unit_price": "38.000", "amount": "38.000"}], "subtotal": "63.000", "total": "63.000", "cash": "70.000", "change": "7.000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 63000.0, "found": 63000.0}, {"name": "cash_change", "passed": true, "expected": 63000.0, "found": 63000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}]}, {"id": 16, "image": "receipts/16.webp", "pred": {"items": [{"name": "[LG] BLACK SAKURA", "qty": "1", "amount": "59,091"}, {"name": "MINERAL WATER (bundling) 5k", "qty": "1", "amount": "4,545"}], "subtotal": "63,636", "tax": "6,364", "total": "70,000", "cash": "100,000", "change": "30,000"}, "gold": {"items": [{"name": "[LG] BLACK SAKURA", "qty": "1", "amount": "59,091"}, {"name": "IVINERAL WATER (bundling) 5k", "qty": "1", "amount": "4,545"}], "subtotal": "63,636", "tax": "6,364", "total": "70,000", "cash": "100,000", "change": "30,000"}, "zeroshot": {"items": [{"name": "[LG] BLACK SAKURA", "qty": "1", "unit_price": "59,091", "amount": "59,091"}, {"name": "LDNGAN", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "ROASTED ALMOND", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "MANGGO", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "MINERAL WATER (bundling) 5k", "qty": "1", "unit_price": "4,545", "amount": "4,545"}], "subtotal": "63,636", "discount": "6,364", "service": "0", "tax": "0", "total": "70,000", "cash": "100,000", "change": "30,000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 63636.0, "found": 63636.0}, {"name": "summary_total", "passed": true, "expected": 70000.0, "found": 70000.0}, {"name": "cash_change", "passed": true, "expected": 70000.0, "found": 70000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0157, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0157, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0222, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0157, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0157, "chosen": false}]}, {"id": 17, "image": "receipts/17.webp", "pred": {"items": [{"name": "Goblin's Mace", "qty": "1", "amount": "25,000"}, {"name": "Mozarella Hot Dog", "qty": "2", "amount": "38,000"}, {"name": "Chili Pepper Croquette", "qty": "1", "amount": "14,000"}, {"name": "Cheese Croquette", "qty": "1", "amount": "14,000"}, {"name": "Plastik Amook", "qty": "1", "amount": "0"}, {"name": "Plastik Putih Take Away", "qty": "1", "amount": "0"}], "subtotal": "91,000", "discount": "(0)", "total": "Rp. 91,000", "card": "91,000"}, "gold": {"items": [{"name": "Goblin's Mace", "qty": "1", "amount": "25,000"}, {"name": "Mozarella Hot Dog", "qty": "2", "amount": "38,000"}, {"name": "Chili Pepper Croquette", "qty": "1", "amount": "14,000"}, {"name": "Cheese Croquette", "qty": "1", "amount": "14,000"}, {"name": "Plastik Amook", "qty": "1", "amount": "0"}, {"name": "Plastik Putih Take Away", "qty": "1", "amount": "0"}], "subtotal": "91,000", "discount": "(0)", "total": "Rp. 91,000", "card": "91,000"}, "zeroshot": {"items": [{"name": "Goblin's Mace", "qty": "1", "unit_price": "25,000", "amount": "25,000"}, {"name": "Mozarella Hot Dog", "qty": "2", "unit_price": "38,000", "amount": "38,000"}, {"name": "Chili Pepper Croquette", "qty": "1", "unit_price": "14,000", "amount": "14,000"}, {"name": "Cheese Croquette", "qty": "1", "unit_price": "14,000", "amount": "14,000"}, {"name": "Plastik Amook", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "Plastik Puthi Take Away", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "91,000", "discount": "(0)", "total": "Rp. 91,000", "cash": "91,000", "card": "XXXXXXXXXXX"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 91000.0, "found": 91000.0}, {"name": "summary_total", "passed": true, "expected": 91000.0, "found": 91000.0}, {"name": "card_total", "passed": true, "expected": 91000.0, "found": 91000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0208, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0181, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0438, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0247, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0247, "chosen": false}]}, {"id": 18, "image": "receipts/18.webp", "pred": {"items": [{"name": "Propolis Cair", "qty": "1", "unit_price": "156000", "amount": "156000"}], "total": "156000", "cash": "156000", "change": "Rp. 0"}, "gold": {"items": [{"name": "Propolis Cair", "qty": "1", "unit_price": "156000", "amount": "156000"}], "total": "156000", "cash": "156000", "change": "Rp. 0"}, "zeroshot": {"items": [{"name": "Propolis Cair 1", "qty": "156000", "unit_price": "156000", "amount": "156000"}], "subtotal": "156000", "total": "156000", "cash": "156000", "change": "Rp. 0"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 156000.0, "found": 156000.0}, {"name": "items_sum_total", "passed": true, "expected": 156000.0, "found": 156000.0}, {"name": "cash_change", "passed": true, "expected": 156000.0, "found": 156000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0172, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0199, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0377, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0199, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0199, "chosen": false}]}, {"id": 19, "image": "receipts/19.webp", "pred": {"items": [{"name": "AMBUSH DBL CHS", "qty": "4", "amount": "60000"}, {"name": "AMBUSH CHS BUR", "qty": "10", "amount": "100000"}], "subtotal": "160000", "tax": "16000", "total": "176000"}, "gold": {"items": [{"name": "AMBUSH DBL CHS", "qty": "4", "amount": "60000"}, {"name": "AMBUSH CHS BUR", "qty": "10", "amount": "100000"}], "subtotal": "160000", "tax": "16000", "total": "176000"}, "zeroshot": {"items": [{"name": "4 ANBUSH DBL CHS", "qty": "4", "unit_price": "60000", "amount": "60000"}, {"name": "10 ANBUSH CHS BUR", "qty": "10", "unit_price": "100000", "amount": "100000"}], "subtotal": "160000", "tax": "16000", "total": "176000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 160000.0, "found": 160000.0}, {"name": "summary_total", "passed": true, "expected": 176000.0, "found": 176000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0173, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0654, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0372, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0173, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0173, "chosen": false}]}, {"id": 20, "image": "receipts/20.webp", "pred": {"items": [{"name": "cashew nuts chkn", "qty": "1", "amount": "64,500"}, {"name": "garlic pepper beef", "qty": "1", "amount": "79,500"}, {"name": "red curry beef", "qty": "1", "amount": "69,500"}, {"name": "phad thai", "qty": "1", "amount": "64,500"}, {"name": "steamed rice", "qty": "4", "amount": "47,600"}], "subtotal": "325,600", "service": "17,908", "tax": "34,351", "total": "377,859"}, "gold": {"items": [{"name": "cashew nuts chkn", "qty": "1", "amount": "64,500"}, {"name": "garlic pepper beef", "qty": "1", "amount": "79,500"}, {"name": "red curry beef", "qty": "1", "amount": "69,500"}, {"name": "phad thai", "qty": "1", "amount": "64,500"}, {"name": "steamed rice", "qty": "4", "amount": "47,600"}], "subtotal": "325,600", "service": "17,908", "tax": "34,351", "total": "377,859"}, "zeroshot": {"items": [{"name": "cashew nuts chkn", "qty": "1", "unit_price": "64,500", "amount": "64,500"}, {"name": "garlic pepper beef", "qty": "1", "unit_price": "79,500", "amount": "79,500"}, {"name": "red curry beef", "qty": "1", "unit_price": "69,500", "amount": "69,500"}, {"name": "phad thai", "qty": "1", "unit_price": "64,500", "amount": "64,500"}, {"name": "steamed rice", "qty": "4", "unit_price": "47,600", "amount": "47,600"}], "subtotal": "325,600", "service": "17,908", "tax": "34,351", "total": "377,859"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 325600.0, "found": 325600.0}, {"name": "summary_total", "passed": true, "expected": 377859.0, "found": 377859.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}]}, {"id": 21, "image": "receipts/21.webp", "pred": {"items": [{"name": "NASI GOR SFD TLR", "qty": "1", "unit_price": "35.000", "amount": "Rp 35.000"}, {"name": "ES TEH TAWAR", "qty": "1", "unit_price": "3.000", "amount": "Rp 3.000"}], "total": "Rp 38.000", "cash": "Rp 50.000", "change": "Rp 12.000"}, "gold": {"items": [{"name": "NASI GOR SFD TLR", "qty": "1", "unit_price": "35.000", "amount": "Rp 35.000"}, {"name": "ES TEH TAWAR", "qty": "1", "unit_price": "3.000", "amount": "Rp 3.000"}], "total": "Rp 38.000", "cash": "Rp 50.000", "change": "Rp 12.000"}, "zeroshot": {"items": [{"name": "NASI GOR SFD TLR", "qty": "1", "unit_price": "35.000", "amount": "Rp35.000"}, {"name": "ES TEH TAWAR", "qty": "1", "unit_price": "3.000", "amount": "Rp3.000"}], "subtotal": "Rp35.000", "total": "Rp38.000", "cash": "Rp50.000", "change": "Rp12.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 35000.0, "found": 35000.0}, {"name": "line_1", "passed": true, "expected": 3000.0, "found": 3000.0}, {"name": "items_sum_total", "passed": true, "expected": 38000.0, "found": 38000.0}, {"name": "cash_change", "passed": true, "expected": 38000.0, "found": 38000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0334, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0334, "chosen": false}]}, {"id": 22, "image": "receipts/22.webp", "pred": {"items": [{"name": "[MD] SOFT STEAMED CHEESEC", "qty": "2", "amount": "20,000"}, {"name": "[MD] SOFT STEAMED CHOCOCA", "qty": "2", "amount": "20,000"}], "total": "40,000", "cash": "100,000", "change": "60,000"}, "gold": {"items": [{"name": "[MD] SOFT STEAMED CHEESEC", "qty": "2", "amount": "20,000"}, {"name": "[MD] SOFT STEAMED CHOCOCA", "qty": "2", "amount": "20,000"}], "total": "40,000", "cash": "100,000", "change": "60,000"}, "zeroshot": {"items": [{"name": "SOFT STEAMED CHEESEC", "qty": "2", "unit_price": "20,000", "amount": "20,000"}, {"name": "SOFT STEAMED CHOCOCCA", "qty": "2", "unit_price": "20,000", "amount": "20,000"}], "subtotal": "40,000", "total": "40,000", "cash": "100,000", "change": "60,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "cash_change", "passed": true, "expected": 40000.0, "found": 40000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0108, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0108, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.025, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0108, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0108, "chosen": false}]}, {"id": 23, "image": "receipts/23.webp", "pred": {"items": [{"name": "TWIST DONUT", "qty": "6", "amount": "54,000"}, {"name": "REDBEAN BREAD", "qty": "1", "amount": "9,000"}], "total": "63,000", "cash": "70,000", "change": "7,000"}, "gold": {"items": [{"name": "TWIST DONUT", "qty": "6", "amount": "54,000"}, {"name": "REDBEAN BREAD", "qty": "1", "amount": "9,000"}], "total": "63,000", "cash": "70,000", "change": "7,000"}, "zeroshot": {"items": [{"name": "TWIST DONUT", "qty": "6", "unit_price": "54,000", "amount": "54,000"}, {"name": "REDBBEAN BREAD", "qty": "1", "unit_price": "9,000", "amount": "9,000"}], "subtotal": "63,000", "total": "63,000", "cash": "70,000", "change": "7,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 63000.0, "found": 63000.0}, {"name": "cash_change", "passed": true, "expected": 63000.0, "found": 63000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0095, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0095, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0095, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0095, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": false}]}, {"id": 24, "image": "receipts/24.webp", "pred": {"items": [{"name": "5001-Corn Flakes Cookies", "qty": "x1", "unit_price": "Rp.56.000", "amount": "Rp.56.000"}, {"name": "5003-Chokoreto Cookies", "qty": "x1", "unit_price": "Rp.62.000", "amount": "Rp.62.000"}, {"name": "6002-Plastic Bag Medium", "qty": "x1", "unit_price": "Rp.0", "amount": "Rp.0"}], "total": "Rp.118.000", "card": "118.000"}, "gold": {"items": [{"name": "5001-Corn Flakes Cookies", "qty": "x1", "unit_price": "Rp.56.000", "amount": "Rp.56.000"}, {"name": "5003-Chokoreto Cookies", "qty": "x1", "unit_price": "Rp.62.000", "amount": "Rp.62.000"}, {"name": "6002-Plastic Bag Medium", "qty": "x1", "unit_price": "Rp.0", "amount": "Rp.0"}], "total": "Rp.118.000", "card": "118.000"}, "zeroshot": {"items": [{"name": "5001-Corn Flakes Cookies", "qty": "x1", "unit_price": "Rp.56.000", "amount": "Rp.56.000"}, {"name": "5003-Chokoreto Cookies", "qty": "x1", "unit_price": "Rp.62.000", "amount": "Rp.62.000"}, {"name": "6002-Plastic Bag Medium", "qty": "x1", "unit_price": "Rp.0", "amount": "Rp.0"}], "subtotal": "Rp.118.000", "total": "Rp.118.000", "card": "118.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 56000.0, "found": 56000.0}, {"name": "line_1", "passed": true, "expected": 62000.0, "found": 62000.0}, {"name": "line_2", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "items_sum_total", "passed": true, "expected": 118000.0, "found": 118000.0}, {"name": "card_total", "passed": true, "expected": 118000.0, "found": 118000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0116, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0116, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0348, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0307, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0399, "chosen": false}]}, {"id": 25, "image": "receipts/25.webp", "pred": {"items": [{"name": "TWIST STRAWBERRY DONUT", "qty": "1", "amount": "10,000"}, {"name": "TLJ CROQUETTE", "qty": "1", "amount": "17,000"}, {"name": "POTATO PEPPER BAGEL", "qty": "1", "amount": "16,000"}], "total": "43,000", "cash": "50,000", "change": "7,000"}, "gold": {"items": [{"name": "TWIST STRAWBERRY DONUT", "qty": "1", "amount": "10,000"}, {"name": "TLJ CROQUETTE", "qty": "1", "amount": "17,000"}, {"name": "POTATO PEPPER BAGEL", "qty": "1", "amount": "16,000"}], "total": "43,000", "cash": "50,000", "change": "7,000"}, "zeroshot": {"items": [{"name": "TWIST STRAWBERRY DONUT", "qty": "1", "unit_price": "10,000", "amount": "10,000"}, {"name": "TLJ CROQUETTE", "qty": "1", "unit_price": "17,000", "amount": "17,000"}, {"name": "POTATO PEPPER BAGEL", "qty": "1", "unit_price": "16,000", "amount": "16,000"}], "subtotal": "43,000", "total": "43,000", "cash": "50,000", "change": "7,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 43000.0, "found": 43000.0}, {"name": "cash_change", "passed": true, "expected": 43000.0, "found": 43000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0011, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0011, "chosen": false}]}, {"id": 26, "image": "receipts/26.webp", "pred": {"items": [{"name": "Cap Cay", "qty": "1", "unit_price": "65.000", "amount": "65.000"}, {"name": "Minuman", "qty": "2", "unit_price": "4.000", "amount": "8.000"}, {"name": "Lain-lain", "qty": "1", "unit_price": "65.000", "amount": "65.000"}], "subtotal": "Rp 138.000", "total": "Rp 138.000", "cash": "Rp 138.000", "change": "Rp 0"}, "gold": {"items": [{"name": "Nasi Cap Cay Porsi B esar", "qty": "1", "unit_price": "65.000", "amount": "65.000"}, {"name": "Teh Tawar", "qty": "2", "unit_price": "4.000"}, {"name": "Fu Yung Hai", "qty": "1", "unit_price": "65.000", "amount": "65.000"}], "subtotal": "Rp 138.000", "total": "Rp 138.000", "cash": "Rp 138.000", "change": "Rp 0"}, "zeroshot": {"items": [{"name": "Nasi Cap Cay Porsi Besar", "qty": "1", "unit_price": "65.000", "amount": "65.000"}, {"name": "Teh Tawar", "qty": "2", "unit_price": "4.000", "amount": "8.000"}, {"name": "Fu Yung Hai", "qty": "1", "unit_price": "65.000", "amount": "65.000"}], "subtotal": "Rp 138.000", "total": "Rp 138.000", "cash": "Rp 138.000", "change": "Rp 0"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 65000.0, "found": 65000.0}, {"name": "line_1", "passed": true, "expected": 8000.0, "found": 8000.0}, {"name": "line_2", "passed": true, "expected": 65000.0, "found": 65000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 138000.0, "found": 138000.0}, {"name": "cash_change", "passed": true, "expected": 138000.0, "found": 138000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.009, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.009, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.009, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.009, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.009, "chosen": false}]}, {"id": 27, "image": "receipts/27.webp", "pred": {"items": [{"name": "PKT AYAM", "amount": "33,000"}, {"name": "GULAI OTAK", "amount": "23,000"}], "subtotal": "56,000", "tax": "5,600", "total": "61,600", "card": "61,600"}, "gold": {"items": [{"name": "PKT AYAM", "amount": "33,000"}, {"name": "GULAI OTAK", "amount": "23,000"}], "subtotal": "56,000", "tax": "5,600", "total": "61,600", "cash": "61,600"}, "zeroshot": {"items": [{"name": "PKT AYAM", "qty": "1", "unit_price": "33,000", "amount": "33,000"}, {"name": "GULAI OTAK", "qty": "1", "unit_price": "23,000", "amount": "23,000"}], "subtotal": "56,000", "tax": "5,600", "total": "61,600"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 56000.0, "found": 56000.0}, {"name": "summary_total", "passed": true, "expected": 61600.0, "found": 61600.0}, {"name": "card_total", "passed": true, "expected": 61600.0, "found": 61600.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0186, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": false}]}, {"id": 28, "image": "receipts/28.webp", "pred": {"items": [{"name": "SAMGYOPSAL", "qty": "2", "amount": "194,000"}, {"name": "SUL LUNG TANG", "qty": "1", "amount": "75,000"}, {"name": "MAKOLI", "qty": "1", "amount": "100,000"}], "subtotal": "369,000", "discount": "0", "service": "18,450", "tax": "38,745", "total": "426,195"}, "gold": {"items": [{"name": "SAMGYOPSAL", "qty": "2", "amount": "194,000"}, {"name": "SUL LUNG TANG", "qty": "1", "amount": "75,000"}, {"name": "MAKOLI", "qty": "1", "amount": "100,000"}], "subtotal": "369,000", "discount": "0", "service": "18,450", "tax": "38,745", "total": "426,195"}, "zeroshot": {"items": [{"name": "SAMGYOPSAL", "qty": "2", "unit_price": "194,000", "amount": "194,000"}, {"name": "SUL LUNG TANG", "qty": "1", "unit_price": "75,000", "amount": "75,000"}, {"name": "MAKOLI", "qty": "1", "unit_price": "100,000", "amount": "100,000"}], "subtotal": "369,000", "discount": "0", "service": "18,450", "tax": "38,745", "total": "426,195"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 369000.0, "found": 369000.0}, {"name": "summary_total", "passed": true, "expected": 426195.0, "found": 426195.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0035, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0035, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0035, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0035, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0035, "chosen": false}]}, {"id": 29, "image": "receipts/29.webp", "pred": {"items": [{"name": "COLD OCHA", "qty": "1", "amount": "10,909"}, {"name": "BCA PROMO", "qty": "1", "amount": "54,455"}, {"name": "SKEWERED SHUMAI", "qty": "1", "amount": "12,727"}, {"name": "SKEWERED TOFU ROLL", "qty": "1", "amount": "12,727"}, {"name": "EBI TEMPURA", "qty": "1", "amount": "13,636"}, {"name": "KITSUNE UDON (KIDS)", "qty": "1", "amount": "28,182"}], "subtotal": "132,636", "tax": "13,264", "total": "145,900", "card": "[145,900]"}, "gold": {"items": [{"name": "COLD OCHA", "qty": "1", "amount": "10,909"}, {"name": "BCA PROMO", "qty": "1", "amount": "54,455"}, {"name": "SKEWERED SHUMAI", "qty": "1", "amount": "12,727"}, {"name": "SKEWERED TOFU ROLL", "qty": "1", "amount": "12,727"}, {"name": "EBI TEMPURA", "qty": "1", "amount": "13,636"}, {"name": "KITSUNE UDON (KIDS)", "qty": "1", "amount": "28,182"}], "subtotal": "132,636", "tax": "13,264", "total": "145,900", "card": "[145,900]"}, "zeroshot": {"items": [{"name": "COLD OCHA", "qty": "1", "unit_price": "10,909", "amount": "10,909"}, {"name": "BCA PROMO", "qty": "1", "unit_price": "54,455", "amount": "54,455"}, {"name": ":-ABURA UDON SPICY", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": ":-KAKE UDON", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "SKEWERED SHUMAI", "qty": "1", "unit_price": "12,727", "amount": "12,727"}, {"name": "SKEWERED TOFU ROLL", "qty": "1", "unit_price": "12,727", "amount": "12,727"}, {"name": "EBI TEMPURA", "qty": "1", "unit_price": "13,636", "amount": "13,636"}, {"name": "KITSUNE UDON (KIDS)", "qty": "1", "unit_price": "28,182", "amount": "28,182"}], "subtotal": "132,636", "discount": "54,455", "service": "13,264", "total": "145,900", "card": "145,900"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 132636.0, "found": 132636.0}, {"name": "summary_total", "passed": true, "expected": 145900.0, "found": 145900.0}, {"name": "card_total", "passed": true, "expected": 145900.0, "found": 145900.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0132, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0136, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0136, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0136, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0132, "chosen": false}]}, {"id": 30, "image": "receipts/30.webp", "pred": {"items": [{"name": "Kupon 3", "amount": "28,636"}], "subtotal": "28,636", "tax": "2,864", "total": "31,500", "cash": "50,000", "change": "18,500"}, "gold": {"items": [{"name": "Kupon 3", "amount": "28,636"}], "subtotal": "28,636", "tax": "2,864", "total": "31,500", "cash": "50,000", "change": "18,500"}, "zeroshot": {"items": [], "subtotal": "28,636", "tax": "2,864", "total": "31,500", "cash": "50,000", "change": "18,500"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 28636.0, "found": 28636.0}, {"name": "summary_total", "passed": true, "expected": 31500.0, "found": 31500.0}, {"name": "cash_change", "passed": true, "expected": 31500.0, "found": 31500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}]}, {"id": 31, "image": "receipts/31.webp", "pred": {"items": [{"name": "SALMON PESTO", "qty": "1", "amount": "85,500"}, {"name": "SALMON PESTO", "qty": "1", "amount": "85,500"}], "subtotal": "85,500", "service": "10,260", "tax": "18,126", "total": "113,886"}, "gold": {"items": [{"name": "SALMON PESTO", "qty": "1", "amount": "85,500"}, {"name": "SALMON PESTO", "qty": "1", "amount": "85,500"}], "subtotal": "85,500", "service": "10,260", "tax": "18,126", "total": "113,886"}, "zeroshot": {"items": [{"name": "SALMON PESTO", "qty": "1", "unit_price": "85,500", "amount": "85,500"}, {"name": "SALMON PESTO", "qty": "1", "unit_price": "85,500", "amount": "85,500"}], "subtotal": "85,500", "discount": "85,500", "service": "10,260", "tax": "18,126", "total": "113,886"}, "flagged": true, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": false, "expected": 171000.0, "found": 85500.0}, {"name": "summary_total", "passed": true, "expected": 113886.0, "found": 113886.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.5, "logprob": -0.0045, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0045, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0045, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0045, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0045, "chosen": false}]}, {"id": 32, "image": "receipts/32.webp", "pred": {"items": [{"name": "THAI ICED GREEN TEA", "qty": "1", "unit_price": "@24.000", "amount": "24.000"}], "subtotal": "24.000", "total": "24.000", "cash": "50.000", "change": "26.000"}, "gold": {"items": [{"name": "THAI ICED GREEN TEA", "qty": "1", "unit_price": "@24.000", "amount": "24.000"}], "subtotal": "24.000", "total": "24.000", "cash": "50.000", "change": "26.000"}, "zeroshot": {"items": [{"name": "THAI ICED GREEN TEA", "qty": "1", "unit_price": "@24.000", "amount": "24.000"}], "subtotal": "24.000", "total": "24.000", "cash": "50.000", "change": "26.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 24000.0, "found": 24000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 24000.0, "found": 24000.0}, {"name": "cash_change", "passed": true, "expected": 24000.0, "found": 24000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0063, "chosen": false}]}, {"id": 33, "image": "receipts/33.webp", "pred": {"items": [{"name": "GRILLED BABY POTATO (R", "qty": "1", "amount": "50,500"}, {"name": "HOT TUNA", "qty": "1", "amount": "67,000"}, {"name": "HOT TUNA", "qty": "1", "amount": "67,000"}], "subtotal": "117,500", "service": "11,070", "tax": "19,557", "total": "148,127"}, "gold": {"items": [{"name": "GRILLED BABY POTATO (R", "qty": "1", "amount": "50,500"}, {"name": "HOT TUNA", "qty": "1", "amount": "67,000"}, {"name": "HOT TUNA", "qty": "1", "amount": "67,000"}], "subtotal": "117,500", "service": "11,070", "tax": "19,557", "total": "148,127"}, "zeroshot": {"items": [{"name": "GRILLED BABY POTATO (R", "qty": "1", "unit_price": "50,500", "amount": "50,500"}, {"name": "HOT TUNA", "qty": "1", "unit_price": "67,000", "amount": "67,000"}, {"name": "HOT TUNA", "qty": "1", "unit_price": "67,000", "amount": "67,000"}], "subtotal": "117,500", "discount": "-67,000", "service": "11,070", "tax": "19,557", "total": "148,127"}, "flagged": true, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": false, "expected": 184500.0, "found": 117500.0}, {"name": "summary_total", "passed": true, "expected": 148127.0, "found": 148127.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.5, "logprob": -0.0056, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0056, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0056, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0056, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0056, "chosen": false}]}, {"id": 34, "image": "receipts/34.webp", "pred": {"items": [{"name": "Ash Chick Sambal Matah", "qty": "5", "amount": "75,000"}, {"name": "Jamur Goreng", "qty": "2", "amount": "10,000"}], "subtotal": "85,000", "tax": "8,500", "total": "93,500", "cash": "100,000", "change": "6,500"}, "gold": {"items": [{"name": "Ash Chick Sambal Matah", "qty": "5", "amount": "75.000"}, {"name": "Jamur Goreng", "qty": "2", "amount": "10.000"}], "subtotal": "85.000", "tax": "8.500", "total": "93.500", "cash": "100.000", "change": "6.500"}, "zeroshot": {"items": [{"name": "Ash Chick Sambal Matah", "qty": "5", "unit_price": "75.000", "amount": "75.000"}, {"name": "Jamur Goreng", "qty": "2", "unit_price": "10.000", "amount": "10.000"}], "subtotal": "85.000", "tax": "8.500", "total": "93.500", "cash": "100.000", "change": "6.500"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 85000.0, "found": 85000.0}, {"name": "summary_total", "passed": true, "expected": 93500.0, "found": 93500.0}, {"name": "cash_change", "passed": true, "expected": 93500.0, "found": 93500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0119, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0312, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0119, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.022, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0119, "chosen": false}]}, {"id": 35, "image": "receipts/35.webp", "pred": {"items": [{"name": "TWIST DONUT", "qty": "2", "amount": "18,000"}, {"name": "BANANA DONUT", "qty": "1", "amount": "11,000"}, {"name": "CREAMCHEESE BREAD", "qty": "1", "amount": "13,000"}, {"name": "FRANKFRUT SAUSAGE ROLL", "qty": "1", "amount": "12,000"}], "total": "54,000", "cash": "104,000", "change": "50,000"}, "gold": {"items": [{"name": "TWIST DONUT", "qty": "2", "amount": "18,000"}, {"name": "BANANA DONUT", "qty": "1", "amount": "11,000"}, {"name": "CREAMCHEESE BREAD", "qty": "1", "amount": "13,000"}, {"name": "FRANKFRUT SAUSAGE ROLL", "qty": "1", "amount": "12,000"}], "total": "54,000", "cash": "104,000", "change": "50,000"}, "zeroshot": {"items": [{"name": "TWIST DONUT", "qty": "2", "unit_price": "18,000", "amount": "18,000"}, {"name": "BANANA DONUT", "qty": "1", "unit_price": "11,000", "amount": "11,000"}, {"name": "CREAMCHEESE BREAD", "qty": "1", "unit_price": "13,000", "amount": "13,000"}, {"name": "FRANKFRUT SAUSAGE ROLL", "qty": "1", "unit_price": "12,000", "amount": "12,000"}], "subtotal": "54,000", "total": "54,000", "cash": "104,000", "change": "50,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 54000.0, "found": 54000.0}, {"name": "cash_change", "passed": true, "expected": 54000.0, "found": 54000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0026, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0026, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0026, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0026, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0026, "chosen": false}]}, {"id": 36, "image": "receipts/36.webp", "pred": {"items": [{"name": "XXL Crispy Chicken", "qty": "1", "amount": "40,000"}], "subtotal": "40,000", "total": "40,000", "cash": "100,000", "change": "60,000"}, "gold": {"items": [{"name": "XXL Crispy Chicken", "qty": "1", "amount": "40,000"}], "subtotal": "40,000", "total": "40,000", "cash": "100,000", "change": "60,000"}, "zeroshot": {"items": [{"name": "XXL Crispy Chicken", "qty": "1", "unit_price": "40,000", "amount": "40,000"}, {"name": "- Sedang", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "40,000", "total": "40,000", "cash": "100,000", "change": "60,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "cash_change", "passed": true, "expected": 40000.0, "found": 40000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0175, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0557, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0175, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.1262, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0175, "chosen": false}]}, {"id": 37, "image": "receipts/37.webp", "pred": {"items": [{"name": "Popcorn Salt (S)", "qty": "1", "amount": "20.000"}], "total": "20.000", "cash": "50.000", "change": "30.000"}, "gold": {"items": [{"name": "Popcorn Salt (S)", "qty": "1", "amount": "20.000"}], "cash": "50.000", "change": "30.000"}, "zeroshot": {"items": [{"name": "Popcorn Salt (S)", "qty": "1", "unit_price": "20.000", "amount": "20.000"}], "total": "20.000", "cash": "50.000", "change": "30.000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 20000.0, "found": 20000.0}, {"name": "cash_change", "passed": true, "expected": 20000.0, "found": 20000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0082, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0082, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0082, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0082, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0476, "chosen": false}]}, {"id": 38, "image": "receipts/38.webp", "pred": {"items": [{"name": "XLB Org Pork 10x", "qty": "1", "amount": "78,000"}, {"name": "Sicito Babi", "qty": "1", "amount": "65,000"}, {"name": "Hotplate Tahu", "qty": "1", "amount": "58,000"}, {"name": "DF Fish Fillet Garlic", "qty": "1", "amount": "108,000"}, {"name": "LM Pork Belly", "qty": "1", "amount": "88,000"}, {"name": "Siew Mai", "qty": "1", "amount": "38,800"}, {"name": "Kwan Yin Cup", "qty": "5", "amount": "50,000"}, {"name": "Herbal Jelly", "qty": "1", "amount": "38,000"}, {"name": "Onde-Onde", "qty": "1", "amount": "38,000"}], "subtotal": "561,800", "service": "42,135", "tax": "60,394", "total": "664,329"}, "gold": {"items": [{"name": "XLB Org Pork 10x", "qty": "1", "amount": "78,000"}, {"name": "Sicito Babi", "qty": "1", "amount": "65,000"}, {"name": "Hotplate Tahu", "qty": "1", "amount": "58,000"}, {"name": "DF Fish Fillet Garlc", "qty": "1", "amount": "108,000"}, {"name": "LM Pork Belly", "qty": "1", "amount": "88,000"}, {"name": "Siew Mai", "qty": "1", "amount": "38,800"}, {"name": "Kwan Yin Cup", "qty": "5", "amount": "50,000"}, {"name": "Herbal Jelly", "qty": "1", "amount": "38,000"}, {"name": "Onde-Onde", "qty": "1", "amount": "38,000"}], "subtotal": "561,800", "service": "42,135", "tax": "60,394", "total": "664,329"}, "zeroshot": {"items": [{"name": "XLB Org Pork 10x", "qty": "1", "unit_price": "78,000", "amount": "78,000"}, {"name": "Sicito Babi", "qty": "1", "unit_price": "65,000", "amount": "65,000"}, {"name": "Hotplate Tahu", "qty": "1", "unit_price": "58,000", "amount": "58,000"}, {"name": "DF Fish Fillet Garlic", "qty": "1", "unit_price": "108,000", "amount": "108,000"}, {"name": "LM Pork Belly", "qty": "1", "unit_price": "88,000", "amount": "88,000"}, {"name": "Siew Mai", "qty": "1", "unit_price": "38,800", "amount": "38,800"}, {"name": "Kwan Yin Cup", "qty": "5", "unit_price": "50,000", "amount": "50,000"}, {"name": "Herbal Jelly", "qty": "1", "unit_price": "38,000", "amount": "38,000"}, {"name": "Onde-Onde", "qty": "1", "unit_price": "38,000", "amount": "38,000"}], "subtotal": "561,800", "service": "42,135", "tax": "60,394", "total": "664,329"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 561800.0, "found": 561800.0}, {"name": "summary_total", "passed": true, "expected": 664329.0, "found": 664329.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0046, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0046, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0046, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0046, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0046, "chosen": false}]}, {"id": 39, "image": "receipts/39.webp", "pred": {"items": [{"name": "HPL754DR LUNCH BOX 3P SET W/RED BAG & SPOON.", "qty": "8 PCS", "unit_price": "243,000", "amount": "1,944,000"}, {"name": "HPL500 RICE CASE 7L W/CUP", "qty": "5 PCS", "unit_price": "195,000", "amount": "975,000"}, {"name": "HPL754BB LUNCH BOX 3P SET W/BLACK BAG & SP", "qty": "4 PCS", "unit_price": "243,000", "amount": "972,000"}], "card": "3,112,800"}, "gold": {"items": [{"name": "LUNCH BOX 3P SET W/RED BAG & SP00 N.", "qty": "8", "unit_price": "243,000", "amount": "1,555,200"}, {"name": "RICE CASE 7L W/CUP", "qty": "5", "unit_price": "195,000", "amount": "780,000"}, {"name": "LUNCH BOX 3P SET W/BLACK BAG & SP OON", "qty": "4", "unit_price": "243,000", "amount": "777,600"}], "card": "3,112,800"}, "zeroshot": {"items": [{"name": "HPL754DR LUNCH BOX 3P SET W/RED BAG & SPOON", "qty": "8 PCS", "unit_price": "243,000", "amount": "1,944,000"}, {"name": "HPL500 RICE CASE 7L W/CUP", "qty": "5 PCS", "unit_price": "195,000", "amount": "975,000"}, {"name": "HPL754RB LUNCH BOX 3P SET W/BLACK BAG & SPOON", "qty": "4 PCS", "unit_price": "243,000", "amount": "972,000"}], "subtotal": "3,991,000", "discount": "798,200", "total": "3,112,800", "card": "3,112,800"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 1944000.0, "found": 1944000.0}, {"name": "line_1", "passed": true, "expected": 975000.0, "found": 975000.0}, {"name": "line_2", "passed": true, "expected": 972000.0, "found": 972000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.8, "logprob": -0.0339, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0423, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0446, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.8, "logprob": -0.0294, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.8, "logprob": -0.0398, "chosen": false}]}, {"id": 40, "image": "receipts/40.webp", "pred": {"items": [{"name": "Shack Lestari All", "qty": "2", "unit_price": "27,000", "amount": "54,000"}, {"name": "Bakery Aneka Sisir banana,Pizza,yoko,Mar mer,Baging,abon,keju,cokelat,dll", "qty": "2", "unit_price": "7,000", "amount": "14,000"}], "total": "68,000", "cash": "100,000", "change": "32,000"}, "gold": {"items": [{"name": "Snack Lestari All", "qty": "2", "unit_price": "27,000", "amount": "54,000"}, {"name": "Bakery Aneka Sisir Banana,Pizza,yoko,Mar mer,Daging,abon,keju,cokelat,dll", "qty": "2", "unit_price": "7,000", "amount": "14,000"}], "total": "68,000", "cash": "100,000", "change": "32,000"}, "zeroshot": {"items": [{"name": "Shack Lestari All", "qty": "2", "unit_price": "27,000", "amount": "54,000"}, {"name": "Bakery Aneka Sisir banana,Pizza,yoko,Mar mer,Baging,abon,keju,cokelat,dll", "qty": "2", "unit_price": "7,000", "amount": "14,000"}], "subtotal": "68,000", "total": "68,000", "cash": "100,000", "change": "32,000"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 54000.0, "found": 54000.0}, {"name": "line_1", "passed": true, "expected": 14000.0, "found": 14000.0}, {"name": "items_sum_total", "passed": true, "expected": 68000.0, "found": 68000.0}, {"name": "cash_change", "passed": true, "expected": 68000.0, "found": 68000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0339, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0487, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0473, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.056, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0615, "chosen": false}]}, {"id": 41, "image": "receipts/41.webp", "pred": {"items": [{"name": "Chicken Maryland", "amount": "47619.00"}, {"name": "Cappucino (Hot/Iced)", "amount": "30303.00"}, {"name": "Naga Lychee Juice", "amount": "34632.00"}, {"name": "Cafe Latte", "amount": "30303.00"}, {"name": "Hot Chocolate Marshmallo", "amount": "30303.00"}, {"name": "Chicken Cesar Salad", "amount": "43290.00"}, {"name": "Mineral Water", "amount": "12987.00"}, {"name": "Mineral Water", "amount": "12987.00"}, {"name": "Lychee/Peach/Lemon/Mango", "amount": "25974.00"}, {"name": "Chicken Maryland", "amount": "47619.00"}], "subtotal": "316017.00", "service": "48982.68", "total": "365000.00"}, "gold": {"items": [{"name": "Chicken Maryland", "amount": "47619.00"}, {"name": "Cappucino (Hot/Iced)", "amount": "30303.00"}, {"name": "Naga Lychee Juice", "amount": "34632.00"}, {"name": "Cafe Latte", "amount": "30303.00"}, {"name": "Hot Chocolate Marshmallo", "amount": "30303.00"}, {"name": "Chicken Cesar Salad", "amount": "43290.00"}, {"name": "Mineral Water", "amount": "12987.00"}, {"name": "Mineral Water", "amount": "12987.00"}, {"name": "Lychee/Peach/Lemon/Mango", "amount": "25974.00"}, {"name": "Chicken Maryland", "amount": "47619.00"}], "subtotal": "316017.00", "service": "48982.68", "total": "365000.00"}, "zeroshot": {"items": [{"name": "Chicken Maryland", "qty": "1", "unit_price": "47619.00", "amount": "47619.00"}, {"name": "Cappuccino (Hot/Iced)", "qty": "1", "unit_price": "30303.00", "amount": "30303.00"}, {"name": "Naga Lychee Juice", "qty": "1", "unit_price": "34632.00", "amount": "34632.00"}, {"name": "Cafe Latte", "qty": "1", "unit_price": "30303.00", "amount": "30303.00"}, {"name": "Hot Chocolate Marshmallo", "qty": "1", "unit_price": "30303.00", "amount": "30303.00"}, {"name": "Chicken Cesar Salad", "qty": "1", "unit_price": "43290.00", "amount": "43290.00"}, {"name": "Mineral Water", "qty": "1", "unit_price": "12987.00", "amount": "12987.00"}, {"name": "Mineral Water", "qty": "1", "unit_price": "12987.00", "amount": "12987.00"}, {"name": "Lychee/Peach/Lemon/Mango", "qty": "1", "unit_price": "25974.00", "amount": "25974.00"}, {"name": "Chicken Maryland", "qty": "1", "unit_price": "47619.00", "amount": "47619.00"}], "subtotal": "316017.00", "service": "48982.68", "total": "365000.00"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 316017.0, "found": 316017.0}, {"name": "summary_total", "passed": true, "expected": 364999.68, "found": 365000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0176, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}]}, {"id": 42, "image": "receipts/42.webp", "pred": {"items": [{"name": "Chicken HCC, 1Pcs", "qty": "1", "amount": "15,000"}], "subtotal": "15,000", "tax": "1,500", "total": "16,500", "cash": "50,000", "change": "33,500"}, "gold": {"items": [{"name": "Chicken HCC. 1Pcs", "qty": "1", "amount": "15.000"}], "subtotal": "15,000", "tax": "1,500", "total": "16,500", "cash": "50,000", "change": "33,500"}, "zeroshot": {"items": [{"name": "Chicken HCC, 1Pcs", "qty": "1", "unit_price": "15.000", "amount": "15.000"}], "subtotal": "15,000", "service": "1.500", "tax": "10 %", "total": "16,500", "cash": "50,000", "change": "33,500"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 15000.0, "found": 15000.0}, {"name": "summary_total", "passed": true, "expected": 16500.0, "found": 16500.0}, {"name": "cash_change", "passed": true, "expected": 16500.0, "found": 16500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0711, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": false}]}, {"id": 43, "image": "receipts/43.webp", "pred": {"items": [{"name": "Cheese Tart", "qty": "6", "amount": "165000.00"}], "subtotal": "Rp 165000.00", "tax": "Rp 15000.00", "total": "Rp 165000.00", "cash": "Rp 200000.00", "change": "Rp 35000.00"}, "gold": {"items": [{"name": "Cheese Tart", "qty": "6", "amount": "165000.00"}], "subtotal": "Rp 165000.00", "tax": "Rp 15000.00", "total": "Rp 165000.00", "cash": "Rp 200000.00", "change": "Rp 35000.00"}, "zeroshot": {"items": [{"name": "6 Pcs Cheese Tart", "qty": "1", "unit_price": "165000.00", "amount": "165000.00"}], "subtotal": "Rp165000.00", "tax": "Rp15000.00", "total": "Rp165000.00", "cash": "Rp200000.00", "change": "Rp35000.00"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 165000.0, "found": 165000.0}, {"name": "summary_total", "passed": true, "expected": 180000.0, "found": 165000.0}, {"name": "cash_change", "passed": true, "expected": 165000.0, "found": 165000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}]}, {"id": 44, "image": "receipts/44.webp", "pred": {"items": [{"name": "Combo 1", "qty": "1", "amount": "30.000"}], "total": "30.000", "cash": "50.000", "change": "20.000"}, "gold": {"items": [{"name": "Combo 1", "qty": "1", "amount": "30.000"}], "total": "30.000", "cash": "50.000", "change": "20.000"}, "zeroshot": {"items": [{"name": "Combo 1", "qty": "1", "unit_price": "30.000", "amount": "30.000"}], "subtotal": "30.000", "total": "30.000", "cash": "50.000", "change": "20.000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 30000.0, "found": 30000.0}, {"name": "cash_change", "passed": true, "expected": 30000.0, "found": 30000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0734, "chosen": false}]}, {"id": 45, "image": "receipts/45.webp", "pred": {"items": [{"name": "Lemon Tea (L).", "qty": "1", "amount": "25.000"}, {"name": "Mike & Ike Original", "qty": "1", "amount": "28.000"}, {"name": "Mike & Berry", "qty": "1", "amount": "28.000"}, {"name": "Roti Keju Manis.", "qty": "1", "amount": "7.000"}], "total": "88.000", "cash": "88.000", "change": "0"}, "gold": {"items": [{"name": "Lemon Tea (L).", "qty": "1", "amount": "25.000"}, {"name": "Mike & Ike Original", "qty": "1", "amount": "28.000"}, {"name": "Mike & Berry", "qty": "1", "amount": "28.000"}, {"name": "Roti Keju Manis.", "qty": "1", "amount": "7.000"}], "total": "88,000", "cash": "88.000", "change": "0"}, "zeroshot": {"items": [{"name": "Lemon Tea (L).", "qty": "1", "unit_price": "25.000", "amount": "25.000"}, {"name": "Mike & Ike Original", "qty": "1", "unit_price": "28.000", "amount": "28.000"}, {"name": "Mike & Berry", "qty": "1", "unit_price": "28.000", "amount": "28.000"}, {"name": "Roti Keju Manis.", "qty": "1", "unit_price": "7.000", "amount": "7.000"}], "subtotal": "88.000", "total": "88.000", "cash": "88.000", "change": "0"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 88000.0, "found": 88000.0}, {"name": "cash_change", "passed": true, "expected": 88000.0, "found": 88000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0034, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0034, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0034, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0034, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0034, "chosen": false}]}, {"id": 46, "image": "receipts/46.webp", "pred": {"items": [{"name": "S-Bubble Milk Tea", "qty": "1X", "unit_price": "@20,000", "amount": "20,000"}, {"name": "S-Caramel Milk Tea", "qty": "1X", "unit_price": "@20,000", "amount": "20,000"}], "total": "40,000", "cash": "40,000", "change": "0"}, "gold": {"items": [{"name": "S-Bubble Milk Tea", "qty": "1X", "unit_price": "@20,000", "amount": "20,000"}, {"name": "S-Caramel Milk Tea", "qty": "1X", "unit_price": "@20,000", "amount": "20,000"}], "total": "40,000", "cash": "40,000", "change": "0"}, "zeroshot": {"items": [{"name": "1X S-Bubble Milk Tea 100%", "qty": "1", "unit_price": "20,000", "amount": "20,000"}, {"name": "1X S-Caramel Milk Tea 100%", "qty": "1", "unit_price": "20,000", "amount": "20,000"}], "subtotal": "40,000", "total": "40,000", "cash": "40,000", "change": "0"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 20000.0, "found": 20000.0}, {"name": "line_1", "passed": true, "expected": 20000.0, "found": 20000.0}, {"name": "items_sum_total", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "cash_change", "passed": true, "expected": 40000.0, "found": 40000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}]}, {"id": 47, "image": "receipts/47.webp", "pred": {"items": [{"name": "COPIA 1 /GB", "qty": "1", "unit_price": "45,000.00", "amount": "45,000.00"}, {"name": "PLASTIC BAG RED CENTRAL SI", "qty": "1", "unit_price": "0.00", "amount": "0.00"}, {"name": "COPIA 1 /GB", "qty": "1", "unit_price": "18,000.00", "amount": "18,000.00"}], "discount": "0.00", "total": "63,000.00", "card": "63,000.00"}, "gold": {"items": [{"name": "COPIA 1 /GB", "qty": "1", "unit_price": "45,000.00", "amount": "45,000.00"}, {"name": "PLASTIC BAG RED CENTRAL SI", "qty": "1", "unit_price": "0.00", "amount": "0.00"}, {"name": "COPIA 1 /GB", "qty": "1", "unit_price": "18,000.00", "amount": "18,000.00"}], "discount": "0.00", "total": "63,000.00", "card": "63,000.00"}, "zeroshot": {"items": [{"name": "COPIA 1 /GB", "qty": "1", "unit_price": "45,000.00", "amount": "45,000.00"}, {"name": "PLASTIC BAG RED CENTRAL SI", "qty": "1", "unit_price": "0.00", "amount": "0.00"}, {"name": "COPIA 1 /GB", "qty": "1", "unit_price": "18,000.00", "amount": "18,000.00"}], "subtotal": "63,000.00", "discount": "0.00", "total": "63,000.00", "card": "63,000.00"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 45000.0, "found": 45000.0}, {"name": "line_1", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "line_2", "passed": true, "expected": 18000.0, "found": 18000.0}, {"name": "card_total", "passed": true, "expected": 63000.0, "found": 63000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.011, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0088, "chosen": true}]}, {"id": 48, "image": "receipts/48.webp", "pred": {"items": [{"name": "S-Hazelnut KOI Cafe", "qty": "1X", "unit_price": "@25,000", "amount": "25,000"}], "subtotal": "22,728", "tax": "2,272", "total": "25,000", "cash": "100,000", "change": "75,000"}, "gold": {"items": [{"name": "S-Hazelnut KOI Cafe", "qty": "1X", "unit_price": "@25,000", "amount": "25,000"}], "subtotal": "22,728", "tax": "2,272", "total": "25,000", "cash": "100,000", "change": "75,000"}, "zeroshot": {"items": [{"name": "S-Hazelnut KOI Cafe", "qty": "1X", "unit_price": "@25,000", "amount": "25,000"}], "subtotal": "22,728", "discount": "2,272", "service": "Less Ice", "total": "25,000", "cash": "100,000", "change": "75,000"}, "flagged": true, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 25000.0, "found": 25000.0}, {"name": "items_sum_subtotal", "passed": false, "expected": 25000.0, "found": 22728.0}, {"name": "summary_total", "passed": true, "expected": 25000.0, "found": 25000.0}, {"name": "cash_change", "passed": true, "expected": 25000.0, "found": 25000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.75, "logprob": -0.0168, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0271, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0264, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0264, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0168, "chosen": false}]}, {"id": 49, "image": "receipts/49.webp", "pred": {"items": [{"name": "Ptgs Eggtart", "qty": "1", "amount": "12,000"}, {"name": "Choco Melt", "qty": "1", "amount": "11,000"}], "subtotal": "23,000", "total": "23,000", "cash": "50,000", "change": "27,000"}, "gold": {"items": [{"name": "Ptgs Eggtart", "qty": "1", "amount": "12,000"}, {"name": "Choco Melt", "qty": "1", "amount": "11,000"}], "subtotal": "23,000", "total": "23,000", "cash": "50,000", "change": "27,000"}, "zeroshot": {"items": [{"name": "1 Ptgs Eggtart", "qty": "1", "unit_price": "12,000", "amount": "12,000"}, {"name": "1 Choco Melt", "qty": "1", "unit_price": "11,000", "amount": "11,000"}], "subtotal": "23,000", "total": "23,000", "cash": "50,000", "change": "27,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 23000.0, "found": 23000.0}, {"name": "cash_change", "passed": true, "expected": 23000.0, "found": 23000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0141, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0141, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0419, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0534, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0422, "chosen": false}]}, {"id": 50, "image": "receipts/50.webp", "pred": {"items": [{"name": "SpecPrice Caudburry", "qty": "1", "amount": "17,727"}], "subtotal": "17,727", "tax": "1,773", "total": "19,500", "cash": "100,000", "change": "80,500"}, "gold": {"items": [{"name": "Superice Cauburry", "qty": "1", "amount": "17,727"}], "subtotal": "17,727", "tax": "1,773", "total": "19,500", "cash": "100,000", "change": "80,500"}, "zeroshot": {"items": [{"name": "Spice Caliburry", "qty": "1", "unit_price": "17,727", "amount": "17,727"}], "subtotal": "17,727", "tax": "1,773", "total": "19,500", "cash": "100,000", "change": "80,500"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 17727.0, "found": 17727.0}, {"name": "summary_total", "passed": true, "expected": 19500.0, "found": 19500.0}, {"name": "cash_change", "passed": true, "expected": 19500.0, "found": 19500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0689, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.1556, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0915, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.1176, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0689, "chosen": false}]}, {"id": 51, "image": "receipts/51.webp", "pred": {"items": [{"name": "(TA) NASI GORENG TERI MEDAN", "qty": "4", "amount": "165,460"}, {"name": "(TA) BIHUN GORENG SEAFOOD", "qty": "1", "amount": "40,456"}, {"name": "(TA) KWETIAW SEAFOOD SIRAM", "qty": "1", "amount": "42,274"}, {"name": "(TA) NASI GORENG", "qty": "2", "amount": "55,456"}], "subtotal": "303,646", "tax": "30,365", "total": "334,000", "card": "334,000"}, "gold": {"items": [{"name": "(TA) NASI GRG TERI MEDAN", "qty": "4", "amount": "165,460"}, {"name": "(TA) BIHUN GORENG SEAFOOD", "qty": "1", "amount": "40,456"}, {"name": "(TA) KWETIAW SEAFOOD SIRAM", "qty": "1", "amount": "42,274"}, {"name": "(TA) NASI GORENG", "qty": "2", "amount": "55,456"}], "subtotal": "303,646", "tax": "30,365", "total": "334,000", "card": "334,000"}, "zeroshot": {"items": [{"name": "NASI GORENG TERI MEDAN", "qty": "4", "unit_price": "165,460", "amount": "165,460"}, {"name": "BIHUN GORENG SEAFOOD SIRAM", "qty": "1", "unit_price": "40,456", "amount": "40,456"}, {"name": "KWETIAW SEAFOOD SIRAM", "qty": "1", "unit_price": "42,274", "amount": "42,274"}, {"name": "NASI GORENG", "qty": "2", "unit_price": "55,456", "amount": "55,456"}], "subtotal": "303,646", "tax": "30,365", "total": "334,000", "card": "334,000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 303646.0, "found": 303646.0}, {"name": "summary_total", "passed": true, "expected": 334011.0, "found": 334000.0}, {"name": "card_total", "passed": true, "expected": 334000.0, "found": 334000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0112, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0345, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0299, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0112, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0112, "chosen": false}]}, {"id": 52, "image": "receipts/52.webp", "pred": {"items": [{"name": "THAI ICED TEA", "qty": "1", "unit_price": "@20.000", "amount": "20.000"}, {"name": "THAI ICED TEA", "qty": "1", "unit_price": "@20.000", "amount": "20.000"}], "subtotal": "40.000", "total": "40.000", "cash": "100.000", "change": "60.000"}, "gold": {"items": [{"name": "THAI ICED TEA", "qty": "1", "unit_price": "@20.000", "amount": "20.000"}, {"name": "THAI ICED TEA", "qty": "1", "unit_price": "@20.000", "amount": "20.000"}], "subtotal": "40.000", "total": "40.000", "cash": "100.000", "change": "60.000"}, "zeroshot": {"items": [{"name": "THAI ICED TEA", "qty": "1", "unit_price": "@20.000", "amount": "20.000"}, {"name": "THAI ICED TEA", "qty": "1", "unit_price": "@20.000", "amount": "20.000"}], "subtotal": "40.000", "total": "40.000", "cash": "100.000", "change": "60.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 20000.0, "found": 20000.0}, {"name": "line_1", "passed": true, "expected": 20000.0, "found": 20000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "cash_change", "passed": true, "expected": 40000.0, "found": 40000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}]}, {"id": 53, "image": "receipts/53.webp", "pred": {"items": [{"name": "Pecel Komplit + Nasi", "qty": "1", "amount": "42.000"}, {"name": "SOTO KUDUS", "qty": "1", "amount": "47.000"}, {"name": "Mineral Water", "qty": "2", "amount": "18.000"}], "subtotal": "107.000", "service": "5.350", "tax": "11.235", "total": "123.585"}, "gold": {"items": [{"name": "Pecel Komplit + Nasi", "qty": "1", "amount": "42.000"}, {"name": "SOTO KUDUS", "qty": "1", "amount": "47.000"}, {"name": "Mineral Water", "qty": "2", "amount": "18.000"}], "subtotal": "107.000", "service": "5.350", "tax": "11.235", "total": "123.585"}, "zeroshot": {"items": [{"name": "Pecel Komplit + Nasi", "qty": "1", "unit_price": "42.000", "amount": "42.000"}, {"name": "SOTO KUDUS", "qty": "1", "unit_price": "47.000", "amount": "47.000"}, {"name": "Mineral Water", "qty": "2", "unit_price": "18.000", "amount": "18.000"}], "subtotal": "107.000", "service": "5.350", "tax": "11.235", "total": "123.585"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 107000.0, "found": 107000.0}, {"name": "summary_total", "passed": true, "expected": 123585.0, "found": 123585.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0079, "chosen": false}]}, {"id": 54, "image": "receipts/54.webp", "pred": {"items": [{"name": "KACANG MERAH", "amount": "10,000"}], "subtotal": "10,000", "total": "10,000", "cash": "10,000"}, "gold": {"items": [{"name": "KACANG MERAH", "amount": "10,000"}], "subtotal": "10,000", "total": "10,000", "cash": "10,000"}, "zeroshot": {"items": [{"name": "KACANG MERAH", "qty": "1", "unit_price": "10,000", "amount": "10,000"}], "subtotal": "10,000", "total": "10,000", "cash": "10,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 10000.0, "found": 10000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0016, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0016, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0016, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0016, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0016, "chosen": false}]}, {"id": 55, "image": "receipts/55.webp", "pred": {"items": [{"name": "APPLE CINNAMON PASTRY", "qty": "1", "amount": "22,000"}, {"name": "ROYAL CHEESE TART", "qty": "2", "amount": "32,000"}], "total": "54,000", "card": "54,000"}, "gold": {"items": [{"name": "APPLE CINNAMON PASTRY", "qty": "1", "amount": "22,000"}, {"name": "ROYAL CHEESE TART", "qty": "2", "amount": "32,000"}], "total": "54,000", "card": "54,000"}, "zeroshot": {"items": [{"name": "APPLE CINNAMON PASTRY", "qty": "1", "unit_price": "22,000", "amount": "22,000"}, {"name": "ROYAL CHEESE TART", "qty": "2", "unit_price": "32,000", "amount": "32,000"}], "subtotal": "54,000", "total": "54,000", "card": "54,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 54000.0, "found": 54000.0}, {"name": "card_total", "passed": true, "expected": 54000.0, "found": 54000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0029, "chosen": false}]}, {"id": 56, "image": "receipts/56.webp", "pred": {"items": [{"name": "AIR MINERAL", "amount": "8,181"}], "subtotal": "8,181", "tax": "818", "total": "8,999", "cash": "10,000", "change": "1,001"}, "gold": {"items": [{"name": "AIR MINERAL", "amount": "8,181"}], "subtotal": "8,181", "tax": "818", "total": "8,999", "cash": "10,000", "change": "1,001"}, "zeroshot": {"items": [{"name": "AIR MINERAL", "qty": "1", "unit_price": "8,181", "amount": "8,181"}], "subtotal": "8,181", "tax": "818", "total": "8,999", "cash": "10,000", "change": "1,001"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 8181.0, "found": 8181.0}, {"name": "summary_total", "passed": true, "expected": 8999.0, "found": 8999.0}, {"name": "cash_change", "passed": true, "expected": 8999.0, "found": 8999.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0048, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0048, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0048, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0048, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0048, "chosen": false}]}, {"id": 57, "image": "receipts/57.webp", "pred": {"items": [{"name": "ICED TT", "amount": "20,000"}, {"name": "ICED GT", "amount": "22,000"}], "cash": "42,000"}, "gold": {"items": [{"name": "ICED TT", "amount": "20,000"}, {"name": "ICED GT", "amount": "22,000"}], "cash": "42,000"}, "zeroshot": {"items": [{"name": "ICED TT", "qty": "1", "unit_price": "20,000", "amount": "20,000"}, {"name": "ICED GT", "qty": "1", "unit_price": "22,000", "amount": "22,000"}], "subtotal": "42,000", "cash": "42,000", "change": "0"}, "flagged": false, "exact": true, "checks": [], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0094, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0094, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0094, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0094, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0094, "chosen": false}]}, {"id": 58, "image": "receipts/58.webp", "pred": {"items": [{"name": "PHO BO TAI", "qty": "1", "amount": "55,000"}], "subtotal": "55,000", "tax": "5,500", "total": "60,500", "cash": "100,000", "change": "39,500"}, "gold": {"items": [{"name": "PHO BO TAI", "qty": "1", "amount": "55,000"}], "subtotal": "55,000", "tax": "5,500", "total": "60,500", "cash": "100,000", "change": "39,500"}, "zeroshot": {"items": [{"name": "PHO BO TAI", "qty": "1", "unit_price": "55,000", "amount": "55,000"}], "subtotal": "55,000", "discount": "5,500", "service": "40,500", "tax": "100,000", "total": "100,000", "cash": "100,000", "change": "39,500"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 55000.0, "found": 55000.0}, {"name": "summary_total", "passed": true, "expected": 60500.0, "found": 60500.0}, {"name": "cash_change", "passed": true, "expected": 60500.0, "found": 60500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0054, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0054, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0054, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0054, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0054, "chosen": false}]}, {"id": 59, "image": "receipts/59.webp", "pred": {"items": [{"name": "Tahu Isi", "qty": "2", "amount": "78,000"}, {"name": "Tea", "qty": "5", "amount": "30,000"}, {"name": "Kepiting 7-8.4ons - Chilly 0.7", "qty": "1", "amount": "297,490"}, {"name": "Udang Telur Asin - Regular", "qty": "1", "amount": "47,500"}, {"name": "Kailan 2 Rasa", "qty": "1", "amount": "45,000"}, {"name": "Mantau - 2 pcs", "qty": "1", "amount": "25,000"}, {"name": "Sweet Tea", "qty": "2", "amount": "16,000"}, {"name": "Nasi Putih", "qty": "7", "amount": "42,000"}, {"name": "Mantau - 3 pcs", "qty": "1", "amount": "37,500"}], "subtotal": "618,490", "tax": "61,849", "total": "680,500"}, "gold": {"items": [{"name": "Tahu Isi", "qty": "2", "amount": "78,000"}, {"name": "Tea", "qty": "5", "amount": "30,000"}, {"name": "Kepiting 7-8.4ons - Chilly 0.7 1", "qty": "1", "amount": "297,490"}, {"name": "Udang Telur Asin - Regular", "qty": "1", "amount": "47,500"}, {"name": "Kailan 2 Rasa", "qty": "1", "amount": "45,000"}, {"name": "Mantau - 2 pcs", "qty": "1", "amount": "25,000"}, {"name": "Sweet Tea", "qty": "2", "amount": "16,000"}, {"name": "Nasi Putih", "qty": "7", "amount": "42,000"}, {"name": "Mantau - 3 pcs", "qty": "1", "amount": "37,500"}], "subtotal": "618,490", "tax": "61,849", "total": "680,500"}, "zeroshot": {"items": [{"name": "Tahu Isi", "qty": "2", "unit_price": "78,000", "amount": "78,000"}, {"name": "Tea", "qty": "5", "unit_price": "30,000", "amount": "30,000"}, {"name": "Kepiting 7-8.4ops - Chilly", "qty": "1", "unit_price": "297,490", "amount": "297,490"}, {"name": "Udang Telur Asin - Regular", "qty": "1", "unit_price": "47,500", "amount": "47,500"}, {"name": "Kailan 2 Rasa", "qty": "1", "unit_price": "45,000", "amount": "45,000"}, {"name": "Mantau - 2 pcs", "qty": "1", "unit_price": "25,000", "amount": "25,000"}, {"name": "Sweet Tea", "qty": "2", "unit_price": "16,000", "amount": "16,000"}, {"name": "Nasi Putih", "qty": "7", "unit_price": "42,000", "amount": "42,000"}, {"name": "Mantau - 3 pcs", "qty": "1", "unit_price": "37,500", "amount": "37,500"}], "subtotal": "618,490", "tax": "61,849", "total": "680,500"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 618490.0, "found": 618490.0}, {"name": "summary_total", "passed": true, "expected": 680339.0, "found": 680500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0233, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0379, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0285, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0247, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.031, "chosen": false}]}, {"id": 60, "image": "receipts/60.webp", "pred": {"items": [{"name": "Topping Milo Sparkle (untuk 1 Porsi)", "qty": "1x", "unit_price": "1.250", "amount": "1.250"}, {"name": "Bola Ubi Mini Original (14 Pcs)", "qty": "2x", "unit_price": "12.500", "amount": "25.000"}], "subtotal": "26.250", "tax": "-", "total": "26.250", "card": "GO-PAY"}, "gold": {"items": [{"name": "Topping Milo Sparkle (untuk 1 Po rsi)", "qty": "1x", "unit_price": "1.250", "amount": "1.250"}, {"name": "Bola Ubi Mini Original (14 Pcs )", "qty": "2x", "unit_price": "12.500", "amount": "25.000"}], "subtotal": "26.250", "tax": "-", "total": "26.250"}, "zeroshot": {"items": [{"name": "Topping Milo Sparkle (untuk 1 Porsi)", "qty": "1x", "unit_price": "1.250", "amount": "1.250"}, {"name": "Bola Ubi Mini Original (14 Pcs)", "qty": "2x", "unit_price": "12.500", "amount": "25.000"}], "subtotal": "26.250", "discount": "-", "service": "-", "tax": "-", "total": "26.250", "cash": "-", "change": "-", "card": "GO-PAY"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 1250.0, "found": 1250.0}, {"name": "line_1", "passed": true, "expected": 25000.0, "found": 25000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 26250.0, "found": 26250.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0289, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0253, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.02, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0289, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0289, "chosen": false}]}, {"id": 61, "image": "receipts/61.webp", "pred": {"items": [{"name": "TALAH UNGU", "qty": "1X", "unit_price": "3500", "amount": "6.500"}, {"name": "AREM - AREH", "qty": "1X", "unit_price": "3000", "amount": "8.000"}, {"name": "LEMPER", "qty": "2X", "unit_price": "9000", "amount": "18.000"}, {"name": "MIKA SEDANG", "qty": "1X", "unit_price": "0", "amount": "0"}, {"name": "PLASTIK KECIL", "qty": "1X", "unit_price": "0", "amount": "0"}, {"name": "TEH KOTAK", "qty": "1X", "unit_price": "5000", "amount": "5.000"}], "subtotal": "24.500", "total": "24.500", "card": "24.500"}, "gold": {"items": [{"name": "TALAM UNGU", "qty": "1x", "unit_price": "6500", "amount": "6,500"}, {"name": "AREM - AREM", "qty": "1X", "unit_price": "8000", "amount": "8,000"}, {"name": "LEMPER", "qty": "2X", "unit_price": "9000", "amount": "18,000"}, {"name": "MIKA SEDANG", "qty": "1X", "unit_price": "0", "amount": "0"}, {"name": "PLASTIK KECIL", "qty": "1X", "unit_price": "0", "amount": "0"}, {"name": "TEH KOTAK", "qty": "1X", "unit_price": "5000", "amount": "5,000"}], "subtotal": "24,500", "total": "24,500", "card": "24,500"}, "zeroshot": {"items": [{"name": "TALAH UNGU", "qty": "1X", "unit_price": "3500", "amount": "6.500"}, {"name": "AREM - AREH", "qty": "1X", "unit_price": "3000", "amount": "8.000"}, {"name": "LEMPER", "qty": "2X", "unit_price": "9000", "amount": "18.000"}, {"name": "MIKA SEDANG", "qty": "1X", "unit_price": "0", "amount": "0"}, {"name": "PLASTIK KECIL", "qty": "1X", "unit_price": "0", "amount": "0"}, {"name": "TEH KOTAK", "qty": "1X", "unit_price": "5000", "amount": "5.000"}], "subtotal": "24.500", "discount": "-7.200", "total": "24.500", "card": "24.500"}, "flagged": true, "exact": false, "checks": [{"name": "line_0", "passed": false, "expected": 3500.0, "found": 6500.0}, {"name": "line_1", "passed": false, "expected": 3000.0, "found": 8000.0}, {"name": "line_2", "passed": true, "expected": 18000.0, "found": 18000.0}, {"name": "line_3", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "line_4", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "line_5", "passed": true, "expected": 5000.0, "found": 5000.0}, {"name": "items_sum_subtotal", "passed": false, "expected": 37500.0, "found": 24500.0}, {"name": "card_total", "passed": true, "expected": 24500.0, "found": 24500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.625, "logprob": -0.021, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0491, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.625, "logprob": -0.0238, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.625, "logprob": -0.0311, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.625, "logprob": -0.021, "chosen": false}]}, {"id": 62, "image": "receipts/62.webp", "pred": {"items": [{"name": "XXI Java Tea (M)", "qty": "1", "amount": "18.000"}, {"name": "Combo 2", "qty": "1", "amount": "30.000"}], "total": "48.000", "cash": "50.000", "change": "2.000"}, "gold": {"items": [{"name": "XXI Java Tea (M)", "qty": "1", "amount": "18.000"}, {"name": "Combo 2", "qty": "1", "amount": "30.000"}], "total": "48.000", "cash": "50.000", "change": "2,000"}, "zeroshot": {"items": [{"name": "XXI Java Tea (M)", "qty": "1", "unit_price": "18.000", "amount": "18.000"}, {"name": "Combo 2", "qty": "1", "unit_price": "30.000", "amount": "30.000"}], "subtotal": "48.000", "total": "48.000", "cash": "50.000", "change": "2.000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 48000.0, "found": 48000.0}, {"name": "cash_change", "passed": true, "expected": 48000.0, "found": 48000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0028, "chosen": false}]}, {"id": 63, "image": "receipts/63.webp", "pred": {"items": [{"name": "Kopi Susu Kampung.", "qty": "x1", "unit_price": "19.000"}, {"name": "Kopi Susu Kampung.", "qty": "x2", "unit_price": "38.000"}], "subtotal": "57.000", "total": "57.000", "cash": "60.000", "change": "3.000"}, "gold": {"items": [{"name": "Kopi Susu Kampung.", "qty": "x1", "amount": "19.000"}, {"name": "Kopi Susu Kampung.", "qty": "x2", "amount": "38.000"}], "subtotal": "57.000", "total": "57.000", "cash": "60.000", "change": "3.000"}, "zeroshot": {"items": [{"name": "Kopi Susu Kampung.", "qty": "x1", "unit_price": "19.000", "amount": "19.000"}, {"name": "Kopi Susu Kampung", "qty": "x2", "unit_price": "38.000", "amount": "38.000"}], "subtotal": "57.000", "discount": "0", "total": "57.000", "cash": "60.000", "change": "3.000"}, "flagged": true, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": false, "expected": 95000.0, "found": 57000.0}, {"name": "cash_change", "passed": true, "expected": 57000.0, "found": 57000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.5, "logprob": -0.0229, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0229, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0468, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0229, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0229, "chosen": false}]}, {"id": 64, "image": "receipts/64.webp", "pred": {"items": [{"name": "SINGLE SCOOP", "amount": "16.000"}], "total": "16.000", "cash": "50.000", "change": "34.000"}, "gold": {"items": [{"name": "SINGLE SCOOP", "amount": "16.000"}], "total": "16.000", "cash": "50.000", "change": "34.000"}, "zeroshot": {"items": [{"name": "SINGLE SCOOP", "qty": "1", "unit_price": "16.000", "amount": "16.000"}], "subtotal": "16.000", "total": "16.000", "cash": "50.000", "change": "34.000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 16000.0, "found": 16000.0}, {"name": "cash_change", "passed": true, "expected": 16000.0, "found": 16000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0037, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0037, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0037, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0037, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0037, "chosen": false}]}, {"id": 65, "image": "receipts/65.webp", "pred": {"items": [{"name": "ubur Polos + Telur", "unit_price": "13.000", "amount": "13.000"}], "subtotal": "13.000", "tax": "-", "total": "13.000"}, "gold": {"items": [{"name": "Bubur Polos + Telur", "qty": "1", "unit_price": "13.000", "amount": "13.000"}], "subtotal": "13.000", "tax": "-", "total": "13.000"}, "zeroshot": {"items": [{"name": "Subur Polos + Telur", "qty": "1", "unit_price": "13.000", "amount": "13.000"}], "subtotal": "13.000", "discount": "-", "service": "-", "tax": "-", "total": "13.000", "cash": "-", "change": "-", "card": "-"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 13000.0, "found": 13000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0297, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0297, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0342, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0297, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0388, "chosen": false}]}, {"id": 66, "image": "receipts/66.webp", "pred": {"items": [{"name": "PILLOW DURIA", "amount": "36,364"}, {"name": "PLASTIK 25", "amount": "0"}], "subtotal": "36,364", "tax": "3,636", "total": "40,000", "cash": "50,000", "change": "10,000"}, "gold": {"items": [{"name": "PILLOW DURIA", "amount": "36,364"}, {"name": "PLASTIK 25", "amount": "0"}], "subtotal": "36,364", "tax": "3,636", "total": "40,000", "cash": "50,000", "change": "10,000"}, "zeroshot": {"items": [{"name": "PILLOW DURI", "qty": "1", "unit_price": "36,364", "amount": "36,364"}, {"name": "PLASTIK 25", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "36,364", "discount": "10.000%", "service": "3,636", "total": "40,000", "cash": "50,000", "change": "10,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 36364.0, "found": 36364.0}, {"name": "summary_total", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "cash_change", "passed": true, "expected": 40000.0, "found": 40000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0365, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0365, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0658, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0671, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0365, "chosen": false}]}, {"id": 67, "image": "receipts/67.webp", "pred": {"items": [{"name": "2005-CHEESE JOHN", "qty": "x1", "unit_price": "9.500,00", "amount": "9.500,00"}], "total": "9.500,00", "cash": "9.500,00"}, "gold": {"items": [{"name": "CHEESE JOHN", "qty": "x1", "unit_price": "9.500,00", "amount": "9.500,00"}], "total": "9.500,00", "cash": "9.500,00"}, "zeroshot": {"items": [{"name": "2005-CHEESE JOHN", "qty": "x1", "unit_price": "9.500,00", "amount": "9.500,00"}], "subtotal": "9.500,00", "total": "9.500,00", "cash": "9.500,00"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 9500.0, "found": 9500.0}, {"name": "items_sum_total", "passed": true, "expected": 9500.0, "found": 9500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0439, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.044, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0269, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0269, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0269, "chosen": false}]}, {"id": 68, "image": "receipts/68.webp", "pred": {"items": [{"name": "ICED TT", "amount": "20,000"}], "total": "20,000", "cash": "50,000", "change": "30,000"}, "gold": {"items": [{"name": "ICED TT", "amount": "20,000"}], "total": "20,000", "cash": "50,000", "change": "30,000"}, "zeroshot": {"items": [{"name": "ICED TT", "qty": "1", "unit_price": "20,000", "amount": "20,000"}], "subtotal": "20,000", "total": "20,000", "cash": "50,000", "change": "30,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 20000.0, "found": 20000.0}, {"name": "cash_change", "passed": true, "expected": 20000.0, "found": 20000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0065, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0065, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0065, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0065, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0065, "chosen": false}]}, {"id": 69, "image": "receipts/69.webp", "pred": {"items": [{"name": "[MD] SOFT MORNING ROLL", "qty": "1", "amount": "18,000"}, {"name": "REAL HONEY PANCAKE BREAD", "qty": "2", "amount": "20,000"}, {"name": "CUSTARD BRIOCHE", "qty": "4", "amount": "36,000"}], "total": "74,000", "cash": "100,000", "change": "26,000"}, "gold": {"items": [{"name": "[MD] SOFT MORNING ROLL", "qty": "1", "amount": "18,000"}, {"name": "REAL HONEY PANCAKE BREAD", "qty": "2", "amount": "20,000"}, {"name": "CUSTARD BRIOCHE", "qty": "4", "amount": "36,000"}], "total": "74,000", "cash": "100,000", "change": "26,000"}, "zeroshot": {"items": [{"name": "SOFT MORNING ROLL", "qty": "1", "unit_price": "18,000", "amount": "18,000"}, {"name": "REAL HONEY PANCAKE BREAD", "qty": "2", "unit_price": "20,000", "amount": "20,000"}, {"name": "CUSTARD BRIOCHE", "qty": "4", "unit_price": "36,000", "amount": "36,000"}], "subtotal": "74,000", "total": "74,000", "cash": "100,000", "change": "26,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_total", "passed": true, "expected": 74000.0, "found": 74000.0}, {"name": "cash_change", "passed": true, "expected": 74000.0, "found": 74000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0084, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0084, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0084, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0084, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0084, "chosen": false}]}, {"id": 70, "image": "receipts/70.webp", "pred": {"items": [{"name": "UDANG RE", "qty": "2", "unit_price": "216,000", "amount": "432,000"}, {"name": "AYM GR JUN NJAN", "qty": "2", "unit_price": "108,000"}, {"name": "SAPO TH SEAFOOD", "qty": "1", "unit_price": "172,000"}, {"name": "POCAI 3", "qty": "2", "unit_price": "111,000", "amount": "222,000"}, {"name": "GURAME FILLET M", "qty": "1", "unit_price": "163,000"}, {"name": "BIHUN GORENG JJ", "qty": "1", "unit_price": "116,000"}, {"name": "ICED TEA", "qty": "5", "unit_price": "12,000", "amount": "60,000"}, {"name": "NASI PUTIH", "qty": "7", "unit_price": "10,000", "amount": "70,000"}], "subtotal": "1,343,000", "service": "80,580", "tax": "142,358", "total": "1,565,938"}, "gold": {"items": [{"name": "UDANG RE", "qty": "2", "unit_price": "216,000", "amount": "432,000"}, {"name": "=*LARGE*==", "qty": "2"}, {"name": "AYM GR JUN NJAN", "qty": "1", "amount": "108,000"}, {"name": "SAPO TH SEAFOOD", "qty": "1", "amount": "172,000"}, {"name": "POCAI 3", "qty": "2", "unit_price": "111,000", "amount": "222.000"}, {"name": "=*MEDIUM*=", "qty": "2"}, {"name": "GURAME FILLET M", "qty": "1", "amount": "163,000"}, {"name": "BIHUN GORENG JJ", "qty": "1", "amount": "116,000"}, {"name": "ICED TEA", "qty": "5", "unit_price": "12,000", "amount": "60,000"}, {"name": "NASI PUTIH", "qty": "7", "unit_price": "10,000", "amount": "70,000"}], "subtotal": "1,343,000", "service": "80,580", "tax": "142,358", "total": "1,565,938"}, "zeroshot": {"items": [{"name": "UDANG RE", "qty": "2", "unit_price": "216,000", "amount": "432,000"}, {"name": "AYM GR JUN NJAN", "qty": "1", "unit_price": "108,000", "amount": "108,000"}, {"name": "SAPO TH SEAFOOD", "qty": "1", "unit_price": "172,000", "amount": "172,000"}, {"name": "POCAI 3", "qty": "2", "unit_price": "111,000", "amount": "222,000"}, {"name": "GURAME FILLET M ASAM MANIS", "qty": "1", "unit_price": "163,000", "amount": "163,000"}, {"name": "BIHUN GORENG JJ", "qty": "1", "unit_price": "116,000", "amount": "116,000"}, {"name": "ICED TEA", "qty": "5", "unit_price": "12,000", "amount": "60,000"}, {"name": "NASI PUTIH", "qty": "7", "unit_price": "10,000", "amount": "70,000"}], "subtotal": "1,213,000", "service": "80,580", "tax": "142,358", "total": "1,565,938"}, "flagged": true, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 432000.0, "found": 432000.0}, {"name": "line_3", "passed": true, "expected": 222000.0, "found": 222000.0}, {"name": "line_6", "passed": true, "expected": 60000.0, "found": 60000.0}, {"name": "line_7", "passed": true, "expected": 70000.0, "found": 70000.0}, {"name": "items_sum_subtotal", "passed": false, "expected": 1451000.0, "found": 1343000.0}, {"name": "summary_total", "passed": true, "expected": 1565938.0, "found": 1565938.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.8333333333333334, "logprob": -0.0073, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.8333333333333334, "logprob": -0.0073, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.8333333333333334, "logprob": -0.0073, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.8333333333333334, "logprob": -0.0073, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.8333333333333334, "logprob": -0.0073, "chosen": false}]}, {"id": 71, "image": "receipts/71.webp", "pred": {"items": [{"name": "Cuka Apel Tefes", "qty": "1", "unit_price": "198000", "amount": "198000"}], "subtotal": "198000", "cash": "200200", "change": "22000"}, "gold": {"items": [{"name": "Cuka Apel Tetes", "qty": "1", "unit_price": "198000", "amount": "198000"}], "total": "198000", "cash": "200200", "change": "22000"}, "zeroshot": {"items": [{"name": "Cuka Apel Tefes 1", "qty": "1", "unit_price": "198000", "amount": "198000"}], "subtotal": "198000", "total": "200200", "cash": "200200", "change": "22000"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 198000.0, "found": 198000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 198000.0, "found": 198000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0236, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.6666666666666666, "logprob": -0.0236, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.027, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0302, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.027, "chosen": false}]}, {"id": 72, "image": "receipts/72.webp", "pred": {"items": [{"name": "Choco Devil", "qty": "1", "amount": "15,909"}], "subtotal": "15,909", "tax": "1,591", "total": "17,500", "cash": "20,000", "change": "2,500"}, "gold": {"items": [{"name": "Choco Devil", "qty": "1", "amount": "15,909"}], "subtotal": "15,909", "tax": "1,591", "total": "17,500", "cash": "20,000", "change": "2,500"}, "zeroshot": {"items": [{"name": "Choco Devil", "qty": "1", "unit_price": "15,909", "amount": "15,909"}], "subtotal": "15,909", "service": "1,591", "total": "17,500", "cash": "20,000", "change": "2,500"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 15909.0, "found": 15909.0}, {"name": "summary_total", "passed": true, "expected": 17500.0, "found": 17500.0}, {"name": "cash_change", "passed": true, "expected": 17500.0, "found": 17500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0021, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0021, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0021, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0021, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0021, "chosen": false}]}, {"id": 73, "image": "receipts/73.webp", "pred": {"items": [{"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "total": "22.000", "cash": "25.000", "change": "3.000"}, "gold": {"items": [{"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "total": "22.000", "cash": "25.000", "change": "3.000"}, "zeroshot": {"items": [{"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "subtotal": "22.000", "total": "22.000", "cash": "25.000", "change": "3.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 22000.0, "found": 22000.0}, {"name": "line_1", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "items_sum_total", "passed": true, "expected": 22000.0, "found": 22000.0}, {"name": "cash_change", "passed": true, "expected": 22000.0, "found": 22000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.002, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.002, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.002, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.002, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.002, "chosen": false}]}, {"id": 74, "image": "receipts/74.webp", "pred": {"items": [{"name": "BLACKCURRANT", "qty": "1", "amount": "32,000"}, {"name": "SPRITE", "qty": "1", "amount": "32,000"}, {"name": "GRILLED CALAMARI", "qty": "1", "amount": "85,000"}, {"name": "DINE FOR 2", "qty": "1", "amount": "129,000"}], "subtotal": "278,000", "service": "22,240", "tax": "30,024", "total": "330,264"}, "gold": {"items": [{"name": "BLACKCURRANT", "qty": "1", "amount": "32,000"}, {"name": "SPRITE", "qty": "1", "amount": "32,000"}, {"name": "GRILLED CALAMARI", "qty": "1", "amount": "85,000"}, {"name": "DINE FOR 2", "qty": "1", "amount": "129,000"}], "subtotal": "278,000", "service": "22,240", "tax": "30,024", "total": "330,264"}, "zeroshot": {"items": [{"name": "BLACKCURRANT", "qty": "1", "unit_price": "32,000", "amount": "32,000"}, {"name": "SPRITE", "qty": "1", "unit_price": "32,000", "amount": "32,000"}, {"name": "GRILLED CALAMARI", "qty": "1", "unit_price": "85,000", "amount": "85,000"}, {"name": "DINE FOR 2", "qty": "1", "unit_price": "129,000", "amount": "129,000"}], "subtotal": "278,000", "discount": "0", "service": "22,240", "tax": "30,024", "total": "330,264"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 278000.0, "found": 278000.0}, {"name": "summary_total", "passed": true, "expected": 330264.0, "found": 330264.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0231, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0231, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0231, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0143, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0231, "chosen": false}]}, {"id": 75, "image": "receipts/75.webp", "pred": {"items": [{"name": "CHOCO PUFF", "qty": "1", "amount": "29,091"}, {"name": "CREAMY BEEF CLS FTC", "qty": "1", "amount": "42,727"}, {"name": "NEW ORIENTAL CHK RICE", "qty": "1", "amount": "34,545"}, {"name": "LIPTON PITCHER", "qty": "1", "amount": "54,545"}, {"name": "SC/P SUPER SUPREME", "qty": "1", "amount": "47,273"}, {"name": "CB/P BLACK PEPP BEEF", "qty": "1", "amount": "48,182"}], "subtotal": "256,363", "tax": "25,637", "total": "282,000"}, "gold": {"items": [{"name": "CHOCO PUFF", "qty": "1", "amount": "29,091"}, {"name": "CREAMY BEEF CLS FTC", "qty": "1", "amount": "42,727"}, {"name": "NEW ORIENTAL CHK RICE", "qty": "1", "amount": "34,545"}, {"name": "LIPTON PITCHER", "qty": "1", "amount": "54,545"}, {"name": "SC/P SUPER SUPREME", "qty": "1", "amount": "47,273"}, {"name": "CB/P BLACK PEPP BEEF", "qty": "1", "amount": "48,182"}], "subtotal": "256,363", "tax": "25,637", "total": "282,000"}, "zeroshot": {"items": [{"name": "CHOCO PUFF", "qty": "1", "unit_price": "29,091", "amount": "29,091"}, {"name": "CREAMY BEEF CLS FTC", "qty": "1", "unit_price": "42,727", "amount": "42,727"}, {"name": "NEW ORIENTAL CHK RICE", "qty": "1", "unit_price": "34,545", "amount": "34,545"}, {"name": "LIPTON PITCHER", "qty": "1", "unit_price": "54,545", "amount": "54,545"}, {"name": "SC/P SUPER SUPREME", "qty": "1", "unit_price": "47,273", "amount": "47,273"}, {"name": "CB/P BLACK PEPP BEEF", "qty": "1", "unit_price": "48,182", "amount": "48,182"}], "subtotal": "256,363", "tax": "25,637", "total": "282,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 256363.0, "found": 256363.0}, {"name": "summary_total", "passed": true, "expected": 282000.0, "found": 282000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}]}, {"id": 76, "image": "receipts/76.webp", "pred": {"items": [{"name": "BASO TAHU", "amount": "*46000"}, {"name": "NASI PUTIH", "amount": "*6000"}, {"name": "BASO TAHU", "amount": "*46000"}, {"name": "NASI PUTIH", "qty": "2x", "unit_price": "6000", "amount": "*12000"}], "cash": "*110000"}, "gold": {"items": [{"name": "BASO TAHU", "amount": "*46000"}, {"name": "NASI PUTIH", "amount": "*6000"}, {"name": "BASO TAHU", "amount": "*46000"}, {"name": "NASI PUTIH", "qty": "2x", "unit_price": "6000", "amount": "*12000"}], "cash": "*110000"}, "zeroshot": {"items": [{"name": "BASO TAHU", "qty": "1", "unit_price": "*46000", "amount": "*46000"}, {"name": "NASI PUTIH", "qty": "1", "unit_price": "*6000", "amount": "*6000"}, {"name": "BASO TAHU", "qty": "1", "unit_price": "*46000", "amount": "*46000"}, {"name": "2x 6000", "qty": "2", "unit_price": "6000", "amount": "*12000"}, {"name": "NASI PUTIH", "qty": "1", "unit_price": "*12000", "amount": "*12000"}], "subtotal": "*110000", "cash": "*110000"}, "flagged": false, "exact": true, "checks": [{"name": "line_3", "passed": true, "expected": 12000.0, "found": 12000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0278, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0686, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0278, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0278, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0278, "chosen": false}]}, {"id": 77, "image": "receipts/77.webp", "pred": {"items": [{"name": "TRIPPLE CHEESE", "qty": "1 x", "unit_price": "17,000", "amount": "17,000"}], "subtotal": "17,000", "total": "17,000", "cash": "22,000", "change": "5,000"}, "gold": {"items": [{"name": "TRIPPLE CHEESE", "qty": "1 x", "unit_price": "17,000", "amount": "17,000"}], "subtotal": "17,000", "total": "17,000", "cash": "22,000", "change": "5,000"}, "zeroshot": {"items": [{"name": "TRIPPLE CHEESE", "qty": "1", "unit_price": "17,000", "amount": "17,000"}], "subtotal": "17,000", "total": "17,000", "cash": "22,000", "change": "5,000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 17000.0, "found": 17000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 17000.0, "found": 17000.0}, {"name": "cash_change", "passed": true, "expected": 17000.0, "found": 17000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0031, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0031, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0031, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0031, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0031, "chosen": false}]}, {"id": 78, "image": "receipts/78.webp", "pred": {"items": [{"name": "Lemon Tea (L)", "qty": "1", "amount": "25.000"}, {"name": "Extra Jelly Lychee", "qty": "1", "amount": "5.000"}], "total": "30.000", "cash": "30.000", "change": "0"}, "gold": {"items": [{"name": "Lemon Tea (L)", "qty": "1", "amount": "25.000"}], "total": "30.000", "cash": "30.000", "change": "0"}, "zeroshot": {"items": [{"name": "Lemon Tea (L)", "qty": "1", "unit_price": "25.000", "amount": "25.000"}, {"name": "Extra Jelly Lychee", "qty": "1", "unit_price": "5.000", "amount": "5.000"}], "total": "30.000", "cash": "30.000", "change": "0"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 30000.0, "found": 30000.0}, {"name": "cash_change", "passed": true, "expected": 30000.0, "found": 30000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.043, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0058, "chosen": false}]}, {"id": 79, "image": "receipts/79.webp", "pred": {"items": [{"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "total": "22.000", "cash": "22.000"}, "gold": {"items": [{"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "total": "22.000", "cash": "22.000"}, "zeroshot": {"items": [{"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "subtotal": "22.000", "total": "22.000", "cash": "22.000", "change": "22.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 22000.0, "found": 22000.0}, {"name": "line_1", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "items_sum_total", "passed": true, "expected": 22000.0, "found": 22000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.005, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.005, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.005, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.005, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.005, "chosen": false}]}, {"id": 80, "image": "receipts/80.webp", "pred": {"items": [{"name": "Viet Milk Coffee", "qty": "1", "amount": "25.000"}], "subtotal": "25.000", "total": "25.000", "cash": "25.000", "change": "0"}, "gold": {"items": [{"name": "Viet Milk Coffee", "qty": "1", "amount": "25,000"}], "subtotal": "25.000", "total": "25.000", "cash": "25.000", "change": "0"}, "zeroshot": {"items": [{"name": "Viet Milk Coffee +Ice +M", "qty": "1", "unit_price": "25.000", "amount": "25.000"}], "subtotal": "25.000", "total": "25.000", "cash": "25.000", "change": "0"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 25000.0, "found": 25000.0}, {"name": "cash_change", "passed": true, "expected": 25000.0, "found": 25000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0089, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0089, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.035, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0089, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0089, "chosen": false}]}, {"id": 81, "image": "receipts/81.webp", "pred": {"items": [{"name": "3002-Kyoto Choco Mochi", "qty": "x2", "unit_price": "14.000", "amount": "28.000"}, {"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "total": "50.000"}, "gold": {"items": [{"name": "3002-Kyoto Choco Mochi", "qty": "x2", "unit_price": "14.000", "amount": "28.000"}, {"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "total": "50.000"}, "zeroshot": {"items": [{"name": "3002-Kyoto Choco Mochi", "qty": "x2", "unit_price": "14.000", "amount": "28.000"}, {"name": "1001-Choco Bun", "qty": "x1", "unit_price": "22.000", "amount": "22.000"}, {"name": "6001-Plastic Bag Small", "qty": "x1", "unit_price": "0", "amount": "0"}], "subtotal": "50.000", "total": "50.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 28000.0, "found": 28000.0}, {"name": "line_1", "passed": true, "expected": 22000.0, "found": 22000.0}, {"name": "line_2", "passed": true, "expected": 0.0, "found": 0.0}, {"name": "items_sum_total", "passed": true, "expected": 50000.0, "found": 50000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0014, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0014, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0014, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0014, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0014, "chosen": false}]}, {"id": 82, "image": "receipts/82.webp", "pred": {"items": [{"name": "Chocolate Log Cake", "qty": "1x", "unit_price": "115,000", "amount": "115,000"}, {"name": "Snowman Cake Chocolate", "qty": "1x", "unit_price": "60,000", "amount": "60,000"}, {"name": "Strawberry Log Cake", "qty": "2x", "unit_price": "105,000", "amount": "210,000"}], "subtotal": "385,000", "total": "385,000", "change": "0", "card": "385,000"}, "gold": {"items": [{"name": "Chocolate Log Cake", "qty": "1x", "unit_price": "115,000", "amount": "115,000"}, {"name": "Snowman Cake Chocolate", "qty": "1x", "unit_price": "60,000", "amount": "60,000"}, {"name": "Strawberry Log Cake", "qty": "2x", "unit_price": "105,000", "amount": "210,000"}], "subtotal": "385,000", "total": "385,000", "change": "0", "card": "385,000"}, "zeroshot": {"items": [{"name": "Chocolate Log Cake", "qty": "1x", "unit_price": "115,000", "amount": "115,000"}, {"name": "Snowman Cake Chocolate", "qty": "1x", "unit_price": "60,000", "amount": "60,000"}, {"name": "Strawberry Log Cake", "qty": "2x", "unit_price": "105,000", "amount": "210,000"}], "subtotal": "385,000", "total": "385,000", "change": "0", "card": "VISA MASTER 8213"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 115000.0, "found": 115000.0}, {"name": "line_1", "passed": true, "expected": 60000.0, "found": 60000.0}, {"name": "line_2", "passed": true, "expected": 210000.0, "found": 210000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 385000.0, "found": 385000.0}, {"name": "card_total", "passed": true, "expected": 385000.0, "found": 385000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0024, "chosen": false}]}, {"id": 83, "image": "receipts/83.webp", "pred": {"items": [{"name": "COOKIES AND CREAM", "qty": "1", "amount": "20,909"}], "subtotal": "20,909", "tax": "2,091", "total": "23,000", "cash": "25,000", "change": "2,000"}, "gold": {"items": [{"name": "COOKIES AND CREAM", "qty": "1", "amount": "20,909"}], "subtotal": "20,909", "tax": "2,091", "total": "23,000", "cash": "25.000", "change": "2.000"}, "zeroshot": {"items": [{"name": "1 COOKIES AND CREAM", "qty": "1", "unit_price": "20.909", "amount": "20.909"}], "subtotal": "20.909", "tax": "2.091", "total": "23.000", "cash": "25.000", "change": "2.000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 20909.0, "found": 20909.0}, {"name": "summary_total", "passed": true, "expected": 23000.0, "found": 23000.0}, {"name": "cash_change", "passed": true, "expected": 23000.0, "found": 23000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0222, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0492, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0222, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0222, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0222, "chosen": false}]}, {"id": 84, "image": "receipts/84.webp", "pred": {"items": [{"name": "Kroket", "qty": "1x", "unit_price": "@12.000", "amount": "12.000"}, {"name": "Arem Arem", "qty": "2x", "unit_price": "@12.000", "amount": "24.000"}], "subtotal": "Rp 36.000", "tax": "Rp 3.600", "total": "Rp 39.600", "card": "Rp 39.600"}, "gold": {"items": [{"name": "Kroket", "qty": "1x", "unit_price": "@ 12.000", "amount": "12.000"}, {"name": "Arem Arem", "qty": "2x", "unit_price": "@ 12.000", "amount": "24.000"}], "subtotal": "Rp 36.000", "tax": "Rp 3.600", "total": "Rp 39.600", "card": "Rp 39.600"}, "zeroshot": {"items": [{"name": "Kroket", "qty": "1x", "unit_price": "Rp 12.000", "amount": "12.000"}, {"name": "Arem Arem", "qty": "2x", "unit_price": "Rp 12.000", "amount": "24.000"}], "subtotal": "Rp 36.000", "tax": "Rp 3.600", "total": "Rp 39.600", "cash": "Rp 39.600"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 12000.0, "found": 12000.0}, {"name": "line_1", "passed": true, "expected": 24000.0, "found": 24000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 36000.0, "found": 36000.0}, {"name": "summary_total", "passed": true, "expected": 39600.0, "found": 39600.0}, {"name": "card_total", "passed": true, "expected": 39600.0, "found": 39600.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0182, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0068, "chosen": false}]}, {"id": 85, "image": "receipts/85.webp", "pred": {"items": [{"name": "Nasi Putih", "qty": "3", "amount": "30.000"}, {"name": "Nasi Tambah", "qty": "1", "amount": "7.000"}, {"name": "Ayam Pop", "qty": "2", "amount": "40.000"}, {"name": "Sambal SP", "qty": "1", "amount": "11.000"}, {"name": "Sambal Gabus Asin Cb", "qty": "1", "amount": "18.000"}, {"name": "Kerupuk Kuah", "qty": "1", "amount": "15.000"}, {"name": "Ikan Bawal Besa", "qty": "1", "amount": "28.500"}, {"name": "Telur Dadar", "qty": "1", "amount": "10.000"}, {"name": "Teh Es", "qty": "1", "amount": "7.000"}, {"name": "Teh Manis", "qty": "1", "amount": "9.000"}, {"name": "Es Batu", "qty": "1", "amount": "4.000"}], "subtotal": "179.500", "tax": "17.950", "total": "197.450", "cash": "197.450"}, "gold": {"items": [{"name": "Nasi Putih", "qty": "3", "amount": "30.000"}, {"name": "Nasi Tambah", "qty": "1", "amount": "7.000"}, {"name": "Ayam Pop", "qty": "2", "amount": "40.000"}, {"name": "Samabal SP", "qty": "1", "amount": "11.000"}, {"name": "Sambal Gabus Asin Cb", "qty": "1", "amount": "18.000"}, {"name": "Kerupuk Kuah", "qty": "1", "amount": "15.000"}, {"name": "Ikan Bawal Besa", "qty": "1", "amount": "28.500"}, {"name": "Telur Dadar", "qty": "1", "amount": "10.000"}, {"name": "Teh Es", "qty": "1", "amount": "7.000"}, {"name": "Teh Manis", "qty": "1", "amount": "9.000"}, {"name": "Es Batu", "qty": "1", "amount": "4.000"}], "subtotal": "179.500", "tax": "17.950", "total": "197.450", "cash": "197.450"}, "zeroshot": {"items": [{"name": "Nasi Putih", "qty": "3", "unit_price": "30.000", "amount": "30.000"}, {"name": "Nasi Tambahan", "qty": "1", "unit_price": "7.000", "amount": "7.000"}, {"name": "Ayam Pop", "qty": "2", "unit_price": "40.000", "amount": "40.000"}, {"name": "Sambal SP", "qty": "1", "unit_price": "11.000", "amount": "11.000"}, {"name": "Sambal Gabus Asin Cb", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "Kerupuk Kuah", "qty": "1", "unit_price": "18.000", "amount": "18.000"}, {"name": "Ikan Bawal Besa", "qty": "1", "unit_price": "15.000", "amount": "15.000"}, {"name": "Telur Dadar", "qty": "1", "unit_price": "10.000", "amount": "10.000"}, {"name": "Teh Es", "qty": "1", "unit_price": "7.000", "amount": "7.000"}, {"name": "Teh Manis", "qty": "1", "unit_price": "9.000", "amount": "9.000"}, {"name": "Es Batu", "qty": "1", "unit_price": "4.000", "amount": "4.000"}], "subtotal": "179.500", "tax": "17.950", "total": "197.450", "cash": "197.450"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 179500.0, "found": 179500.0}, {"name": "summary_total", "passed": true, "expected": 197450.0, "found": 197450.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0216, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0134, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0174, "chosen": false}]}, {"id": 86, "image": "receipts/86.webp", "pred": {"items": [{"name": "Cheezemania", "qty": "1", "amount": "9,500"}, {"name": "Mamamia", "qty": "1", "amount": "12,500"}], "subtotal": "22,000", "total": "22,000", "cash": "52,000", "change": "30,000"}, "gold": {"items": [{"name": "Cheezemania", "qty": "1", "amount": "9,500"}, {"name": "Mamamia", "qty": "1", "amount": "12,500"}], "subtotal": "22,000", "total": "22,000", "cash": "52,000", "change": "30,000"}, "zeroshot": {"items": [{"name": "Chcezemania", "qty": "1", "unit_price": "9,500", "amount": "9,500"}, {"name": "Mamamia", "qty": "1", "unit_price": "12,500", "amount": "12,500"}], "subtotal": "22,000", "total": "22,000", "cash": "52,000", "change": "30,000"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 22000.0, "found": 22000.0}, {"name": "cash_change", "passed": true, "expected": 22000.0, "found": 22000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0096, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0096, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0096, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0096, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0096, "chosen": false}]}, {"id": 87, "image": "receipts/87.webp", "pred": {"items": [{"name": "PHO THAI CHIN", "qty": "1", "amount": "36,500"}], "subtotal": "36,500", "tax": "3,650", "total": "40,150", "card": "40,150"}, "gold": {"items": [{"name": "PHOTAI CHIN", "qty": "1", "amount": "36,500"}], "subtotal": "36,500", "tax": "3,650", "total": "40,150", "card": "40,150"}, "zeroshot": {"items": [{"name": "PHO THAI CHIN", "qty": "1", "unit_price": "36.500", "amount": "36.500"}], "subtotal": "36.500", "discount": "3.650", "service": "10.0%", "total": "40.150", "card": "5183230101 CREDIT CARD"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 36500.0, "found": 36500.0}, {"name": "summary_total", "passed": true, "expected": 40150.0, "found": 40150.0}, {"name": "card_total", "passed": true, "expected": 40150.0, "found": 40150.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.02, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0491, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.02, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0446, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.038, "chosen": false}]}, {"id": 88, "image": "receipts/88.webp", "pred": {"items": [{"name": "STIX ECLAIRS", "qty": "1 x", "unit_price": "19,000", "amount": "19,000"}, {"name": "ALMOND CREAM CHEESE", "qty": "1 x", "unit_price": "28,000", "amount": "28,000"}], "subtotal": "47,000", "total": "47,000", "change": "0", "card": "47,000"}, "gold": {"items": [{"name": "STIX ECLAIRS", "qty": "1 x", "unit_price": "19,000", "amount": "19,000"}, {"name": "ALMOND CREAM CHEESE", "qty": "1 x", "unit_price": "28,000", "amount": "28,000"}], "subtotal": "47,000", "total": "47,000", "change": "0", "card": "47,000"}, "zeroshot": {"items": [{"name": "STIX ECLAIRS", "qty": "1", "unit_price": "19,000", "amount": "19,000"}, {"name": "ALMOND CREAM CHEESE", "qty": "1", "unit_price": "28,000", "amount": "28,000"}], "subtotal": "47,000", "total": "47,000", "change": "0", "card": "VISA 8945"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 19000.0, "found": 19000.0}, {"name": "line_1", "passed": true, "expected": 28000.0, "found": 28000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 47000.0, "found": 47000.0}, {"name": "card_total", "passed": true, "expected": 47000.0, "found": 47000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0067, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0067, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0431, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0067, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0067, "chosen": false}]}, {"id": 89, "image": "receipts/89.webp", "pred": {"items": [{"name": "XXL Crispy Chicken", "qty": "1", "amount": "40,000"}], "total": "40,000", "cash": "50,000", "change": "10,000"}, "gold": {"items": [{"name": "XXL Crispy Chicken", "qty": "1", "amount": "40,000"}], "subtotal": "40,000", "total": "40,000", "cash": "50,000", "change": "10,000"}, "zeroshot": {"items": [{"name": "XXL Crispy Chicken", "qty": "1", "unit_price": "40.000", "amount": "40.000"}, {"name": "- Pedas sedikit", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "40.000", "total": "40.000", "cash": "50.000", "change": "10.000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "cash_change", "passed": true, "expected": 40000.0, "found": 40000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0324, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0926, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0324, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0324, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0369, "chosen": false}]}, {"id": 90, "image": "receipts/90.webp", "pred": {"items": [{"name": "CIRENG PANDAWA", "qty": "1", "amount": "26,818"}], "subtotal": "26,818", "tax": "2,681", "total": "29,500", "cash": "29,500"}, "gold": {"items": [{"name": "CIRENG PANDAWA", "qty": "1", "amount": "26,818"}], "subtotal": "26,818", "tax": "2,681", "total": "29,500", "cash": "29,500"}, "zeroshot": {"items": [{"name": "CIRENG PANDAWA", "qty": "1", "unit_price": "26,818", "amount": "26,818"}], "subtotal": "26,818", "discount": "2,681", "total": "29,500", "cash": "29,500"}, "flagged": false, "exact": true, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 26818.0, "found": 26818.0}, {"name": "summary_total", "passed": true, "expected": 29499.0, "found": 29500.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0025, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0025, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0025, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0025, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0025, "chosen": false}]}, {"id": 91, "image": "receipts/91.webp", "pred": {"items": [{"name": "BAKSO BNGKS", "qty": "1", "amount": "15.000"}, {"name": "GORENGAN", "qty": "5", "amount": "6.000"}], "total": "21.000", "cash": "30.000", "change": "9.000"}, "gold": {"items": [{"name": "BAKSO BNGKS", "qty": "1", "amount": "15.000"}, {"name": "GORENGAN", "qty": "6", "amount": "6.000"}], "total": "21.000", "cash": "30.000", "change": "9.000"}, "zeroshot": {"items": [{"name": "BAKSO BNGKS", "qty": "1", "unit_price": "15.000", "amount": "15.000"}, {"name": "GORENGAN", "qty": "6", "unit_price": "1.000", "amount": "6.000"}], "subtotal": "21.000", "discount": "0.000", "service": "0.000", "tax": "0.000", "total": "21.000", "cash": "30.000", "change": "9.000", "card": "0.000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 21000.0, "found": 21000.0}, {"name": "cash_change", "passed": true, "expected": 21000.0, "found": 21000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.5, "logprob": -0.0414, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0436, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0387, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.5, "logprob": -0.0387, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0554, "chosen": true}]}, {"id": 92, "image": "receipts/92.webp", "pred": {"items": [{"name": "- TICKET CP", "qty": "4", "unit_price": "60.000", "amount": "240.000"}], "total": "240.000", "cash": "250.000", "change": "10.000"}, "gold": {"items": [{"name": "- TICKET CP", "qty": "4", "unit_price": "60.000", "amount": "240,000"}], "total": "240.000", "cash": "250.000", "change": "10,000"}, "zeroshot": {"items": [{"name": "TICKET CP", "qty": "4", "unit_price": "60.000", "amount": "240.000"}], "subtotal": "240.000", "total": "240.000", "cash": "250.000", "change": "10.000"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 240000.0, "found": 240000.0}, {"name": "items_sum_total", "passed": true, "expected": 240000.0, "found": 240000.0}, {"name": "cash_change", "passed": true, "expected": 240000.0, "found": 240000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0107, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0107, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0107, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0107, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0107, "chosen": false}]}, {"id": 93, "image": "receipts/93.webp", "pred": {"items": [{"name": "THAI ICED TEA (L)", "qty": "1 X", "unit_price": "16,363", "amount": "16,363"}], "subtotal": "16,363", "tax": "1,636", "total": "17,999"}, "gold": {"items": [{"name": "THAI ICED TEA (L)", "qty": "1 X", "unit_price": "16,363", "amount": "16,363"}], "subtotal": "16,363", "tax": "1,636", "total": "17,999"}, "zeroshot": {"items": [{"name": "THAI ICED TEA (L)", "qty": "1", "unit_price": "16,363", "amount": "16,363"}], "subtotal": "16,363", "tax": "1,636", "total": "17,999"}, "flagged": false, "exact": true, "checks": [{"name": "line_0", "passed": true, "expected": 16363.0, "found": 16363.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 16363.0, "found": 16363.0}, {"name": "summary_total", "passed": true, "expected": 17999.0, "found": 17999.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0077, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0077, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0077, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0325, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0077, "chosen": false}]}, {"id": 94, "image": "receipts/94.webp", "pred": {"items": [{"name": "TAHU GORENG", "qty": "1", "amount": "28,000"}, {"name": "CAKWE", "qty": "1", "amount": "17,000"}, {"name": "PHO TAI CHIN (R)", "qty": "1", "amount": "63,000"}, {"name": "TEA", "qty": "1", "amount": "11,000"}], "subtotal": "119,000", "service": "8,330", "tax": "12,733", "total": "140,063", "card": "140,063"}, "gold": {"items": [{"name": "TAHU GORENG", "qty": "1", "amount": "28,000"}, {"name": "CAKWE", "qty": "1", "amount": "17,000"}, {"name": "PHO TAI CHIN(R)", "qty": "1", "amount": "63,000"}, {"name": "TEA", "qty": "1", "amount": "11,000"}], "subtotal": "119,000", "service": "8,330", "tax": "12,733", "total": "140,063", "card": "140,063"}, "zeroshot": {"items": [{"name": "TAHU GORENG", "qty": "1", "unit_price": "28,000", "amount": "28,000"}, {"name": "CAKWE", "qty": "1", "unit_price": "17,000", "amount": "17,000"}, {"name": "PHO TAI CHIN (R)", "qty": "1", "unit_price": "63,000", "amount": "63,000"}, {"name": "TEA", "qty": "1", "unit_price": "11,000", "amount": "11,000"}], "subtotal": "119,000", "service": "8,330", "tax": "12,733", "total": "140,063", "card": "140,063"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 119000.0, "found": 119000.0}, {"name": "summary_total", "passed": true, "expected": 140063.0, "found": 140063.0}, {"name": "card_total", "passed": true, "expected": 140063.0, "found": 140063.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0113, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0143, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0177, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0143, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0113, "chosen": false}]}, {"id": 95, "image": "receipts/95.webp", "pred": {"items": [{"name": "BASO TAHU", "qty": "1", "unit_price": "43,181", "amount": "43,181"}, {"name": "ES JERUK", "qty": "1", "unit_price": "13,000", "amount": "13,000"}], "subtotal": "56,181", "tax": "5,618", "total": "61,799", "cash": "62,000", "change": "201"}, "gold": {"items": [{"name": "BASO TAHU", "qty": "1", "unit_price": "43,181", "amount": "43,181"}, {"name": "ES JERUK", "qty": "1", "unit_price": "13,000", "amount": "13,000"}], "subtotal": "56,181", "tax": "5,618", "total": "61,799", "cash": "62,000"}, "zeroshot": {"items": [{"name": "BASO TAHU", "qty": "1", "unit_price": "43,181", "amount": "43,181"}, {"name": "ES JERUK", "qty": "1", "unit_price": "13,000", "amount": "13,000"}], "subtotal": "56,181", "tax": "5,618", "total": "61,799", "cash": "62,000", "change": "201"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 43181.0, "found": 43181.0}, {"name": "line_1", "passed": true, "expected": 13000.0, "found": 13000.0}, {"name": "items_sum_subtotal", "passed": true, "expected": 56181.0, "found": 56181.0}, {"name": "summary_total", "passed": true, "expected": 61799.0, "found": 61799.0}, {"name": "cash_change", "passed": true, "expected": 61799.0, "found": 61799.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0047, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0047, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0047, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0047, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0047, "chosen": false}]}, {"id": 96, "image": "receipts/96.webp", "pred": {"items": [{"name": "BBQ Chicken", "qty": "1", "amount": "41,000"}], "total": "41,000", "cash": "50,000", "change": "9,000"}, "gold": {"items": [{"name": "BBQ Chicken", "qty": "1", "amount": "41,000"}], "subtotal": "41,000", "total": "41,000", "cash": "50,000", "change": "9,000"}, "zeroshot": {"items": [{"name": "BBQ Chicken", "qty": "1", "unit_price": "41,000", "amount": "41,000"}, {"name": "- Tidak Pedas", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "41,000", "total": "41,000", "cash": "50,000", "change": "9,000"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_total", "passed": true, "expected": 41000.0, "found": 41000.0}, {"name": "cash_change", "passed": true, "expected": 41000.0, "found": 41000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0279, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0279, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0146, "chosen": false}]}, {"id": 97, "image": "receipts/97.webp", "pred": {"items": [{"name": "BUBUR GO", "qty": "2", "unit_price": "20.000", "amount": "40.000"}, {"name": "PUYUH GO", "amount": "6.000"}, {"name": "SATEATI GO", "qty": "3", "unit_price": "3.000", "amount": "9.000"}], "total": "55.000", "cash": "55.000"}, "gold": {"items": [{"name": "BUBUR GO", "qty": "2", "unit_price": "20.000", "amount": "40.000"}, {"name": "PUYUH GO", "amount": "6.000"}, {"name": "SATE ATI GO", "qty": "3", "unit_price": "3.000", "amount": "9.000"}], "total": "55.000", "cash": "55.000"}, "zeroshot": {"items": [{"name": "BUBUR GO", "qty": "2", "unit_price": "20.000", "amount": "40.000"}, {"name": "PUYUH GO", "qty": "1", "unit_price": "6.000", "amount": "6.000"}, {"name": "SATECATI GO", "qty": "3", "unit_price": "3.000", "amount": "9.000"}], "subtotal": "55.000", "total": "55.000", "cash": "55.000"}, "flagged": false, "exact": false, "checks": [{"name": "line_0", "passed": true, "expected": 40000.0, "found": 40000.0}, {"name": "line_2", "passed": true, "expected": 9000.0, "found": 9000.0}, {"name": "items_sum_total", "passed": true, "expected": 55000.0, "found": 55000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.0538, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0439, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0643, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0625, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0525, "chosen": true}]}, {"id": 98, "image": "receipts/98.webp", "pred": {"items": [{"name": "BLACK PEPPER MEATBALL PAS", "qty": "1", "amount": "79,000"}, {"name": "TRUFFLE CREAM", "qty": "1", "amount": "77,000"}, {"name": "EARL GREY MILK TEA", "qty": "1", "amount": "59,000"}], "subtotal": "215,000", "service": "12,900", "tax": "22,790", "total": "250,690"}, "gold": {"items": [{"name": "BLACK PAPPER MEATBALL PAS", "qty": "1", "amount": "79,000"}, {"name": "TRUFFLE CREAM", "qty": "1", "amount": "77,000"}, {"name": "EARL GREY MILK TEA", "qty": "1", "amount": "59,000"}], "subtotal": "215,000", "service": "12,900", "tax": "22,790", "total": "250,690"}, "zeroshot": {"items": [{"name": "BLACK PEPPER MEATBALL PAS", "qty": "1", "unit_price": "79,000", "amount": "79,000"}, {"name": "TRUFFLE CREAM", "qty": "1", "unit_price": "59,000", "amount": "59,000"}, {"name": "EARL GREY MILK TEA", "qty": "1", "unit_price": "215,000", "amount": "215,000"}], "subtotal": "215,000", "service": "Service Charge 6% 12,300", "tax": "TAX 10% 22,790", "total": "250,690"}, "flagged": false, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 215000.0, "found": 215000.0}, {"name": "summary_total", "passed": true, "expected": 250690.0, "found": 250690.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 1.0, "logprob": -0.013, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 1.0, "logprob": -0.0117, "chosen": false}]}, {"id": 99, "image": "receipts/99.webp", "pred": {"items": [{"name": "FL-Xmas 30 Off", "qty": "1", "amount": "68,180"}, {"name": "PAKET SLICES", "qty": "1", "amount": "0"}, {"name": "FL Cake - French", "qty": "1", "amount": "0"}, {"name": "PAKET SLICES", "qty": "1", "amount": "0"}, {"name": "FL Cake - Green", "qty": "1", "amount": "0"}, {"name": "PAKET SLICES", "qty": "1", "amount": "0"}, {"name": "FL Cake - Belgium", "qty": "1", "amount": "0"}], "subtotal": "68,180", "discount": "0", "tax": "6,818", "total": "75,000", "cash": "0", "change": "0", "card": "75,000"}, "gold": {"items": [{"name": "FL-Xmas 30 Off", "qty": "1", "amount": "68,180"}], "subtotal": "68,180", "discount": "0", "tax": "6,818", "total": "75,000", "cash": "0", "change": "0", "card": "75,000"}, "zeroshot": {"items": [{"name": "FL-Xmas 30 Off", "qty": "1", "unit_price": "68,180", "amount": "68,180"}, {"name": "PAKET SLICES", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "FL Cake - French Vanilla SLC", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "PAKET SLICES", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "FL Cake - Green Tea SLC", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "PAKET SLICES", "qty": "1", "unit_price": "0", "amount": "0"}, {"name": "FL Cake - Belgium Choco SLC", "qty": "1", "unit_price": "0", "amount": "0"}], "subtotal": "68,180", "discount": "0", "service": "2", "tax": "6,818", "total": "75,000", "cash": "0", "change": "0", "card": "75,000"}, "flagged": true, "exact": false, "checks": [{"name": "items_sum_subtotal", "passed": true, "expected": 68180.0, "found": 68180.0}, {"name": "summary_total", "passed": true, "expected": 74998.0, "found": 75000.0}, {"name": "cash_change", "passed": false, "expected": 0.0, "found": 75000.0}, {"name": "card_total", "passed": true, "expected": 75000.0, "found": 75000.0}], "candidates": [{"kind": "greedy", "valid": true, "consistency": 0.75, "logprob": -0.0186, "chosen": true}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0186, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0213, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0376, "chosen": false}, {"kind": "sampled", "valid": true, "consistency": 0.75, "logprob": -0.0186, "chosen": false}]}] \ No newline at end of file diff --git a/web/public/data/receipts/42.webp b/web/public/data/receipts/42.webp new file mode 100644 index 0000000000000000000000000000000000000000..dbd6a84ccd4bc8d805e2cc3fd3b99e80643e4d7c Binary files /dev/null and b/web/public/data/receipts/42.webp differ diff --git a/web/public/data/receipts/43.webp b/web/public/data/receipts/43.webp new file mode 100644 index 0000000000000000000000000000000000000000..a1af62970d215e8c1b835790e14deccb0f9c9938 Binary files /dev/null and b/web/public/data/receipts/43.webp differ diff --git a/web/public/data/receipts/44.webp b/web/public/data/receipts/44.webp new file mode 100644 index 0000000000000000000000000000000000000000..4d197131361db6de5ce2a812bed9fa5607d30e96 Binary files /dev/null and b/web/public/data/receipts/44.webp differ diff --git a/web/public/data/receipts/45.webp b/web/public/data/receipts/45.webp new file mode 100644 index 0000000000000000000000000000000000000000..edc5558d12a56a47673b4876f91f96e107d7878c Binary files /dev/null and b/web/public/data/receipts/45.webp differ diff --git a/web/public/data/receipts/46.webp b/web/public/data/receipts/46.webp new file mode 100644 index 0000000000000000000000000000000000000000..4d3103f3068161745a688df3ac906179e907f5fe Binary files /dev/null and b/web/public/data/receipts/46.webp differ diff --git a/web/public/data/receipts/47.webp b/web/public/data/receipts/47.webp new file mode 100644 index 0000000000000000000000000000000000000000..681c61e9ffd998aed67d6579b6cddd77cae74e31 Binary files /dev/null and b/web/public/data/receipts/47.webp differ diff --git a/web/public/data/receipts/48.webp b/web/public/data/receipts/48.webp new file mode 100644 index 0000000000000000000000000000000000000000..efe7c6c3cf31c0af57fe2a8bb4773a80e8dabf0d Binary files /dev/null and b/web/public/data/receipts/48.webp differ diff --git a/web/public/data/receipts/49.webp b/web/public/data/receipts/49.webp new file mode 100644 index 0000000000000000000000000000000000000000..c5fd7a34663b66147619f4f065d0532ac404e39f Binary files /dev/null and b/web/public/data/receipts/49.webp differ diff --git a/web/public/data/receipts/5.webp b/web/public/data/receipts/5.webp new file mode 100644 index 0000000000000000000000000000000000000000..dffc2e46e9e09c1db711153999b0363473c555d3 Binary files /dev/null and b/web/public/data/receipts/5.webp differ diff --git a/web/public/data/receipts/50.webp b/web/public/data/receipts/50.webp new file mode 100644 index 0000000000000000000000000000000000000000..4c9c56c2b0d718ee23b1d48f1d11578245f34345 Binary files /dev/null and b/web/public/data/receipts/50.webp differ diff --git a/web/public/data/receipts/51.webp b/web/public/data/receipts/51.webp new file mode 100644 index 0000000000000000000000000000000000000000..df9444ab09e18b2a58a621531ac020386313ed2c Binary files /dev/null and b/web/public/data/receipts/51.webp differ diff --git a/web/public/data/receipts/52.webp b/web/public/data/receipts/52.webp new file mode 100644 index 0000000000000000000000000000000000000000..09added40643cab9f6790323abfdba6c7e5b6faf Binary files /dev/null and b/web/public/data/receipts/52.webp differ diff --git a/web/public/data/receipts/53.webp b/web/public/data/receipts/53.webp new file mode 100644 index 0000000000000000000000000000000000000000..a0bd20d1c846e7daedd4e61c907a060d222ad936 Binary files /dev/null and b/web/public/data/receipts/53.webp differ diff --git a/web/public/data/receipts/54.webp b/web/public/data/receipts/54.webp new file mode 100644 index 0000000000000000000000000000000000000000..784e5bc436a2c8caf16f262e1015b0aef96c6ad6 Binary files /dev/null and b/web/public/data/receipts/54.webp differ diff --git a/web/public/data/receipts/55.webp b/web/public/data/receipts/55.webp new file mode 100644 index 0000000000000000000000000000000000000000..474cc06b5cd9d3603512368bd10c04088fa47331 Binary files /dev/null and b/web/public/data/receipts/55.webp differ diff --git a/web/public/data/receipts/56.webp b/web/public/data/receipts/56.webp new file mode 100644 index 0000000000000000000000000000000000000000..4575bf6d2e990a247af1c293ba2d2068753f7a66 Binary files /dev/null and b/web/public/data/receipts/56.webp differ diff --git a/web/public/data/receipts/57.webp b/web/public/data/receipts/57.webp new file mode 100644 index 0000000000000000000000000000000000000000..61f409ba2cfa0a7cb59dbeaf54e4b237613ac539 Binary files /dev/null and b/web/public/data/receipts/57.webp differ diff --git a/web/public/data/receipts/58.webp b/web/public/data/receipts/58.webp new file mode 100644 index 0000000000000000000000000000000000000000..c28f9e0f1f7429036e3f9ba4de9b9680e76269e4 Binary files /dev/null and b/web/public/data/receipts/58.webp differ diff --git a/web/public/data/receipts/59.webp b/web/public/data/receipts/59.webp new file mode 100644 index 0000000000000000000000000000000000000000..2c60ef1d169e7bfc6cf8e81a192f417a50a3aa3b Binary files /dev/null and b/web/public/data/receipts/59.webp differ diff --git a/web/public/data/receipts/6.webp b/web/public/data/receipts/6.webp new file mode 100644 index 0000000000000000000000000000000000000000..607fb4d2c207b15a2aaf668ea1ae96bf19e93e93 Binary files /dev/null and b/web/public/data/receipts/6.webp differ diff --git a/web/public/data/receipts/60.webp b/web/public/data/receipts/60.webp new file mode 100644 index 0000000000000000000000000000000000000000..20f99988e4fe6cfedc48f706d1397c7ac38e8433 Binary files /dev/null and b/web/public/data/receipts/60.webp differ diff --git a/web/public/data/receipts/61.webp b/web/public/data/receipts/61.webp new file mode 100644 index 0000000000000000000000000000000000000000..0ccc497a42df50f96a7dec8215a69c9f567e0abf Binary files /dev/null and b/web/public/data/receipts/61.webp differ diff --git a/web/public/data/receipts/62.webp b/web/public/data/receipts/62.webp new file mode 100644 index 0000000000000000000000000000000000000000..f4f1cb174847fe1ab6ee9bc8fa2f4c3752ded7c4 Binary files /dev/null and b/web/public/data/receipts/62.webp differ diff --git a/web/public/data/receipts/63.webp b/web/public/data/receipts/63.webp new file mode 100644 index 0000000000000000000000000000000000000000..a30db1ee56ea4d76344848f3e98c23f842390685 Binary files /dev/null and b/web/public/data/receipts/63.webp differ diff --git a/web/public/data/receipts/64.webp b/web/public/data/receipts/64.webp new file mode 100644 index 0000000000000000000000000000000000000000..df445444fe078ede9d27e73bff783d832c44fc9a Binary files /dev/null and b/web/public/data/receipts/64.webp differ diff --git a/web/public/data/receipts/65.webp b/web/public/data/receipts/65.webp new file mode 100644 index 0000000000000000000000000000000000000000..98b8de6edfdc1a65aa93f063c128d6047a897f48 Binary files /dev/null and b/web/public/data/receipts/65.webp differ diff --git a/web/public/data/receipts/66.webp b/web/public/data/receipts/66.webp new file mode 100644 index 0000000000000000000000000000000000000000..3a9c07dc29b931a4c86f94a0386b50bcc3187ce2 Binary files /dev/null and b/web/public/data/receipts/66.webp differ diff --git a/web/public/data/receipts/67.webp b/web/public/data/receipts/67.webp new file mode 100644 index 0000000000000000000000000000000000000000..7cf0026e5ade86110a4f5aeca083d6fe9e2da298 Binary files /dev/null and b/web/public/data/receipts/67.webp differ diff --git a/web/public/data/receipts/68.webp b/web/public/data/receipts/68.webp new file mode 100644 index 0000000000000000000000000000000000000000..2c58b82169324f2495e8b34bd06397a3673ac5c8 Binary files /dev/null and b/web/public/data/receipts/68.webp differ diff --git a/web/public/data/receipts/69.webp b/web/public/data/receipts/69.webp new file mode 100644 index 0000000000000000000000000000000000000000..6b621d2cd9220192d04fc3e8a39344408e9c927f Binary files /dev/null and b/web/public/data/receipts/69.webp differ diff --git a/web/public/data/receipts/7.webp b/web/public/data/receipts/7.webp new file mode 100644 index 0000000000000000000000000000000000000000..9ee3cc95c1ba22f486bf92ac9675128e93fc9c0b Binary files /dev/null and b/web/public/data/receipts/7.webp differ diff --git a/web/public/data/receipts/70.webp b/web/public/data/receipts/70.webp new file mode 100644 index 0000000000000000000000000000000000000000..687d676412b10952b1835dccfd5650f3d157dc26 Binary files /dev/null and b/web/public/data/receipts/70.webp differ diff --git a/web/public/data/receipts/71.webp b/web/public/data/receipts/71.webp new file mode 100644 index 0000000000000000000000000000000000000000..1a501c5322df8e796f956d55d53596d89c7691d4 Binary files /dev/null and b/web/public/data/receipts/71.webp differ diff --git a/web/public/data/receipts/72.webp b/web/public/data/receipts/72.webp new file mode 100644 index 0000000000000000000000000000000000000000..d412dd1e499a75099ba6f00d9f9395d65b0e9115 Binary files /dev/null and b/web/public/data/receipts/72.webp differ diff --git a/web/public/data/receipts/73.webp b/web/public/data/receipts/73.webp new file mode 100644 index 0000000000000000000000000000000000000000..2fb8d26c251677e81a3587b903900273103608db Binary files /dev/null and b/web/public/data/receipts/73.webp differ diff --git a/web/public/data/receipts/74.webp b/web/public/data/receipts/74.webp new file mode 100644 index 0000000000000000000000000000000000000000..2e39640b9099ccb4bac880226b7625870b2e6d53 Binary files /dev/null and b/web/public/data/receipts/74.webp differ diff --git a/web/public/data/receipts/75.webp b/web/public/data/receipts/75.webp new file mode 100644 index 0000000000000000000000000000000000000000..a9e331b45f60cec4e74291a700b5ca5a224a746f Binary files /dev/null and b/web/public/data/receipts/75.webp differ diff --git a/web/public/data/receipts/76.webp b/web/public/data/receipts/76.webp new file mode 100644 index 0000000000000000000000000000000000000000..b6e6f9bab4de57ebccf77175b7ca78e666c106a0 Binary files /dev/null and b/web/public/data/receipts/76.webp differ diff --git a/web/public/data/receipts/77.webp b/web/public/data/receipts/77.webp new file mode 100644 index 0000000000000000000000000000000000000000..ce166799b2778195294559e0cdd76e3df2364651 Binary files /dev/null and b/web/public/data/receipts/77.webp differ diff --git a/web/public/data/receipts/78.webp b/web/public/data/receipts/78.webp new file mode 100644 index 0000000000000000000000000000000000000000..40da57705554c93fb61b9b69a194d0358dc9c89c Binary files /dev/null and b/web/public/data/receipts/78.webp differ diff --git a/web/public/data/receipts/79.webp b/web/public/data/receipts/79.webp new file mode 100644 index 0000000000000000000000000000000000000000..18b10414b7fa2afc994621262ef17086842f7a62 Binary files /dev/null and b/web/public/data/receipts/79.webp differ diff --git a/web/public/data/receipts/8.webp b/web/public/data/receipts/8.webp new file mode 100644 index 0000000000000000000000000000000000000000..0092c4b68e40914ab3eb319a462500c34985a1e2 Binary files /dev/null and b/web/public/data/receipts/8.webp differ diff --git a/web/public/data/receipts/80.webp b/web/public/data/receipts/80.webp new file mode 100644 index 0000000000000000000000000000000000000000..782886133c3c858337114915067d11ee05801acc Binary files /dev/null and b/web/public/data/receipts/80.webp differ diff --git a/web/public/data/receipts/81.webp b/web/public/data/receipts/81.webp new file mode 100644 index 0000000000000000000000000000000000000000..fc0a18502527b31579f4678c02bb4d911cbeaf39 Binary files /dev/null and b/web/public/data/receipts/81.webp differ diff --git a/web/public/data/receipts/82.webp b/web/public/data/receipts/82.webp new file mode 100644 index 0000000000000000000000000000000000000000..8b22acce5d63714055870ca09617a08a8e709dca Binary files /dev/null and b/web/public/data/receipts/82.webp differ diff --git a/web/public/data/receipts/83.webp b/web/public/data/receipts/83.webp new file mode 100644 index 0000000000000000000000000000000000000000..4324ee703a3cb847482a1088778366ae1c9481df Binary files /dev/null and b/web/public/data/receipts/83.webp differ diff --git a/web/public/data/receipts/84.webp b/web/public/data/receipts/84.webp new file mode 100644 index 0000000000000000000000000000000000000000..6ef30cca3652abf50ee9cb95997f2b771f273670 Binary files /dev/null and b/web/public/data/receipts/84.webp differ diff --git a/web/public/data/receipts/85.webp b/web/public/data/receipts/85.webp new file mode 100644 index 0000000000000000000000000000000000000000..69f02c86c6d5724a98227100ed5594a2bbc716d0 Binary files /dev/null and b/web/public/data/receipts/85.webp differ diff --git a/web/public/data/receipts/86.webp b/web/public/data/receipts/86.webp new file mode 100644 index 0000000000000000000000000000000000000000..1521c5f7861ddf396995317fb9dceb8181f6c572 Binary files /dev/null and b/web/public/data/receipts/86.webp differ diff --git a/web/public/data/receipts/87.webp b/web/public/data/receipts/87.webp new file mode 100644 index 0000000000000000000000000000000000000000..12fd67c438f3b1d65184adb4d14e04ac1d35c785 Binary files /dev/null and b/web/public/data/receipts/87.webp differ diff --git a/web/public/data/receipts/88.webp b/web/public/data/receipts/88.webp new file mode 100644 index 0000000000000000000000000000000000000000..2c2deaa791a9478dddbafdab2f88875f96a48805 Binary files /dev/null and b/web/public/data/receipts/88.webp differ diff --git a/web/public/data/receipts/89.webp b/web/public/data/receipts/89.webp new file mode 100644 index 0000000000000000000000000000000000000000..93eb2070a4932cf7c5a76b32fb642b10f009740f Binary files /dev/null and b/web/public/data/receipts/89.webp differ diff --git a/web/public/data/receipts/9.webp b/web/public/data/receipts/9.webp new file mode 100644 index 0000000000000000000000000000000000000000..0e6177c30301839eb752905451f8b67c7a5851b5 Binary files /dev/null and b/web/public/data/receipts/9.webp differ diff --git a/web/public/data/receipts/90.webp b/web/public/data/receipts/90.webp new file mode 100644 index 0000000000000000000000000000000000000000..028253e4dd44c25a46f70c54fdd5f54836676bd3 Binary files /dev/null and b/web/public/data/receipts/90.webp differ diff --git a/web/public/data/receipts/91.webp b/web/public/data/receipts/91.webp new file mode 100644 index 0000000000000000000000000000000000000000..9cb09f7e050a953729d807493929b5bcdfe97444 Binary files /dev/null and b/web/public/data/receipts/91.webp differ diff --git a/web/public/data/receipts/92.webp b/web/public/data/receipts/92.webp new file mode 100644 index 0000000000000000000000000000000000000000..4100713d4048b0325c9ad468a14b51114176931b Binary files /dev/null and b/web/public/data/receipts/92.webp differ diff --git a/web/public/data/receipts/93.webp b/web/public/data/receipts/93.webp new file mode 100644 index 0000000000000000000000000000000000000000..cff25b81de2ae353e5351079386d75505705e3c4 Binary files /dev/null and b/web/public/data/receipts/93.webp differ diff --git a/web/public/data/receipts/94.webp b/web/public/data/receipts/94.webp new file mode 100644 index 0000000000000000000000000000000000000000..93f6b4f6c4cbaad957d0a23161d4b50501d21600 Binary files /dev/null and b/web/public/data/receipts/94.webp differ diff --git a/web/public/data/receipts/95.webp b/web/public/data/receipts/95.webp new file mode 100644 index 0000000000000000000000000000000000000000..ba02e40112867a5aae9aab77cd1634b977dc72a7 Binary files /dev/null and b/web/public/data/receipts/95.webp differ diff --git a/web/public/data/receipts/96.webp b/web/public/data/receipts/96.webp new file mode 100644 index 0000000000000000000000000000000000000000..c181aac2609a5b259b4227303f61a729907ffa7a Binary files /dev/null and b/web/public/data/receipts/96.webp differ diff --git a/web/public/data/receipts/97.webp b/web/public/data/receipts/97.webp new file mode 100644 index 0000000000000000000000000000000000000000..63afdbbc9bf3e38e49e774c0c8c62b3dde61a0d8 Binary files /dev/null and b/web/public/data/receipts/97.webp differ diff --git a/web/public/data/receipts/98.webp b/web/public/data/receipts/98.webp new file mode 100644 index 0000000000000000000000000000000000000000..969f5dd25c7ab977c659982f7ea476ae348d56ac Binary files /dev/null and b/web/public/data/receipts/98.webp differ diff --git a/web/public/data/receipts/99.webp b/web/public/data/receipts/99.webp new file mode 100644 index 0000000000000000000000000000000000000000..b170d1e64a9b9e9a8e9930883b4eaa872860ae1f Binary files /dev/null and b/web/public/data/receipts/99.webp differ diff --git a/web/scripts/parity.ts b/web/scripts/parity.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e4c90583143fc29625e4d726a3e3aaf4f2acfc9 --- /dev/null +++ b/web/scripts/parity.ts @@ -0,0 +1,34 @@ +// Checks that the TypeScript accounting checker agrees with the Python one on every receipt. +// Run: node scripts/parity.ts (Node 23.6+ runs TypeScript directly) +import fs from "node:fs"; +import { check, parseAmount } from "../src/lib/consistency.ts"; + +type PyCheck = { name: string; passed: boolean; expected: number; found: number }; +type Rec = { id: number; pred: Record | null; checks: PyCheck[] }; + +const receipts: Rec[] = JSON.parse(fs.readFileSync(new URL("../public/data/receipts.json", import.meta.url), "utf-8")); +let rules = 0; +const mismatches: string[] = []; + +for (const r of receipts) { + if (!r.pred) continue; + const ts = check(r.pred); + if (ts.length !== r.checks.length) { + mismatches.push(`#${r.id}: ${ts.length} rules in TS vs ${r.checks.length} in Python`); + continue; + } + ts.forEach((c, k) => { + const py = r.checks[k]; + rules++; + if (c.name !== py.name || c.passed !== py.passed || Math.abs(c.expected - py.expected) > 1e-6 || Math.abs(c.found - py.found) > 1e-6) { + mismatches.push(`#${r.id} ${py.name}: TS ${JSON.stringify(c)} vs Python ${JSON.stringify(py)}`); + } + }); +} + +const spot: [string, number | null][] = [["60.000", 60000], ["1,234.50", 1234.5], ["Rp 17.500", 17500], ["-60.000", -60000], ["2.00", 2], ["abc", null]]; +for (const [s, want] of spot) if (parseAmount(s) !== want) mismatches.push(`parseAmount(${s}) = ${parseAmount(s)}, want ${want}`); + +console.log(`compared ${rules} rule results on ${receipts.length} receipts: ${mismatches.length ? `${mismatches.length} MISMATCHES` : "all identical"}`); +mismatches.slice(0, 10).forEach((m) => console.log(" " + m)); +process.exit(mismatches.length ? 1 : 0); diff --git a/web/src/app/about/page.tsx b/web/src/app/about/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..236f3a02220dd1044184958c3832d4dc7d349460 --- /dev/null +++ b/web/src/app/about/page.tsx @@ -0,0 +1,68 @@ +import { Cpu, Database, MonitorPlay, Scale } from "lucide-react"; +import { GITHUB_URL } from "@/lib/site"; +import { Banner, Card, Pill } from "@/components/ui"; + +export default function AboutPage() { + return ( + <> + real data · open models} + meta="What this site shows, where the data comes from, and how the numbers were produced." + /> +
+ }> +

+ Every reading, rule result and ranked page here is the real output of the evaluation runs reported in the README. Nothing is + simulated. The models need a GPU, which free hosting does not provide, so this site shows the saved outputs. The accounting + checker runs live in your browser, so edits are rechecked instantly. +

+

+ Live mode: run the FastAPI reader on a GPU machine (bash scripts/wsl.sh bash scripts/serve.sh) and open the site locally; the Scan receipt page then reads uploaded photos with the fine-tuned model. +

+
+ }> +
    +
  • Receipts: the 100-receipt CORD-v2 test split, never used in training. Fine-tuning used the 800-receipt train split.
  • +
  • Search: all 150 FinanceBench questions, scored against the evidence pages the analysts labelled.
  • +
  • Hardware: one RTX 4060 laptop GPU (8 GB), Windows 11 with WSL2 Ubuntu. Cost: $0.
  • +
  • + Code and scripts that reproduce every number:{" "} + + github.com/WAYTECHG/SumProof + +
  • +
+
+ }> +
    +
  • +

    CORD-v2 receipts · CC-BY-4.0

    +

    Real Indonesian receipts with field labels, by NAVER Clova. The receipt photos on this site come from its test split.

    +
  • +
  • +

    FinanceBench · CC-BY-NC-4.0

    +

    + Questions, answers and evidence pages written by financial analysts about real SEC filings, by Patronus AI. Page text is shown here + for non-commercial demonstration. +

    +
  • +
+
+ }> +
    +
  • +

    Qwen3.5-4B, Qwen3-Embedding-0.6B, Qwen3-Reranker-0.6B · Apache-2.0

    +

    Open models from the Qwen team, downloaded from Hugging Face.

    +
  • +
  • +

    SumProof code · MIT

    +

    The licence covers the code only; datasets and model weights keep their own licences.

    +
  • +
+
+
+ + ); +} diff --git a/web/src/app/architecture/page.tsx b/web/src/app/architecture/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e8b398486bb97d15842b9a1019454deac34e290c --- /dev/null +++ b/web/src/app/architecture/page.tsx @@ -0,0 +1,59 @@ +/* eslint-disable @next/next/no-img-element */ +import { FileSearch, ReceiptText } from "lucide-react"; +import { Banner, Card, Pill } from "@/components/ui"; + +const RECEIPT_STEPS = [ + ["Read", "The photo goes straight into Qwen3.5-4B, a vision-language model. Its vision encoder turns the image into up to ~800 image tokens and the language model writes the receipt as JSON. There is no separate OCR step.", "receipts/vlm.py"], + ["Sample", "Besides the normal (greedy) reading, the model samples four more, giving five candidates.", "vlm.generate"], + ["Check", "Each candidate is tested against the receipt's arithmetic. The checker keeps the one that passes the most rules; if even that one breaks a rule, the receipt goes to human review.", "receipts/consistency.py"], + ["Fine-tune (offline)", "QLoRA trains a small LoRA adapter (0.67% of the weights) on 800 real CORD receipts while the 4-bit base model stays frozen; the adapter plugs into the language model at inference.", "receipts/train_qlora.py"], +]; +const SEARCH_STEPS = [ + ["Index (offline)", "The 84 filings are split into 12,013 pages and each page is embedded with Qwen3-Embedding into a 1024-number vector.", "rag/download_financebench.py"], + ["Route", "The question's company (name, ticker or nickname) and fiscal year select the matching filings.", "financebench.build_router"], + ["Search", "The question is embedded the same way, and exact vector search finds the closest pages among the routed filings, in FAISS or in PostgreSQL with pgvector, where routing is a SQL WHERE clause.", "rag/index.py · rag/pgstore.py"], + ["Rerank", "Qwen3-Reranker reads the question and each of the top 30 pages together and reorders them; the output is the evidence pages with their page numbers.", "financebench.py"], +]; + +function Steps({ steps }: { steps: string[][] }) { + return ( +
    + {steps.map(([title, text, file], k) => ( +
  1. + {k + 1} +
    +

    {title}

    +

    {text}

    + {file} +
    +
  2. + ))} +
+ ); +} + +export default function ArchitecturePage() { + return ( + <> + two pipelines} + meta="Solid boxes run for every request; dashed boxes are offline steps that run once." + /> + +
+ SumProof architecture: receipt reader and financial filing search pipelines +
+
+
+ }> + + + }> + + +
+ + ); +} diff --git a/web/src/app/compare/page.tsx b/web/src/app/compare/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..0ddcaf0815948d316b4320e2ddf595b49513bad3 --- /dev/null +++ b/web/src/app/compare/page.tsx @@ -0,0 +1,12 @@ +import { Suspense } from "react"; +import { CompareMethods } from "@/components/CompareMethods"; +import { loadDashboard, loadQuestions } from "@/lib/data"; + +export default function ComparePage() { + const d = loadDashboard(); + return ( + + + + ); +} diff --git a/web/src/app/favicon.ico b/web/src/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c Binary files /dev/null and b/web/src/app/favicon.ico differ diff --git a/web/src/app/globals.css b/web/src/app/globals.css new file mode 100644 index 0000000000000000000000000000000000000000..ef85cfeb1fd1ea18dfa99a9fdad8f6540db579c1 --- /dev/null +++ b/web/src/app/globals.css @@ -0,0 +1,96 @@ +@import "tailwindcss"; + +/* SumProof design tokens: one light theme. Navy sidebar, light grey canvas, white cards with thin + borders, royal-blue accent. Text contrast ~16:1, muted ~6:1, blue on white ~5.6:1. */ +:root { + --bg: #f5f6f8; + --surface: #ffffff; + --surface-solid: #ffffff; + --sunken: #f7f8fa; + --ink: #1a1f36; + --muted: #5b6275; + --line: #e4e7ec; + --accent: #3a5bd9; + --accent-deep: #2c47b8; + --accent-soft: #eef1fd; + --caramel: #f5b83d; + --rose: #e5484d; + --sage: #12a594; + --good: #16803c; + --good-soft: #e7f6ec; + --warn: #d92d20; + --warn-soft: #fdecea; + --info: #3a5bd9; + --info-soft: #eef1fd; + --nav: #232a52; + --nav-ink: #e8eaf6; + --nav-muted: #a4abd1; + --shadow: 0 1px 2px rgba(16, 24, 40, 0.04); +} + +@theme inline { + --color-bg: var(--bg); + --color-surface: var(--surface); + --color-surface-solid: var(--surface-solid); + --color-sunken: var(--sunken); + --color-ink: var(--ink); + --color-muted: var(--muted); + --color-line: var(--line); + --color-accent: var(--accent); + --color-accent-deep: var(--accent-deep); + --color-accent-soft: var(--accent-soft); + --color-nav: var(--nav); + --color-nav-ink: var(--nav-ink); + --color-nav-muted: var(--nav-muted); + --color-caramel: var(--caramel); + --color-rose: var(--rose); + --color-sage: var(--sage); + --color-good: var(--good); + --color-good-soft: var(--good-soft); + --color-warn: var(--warn); + --color-warn-soft: var(--warn-soft); + --color-info: var(--info); + --color-info-soft: var(--info-soft); + --font-sans: var(--font-inter), ui-sans-serif, system-ui, "Segoe UI", sans-serif; + --font-mono: var(--font-plex-mono), ui-monospace, "Cascadia Mono", Consolas, monospace; + --shadow-card: var(--shadow); +} + +html, +body { + background: var(--bg); + color: var(--ink); +} + +body { + font-family: var(--font-sans); + -webkit-font-smoothing: antialiased; +} + +.accent-fill { + background: var(--accent); +} + +.tabular { + font-variant-numeric: tabular-nums; +} + +/* Highlight for matched words in filing pages. */ +mark { + background: color-mix(in srgb, var(--caramel) 35%, transparent); + color: inherit; + border-radius: 3px; + padding: 0 2px; +} + +:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; +} + +@media (prefers-reduced-motion: reduce) { + * { + transition: none !important; + animation: none !important; + } +} diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx new file mode 100644 index 0000000000000000000000000000000000000000..d79cfc9090008fb2f74585c4f2b0e2acb82555bb --- /dev/null +++ b/web/src/app/layout.tsx @@ -0,0 +1,23 @@ +import type { Metadata } from "next"; +import { IBM_Plex_Mono, Inter } from "next/font/google"; +import { Shell } from "@/components/Shell"; +import "./globals.css"; + +const inter = Inter({ variable: "--font-inter", subsets: ["latin"], weight: ["400", "500", "600", "700"] }); +const plexMono = IBM_Plex_Mono({ variable: "--font-plex-mono", subsets: ["latin"], weight: ["400", "500"] }); + +export const metadata: Metadata = { + title: "SumProof", + description: + "Receipt AI that checks the numbers add up, and evidence search over 12,013 pages of real SEC filings. Explorer for the real evaluation results.", +}; + +export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) { + return ( + + + {children} + + + ); +} diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a48543e05b680c7d80904e9ea989fd56dc51b089 --- /dev/null +++ b/web/src/app/page.tsx @@ -0,0 +1,13 @@ +import { Suspense } from "react"; +import { ScanReceipt } from "@/components/ScanReceipt"; +import { loadReceipts } from "@/lib/data"; + +export default function ScanPage() { + // Only what the scan page needs: the photo and the fine-tuned model's reading of each sample. + const samples = loadReceipts().map(({ id, image, pred, flagged }) => ({ id, image, pred, flagged })); + return ( + + + + ); +} diff --git a/web/src/app/queue/page.tsx b/web/src/app/queue/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..cd972d4a4601afed9877c4254add8ad0f3f386d0 --- /dev/null +++ b/web/src/app/queue/page.tsx @@ -0,0 +1,6 @@ +import { QueueTable } from "@/components/QueueTable"; +import { loadReceipts } from "@/lib/data"; + +export default function QueuePage() { + return ; +} diff --git a/web/src/app/receipts/[id]/page.tsx b/web/src/app/receipts/[id]/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..3c45ea50628211aff704f9d83d46a5fe10d14ba3 --- /dev/null +++ b/web/src/app/receipts/[id]/page.tsx @@ -0,0 +1,14 @@ +import { ReceiptChecker } from "@/components/ReceiptChecker"; +import { loadReceipts } from "@/lib/data"; + +export function generateStaticParams() { + return loadReceipts().map((r) => ({ id: String(r.id) })); +} + +export default async function ReceiptPage({ params }: { params: Promise<{ id: string }> }) { + const { id } = await params; + const receipts = loadReceipts(); + const i = Number(id); + const record = receipts[i]; + return 0 ? i - 1 : null} next={i < receipts.length - 1 ? i + 1 : null} />; +} diff --git a/web/src/app/receipts/page.tsx b/web/src/app/receipts/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..12463544458f5399ccee1eabdc15c45538ff6571 --- /dev/null +++ b/web/src/app/receipts/page.tsx @@ -0,0 +1,33 @@ +/* eslint-disable @next/next/no-img-element */ +import Link from "next/link"; +import { Banner, Card, Pill } from "@/components/ui"; +import { loadReceipts } from "@/lib/data"; + +export default function ReceiptsGallery() { + const receipts = loadReceipts(); + return ( + <> + 100 test receipts} + meta="Pick a test receipt to compare the model before and after fine-tuning against the human label, and to see how the checker picked its reading." + /> + +
    + {receipts.map((r) => ( +
  • + + {`Receipt + + #{r.id} + + + +
  • + ))} +
+
+ + ); +} diff --git a/web/src/app/results/page.tsx b/web/src/app/results/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..9c531b263086681d88925f1b1b8893276f4a7102 --- /dev/null +++ b/web/src/app/results/page.tsx @@ -0,0 +1,166 @@ +import { ArrowRight, Columns3, Database, FileSearch, Gauge, Inbox, LineChart, ReceiptText } from "lucide-react"; +import Link from "next/link"; +import { BarBreakdown, TrainingCurve } from "@/components/charts"; +import { Banner, Button, Card, Pill, Stat } from "@/components/ui"; +import { loadDashboard, loadReceipts } from "@/lib/data"; + +const RECEIPT_ROWS = [ + { key: "zeroshot", label: "Zero-shot" }, + { key: "zeroshot_best4", label: "+ checker (best-of-4)" }, + { key: "sft", label: "+ QLoRA fine-tune" }, + { key: "sft_best4", label: "+ fine-tune + checker" }, +] as const; + +const LADDER = [ + { key: "1_bm25", label: "BM25" }, + { key: "2_dense", label: "Dense" }, + { key: "3_hybrid_rrf", label: "Hybrid" }, + { key: "4_dense_routed", label: "Routed" }, + { key: "5_dense_routed_reranked", label: "Reranked" }, +]; + +const SCREENS = [ + { href: "/receipts/0/", icon: ReceiptText, title: "Receipt checker", text: "See the model read a real receipt, edit any field and watch the accounting rules recheck." }, + { href: "/queue/", icon: Inbox, title: "Review queue", text: "All 100 test receipts: what was auto-accepted, what went to review, and export to CSV." }, + { href: "/search/", icon: FileSearch, title: "Filing search", text: "Ask one of 150 analyst questions and get the evidence pages from real SEC filings." }, + { href: "/compare/", icon: Columns3, title: "Compare methods", text: "The same question under BM25, dense, routing and reranking, side by side." }, +]; + +export default function Overview() { + const d = loadDashboard(); + const receipts = loadReceipts(); + const r = d.receipts; + const m = d.retrieval.metrics; + const flagged = receipts.filter((x) => x.flagged).length; + const pg = d.pgvector; + + return ( + <> + + Qwen3.5-4B fine-tuned + Real data · $0 + + } + meta="Reads receipt photos and checks that the numbers add up · finds the page in a real SEC filing that answers an analyst's question · one 8 GB laptop GPU" + right={ + <> + + + + } + /> + +
+ + + + +
+ +
+ } action={{flagged} sent to review}> +
+ + + + + + + + + + + + {RECEIPT_ROWS.map(({ key, label }) => { + const row = r[key]; + const best = key === "sft_best4"; + return ( + + + + + + + + ); + })} + +
Qwen3.5-4BF1NumbersCorrects/rcpt
{label}{row.strict_f1.toFixed(3)}{row.numbers_f1.toFixed(3)}{row.exact}/100{row.sec.toFixed(1)}
+
+

+ Fine-tuning is the big gain; the accounting checker adds a little at 2.5× the time. Only 88 of the 100 human labels pass every + rule, because some real receipts are printed inconsistently. +

+
+ + } action={{m["5_dense_routed_reranked"]["R@5"].toFixed(2)}Recall@5}> + ({ label: s.label, value: m[s.key]["R@5"], highlight: s.key === "5_dense_routed_reranked" }))} + /> +

+ BM25 struggles on 10-K pages full of repeated wording and number tables, so the common hybrid default drops below dense search. + Routing by company and year, then reranking, gives the best result. +

+
+ + } action={30.5M trainable params · 7.2 GB peak}> + + + + } action={identical top-10 · 150/150}> +
+ + + + + + + + + + {[ + ["FAISS IndexFlatIP (exact)", `${d.faiss.benchmark[0].ms_per_query.toFixed(1)} ms`, "100%"], + ["FAISS HNSW, efSearch 64", `${d.faiss.benchmark.find((b) => b.efSearch === 64)?.ms_per_query.toFixed(2)} ms`, "100%"], + ["PostgreSQL + pgvector, exact", `${pg.exact_ms_median} ms`, "150/150 = FAISS"], + ["PostgreSQL + pgvector, HNSW", `${pg.hnsw_ms_median} ms`, `${(Number(pg.hnsw_top10_overlap_with_exact) * 100).toFixed(1)}%`], + ].map(([a, b, c]) => ( + + + + + + ))} + +
Index · 12,013 × 1024-dMedian latencySame top-10
{a}{b}{c}
+
+

+ + In pgvector, filing routing is a SQL WHERE doc_name = ANY(...) clause next to the vector search. +

+
+
+ +

Explore the results

+
+ {SCREENS.map(({ href, icon: Icon, title, text }) => ( + + + + +

+ {title} +

+

{text}

+ + ))} +
+ + ); +} diff --git a/web/src/app/search/page.tsx b/web/src/app/search/page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..205ea1de79e4c999a951c0ee02d9f2f28353047b --- /dev/null +++ b/web/src/app/search/page.tsx @@ -0,0 +1,11 @@ +import { Suspense } from "react"; +import { FilingSearch } from "@/components/FilingSearch"; +import { loadQuestions } from "@/lib/data"; + +export default function SearchPage() { + return ( + + + + ); +} diff --git a/web/src/components/CompareMethods.tsx b/web/src/components/CompareMethods.tsx new file mode 100644 index 0000000000000000000000000000000000000000..64d0c5ee5c8c1a4f2d08e48443a23d26d35010b5 --- /dev/null +++ b/web/src/components/CompareMethods.tsx @@ -0,0 +1,137 @@ +"use client"; + +import { BarChart3, Check, Lightbulb, X } from "lucide-react"; +import Link from "next/link"; +import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { useMemo, useState } from "react"; +import { docParts, METHODS, type QuestionSummary } from "@/lib/types"; +import { BarBreakdown } from "./charts"; +import { QuestionPicker, useQuestion } from "./QuestionPicker"; +import { Banner, Card, Pill } from "./ui"; + +const METRIC_KEY: Record = { + bm25: "1_bm25", + dense: "2_dense", + hybrid: "3_hybrid_rrf", + routed: "4_dense_routed", + reranked: "5_dense_routed_reranked", +}; + +export function CompareMethods({ questions, metrics }: { questions: QuestionSummary[]; metrics: Record> }) { + const params = useSearchParams(); + const router = useRouter(); + const pathname = usePathname(); + const fromUrl = params.has("q") ? Number(params.get("q")) : NaN; + const interesting = useMemo(() => { + const keywordMiss = questions.filter((q) => q.rank.reranked === 1 && q.rank.bm25 === null).slice(0, 3); + const routingHelps = questions.filter((q) => q.rank.dense === null && q.rank.reranked !== null && q.rank.reranked <= 3).slice(0, 2); + return [...keywordMiss.map((q) => ({ q, why: "BM25 misses, reranker #1" })), ...routingHelps.map((q) => ({ q, why: "dense misses, routing finds it" }))]; + }, [questions]); + const [qi, setQi] = useState(Number.isInteger(fromUrl) && fromUrl >= 0 && fromUrl < questions.length ? fromUrl : interesting[0]?.q.i ?? 0); + const { detail } = useQuestion(qi); + + const choose = (i: number) => { + setQi(i); + router.replace(`${pathname}?q=${i}`, { scroll: false }); + }; + + return ( + <> + same question · 5 retrieval steps} + meta="Each column is one step of the ladder. A green row is a page the financial analysts marked as the evidence." + > + +
+ + Questions that show the difference: + + {interesting.map(({ q, why }) => ( + + ))} +
+
+ + {!detail && Loading the question…} + + {detail && ( +
+ {METHODS.map((m) => { + const hits = detail.methods[m.key].slice(0, 5); + const rank = detail.methods[m.key].findIndex((h) => h.gold) + 1; + const final = m.key === "reranked"; + return ( +
+

{m.note}

+

{m.label}

+
+ {rank > 0 ? ( + + evidence at rank {rank} + + ) : ( + + not in top 10 + + )} +
+
    + {hits.map((h, k) => { + const p = detail.pages[String(h.row)]; + const { company, period } = docParts(p.doc); + return ( +
  1. + + {k + 1} + + + {period} · p.{p.page + 1} + + {company} + + +
  2. + ); + })} +
+
+ ); + })} +
+ )} + + } action={Recall@1 · first result is the evidence}> + ({ label: m.short, value: metrics[METRIC_KEY[m.key]]["R@1"], highlight: m.key === "reranked" }))} + max={0.5} + /> +

+ How often the very first page is the analysts' evidence page. The final pipeline gets it right on its first try for{" "} + {Math.round(metrics["5_dense_routed_reranked"]["R@1"] * 150)} of 150 questions, against {Math.round(metrics["1_bm25"]["R@1"] * 150)} for keyword search. +

+
+ + ); +} diff --git a/web/src/components/FilingSearch.tsx b/web/src/components/FilingSearch.tsx new file mode 100644 index 0000000000000000000000000000000000000000..1b7a10e0bac897b6d2cd4942bcbb01fca69a2d62 --- /dev/null +++ b/web/src/components/FilingSearch.tsx @@ -0,0 +1,188 @@ +"use client"; + +import { Building2, CalendarDays, Check, ExternalLink, FileText, Files, MessageSquareQuote, Route } from "lucide-react"; +import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { useEffect, useMemo, useState } from "react"; +import { prettyDoc, TYPE_LABEL, type QuestionSummary } from "@/lib/types"; +import { Highlight, keyTerms, QuestionPicker, snippet, useQuestion } from "./QuestionPicker"; +import { Banner, Card, Pill } from "./ui"; + +export function FilingSearch({ questions }: { questions: QuestionSummary[] }) { + const params = useSearchParams(); + const router = useRouter(); + const pathname = usePathname(); + const fromUrl = params.has("q") ? Number(params.get("q")) : NaN; + const [qi, setQi] = useState(Number.isInteger(fromUrl) && fromUrl >= 0 && fromUrl < questions.length ? fromUrl : questions[0].i); + const { detail, error } = useQuestion(qi); + const [selected, setSelected] = useState(null); + const [showAnswer, setShowAnswer] = useState(false); + + const choose = (i: number) => { + setQi(i); + setSelected(null); + setShowAnswer(false); + router.replace(`${pathname}?q=${i}`, { scroll: false }); + }; + + const hits = useMemo(() => detail?.methods.reranked.slice(0, 5) ?? [], [detail]); + useEffect(() => { + if (detail && selected === null && hits.length) setSelected(hits[0].row); + }, [detail, selected, hits]); + + const terms = detail ? keyTerms(detail.question) : []; + const page = detail && selected !== null ? detail.pages[String(selected)] : null; + const isGold = detail && selected !== null ? detail.gold.some((g) => g.row === selected) : false; + const goldRank = detail ? detail.methods.reranked.findIndex((h) => h.gold) + 1 : 0; + const summary = questions.find((q) => q.i === qi); + + return ( + <> + + 12,013 pages · 84 SEC filings + 150 analyst questions + + } + meta="Pick an analyst question about a company's SEC filing. SumProof finds the pages that answer it and shows them with the matching words marked." + > + + + + {error && Could not load this question. Check that the exported data is present in public/data/q.} + {!detail && !error && Loading the question…} + + {detail && ( + <> + } action={{TYPE_LABEL[detail.type] ?? detail.type}}> +
+ {detail.detected ? ( + <> + + {detail.detected.company} + + {detail.detected.years.length > 0 && ( + + {detail.detected.years.join(", ")} + + )} + {detail.detected.filings.map((f) => ( + + {prettyDoc(f)} + + ))} + + ) : ( + No company named · searched all 84 filings + )} +
+
+ + {showAnswer && ( +
+

{detail.answer}

+ {detail.justification &&

{detail.justification}

} +

+ From FinanceBench. SumProof retrieves the evidence pages; writing the answer is the next step (generation). +

+
+ )} +
+
+ +
+ } + action={ + goldRank > 0 && goldRank <= 5 ? ( + + analysts' page at rank {goldRank} + + ) : goldRank > 5 ? ( + analysts' page at rank {goldRank} + ) : ( + analysts' page not in top 10 + ) + } + > +
    + {hits.map((h, k) => { + const p = detail.pages[String(h.row)]; + const active = selected === h.row; + return ( +
  1. + +
  2. + ); + })} +
+
+ + } + action={ + page ? ( + <> + {isGold && analysts' evidence page} + page {page.page + 1} + + ) : null + } + > + {page ? ( + <> +
+ +
+
+ Text extracted with PyMuPDF; highlights are words from the question. + {summary && detail.doc_link && page.doc === detail.gold[0]?.doc && ( + + Open original filing + + )} +
+ + ) : ( +

Select a page to read it.

+ )} +
+
+ + )} + + ); +} diff --git a/web/src/components/QuestionPicker.tsx b/web/src/components/QuestionPicker.tsx new file mode 100644 index 0000000000000000000000000000000000000000..b017b757fa662398d455ace5fbf3f318ab1aa468 --- /dev/null +++ b/web/src/components/QuestionPicker.tsx @@ -0,0 +1,164 @@ +"use client"; + +import { ChevronDown, ChevronLeft, ChevronRight, Search } from "lucide-react"; +import { useEffect, useMemo, useRef, useState } from "react"; +import { TYPE_LABEL, type QuestionDetail, type QuestionSummary } from "@/lib/types"; + +export function QuestionPicker({ + questions, + value, + onChange, +}: { + questions: QuestionSummary[]; + value: number; + onChange: (i: number) => void; +}) { + const [open, setOpen] = useState(false); + const [query, setQuery] = useState(""); + const [type, setType] = useState("all"); + const box = useRef(null); + const current = questions.find((q) => q.i === value); + + useEffect(() => { + const onClick = (e: MouseEvent) => { + if (box.current && !box.current.contains(e.target as Node)) setOpen(false); + }; + window.addEventListener("mousedown", onClick); + return () => window.removeEventListener("mousedown", onClick); + }, []); + + const list = useMemo(() => { + const words = query.toLowerCase().split(/\s+/).filter(Boolean); + return questions.filter((q) => (type === "all" || q.type === type) && words.every((w) => `${q.question} ${q.company}`.toLowerCase().includes(w))); + }, [questions, query, type]); + + const pos = questions.findIndex((q) => q.i === value); + const step = (d: number) => onChange(questions[(pos + d + questions.length) % questions.length].i); + + return ( +
+
+ + + +
+ + {open && ( +
+
+ + +
+
    + {list.map((q) => ( +
  • + +
  • + ))} + {list.length === 0 &&
  • No question matches.
  • } +
+
+ )} +
+ ); +} + +/** Loads one question's detail file (routed filings, every method's top 10, page texts). */ +export function useQuestion(i: number) { + const [detail, setDetail] = useState(null); + const [error, setError] = useState(false); + useEffect(() => { + let live = true; + setError(false); + fetch(`/data/q/${i}.json`) + .then((r) => (r.ok ? r.json() : Promise.reject())) + .then((d) => live && setDetail(d)) + .catch(() => live && setError(true)); + return () => { + live = false; + }; + }, [i]); + return { detail: detail?.i === i ? detail : null, error }; +} + +const STOP = new Set( + "what which with were from that this have been their there about than then into over under does did was were how many much per for and the are year fiscal company total amount based using shown give response question relying details answer please calculate round decimal places line items clearly".split(" "), +); + +/** Words from the question worth highlighting in a page. */ +export function keyTerms(question: string): string[] { + const words = question.toLowerCase().match(/[a-z0-9][a-z0-9&.-]*/g) ?? []; + return [...new Set(words.filter((w) => (w.length >= 4 || /^\d{2,}$/.test(w)) && !STOP.has(w)))].slice(0, 12); +} + +export function Highlight({ text, terms }: { text: string; terms: string[] }) { + if (!terms.length) return <>{text}; + const re = new RegExp(`(${terms.map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`, "gi"); + return ( + <> + {text.split(re).map((part, k) => (k % 2 === 1 ? {part} : {part}))} + + ); +} + +export function snippet(text: string, terms: string[], width = 260): string { + const flat = text.replace(/\s+/g, " ").trim(); + const lower = flat.toLowerCase(); + const hit = terms.map((t) => lower.indexOf(t)).filter((p) => p >= 0).sort((a, b) => a - b)[0] ?? 0; + const start = Math.max(0, hit - 60); + return (start > 0 ? "… " : "") + flat.slice(start, start + width) + (start + width < flat.length ? " …" : ""); +} diff --git a/web/src/components/QueueTable.tsx b/web/src/components/QueueTable.tsx new file mode 100644 index 0000000000000000000000000000000000000000..59a253c43483c8fd30e8c99633a8e69412cde0e0 --- /dev/null +++ b/web/src/components/QueueTable.tsx @@ -0,0 +1,183 @@ +"use client"; + +/* eslint-disable @next/next/no-img-element */ +import { Check, CircleAlert, Download, Search, Send } from "lucide-react"; +import Link from "next/link"; +import { useMemo, useState } from "react"; +import { parseAmount } from "@/lib/consistency"; +import { useDecisions, type Decision } from "@/lib/decisions"; +import type { ReceiptRecord } from "@/lib/types"; +import { Banner, Button, Card, Pill, Segmented } from "./ui"; + +type Filter = "all" | "accepted" | "review" | "mine"; +type Status = "accepted" | "review" | "approved" | "sent"; + +const STATUS: Record = { + accepted: { label: "Auto-accepted", tone: "good", icon: }, + review: { label: "Needs review", tone: "warn", icon: }, + approved: { label: "Approved by you", tone: "good", icon: }, + sent: { label: "Sent to review", tone: "warn", icon: }, +}; + +function statusOf(r: ReceiptRecord, d?: Decision): Status { + if (d) return d.status === "approved" ? "approved" : "sent"; + return r.flagged ? "review" : "accepted"; +} + +export function QueueTable({ receipts }: { receipts: ReceiptRecord[] }) { + const { decisions } = useDecisions(); + const [filter, setFilter] = useState("all"); + const [query, setQuery] = useState(""); + + const rows = useMemo( + () => + receipts.map((r) => { + const d = decisions[r.id]; + const reading = d?.edited ?? r.pred; + const passed = r.checks.filter((c) => c.passed).length; + return { + r, + status: statusOf(r, d), + items: reading?.items?.length ?? 0, + total: reading?.total ?? "", + names: (reading?.items ?? []).map((it) => it.name ?? "").join(" ").toLowerCase(), + rules: r.checks.length ? `${passed}/${r.checks.length}` : "–", + rulesOk: passed === r.checks.length, + }; + }), + [receipts, decisions], + ); + + const counts = { + accepted: rows.filter((x) => x.status === "accepted").length, + review: rows.filter((x) => x.status === "review").length, + mine: rows.filter((x) => x.status === "approved" || x.status === "sent").length, + }; + + const shown = rows.filter((x) => { + if (filter === "accepted" && x.status !== "accepted") return false; + if (filter === "review" && x.status !== "review") return false; + if (filter === "mine" && !(x.status === "approved" || x.status === "sent")) return false; + const q = query.trim().toLowerCase(); + return !q || x.names.includes(q) || `#${x.r.id}` === q || String(x.r.id) === q; + }); + + const exportCsv = () => { + const header = ["receipt", "status", "total", "total_number", "items", "rules_passed", "matches_human_label"]; + const lines = shown.map((x) => + [x.r.id, STATUS[x.status].label, `"${x.total.replace(/"/g, '""')}"`, parseAmount(x.total) ?? "", x.items, x.rules, x.r.exact ? "yes" : "no"].join(","), + ); + const blob = new Blob([[header.join(","), ...lines].join("\n")], { type: "text/csv" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = `sumproof-receipts-${filter}.csv`; + a.click(); + URL.revokeObjectURL(url); + }; + + return ( + <> + + {counts.accepted} auto-accepted + {counts.review} need review + {counts.mine > 0 && {counts.mine} decided by you} + + } + meta="The 100 sample receipts as SumProof read them. Only the ones whose numbers do not add up need a person to check." + right={ + + } + /> + + +
+ + +
+ +
+ + + + + + + + + + + + + + {shown.map((x) => { + const s = STATUS[x.status]; + const href = `/?sample=${x.r.id}`; + const first = (x.r.pred?.items ?? []).slice(0, 2).map((it) => it.name).filter(Boolean).join(", "); + return ( + + + + + + + + + + ); + })} + {shown.length === 0 && ( + + + + )} + +
ReceiptFirst itemsItemsTotalRulesvs human labelStatus
+ + + #{x.r.id} + + {first || "–"}{x.items}{x.total || "–"}{x.rules}{x.r.exact ? matches : differs} + + + {s.icon} {s.label} + + +
+ No receipts match this filter. +
+
+

+ "vs human label" compares every field with CORD's annotation; most differences are item-name spellings, not amounts. + Your decisions are saved in this browser only. +

+
+ + ); +} diff --git a/web/src/components/QuickJump.tsx b/web/src/components/QuickJump.tsx new file mode 100644 index 0000000000000000000000000000000000000000..6d7d2e9fd96aff7c48fd60b88a03fb92a6141965 --- /dev/null +++ b/web/src/components/QuickJump.tsx @@ -0,0 +1,135 @@ +"use client"; + +import { FileSearch, ReceiptText, Search } from "lucide-react"; +import { useRouter } from "next/navigation"; +import { useEffect, useMemo, useRef, useState } from "react"; +import type { QuestionSummary } from "@/lib/types"; + +type Result = { key: string; label: string; sub: string; href: string; kind: "receipt" | "question" }; + +export function QuickJump() { + const router = useRouter(); + const [query, setQuery] = useState(""); + const [open, setOpen] = useState(false); + const [active, setActive] = useState(0); + const [questions, setQuestions] = useState(null); + const box = useRef(null); + const input = useRef(null); + + const load = () => { + if (questions) return; + fetch("/data/questions.json") + .then((r) => r.json()) + .then(setQuestions) + .catch(() => setQuestions([])); + }; + + // Ctrl/Cmd + K focuses the search box. + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "k") { + e.preventDefault(); + input.current?.focus(); + } + }; + const onClick = (e: MouseEvent) => { + if (box.current && !box.current.contains(e.target as Node)) setOpen(false); + }; + window.addEventListener("keydown", onKey); + window.addEventListener("mousedown", onClick); + return () => { + window.removeEventListener("keydown", onKey); + window.removeEventListener("mousedown", onClick); + }; + }, []); + + const results = useMemo(() => { + const q = query.trim().toLowerCase(); + if (!q) return []; + const out: Result[] = []; + const num = q.match(/^#?(\d{1,2})$/); + if (num && Number(num[1]) < 100) { + out.push({ key: `r${num[1]}`, kind: "receipt", label: `Receipt #${num[1]}`, sub: "Open the receipt", href: `/?sample=${Number(num[1])}` }); + } + const words = q.split(/\s+/).filter(Boolean); + for (const item of questions ?? []) { + const hay = `${item.question} ${item.company}`.toLowerCase(); + if (words.every((w) => hay.includes(w))) { + out.push({ key: `q${item.i}`, kind: "question", label: item.question, sub: item.company, href: `/search/?q=${item.i}` }); + if (out.length >= 7) break; + } + } + return out; + }, [query, questions]); + + const go = (r: Result) => { + setOpen(false); + setQuery(""); + router.push(r.href); + }; + + return ( +
+ + + { + load(); + setOpen(true); + }} + onChange={(e) => { + setQuery(e.target.value); + setActive(0); + setOpen(true); + }} + onKeyDown={(e) => { + if (e.key === "ArrowDown") { + e.preventDefault(); + setActive((a) => Math.min(a + 1, results.length - 1)); + } else if (e.key === "ArrowUp") { + e.preventDefault(); + setActive((a) => Math.max(a - 1, 0)); + } else if (e.key === "Enter" && results[active]) { + go(results[active]); + } else if (e.key === "Escape") { + setOpen(false); + } + }} + placeholder="Find a receipt number or a question…" + autoComplete="off" + role="combobox" + aria-expanded={open && results.length > 0} + aria-controls="quick-jump-list" + className="h-10 w-full min-w-0 rounded-xl border border-line bg-surface-solid pr-3 pl-10 sm:pr-14 text-[14px] text-ink shadow-card placeholder:text-muted focus:border-accent focus:outline-none" + /> + + Ctrl K + + {open && results.length > 0 && ( +
    + {results.map((r, i) => ( +
  • + +
  • + ))} +
+ )} +
+ ); +} diff --git a/web/src/components/ReceiptChecker.tsx b/web/src/components/ReceiptChecker.tsx new file mode 100644 index 0000000000000000000000000000000000000000..cf95d7377c726125637dedb4dd2af97850de0bd0 --- /dev/null +++ b/web/src/components/ReceiptChecker.tsx @@ -0,0 +1,240 @@ +"use client"; + +/* eslint-disable @next/next/no-img-element */ +import { Check as CheckIcon, ChevronLeft, ChevronRight, CircleAlert, RotateCcw, Send, Sparkles, ZoomIn, ZoomOut } from "lucide-react"; +import { useEffect, useMemo, useState } from "react"; +import { check, type Receipt } from "@/lib/consistency"; +import { useDecisions } from "@/lib/decisions"; +import type { ReceiptRecord } from "@/lib/types"; +import { CheckList, cloneReceipt as clone, ReceiptFields } from "./ReceiptFields"; +import { Banner, Button, Card, Pill, Segmented } from "./ui"; + +type Source = "model" | "zeroshot" | "label"; +const SOURCES: { value: Source; label: string }[] = [ + { value: "model", label: "Fine-tuned model" }, + { value: "zeroshot", label: "Before fine-tuning" }, + { value: "label", label: "Human label" }, +]; +export function ReceiptChecker({ record, prev, next }: { record: ReceiptRecord; prev: number | null; next: number | null }) { + const { decisions, save } = useDecisions(); + const decision = decisions[record.id]; + const [source, setSource] = useState("model"); + const [working, setWorking] = useState(() => clone(record.pred)); + const [dirty, setDirty] = useState(false); + const [zoom, setZoom] = useState(false); + const [showDiff, setShowDiff] = useState(true); + const [notice, setNotice] = useState(null); + + const original = (s: Source) => (s === "model" ? record.pred : s === "zeroshot" ? record.zeroshot : record.gold); + + // A saved edit from this browser replaces the model's reading when the page opens. + useEffect(() => { + if (decision?.edited && source === "model" && !dirty) setWorking(clone(decision.edited)); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [decision]); + + const switchSource = (s: Source) => { + setSource(s); + setWorking(clone(original(s))); + setDirty(false); + setNotice(null); + }; + + const update = (fn: (r: Receipt) => void) => { + setWorking((w) => { + const n = clone(w); + fn(n); + return n; + }); + setDirty(true); + setNotice(null); + }; + + const checks = useMemo(() => check(working), [working]); + const failed = checks.filter((c) => !c.passed).length; + const compare = showDiff && source !== "label"; + + const decide = (status: "approved" | "review") => { + save(record.id, { status, edited: dirty || decision?.edited ? working : undefined, at: new Date().toISOString() }); + setNotice(status === "approved" ? "Approved. Saved in this browser." : "Sent to review. Saved in this browser."); + }; + + const statusPill = decision ? ( + decision.status === "approved" ? ( + + Approved by you + + ) : ( + + Sent to review by you + + ) + ) : record.flagged ? ( + + Model: needs review + + ) : ( + + Model: auto-accepted + + ); + + return ( + <> + + + {checks.length ? `${checks.length - failed} / ${checks.length} rules pass` : "no rule applies"} + + {statusPill} + {record.exact && matches human label} + + } + meta="CORD-v2 test receipt · read by Qwen3.5-4B (QLoRA) with best-of-4 and the accounting checker" + right={ + <> + {prev !== null ? ( + + ) : null} + {next !== null ? ( + + ) : null} + + } + /> + +
+
+ setZoom((z) => !z)} + className="flex items-center gap-1.5 rounded-lg border border-line bg-surface-solid px-2.5 py-1.5 text-[12.5px] font-semibold text-ink hover:border-accent" + > + {zoom ? : } {zoom ? "Fit" : "Zoom"} + + } + > +
+ {`Photo +
+
+ + }> +

+ The model wrote one normal reading and four sampled ones. The checker keeps the reading that passes the most accounting rules; + the model's confidence only breaks ties. +

+
    + {record.candidates.map((c, k) => ( +
  • + {k === 0 ? "Greedy" : `Sample ${k}`} +
    +
    +
    + + {c.valid ? `${Math.round((c.consistency ?? 0) * 100)}% rules` : "invalid JSON"} + + {c.chosen && picked} +
  • + ))} +
+
+
+ +
+ switchSource(source)} + className="flex items-center gap-1.5 rounded-lg px-2 py-1 text-[12.5px] font-semibold text-accent-deep hover:underline" + > + Reset edits + + ) : null + } + > +
+ + {source !== "label" && ( + + )} +
+ + +
+ + no rule applies + ) : failed === 0 ? ( + + would be accepted + + ) : ( + + goes to human review + + ) + } + > + {checks.length === 0 ? ( +

+ None of the five rules can run: the fields each rule needs are not all present. Try adding a total or the item amounts. +

+ ) : ( + + )} +

+ The rules recheck as you edit, using a TypeScript port of the Python checker that agrees with it on all 277 rule results of the + test set. Amounts within 1% are treated as equal, to allow for rounding. +

+
+ +
+ + + {decision && ( + + )} + {notice && ( + + {notice} + + )} +
+
+
+ + ); +} diff --git a/web/src/components/ReceiptFields.tsx b/web/src/components/ReceiptFields.tsx new file mode 100644 index 0000000000000000000000000000000000000000..175e5cb6f59cd0c0b3803ff671f3d75b6ec2ec3e --- /dev/null +++ b/web/src/components/ReceiptFields.tsx @@ -0,0 +1,256 @@ +"use client"; + +import { Check as CheckIcon, Plus, Trash2, X } from "lucide-react"; +import { + amountsEqual, + describe, + formatAmount, + parseAmount, + SUMMARY_FIELDS, + type Check, + type Item, + type Receipt, + type SummaryField, +} from "@/lib/consistency"; + +/** Shared receipt form and rule list, used by the scan page (users) and the model view (evaluation). */ + +export const FIELD_LABEL: Record = { + subtotal: "Subtotal", + discount: "Discount", + service: "Service charge", + tax: "Tax", + total: "Total", + cash: "Cash paid", + change: "Change", + card: "Card charge", +}; +const ITEM_COLS: { key: keyof Item; label: string; money: boolean }[] = [ + { key: "name", label: "Item", money: false }, + { key: "qty", label: "Qty", money: true }, + { key: "unit_price", label: "Unit price", money: true }, + { key: "amount", label: "Amount", money: true }, +]; + +export const cloneReceipt = (r: Receipt | null | undefined): Receipt => + JSON.parse(JSON.stringify(r ?? { items: [] })); + +function norm(money: boolean, v: string | undefined): string { + if (!v) return ""; + if (money) { + const p = parseAmount(v); + if (p !== null) return Math.abs(p).toFixed(2); + } + return v.replace(/\s+/g, " ").trim().toLowerCase(); +} + +/** + * Editable items table and summary fields. `update` applies a mutation to a copy of the receipt. + * When `gold` is given and `compare` is on, cells that differ from the human label are marked. + */ +export function ReceiptFields({ + value, + update, + gold, + compare = false, +}: { + value: Receipt; + update: (fn: (r: Receipt) => void) => void; + gold?: Receipt; + compare?: boolean; +}) { + const items = value.items ?? []; + const goldItems = gold?.items ?? []; + const marking = compare && !!gold; + + return ( + <> +
+ + + + {ITEM_COLS.map((c) => ( + + ))} + + + + + {items.map((it, i) => ( + + {ITEM_COLS.map((c) => { + const v = it[c.key] ?? ""; + const g = goldItems[i]?.[c.key]; + const differs = + marking && norm(c.money, v) !== norm(c.money, g); + return ( + + ); + })} + + + ))} + {items.length === 0 && ( + + + + )} + +
+ {c.label} + + Remove +
+ + update((r) => { + (r.items ??= [])[i] = { + ...r.items![i], + [c.key]: e.target.value, + }; + }) + } + className={`tabular h-8 w-full rounded-md border bg-transparent px-2 text-[13.5px] text-ink focus:border-accent focus:outline-none ${ + differs + ? "border-warn/60 bg-warn-soft/40" + : "border-transparent hover:border-line" + }`} + /> + + +
+ No items found. Add them with the button below. +
+
+ + +
+ {SUMMARY_FIELDS.map((f) => { + const v = value[f] ?? ""; + const g = gold?.[f]; + const differs = marking && norm(true, v) !== norm(true, g); + return ( + + ); + })} +
+ + ); +} + +/** One row per accounting rule: what the receipt should say, and what it says. */ +export function CheckList({ checks }: { checks: Check[] }) { + return ( +
    + {checks.map((c) => { + // The total rule also passes when tax is already inside the subtotal; show the form that matched. + const taxInside = + c.name === "summary_total" && + c.passed && + !amountsEqual(c.expected, c.found); + const expected = taxInside ? c.found : c.expected; + return ( +
  • + + {c.passed ? ( + + ) : ( + + )} + + + {taxInside + ? "Subtotal − discount + service = total (tax already included)" + : describe(c)} + + + expected{" "} + + {formatAmount(expected)} + {" "} + · found{" "} + + {formatAmount(c.found)} + + +
  • + ); + })} +
+ ); +} diff --git a/web/src/components/ScanReceipt.tsx b/web/src/components/ScanReceipt.tsx new file mode 100644 index 0000000000000000000000000000000000000000..2dcdefec22fcd293c609a26c218e9db57244fa8c --- /dev/null +++ b/web/src/components/ScanReceipt.tsx @@ -0,0 +1,376 @@ +"use client"; + +/* eslint-disable @next/next/no-img-element */ +import { CircleAlert, CircleCheck, Download, Flag, ImageUp, Info, LoaderCircle, RotateCcw, Save, ScanLine } from "lucide-react"; +import Link from "next/link"; +import { useSearchParams } from "next/navigation"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { check, SUMMARY_FIELDS, type Receipt } from "@/lib/consistency"; +import { useDecisions } from "@/lib/decisions"; +import { CheckList, cloneReceipt, FIELD_LABEL, ReceiptFields } from "./ReceiptFields"; +import { Banner, Button, Card, Pill } from "./ui"; + +export type Sample = { id: number; image: string; pred: Receipt | null; flagged: boolean }; + +type Current = { kind: "sample"; id: number; src: string } | { kind: "upload"; name: string; src: string }; +type Live = "checking" | "on" | "off"; + +/** The live reader runs on a GPU machine. It is only contacted when one is configured, or when the site runs locally. */ +function apiBase(): string | null { + if (process.env.NEXT_PUBLIC_SUMPROOF_API) return process.env.NEXT_PUBLIC_SUMPROOF_API.replace(/\/$/, ""); + if (typeof window !== "undefined" && ["localhost", "127.0.0.1"].includes(window.location.hostname)) return "http://localhost:8000"; + return null; +} + +function toCsv(r: Receipt): string { + const esc = (v: string | undefined) => `"${(v ?? "").replace(/"/g, '""')}"`; + const lines = [["section", "name", "qty", "unit_price", "amount"].join(",")]; + for (const it of r.items ?? []) lines.push(["item", esc(it.name), esc(it.qty), esc(it.unit_price), esc(it.amount)].join(",")); + for (const f of SUMMARY_FIELDS) if (r[f]) lines.push(["summary", esc(FIELD_LABEL[f]), "", "", esc(r[f])].join(",")); + return lines.join("\n"); +} + +export function ScanReceipt({ samples }: { samples: Sample[] }) { + const params = useSearchParams(); + const { decisions, save } = useDecisions(); + const [live, setLive] = useState("checking"); + const [current, setCurrent] = useState(null); + const [reading, setReading] = useState(null); + const [original, setOriginal] = useState(null); + const [busy, setBusy] = useState(false); + const [seconds, setSeconds] = useState(null); + const [error, setError] = useState(null); + const [notice, setNotice] = useState(null); + const [dragging, setDragging] = useState(false); + const input = useRef(null); + const byId = useMemo(() => new Map(samples.map((s) => [s.id, s])), [samples]); + const picks = useMemo(() => { + const ok = samples.filter((s) => !s.flagged).slice(0, 9); + const toCheck = samples.filter((s) => s.flagged).slice(0, 3); + return [...ok, ...toCheck].sort((a, b) => a.id - b.id); + }, [samples]); + + useEffect(() => { + const base = apiBase(); + if (!base) return setLive("off"); + fetch(`${base}/health`, { signal: AbortSignal.timeout(2500) }) + .then((r) => r.json()) + .then((j) => setLive(j.ok ? "on" : "off")) + .catch(() => setLive("off")); + }, []); + + const reset = useCallback(() => { + if (current?.kind === "upload") URL.revokeObjectURL(current.src); + setCurrent(null); + setReading(null); + setOriginal(null); + setError(null); + setNotice(null); + setSeconds(null); + window.history.replaceState(null, "", "/"); + }, [current]); + + const openSample = useCallback( + (id: number) => { + const s = byId.get(id); + if (!s) return; + setCurrent({ kind: "sample", id, src: `/data/${s.image}` }); + setOriginal(cloneReceipt(s.pred)); + setReading(cloneReceipt(s.pred)); + setError(null); + setNotice(null); + setSeconds(null); + window.history.replaceState(null, "", `/?sample=${id}`); + }, + [byId], + ); + + // Open ?sample=N (links from the receipt inbox). + useEffect(() => { + const q = params.get("sample"); + if (q !== null && /^\d+$/.test(q)) openSample(Number(q)); + }, [params, openSample]); + + // A saved edit from this browser replaces the stored reading of a sample. + const savedEdit = current?.kind === "sample" ? decisions[current.id]?.edited : undefined; + useEffect(() => { + if (savedEdit) setReading(cloneReceipt(savedEdit)); + }, [savedEdit]); + + const upload = async (file: File) => { + const base = apiBase(); + if (!base || live !== "on") return; + if (!file.type.startsWith("image/")) return setError("Please choose a photo (JPG, PNG or WebP)."); + if (file.size > 10 * 1024 * 1024) return setError("The photo is larger than 10 MB."); + if (current?.kind === "upload") URL.revokeObjectURL(current.src); + setCurrent({ kind: "upload", name: file.name, src: URL.createObjectURL(file) }); + setReading(null); + setError(null); + setNotice(null); + setBusy(true); + try { + const body = new FormData(); + body.append("file", file); + const res = await fetch(`${base}/read`, { method: "POST", body }); + const json = await res.json().catch(() => ({})); + if (!res.ok) throw new Error(json.detail || "The reader could not read this photo."); + setOriginal(cloneReceipt(json.receipt)); + setReading(cloneReceipt(json.receipt)); + setSeconds(json.seconds ?? null); + } catch (e) { + setError(e instanceof Error && e.message !== "Failed to fetch" ? e.message : "The reader stopped responding. Is the server still running?"); + } finally { + setBusy(false); + } + }; + + const update = (fn: (r: Receipt) => void) => { + setReading((w) => { + const n = cloneReceipt(w); + fn(n); + return n; + }); + setNotice(null); + }; + + const checks = useMemo(() => (reading ? check(reading) : []), [reading]); + const failed = checks.filter((c) => !c.passed).length; + const edited = JSON.stringify(reading) !== JSON.stringify(original); + + const download = () => { + if (!reading) return; + const url = URL.createObjectURL(new Blob([toCsv(reading)], { type: "text/csv" })); + const a = document.createElement("a"); + a.href = url; + a.download = current?.kind === "sample" ? `receipt-${current.id}.csv` : "receipt.csv"; + a.click(); + URL.revokeObjectURL(url); + }; + + const decide = (status: "approved" | "review") => { + if (current?.kind !== "sample" || !reading) return; + save(current.id, { status, edited: edited || savedEdit ? reading : undefined, at: new Date().toISOString() }); + setNotice(status === "approved" ? "Saved." : "Flagged for a second look."); + }; + + const header = ( + Reader online : undefined} + meta="Upload a photo of a receipt. SumProof reads every item and total, then checks that the numbers add up." + right={ + current ? ( + + ) : undefined + } + /> + ); + + if (!current) { + const canUpload = live === "on"; + return ( + <> + {header} + +
canUpload && input.current?.click()} + onKeyDown={(e) => canUpload && (e.key === "Enter" || e.key === " ") && input.current?.click()} + onDragOver={(e) => { + e.preventDefault(); + if (canUpload) setDragging(true); + }} + onDragLeave={() => setDragging(false)} + onDrop={(e) => { + e.preventDefault(); + setDragging(false); + const f = e.dataTransfer.files[0]; + if (f) upload(f); + }} + className={`flex flex-col items-center gap-3 rounded-xl border-2 border-dashed px-6 py-10 text-center transition ${ + canUpload + ? `cursor-pointer ${dragging ? "border-accent bg-accent-soft" : "border-accent/50 hover:border-accent hover:bg-accent-soft/50"}` + : "border-line bg-sunken" + }`} + > + + {live === "checking" ? : } + + {canUpload ? ( + <> +

+ Drop a receipt photo here or browse +

+

JPG, PNG or WebP, up to 10 MB · one receipt per photo

+ + ) : live === "checking" ? ( +

Connecting to the receipt reader…

+ ) : ( + <> +

Uploading your own photo is offline in this online demo

+

+ The reader is an AI model that needs a graphics card, which free hosting does not have. Try one of the sample receipts below: + each shows exactly what the model read. +

+ + )} + {error &&

{error}

} + { + const f = e.target.files?.[0]; + if (f) upload(f); + e.target.value = ""; + }} + /> +
+
+ + See all 100}> +
    + {picks.map((s) => ( +
  • + +
  • + ))} +
+
+ + ); + } + + const status = busy ? null : !reading ? null : checks.length === 0 ? ( +
+ +
+

Couldn't cross-check the totals

+

This receipt doesn't show enough amounts to check against each other. Compare the numbers with the photo.

+
+
+ ) : failed === 0 ? ( +
+ +
+

Everything adds up

+

The items, subtotal, tax and total agree with each other. Glance at the item names, then save.

+
+
+ ) : ( +
+ +
+

+ Please check {failed === 1 ? "one number" : `${failed} numbers`} +

+

Something on this receipt doesn't add up. Compare the red row below with the photo and fix the field.

+
+
+ ); + + return ( + <> + {header} +
+ +
+ The receipt photo +
+
+ +
+ {busy ? ( + +
+ +
+

Reading the receipt…

+

This takes about 10 to 30 seconds.

+
+
+
+ ) : error ? ( + +
+ +
+

Couldn't read this photo

+

{error}

+
+
+
+ ) : ( + reading && ( + <> + {status} + + setReading(cloneReceipt(original))} + className="flex items-center gap-1.5 text-[13px] font-medium text-accent hover:underline" + > + Undo my edits + + ) : null + } + > +

Click any value to correct it. The checks below update as you type.

+ +
+ + {checks.length > 0 && ( + + + + )} + +
+ {current.kind === "sample" && ( + <> + + + + )} + + {notice && ( + + {notice} + + )} +
+

+ {current.kind === "sample" ? "Sample receipts show the model's saved reading." : seconds !== null ? `Read in ${seconds} s on the local GPU.` : ""} AI can misread + names and numbers, so compare with the photo before you save. +

+ + ) + )} +
+
+ + ); +} diff --git a/web/src/components/Shell.tsx b/web/src/components/Shell.tsx new file mode 100644 index 0000000000000000000000000000000000000000..1e0f41d0aeab550e26f0984555788f91c5d1b5ad --- /dev/null +++ b/web/src/components/Shell.tsx @@ -0,0 +1,171 @@ +"use client"; + +import { + BarChart3, + BookOpen, + Columns3, + FileSearch, + Github, + Inbox, + Menu, + Network, + ReceiptText, + ScanLine, + X, +} from "lucide-react"; +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { useEffect, useState } from "react"; +import { QuickJump } from "./QuickJump"; + +import { GITHUB_URL } from "@/lib/site"; + +// The app: what an everyday user needs. +const MAIN = [ + { href: "/", label: "Scan receipt", icon: ScanLine }, + { href: "/queue/", label: "Receipt inbox", icon: Inbox }, + { href: "/search/", label: "Filing search", icon: FileSearch }, +]; +// How the models were built and measured, for technical readers. +const WORKSPACE = [ + { href: "/results/", label: "Model results", icon: BarChart3 }, + { href: "/receipts/", label: "Before vs after", icon: ReceiptText }, + { href: "/compare/", label: "Compare search methods", icon: Columns3 }, + { href: "/architecture/", label: "Architecture", icon: Network }, + { href: "/about/", label: "Data & licences", icon: BookOpen }, +]; + +function isActive(path: string, href: string) { + if (href === "/") return path === "/"; + const root = href.split("/")[1]; + return path.startsWith(`/${root}`); +} + +function Logo() { + return ( + + Σ + + SumProof + Receipt AI · filing search + + + ); +} + +function NavList({ items, path, onNavigate }: { items: typeof MAIN; path: string; onNavigate?: () => void }) { + return ( +
    + {items.map(({ href, label, icon: Icon }) => { + const active = isActive(path, href); + return ( +
  • + + + {label} + +
  • + ); + })} +
+ ); +} + +function Sidebar({ path, onNavigate }: { path: string; onNavigate?: () => void }) { + return ( +
+ + + +
+

Online demo

+

+ Sample receipts show real model outputs. Reading your own photos needs the reader running on a GPU. +

+

$0 · open models

+
+
+ ); +} + +export function Shell({ children }: { children: React.ReactNode }) { + const path = usePathname() || "/"; + const [open, setOpen] = useState(false); + useEffect(() => setOpen(false), [path]); + + return ( +
+ + + {open && ( +
+ + setOpen(false)} /> +
+
+ )} + +
+
+ + +
+ + + +
+
+
+
{children}
+
+
+ + ); +} diff --git a/web/src/components/charts.tsx b/web/src/components/charts.tsx new file mode 100644 index 0000000000000000000000000000000000000000..0c2ec1eb2402fa30c9d65ae72e9b663954e333e0 --- /dev/null +++ b/web/src/components/charts.tsx @@ -0,0 +1,110 @@ +// Small hand-made SVG charts drawn from the real results (no chart library). + +export function BarBreakdown({ + bars, + max = 1, + format = (v: number) => v.toFixed(2), + label, +}: { + bars: { label: string; value: number; highlight?: boolean; note?: string }[]; + max?: number; + format?: (v: number) => string; + label: string; +}) { + return ( +
+ {bars.map((b) => { + const h = Math.max(6, (b.value / max) * 100); + return ( +
+
+ + {format(b.value)} + +
+
+ {b.label} +
+ ); + })} +
+ ); +} + +export function TrainingCurve({ + log, + val, +}: { + log: { step: number; loss: number; lr: number }[]; + val: { field_f1: number; epoch: number }[]; +}) { + const W = 620; + const H = 248; + const pad = { l: 46, r: 16, t: 14, b: 50 }; + const maxStep = Math.max(...log.map((d) => d.step)); + const maxLoss = Math.ceil(Math.max(...log.map((d) => d.loss)) * 10) / 10; + const x = (s: number) => pad.l + ((s - 1) / (maxStep - 1)) * (W - pad.l - pad.r); + const y = (v: number) => pad.t + (1 - v / maxLoss) * (H - pad.t - pad.b); + // light smoothing (moving average of 5 steps) so the trend is readable; raw loss is faint behind it + const smooth = log.map((d, i) => { + const win = log.slice(Math.max(0, i - 2), i + 3); + return { step: d.step, loss: win.reduce((a, b) => a + b.loss, 0) / win.length }; + }); + const line = (pts: { step: number; loss: number }[]) => pts.map((d, i) => `${i ? "L" : "M"}${x(d.step).toFixed(1)},${y(d.loss).toFixed(1)}`).join(" "); + const area = `${line(smooth)} L${x(maxStep)},${y(0)} L${x(1)},${y(0)} Z`; + const ticks = [0, maxLoss / 2, maxLoss]; + const epochStep = 100; + + return ( +
+
+ + + + + + + + {ticks.map((t) => ( + + + + {t.toFixed(2)} + + + ))} + + + end of epoch 1 · checkpoint used + + + + + {[1, 50, 100, 150].map((s) => ( + + {s} + + ))} + + optimizer step (8 receipts each) + + +
+
+ Validation field F1 (30 receipts): + {val.map((v) => ( + + epoch {v.epoch}: {v.field_f1.toFixed(2)} + + ))} +
+
+ ); +} diff --git a/web/src/components/ui.tsx b/web/src/components/ui.tsx new file mode 100644 index 0000000000000000000000000000000000000000..315aab74841bc86dfec800918e064edb83532c6b --- /dev/null +++ b/web/src/components/ui.tsx @@ -0,0 +1,171 @@ +import { ChevronRight } from "lucide-react"; +import Link from "next/link"; + +export function Card({ + title, + icon, + action, + children, + className = "", + bodyClassName = "", +}: { + title?: React.ReactNode; + icon?: React.ReactNode; + action?: React.ReactNode; + children: React.ReactNode; + className?: string; + bodyClassName?: string; +}) { + return ( +
+ {(title || action) && ( +
+ {icon && {icon}} + {title &&

{title}

} + {action &&
{action}
} +
+ )} +
{children}
+
+ ); +} + +/** Plain page header: breadcrumb, title with status pills, one-line description. */ +export function Banner({ + crumbs, + title, + pills, + meta, + right, + children, +}: { + crumbs: { label: string; href?: string }[]; + title: React.ReactNode; + pills?: React.ReactNode; + meta?: React.ReactNode; + right?: React.ReactNode; + children?: React.ReactNode; +}) { + return ( +
+ +
+

{title}

+ {pills &&
{pills}
} + {right &&
{right}
} +
+ {meta &&
{meta}
} + {children} +
+ ); +} + +const PILL_TONES = { + dark: "bg-accent-soft text-accent-deep", + light: "bg-surface-solid text-ink border border-line", + good: "bg-good-soft text-good", + warn: "bg-warn-soft text-warn", + info: "bg-info-soft text-info", + accent: "accent-fill text-white", +} as const; + +export function Pill({ tone = "light", children, className = "" }: { tone?: keyof typeof PILL_TONES; children: React.ReactNode; className?: string }) { + return ( + + {children} + + ); +} + +export function Stat({ label, before, after, note }: { label: string; before: string; after: string; note?: string }) { + return ( +
+

{label}

+

+ {before} + → + {after} +

+ {note &&

{note}

} +
+ ); +} + +export function Segmented({ + options, + value, + onChange, + label, +}: { + options: { value: T; label: string }[]; + value: T; + onChange: (v: T) => void; + label: string; +}) { + return ( +
+ {options.map((o) => ( + + ))} +
+ ); +} + +export function Button({ + children, + onClick, + tone = "light", + href, + disabled, + className = "", +}: { + children: React.ReactNode; + onClick?: () => void; + tone?: "dark" | "light" | "accent"; + href?: string; + disabled?: boolean; + className?: string; +}) { + const styles = { + dark: "bg-nav text-white hover:bg-ink", + light: "bg-surface-solid text-ink border border-line hover:border-accent", + accent: "bg-accent text-white hover:bg-accent-deep", + }[tone]; + const cls = `inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-[14px] font-medium shadow-card transition disabled:opacity-50 ${styles} ${className}`; + if (href) { + return ( + + {children} + + ); + } + return ( + + ); +} diff --git a/web/src/lib/consistency.ts b/web/src/lib/consistency.ts new file mode 100644 index 0000000000000000000000000000000000000000..5f7af1465f798c465d85f0d072bc658b0c9bb9ab --- /dev/null +++ b/web/src/lib/consistency.ts @@ -0,0 +1,140 @@ +// TypeScript port of sumproof/receipts/{amounts,consistency}.py. +// Kept rule-for-rule identical so the checker gives the same verdict in the browser +// (verified against the Python results on all 100 test receipts: web/scripts/parity.ts). + +export type Item = { name?: string; qty?: string; unit_price?: string; amount?: string }; +export type Receipt = { + items?: Item[]; + subtotal?: string; + discount?: string; + service?: string; + tax?: string; + total?: string; + cash?: string; + change?: string; + card?: string; +}; +export type Check = { name: string; passed: boolean; expected: number; found: number }; + +export const SUMMARY_FIELDS = ["subtotal", "discount", "service", "tax", "total", "cash", "change", "card"] as const; +export type SummaryField = (typeof SUMMARY_FIELDS)[number]; + +const NUM = /[-+]?\d[\d.,\s]*/; + +/** "60.000" -> 60000, "1,234.50" -> 1234.5, "Rp 17.500" -> 17500, "-60.000" -> -60000 */ +export function parseAmount(text: string | undefined | null): number | null { + if (text === undefined || text === null) return null; + const s = String(text).trim(); + if (!s) return null; + const negative = s.startsWith("-") || s.startsWith("(") || s.endsWith("-"); + const m = s.replace(/ /g, "").match(NUM); + if (!m) return null; + const body = m[0].replace(/^[+-]+/, "").replace(/[.,]+$/, ""); + if (!body) return null; + const lastSep = Math.max(body.lastIndexOf("."), body.lastIndexOf(",")); + let value: number; + if (lastSep === -1) { + value = parseFloat(body); + } else { + const tail = body.slice(lastSep + 1); + const head = body.slice(0, lastSep).replace(/[.,]/g, ""); + if (tail.length === 3 || tail.length === 0) value = parseFloat(head + tail || "0"); + else value = parseFloat(`${head || "0"}.${tail}`); + } + if (Number.isNaN(value)) return null; + return negative ? -value : value; +} + +export function amountsEqual(a: number | null, b: number | null, relTol = 0.01, absTol = 1.0): boolean { + if (a === null || b === null) return false; + return Math.abs(a - b) <= Math.max(absTol, relTol * Math.max(Math.abs(a), Math.abs(b))); +} + +function lineAmount(item: Item): number | null { + const amount = parseAmount(item.amount); + if (amount !== null) return amount; + const unit = parseAmount(item.unit_price); + const qty = parseAmount(item.qty); + return unit !== null && qty !== null ? unit * qty : null; +} + +/** The five accounting rules. Each rule only applies when every field it needs is present. */ +export function check(r: Receipt): Check[] { + const checks: Check[] = []; + const items = r.items ?? []; + const subtotal = parseAmount(r.subtotal); + const total = parseAmount(r.total); + const discount = parseAmount(r.discount); + const tax = parseAmount(r.tax) || 0; + const service = parseAmount(r.service) || 0; + const cash = parseAmount(r.cash); + const change = parseAmount(r.change); + const card = parseAmount(r.card); + + // 1. qty x unit price = line amount + items.forEach((it, i) => { + const unit = parseAmount(it.unit_price); + const qty = parseAmount(it.qty); + const amount = parseAmount(it.amount); + if (unit !== null && qty !== null && amount !== null) { + checks.push({ name: `line_${i}`, passed: amountsEqual(unit * qty, amount), expected: unit * qty, found: amount }); + } + }); + + // 2. items add up to the subtotal (or to the total when no subtotal is printed) + const lines = items.map(lineAmount); + if (lines.length && lines.every((v) => v !== null)) { + const itemsSum = (lines as number[]).reduce((a, b) => a + b, 0); + const [targetName, target] = subtotal !== null ? ["subtotal", subtotal] : ["total", total]; + if (target !== null && (targetName === "subtotal" || (tax === 0 && service === 0 && discount === null))) { + checks.push({ name: `items_sum_${targetName}`, passed: amountsEqual(itemsSum, target), expected: itemsSum, found: target }); + } + } + + // 3. subtotal - discount + tax + service = total (tax may already be inside the subtotal) + if (subtotal !== null && total !== null && (tax || service || discount !== null)) { + const disc = discount !== null ? Math.abs(discount) : 0; + const exclusive = subtotal - disc + tax + service; + const inclusive = subtotal - disc + service; + checks.push({ + name: "summary_total", + passed: amountsEqual(exclusive, total) || amountsEqual(inclusive, total), + expected: exclusive, + found: total, + }); + } + + // 4. cash - change = total + if (cash !== null && change !== null && total !== null) { + checks.push({ name: "cash_change", passed: amountsEqual(cash - Math.abs(change), total), expected: cash - Math.abs(change), found: total }); + } + + // 5. card charge = total + if (card !== null && total !== null) { + checks.push({ name: "card_total", passed: amountsEqual(card, total), expected: total, found: card }); + } + return checks; +} + +/** Human-readable description of a rule, for the checklist. */ +export function describe(c: Check): string { + if (c.name.startsWith("line_")) return `Line ${Number(c.name.slice(5)) + 1}: qty × unit price = amount`; + switch (c.name) { + case "items_sum_subtotal": + return "Items add up to the subtotal"; + case "items_sum_total": + return "Items add up to the total"; + case "summary_total": + return "Subtotal − discount + tax + service = total"; + case "cash_change": + return "Cash − change = total"; + case "card_total": + return "Card charge = total"; + default: + return c.name; + } +} + +export function formatAmount(v: number): string { + return Number.isInteger(v) ? v.toLocaleString("en-US") : v.toLocaleString("en-US", { maximumFractionDigits: 2 }); +} diff --git a/web/src/lib/data.ts b/web/src/lib/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e6dbb7f25aef82488592a6fef06ba51feef43b1 --- /dev/null +++ b/web/src/lib/data.ts @@ -0,0 +1,12 @@ +// Build-time data loading (server components only). The JSON is produced by +// `python -m sumproof.export_web` from the real evaluation outputs. +import fs from "node:fs"; +import path from "node:path"; +import type { Dashboard, QuestionSummary, ReceiptRecord } from "./types"; + +const DATA = path.join(process.cwd(), "public", "data"); +const read = (name: string): T => JSON.parse(fs.readFileSync(path.join(DATA, name), "utf-8")) as T; + +export const loadReceipts = () => read("receipts.json"); +export const loadDashboard = () => read("dashboard.json"); +export const loadQuestions = () => read("questions.json"); diff --git a/web/src/lib/decisions.ts b/web/src/lib/decisions.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4648b9f026c5fa51b45e9ab013311c3b70b6c19 --- /dev/null +++ b/web/src/lib/decisions.ts @@ -0,0 +1,33 @@ +"use client"; + +// Reviewer decisions (approve / send to review, plus edited fields) are kept in this browser only. +import { useCallback, useEffect, useState } from "react"; +import type { Receipt } from "./consistency"; + +export type Decision = { status: "approved" | "review"; edited?: Receipt; at: string }; +const KEY = "sumproof-decisions"; + +function read(): Record { + try { + return JSON.parse(localStorage.getItem(KEY) || "{}"); + } catch { + return {}; + } +} + +export function useDecisions() { + const [decisions, setDecisions] = useState>({}); + useEffect(() => setDecisions(read()), []); + + const save = useCallback((id: number, d: Decision | null) => { + const next = { ...read() }; + if (d) next[id] = d; + else delete next[id]; + try { + localStorage.setItem(KEY, JSON.stringify(next)); + } catch {} + setDecisions(next); + }, []); + + return { decisions, save }; +} diff --git a/web/src/lib/site.ts b/web/src/lib/site.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fd5d0df0da728de9280a4f8a8caf35f96b3295f --- /dev/null +++ b/web/src/lib/site.ts @@ -0,0 +1 @@ +export const GITHUB_URL = "https://github.com/WAYTECHG/SumProof"; diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..17baf73c8608bc47307f9813fcf1e09fd7057d99 --- /dev/null +++ b/web/src/lib/types.ts @@ -0,0 +1,91 @@ +import type { Check, Receipt } from "./consistency"; + +export type Candidate = { kind: "greedy" | "sampled"; valid: boolean; consistency: number | null; logprob: number; chosen: boolean }; + +export type ReceiptRecord = { + id: number; + image: string; + pred: Receipt | null; // fine-tuned Qwen3.5-4B + best-of-4 with the accounting checker + zeroshot: Receipt | null; // the same model before fine-tuning + gold: Receipt; // human label from CORD-v2 + flagged: boolean; // the checker sent it to human review + exact: boolean; // every field equals the human label + checks: Check[]; // checker results computed in Python (the browser recomputes them live) + candidates: Candidate[]; +}; + +export type Method = "bm25" | "dense" | "hybrid" | "routed" | "reranked"; + +export const METHODS: { key: Method; label: string; short: string; note: string }[] = [ + { key: "bm25", label: "BM25", short: "BM25", note: "keyword match" }, + { key: "dense", label: "Dense (Qwen3-Embedding)", short: "Dense", note: "meaning, all filings" }, + { key: "hybrid", label: "Hybrid BM25 + dense (RRF)", short: "Hybrid", note: "common default" }, + { key: "routed", label: "Dense + filing routing", short: "Routed", note: "company + year" }, + { key: "reranked", label: "Routed + Qwen3-Reranker", short: "Reranked", note: "final pipeline" }, +]; + +export type QuestionSummary = { + i: number; + question: string; + company: string; + type: string; + rank: Record; // first rank of an evidence page in the top 10, or null +}; + +export type Hit = { row: number; gold: boolean; score?: number }; + +export type QuestionDetail = { + i: number; + question: string; + company: string; + type: string; + answer: string; + justification: string | null; + doc_link: string; + gold: { row: number; doc: string; page: number }[]; + detected: { company: string; years: number[]; filings: string[] } | null; + methods: Record; + pages: Record; +}; + +export type Dashboard = { + receipts: Record< + "zeroshot" | "zeroshot_best4" | "sft" | "sft_best4", + { strict_f1: number; norm_f1: number; numbers_f1: number; exact: number; exact_norm: number; total_acc: number; valid: number; sec: number; flag: { precision: number; recall: number } } + >; + retrieval: { + n_questions: number; + n_pages: number; + n_filings: number; + router_kept_right_filing: number; + metrics: Record>; + "recall@5_by_question_type": Record>; + }; + faiss: { benchmark: { index: string; efSearch: number | null; ms_per_query: number; "overlap@10_vs_exact": number; "recall@5_gold": number }[] }; + pgvector: Record; + train_log: { step: number; epoch: number; loss: number; lr: number }[]; + val_log: { field_f1: number; total_accuracy: number; epoch: number }[]; +}; + +export const TYPE_LABEL: Record = { + "metrics-generated": "Metric lookup", + "domain-relevant": "Analyst reasoning", + "novel-generated": "Open-ended", +}; + +/** "3M_2018_10K" -> { company: "3M", period: "2018 10-K" } */ +export function docParts(doc: string): { company: string; period: string } { + const m = doc.match(/^(.+?)_(\d{4})(Q\d)?_([A-Z0-9]+)/); + if (!m) return { company: doc.replace(/_/g, " "), period: "" }; + const kind = { "10K": "10-K", "10Q": "10-Q", "8K": "8-K", EARNINGS: "earnings" }[m[4]] ?? m[4]; + return { company: m[1].replace(/_/g, " "), period: `${m[2]}${m[3] ? ` ${m[3]}` : ""} ${kind}` }; +} + +/** "3M_2018_10K" -> "3M · 2018 10-K" */ +export function prettyDoc(doc: string): string { + const m = doc.match(/^(.+?)_(\d{4})(Q\d)?_([A-Z0-9]+)/); + if (!m) return doc.replace(/_/g, " "); + const company = m[1].replace(/_/g, " "); + const kind = { "10K": "10-K", "10Q": "10-Q", "8K": "8-K", EARNINGS: "earnings" }[m[4]] ?? m[4]; + return `${company} · ${m[2]}${m[3] ? ` ${m[3]}` : ""} ${kind}`; +} diff --git a/web/tsconfig.json b/web/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..ccdb1d581d41dad445e7af5a529c8062c86e3fa8 --- /dev/null +++ b/web/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "ES2017", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules", "scripts"] +}