#503
Document Intelligence
Upload an invoice, receipt, PO or quotation (PDF, text or image) and get its type, fields, line items and checks.
Technique: Keyword classifier + field extractors + arithmetic validation; PDFBox for PDF text
Read the code:
src/main/java/com/study/advlab/docintel/DocumentAnalyzer.javasrc/main/java/com/study/advlab/docintel/SampleDocuments.java
1. Document type
RECEIPT
Sample: Receipt · text
INVOICE
0%
RECEIPT
98%
PURCHASE ORDER
0%
QUOTATION
0%
CONTRACT
0%
Line items
| Description | Qty | Unit price | Amount |
|---|---|---|---|
| Thai jasmine rice 5kg | 2 | 295.00 | 590.00 |
| Coconut milk | 3 | 35.00 | 105.00 |
| Mango sticky rice | 1 | 89.00 | 89.00 |
3. Validation 6 of 6 checks passed
-
Line: Thai jasmine rice 5kg2 x 295.00 = 590.00 (document says 590.00)
-
Line: Coconut milk3 x 35.00 = 105.00 (document says 105.00)
-
Line: Mango sticky rice1 x 89.00 = 89.00 (document says 89.00)
-
Items add up to the subtotalItems 784.00 vs subtotal 784.00
-
Subtotal + VAT = total784.00 + 54.88 = 838.88 (document says 838.88)
-
VAT is 7% of the subtotalExpected 54.88, document says 54.88
Source text highlighted lines were used
1SIAM FRESH MARKET
2Central World, Bangkok
3RECEIPT
4Receipt No: R-2026-0418
5Date: 26/10/2026 14:32
6Cashier: Mali
72 x Thai jasmine rice 5kg 590.00
83 x Coconut milk 105.00
91 x Mango sticky rice 89.00
10Subtotal 784.00
11VAT 7% 54.88
12Total 838.88
13Cash 1,000.00
14Change 161.12
15Thank you for shopping with us!
Recent documents
| Document | Type | Confidence | Checks | When |
|---|---|---|---|---|
| Sample: Receipt | RECEIPT | 98% | 6/6 | 09 Nov 21:35 |
| Sample: Quotation | QUOTATION | 100% | 7/7 | 09 Nov 21:16 |
| Sample: Invoice | INVOICE | 100% | 8/8 | 09 Nov 21:16 |
| Sample: Contract (no numbers) | CONTRACT | 100% | 0/0 | 09 Nov 20:56 |
| Sample: Receipt | RECEIPT | 98% | 6/6 | 09 Nov 20:56 |
| Sample: Quotation | QUOTATION | 100% | 7/7 | 09 Nov 20:56 |
| Sample: Invoice | INVOICE | 100% | 8/8 | 09 Nov 20:56 |
| Sample: Purchase order | PURCHASE_ORDER | 99% | 6/6 | 09 Nov 20:56 |