{
  "licence": "https://creativecommons.org/licenses/by/4.0/",
  "credit": "Saulius Beconis, sbeconis.com",
  "page": "https://sbeconis.com/lab/document-intelligence/",
  "url": "https://sbeconis.com/lab/document-intelligence/cord-2026-10-06.json",
  "note": "Measurements and text are CC BY 4.0. Source data and quoted excerpts keep their own licences: see \"attribution\".",
  "lab": "LAB/002",
  "title": "Receipt extraction with validation and review routing (CORD-v2)",
  "date": "2026-10-06",
  "dataset": {
    "name": "naver-clova-ix/cord-v2",
    "splits": [
      "validation",
      "test"
    ],
    "documents": 200,
    "license": "CC BY 4.0"
  },
  "method": {
    "model": "Qwen/Qwen3-VL-4B-Instruct",
    "decoding": "greedy, max_new_tokens 1024, bf16, image longest side ≤ 1280 px",
    "prompt": "Extract the data from this receipt as JSON with exactly these keys:\n{\n  \"items\": [{\"name\": string, \"quantity\": number or null, \"price\": string}],\n  \"subtotal\": string or null,\n  \"tax\": string or null,\n  \"service\": string or null,\n  \"discount\": string or null,\n  \"total\": string or null,\n  \"cash\": string or null,\n  \"change\": string or null\n}\nRules: one entry in \"items\" per purchased line; \"price\" is the line amount as printed. Copy amounts exactly as printed. Use null for anything not printed on the receipt. Return only the JSON.",
    "normalisation": "amounts reduced to digits (sign kept); item match = equal price and (name similarity ≥ 0.8 or one normalised name contains the other)",
    "rules": {
      "items_sum": "sum of line prices = subtotal (or total if no subtotal)",
      "subtotal_to_total": "subtotal + tax + service − |discount| = total",
      "cash_change": "cash − change = total"
    },
    "routing": "auto-accept only if JSON parsed, a total exists and every applicable rule passes"
  },
  "environment": {
    "gpu": "NVIDIA GeForce RTX 4070",
    "cpu": "13th Gen Intel(R) Core(TM) i5-13400F",
    "python": "3.12.14",
    "torch": "2.14.1+cu130",
    "transformers": "5.19.0"
  },
  "ground_truth_rules": {
    "per_rule": {
      "cash_change": {
        "applicable": 106,
        "hold": 100
      },
      "items_sum": {
        "applicable": 192,
        "hold": 177
      },
      "subtotal_to_total": {
        "applicable": 129,
        "hold": 118
      }
    },
    "auto_rate": 0.815
  },
  "overall": {
    "documents": 200,
    "parsed_rate": 1,
    "field_accuracy": {
      "cash": {
        "accuracy": 0.9618320610687023,
        "n": 131
      },
      "change": {
        "accuracy": 0.95,
        "n": 120
      },
      "discount": {
        "accuracy": 0.9166666666666666,
        "n": 12
      },
      "service": {
        "accuracy": 0.64,
        "n": 25
      },
      "subtotal": {
        "accuracy": 0.9924242424242424,
        "n": 132
      },
      "tax": {
        "accuracy": 0.8295454545454546,
        "n": 88
      },
      "total": {
        "accuracy": 0.9740932642487047,
        "n": 193
      }
    },
    "items": {
      "precision": 0.8286778398510242,
      "recall": 0.9427966101694916,
      "f1": 0.8820614469772051,
      "gt": 472,
      "pred": 537
    },
    "fully_correct_rate": 0.655,
    "total_correct_rate": 0.9740932642487047,
    "hallucinated_fields": 115
  },
  "routing": {
    "auto_rate": 0.725,
    "auto": {
      "documents": 145,
      "parsed_rate": 1,
      "field_accuracy": {
        "cash": {
          "accuracy": 0.98989898989899,
          "n": 99
        },
        "change": {
          "accuracy": 1,
          "n": 89
        },
        "discount": {
          "accuracy": 1,
          "n": 5
        },
        "service": {
          "accuracy": 0.75,
          "n": 16
        },
        "subtotal": {
          "accuracy": 1,
          "n": 88
        },
        "tax": {
          "accuracy": 0.9245283018867925,
          "n": 53
        },
        "total": {
          "accuracy": 1,
          "n": 140
        }
      },
      "items": {
        "precision": 0.9036827195467422,
        "recall": 0.9845679012345679,
        "f1": 0.9423929098966026,
        "gt": 324,
        "pred": 353
      },
      "fully_correct_rate": 0.8068965517241379,
      "total_correct_rate": 1,
      "hallucinated_fields": 71
    },
    "review": {
      "documents": 55,
      "parsed_rate": 1,
      "field_accuracy": {
        "cash": {
          "accuracy": 0.875,
          "n": 32
        },
        "change": {
          "accuracy": 0.8064516129032258,
          "n": 31
        },
        "discount": {
          "accuracy": 0.8571428571428571,
          "n": 7
        },
        "service": {
          "accuracy": 0.4444444444444444,
          "n": 9
        },
        "subtotal": {
          "accuracy": 0.9772727272727273,
          "n": 44
        },
        "tax": {
          "accuracy": 0.6857142857142857,
          "n": 35
        },
        "total": {
          "accuracy": 0.9056603773584906,
          "n": 53
        }
      },
      "items": {
        "precision": 0.6847826086956522,
        "recall": 0.8513513513513513,
        "f1": 0.7590361445783131,
        "gt": 148,
        "pred": 184
      },
      "fully_correct_rate": 0.2545454545454545,
      "total_correct_rate": 0.9056603773584906,
      "hallucinated_fields": 44
    }
  },
  "latency": {
    "p50_s": 3.4,
    "p95_s": 7.16,
    "mean_tokens": 167.2
  },
  "examples": [
    {
      "id": "validation/0",
      "route": "auto",
      "checks": {
        "items_sum": true,
        "subtotal_to_total": true,
        "cash_change": true
      },
      "fully_correct": true,
      "image": {
        "src": "/lab-media/document-intelligence/validation-0.webp",
        "width": 420,
        "height": 630
      },
      "extracted": {
        "subtotal": "45,500",
        "tax": null,
        "service": null,
        "discount": null,
        "total": "45,500",
        "cash": "50,000",
        "change": "4,500"
      },
      "extracted_items": [
        {
          "name": "REAL GANACHE",
          "price": "16,500"
        },
        {
          "name": "EGG TART",
          "price": "13,000"
        },
        {
          "name": "PIZZA TOAST",
          "price": "16,000"
        }
      ],
      "ground_truth": {
        "total": 45500,
        "cash": 50000,
        "change": 4500
      }
    },
    {
      "id": "validation/2",
      "route": "review",
      "checks": {
        "items_sum": false,
        "subtotal_to_total": false,
        "cash_change": true
      },
      "fully_correct": false,
      "image": {
        "src": "/lab-media/document-intelligence/validation-2.webp",
        "width": 420,
        "height": 744
      },
      "extracted": {
        "subtotal": "18,181",
        "tax": "10% Tax Included",
        "service": null,
        "discount": "50%",
        "total": "20,000",
        "cash": "100,000",
        "change": "80,000"
      },
      "extracted_items": [
        {
          "name": "S-Ovaltine",
          "price": "20,000"
        }
      ],
      "ground_truth": {
        "subtotal": 18181,
        "tax": 1818,
        "total": 20000,
        "cash": 100000,
        "change": 80000
      }
    }
  ],
  "attribution": "Receipt images: CORD-v2 (Park et al., 2019), CC BY 4.0, resized."
}
