{
  "id": 21810748,
  "title": "The model reads, the code decides: AI document reading that can't put a wrong number in the books",
  "url": "https://urgent.news/2026/11/25/the-model-reads-the-code-decides-ai-document-reading-that-cant-put-a",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-25T15:44:24.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/saksham653/the-model-reads-the-code-decides-ai-document-reading-that-cant-put-a-wrong-number-in-the-books-5dn7"
  },
  "original_language": "en",
  "account": "The ability to read documents and accurately interpret their contents is a critical task for modern businesses. However, the challenge lies not in the reading itself, but in the subsequent decision-making process to determine the validity and accuracy of the information extracted. This is where artificial intelligence comes into play.\n\nA novel AI-powered document reading system has been developed that excels at copying text from images such as invoices and weighbridge slips. The model meticulously copies the content verbatim into a JSON object, without attempting to add up numbers, convert units, or reformat data. All such transformations are left to the coded logic.\n\nFor example, the model may output:\n```json\n{\n\"net_weight\" : \"12,345 KG\",\n\"date\" : \"25/11/26\",\n\"plate\" : \"UP 32 XX 0000\"\n}\n```\n\nHowever, the model does not perform any calculations on this raw data. Advanced code is then used to convert the numbers to quintals (123.45), parse the date into a proper format (2026-11-25), and normalize the vehicle plate (UP32XX0000).\n\nBut the real work begins when the AI model's output is subjected to strict validation checks. Only when the calculated figures match the values on the original document, and comply with internal business rules, are they accepted. This ensures that the AI reading process is always double-checked by the coded logic, preventing any potential errors or misinterpretations from propagating through the system.\n\nKey principles include:\n1. The AI model is solely responsible for copying data\n2. All calculations, conversions, and formatting are performed by the coded logic\n3. Every piece of extracted information must agree with its source document\n4. Checks include verifying invoice line calculations, flagging overcharged receipts, validating delivery dates, ensuring cheque amounts match, and aligning payment copies\n\nBy enforcing this separation of reading and decision-making, the system minimizes the risk of wrong numbers being entered into the books. The AI model can be easily swapped out for another without impacting the core business rules. This separation of concerns allows the focus to remain on the crucial step of human validation, ensuring that only accurate and reliable data is recorded in the accounting system.",
  "summary": "Papers arrive as photos: invoices, weighbridge slips, payment slips. Reading them with an AI model is the easy part now. The hard part is deciding how much of what it read to believe, because a misread \"8\" becomes a wrong bill, and wrong bills are exactly what this backend is built to refuse. So the rule is the same as everywhere else in it: the model is allowed to read. Only code is allowed to…",
  "key_points": [
    "AI model copies text from images without altering data",
    "Separate coding logic handles calculations, conversions, formatting",
    "Strict validation checks ensure extracted info matches original document"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}