<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dr. Punitha Ponnuraj on Medium]]></title>
        <description><![CDATA[Stories by Dr. Punitha Ponnuraj on Medium]]></description>
        <link>https://medium.com/@punitha.p.raj?source=rss-41ad5e84221a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ND1eyKI8_xh9j9uR</url>
            <title>Stories by Dr. Punitha Ponnuraj on Medium</title>
            <link>https://medium.com/@punitha.p.raj?source=rss-41ad5e84221a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 07:30:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@punitha.p.raj/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Same Answer, Different Evidence: Checking Citation Drift in RAG Pipelines]]></title>
            <link>https://levelup.gitconnected.com/same-answer-different-evidence-checking-citation-drift-in-rag-pipelines-88a4a3dbd5af?source=rss-41ad5e84221a------2</link>
            <guid isPermaLink="false">https://medium.com/p/88a4a3dbd5af</guid>
            <category><![CDATA[information-retrieval]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Dr. Punitha Ponnuraj]]></dc:creator>
            <pubDate>Fri, 29 May 2026 14:16:52 GMT</pubDate>
            <atom:updated>2026-05-29T14:16:52.164Z</atom:updated>
            <content:encoded><![CDATA[<p>Why output stability does not always mean retrieval stability</p><p>RAG pipelines are usually evaluated through answer quality, grounding, retrieval accuracy, and latency. These checks are necessary, but they do not fully capture how the retrieval layer behaves across pipeline changes.</p><p>A pipeline may produce nearly identical answers before and after a retrieval change, while the supporting evidence changes underneath. This can happen after changes to chunk size, overlap, top-k, reranking, embedding models, or index configuration.</p><p>For systems that require debugging, regression testing, auditability, or traceability, this difference matters. The final answer is only one part of the behavior. Evidence trail matters as much as the final answer.</p><p>I started paying closer attention to this while running RAG evaluation experiments. In several runs, the answer text looked stable enough, but the cited support shifted after relatively small retrieval changes. That made the issue feel less like an answer-quality problem and more like a reproducibility problem.</p><h3>The Problem: Output Stability Can Hide Evidence Drift</h3><p>A common workflow looks like this:</p><ol><li>Modify the retriever or index configuration.</li><li>Run the evaluation set.</li><li>Compare answer quality, retrieval metrics, and latency.</li><li>Promote the change if the results look acceptable.</li></ol><p>This process can miss evidence drift.</p><p>Evidence drift occurs when the answer remains stable, but the retrieved documents or cited text spans change across runs. In some cases, the change is minor. In others, the system may shift from one source of authority to another while producing the same surface-level response.</p><p>That makes later review difficult. Engineers may struggle to reproduce the same support trail, explain why a source changed, or identify whether a pipeline change affected citation behavior.</p><h3>Example: Same Answer, Different Sources</h3><p>Consider an internal HR assistant. A user asks:</p><blockquote>How many days per week can hybrid employees work remotely?</blockquote><p>Before a retrieval change, the assistant answers:</p><blockquote>Hybrid employees may work remotely up to three days per week.</blockquote><p>It cites:</p><blockquote>HR_Policy_2024.pdf<br>Remote_Work_FAQ.pdf</blockquote><p>After a retrieval change, the assistant gives nearly the same answer, but cites:</p><blockquote>Manager_Guidelines.pdf<br>Team_Handbook.pdf</blockquote><p>The answer did not change but the evidence did. The review question is no longer only whether the answer is correct. It is also whether the system is relying on the correct source, whether the change is expected, and whether the new evidence trail is acceptable.</p><h3>The Subtler Case: Same Document, Different Span</h3><p>Evidence drift is not always visible at the document level. Two runs may cite the same document but use different passages within it. A document-level comparison would treat this as stable, while the actual justification may have changed.</p><p>This matters because different passages in the same document can carry different meaning:</p><blockquote>Policy rule → primary authority<br>Background text → supporting context<br>Exception clause → conditional rule<br>FAQ explanation → informal interpretation</blockquote><p>If the cited span moves from a policy rule to an explanatory note, the answer may still look reasonable, but the support trail has changed in a way that matters.</p><h3>From Evaluation to Implementation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-iPUh6jDFUTSgYKlGzW6g.png" /></figure><p>The diagram shows the basic idea behind the check. The same query set is run multiple times while changing retrieval settings such as chunking, overlap, or top-k. Each run produces a retrieval trace containing the documents and spans used as evidence.</p><p>Those traces are then compared across runs. The goal is not to measure whether the answer changed. It is to measure whether the supporting evidence remained stable after retrieval changes.</p><blockquote>The output may look stable while the retrieval trail moves.</blockquote><p>I built <a href="https://github.com/ppon1086/ragcitecheck"><strong>RagCiteCheck</strong></a> because I wanted a lightweight way to inspect this behavior without manually comparing retrieval logs across runs.</p><p>The goal was straightforward: take retrieval outputs from multiple runs and show whether the supporting evidence stayed stable.</p><p>The tool does not replace answer-quality scoring, faithfulness checks, or retrieval benchmarks. It focuses on a narrower question:</p><blockquote>Did the evidence behind the answer remain stable across runs?</blockquote><p>Given retrieval logs from multiple runs, RagCiteCheck can validate run structure, compare document-level evidence and document-plus-span evidence, generate stability summaries and reports where evidence changes across runs.</p><p>The project is available on <a href="https://github.com/ppon1086/ragcitecheck">GitHub</a> and can be run against existing retrieval logs without requiring changes to the retrieval pipeline itself.</p><h3>Minimal Workflow</h3><p>The workflow is simple:</p><ol><li>Run the same query set across different retrieval configurations.</li><li>Save the retrieved evidence for each run.</li><li>Compare evidence across runs.</li></ol><p>Validate the logs:</p><pre>python -m ragcitecheck.cli validate --runs ./examples/minimal --out ./out_che</pre><p>Generate a document-level report:</p><pre>python -m ragcitecheck.cli report --runs ./examples/minimal --out ./out_report_doc --evidence-key doc</pre><p>Generate a document-plus-span-level report:</p><pre>python -m ragcitecheck.cli report --runs ./examples/minimal --out ./out_report_span --evidence-key doc_span</pre><p>The reports help identify:</p><ul><li>queries with frequent evidence changes</li><li>cases where documents remain stable but spans shift</li><li>retrieval settings that introduce more citation movement than expected</li></ul><h3>What the Check Reveals</h3><p>This type of comparison often exposes behavior that answer-level evaluation misses:</p><ul><li>same answer, different cited documents</li><li>same document, different cited passage</li><li>unstable queries that repeatedly change evidence</li><li>chunking or reranking changes that affect citations more than answer text</li><li>retrieval changes that look safe at output level but alter the support trail</li></ul><p>Not every evidence change is a failure. Some changes are expected after retrieval tuning. The value is in making the change visible, so it can be reviewed instead of missed.</p><h3>Why This Matters for RAG Engineering</h3><p>For production RAG systems, the evidence trail is part of system behavior.</p><p>If a retrieval update changes which documents or spans support an answer, teams should be able to detect and inspect that change. This is useful for:</p><ul><li>regression testing</li><li>debugging retrieval updates</li><li>reviewing citation behavior</li><li>validating traceability</li><li>comparing retriever and chunking configurations</li></ul><p>Answer quality tells whether the response looks acceptable. Evidence stability tells whether the system is relying on the same support.</p><h3>Final Thought</h3><p>This started as a small debugging concern: the answer looked stable, but the evidence kept moving. The more I looked at it, the more it felt like a useful engineering check for RAG systems.</p><p>A RAG pipeline can return the same answer while relying on different evidence and that is not just a citation detail. It is system behavior worth measuring.</p><p>Quality:</p><ul><li>Before fixes: 8.8/10</li><li>After tiny tweaks: ~9.5/10</li></ul><p>This now looks like:</p><blockquote><em>“real OSS engineering tool architecture”</em></blockquote><p>— not a paper figure. Which is exactly what you want.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88a4a3dbd5af" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/same-answer-different-evidence-checking-citation-drift-in-rag-pipelines-88a4a3dbd5af">Same Answer, Different Evidence: Checking Citation Drift in RAG Pipelines</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Production AI Needs More Than Benchmark Scores]]></title>
            <link>https://levelup.gitconnected.com/why-production-ai-needs-more-than-benchmark-scores-5a46a0ae53b6?source=rss-41ad5e84221a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a46a0ae53b6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Dr. Punitha Ponnuraj]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 14:20:14 GMT</pubDate>
            <atom:updated>2026-04-24T14:20:14.236Z</atom:updated>
            <content:encoded><![CDATA[<p>If a model scores well on a benchmark, is it ready for production?</p><p>In many teams, that is still the default assumption. A strong aggregate score, a good leaderboard position, maybe a clean demo, and suddenly a system feels “ready enough.” But production failures often don’t come from average-case performance. They come from edge cases, ambiguous slices, unstable retrieval settings, or evidence that cannot be reconstructed after the fact. That is exactly where evaluation needs to get more serious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*2rAfp6IH5-uac4uYu21l3Q.png" /></figure><h3>Average performance hides the hardest failures</h3><p>A system can look strong overall and still fail where it matters most.</p><p>This happens when errors are concentrated in ambiguous cases, high-risk slices and near-boundary classifications or adversarial or edge conditions.</p><p>If you only report average metrics, you can miss the part of the distribution that actually drives deployment risk. In practice, production decisions are often shaped less by “How good is this on average?” and more by “Where does it fail, and how badly?”</p><p>A more useful evaluation report should separate:</p><ul><li>average-case performance</li><li>worst-case slice performance</li><li>dispersion across slices</li></ul><p>That shift sounds small, but it changes the meaning of the entire benchmark.</p><h3>Stop optimizing only for the best overall score</h3><p>A second problem is how teams choose operating points.</p><p>Most evaluation practice still defaults to maximizing an aggregate metric: accuracy, F1, maybe AUC. But many production environments are not score-maximization problems. They are <strong>constraint problems</strong>.</p><p>A better production question is:</p><blockquote><em>What operating point maximizes utility while keeping a critical error under a fixed bound?</em></blockquote><p>That matters especially in systems where one error type is disproportionately costly. High-similarity entity matching is a good example. A false positive is not just a misclassification. It can create downstream identity errors, bad merges, and operational cleanup work. In that situation, “best F-score” may actually be the wrong operating point.</p><p>A more deployment-aligned evaluation should state:</p><ul><li>what constraint is being enforced</li><li>on which slices it is enforced</li><li>what trade-offs result</li></ul><p>That is much closer to how production teams actually make decisions.</p><h3>Stability matters more than many teams admit</h3><p>A surprising weakness in modern AI evaluation is that systems can appear stable at the metric level while behaving differently underneath.</p><p>This is especially true in retrieval-augmented and agentic pipelines. Small changes in:</p><ul><li>retrieval depth</li><li>chunking strategy</li><li>prompt structure</li><li>tool availability</li></ul><p>can materially change the underlying behavior, even when the aggregate score still looks similar. That creates false confidence. A benchmark may look reproducible while the system’s actual evidence path or decision basis is shifting under routine configuration changes.</p><p>If an evaluation result is sensitive to normal setup choices, that is not a minor implementation detail. That is part of the result.</p><p>Teams should report:</p><ul><li>sensitivity to protocol parameters</li><li>whether conclusions remain stable under reasonable perturbations</li><li>whether outputs or decisions remain stable across configurations</li></ul><p>Without that, benchmark results can easily look firmer than they really are.</p><h3>Reproducibility needs evidence traces, not just outputs</h3><p>For systems that depend on retrieval or selected evidence, the final answer is not enough.</p><p>If the system’s output depends on what it retrieved, then reproducibility requires preserving some record of the evidence path. Otherwise, you can reproduce the prompt and still fail to reproduce the result. That gets worse when teams rely on implementation-specific artifacts like chunk IDs that change across systems or settings.</p><p>A more robust evaluation artifact set should include:</p><ul><li>document-level evidence identifiers</li><li>normalized fine-grained evidence representations where feasible</li></ul><p>This is not just a research neatness issue. It supports reproducibility, comparability across configurations and auditability after deployment.</p><p>If a benchmark result depends on evidence, then the evidence path is part of the benchmark result.</p><h3>Forced answering makes systems look better than they are</h3><p>Production systems often face: insufficient evidence, ambiguous input and out-of-scope requests.</p><p>But many evaluations still assume every query should produce an answer. That can inflate reliability claims. A system that is forced to answer when evidence is missing may look productive, but it may simply be converting uncertainty into confident error.</p><p>That is why abstention handling matters.</p><p>Evaluation reports should say whether abstention is allowed, how abstentions are scored, how common no-evidence scenarios are, what trade-off exists between answer rate and risk.</p><p>This is not a cosmetic reporting choice. It is part of whether the benchmark reflects real deployment conditions.</p><h3>Benchmarks should support qualified claims, not just attractive numbers</h3><p>A good benchmark result should answer more than “How high was the score?”</p><p>It should support qualified claims like:</p><ul><li>results were stable under reasonable protocol changes</li><li>deployment-relevant constraints were satisfied</li><li>evidence could be traced and reconstructed</li><li>worst-case slices remained within acceptable bounds</li></ul><p>That is how evaluation starts to align with deployment. Production AI needs more than benchmark scores. It needs benchmark outputs that preserve risk context, configuration sensitivity, and evidence structure. Otherwise, teams may mistake a clean aggregate metric for real operational readiness.</p><p>Note: This piece is adapted from comments I submitted in response to NIST AI 800–2 IPD, “Practices for Automated Benchmark Evaluations of Language Models</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a46a0ae53b6" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/why-production-ai-needs-more-than-benchmark-scores-5a46a0ae53b6">Why Production AI Needs More Than Benchmark Scores</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dashboards Look Back. Agentic AI Moves the Enterprise Analytics Forward.]]></title>
            <link>https://levelup.gitconnected.com/dashboards-look-back-agentic-ai-moves-the-enterprise-analytics-forward-72e2744237d3?source=rss-41ad5e84221a------2</link>
            <guid isPermaLink="false">https://medium.com/p/72e2744237d3</guid>
            <dc:creator><![CDATA[Dr. Punitha Ponnuraj]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 15:32:06 GMT</pubDate>
            <atom:updated>2026-02-20T15:32:06.088Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“Written from a practitioner’s perspective based on real enterprise workflows”</em></p><p>Dashboards have held the center of enterprise decision-making for a long time. They bring KPIs together, give teams and leadership a shared view of performance, and help everyone stay aligned. They’re dependable.</p><p>But there is just one issue — they don’t react. And they don’t nudge anything forward.</p><p>A dashboard waits for someone to open it, look at the data, interpret what changed, and then decide whether it matters. In an environment where things shift mid-week or even mid-day, that delay is where early signs get missed.</p><p>That’s usually because no one revisits the data again until the next review cycle. Most companies still operate on weekly review rhythms. Agentic AI could address this, by challenging that rhythm — reducing the distance between a change and a response. It stays in the background, watches continuously and steps in the moment something moves out of pattern.</p><p>And that’s where the limits of dashboards start to show.</p><h3>1. Where Dashboards Hit Their Limits</h3><p>People know their KPIs. They know what to filter. They know which charts matter.</p><p>The problem isn’t capability. It’s bandwidth.</p><p>On any given day, teams focus on the dashboards tied to their immediate decisions or meetings. Everything else gets checked later — if at all. And “later” is where small shifts hide.</p><p>Dashboards also follow the pace of data pipelines: scheduled refreshes, weekly loads, planned checks.</p><p>You see the updated snapshot, but you rarely see the motion between snapshots.</p><p>And not every insight earns its own dashboard. Many useful signals don’t justify a daily review, so they sit quietly until someone remembers to look.</p><p>Dashboards show what happened, but they don’t move the work forward. Whether anything happens next depends entirely on whoever happened to notice and what else they were juggling that day.</p><h3>2. What Agentic AI Adds</h3><p>Agentic AI fills the timing and follow-through gaps that dashboards can’t.</p><p>Instead of waiting for someone to log in or choose the right filter, it just keeps watching. It doesn’t depend on a meeting, a reminder, or a review cycle.</p><p>It stays aware — monitoring, detecting, reasoning, and offering the next step when something shifts. Sometimes it even takes the step itself.</p><blockquote><strong>Dashboards = visibility.</strong><br><strong>Agents = visibility + interpretation + action.</strong></blockquote><p>That one addition — <strong>action</strong> — is what most teams are missing during the week.</p><h3>3. Dashboard vs Agentic AI</h3><p>Dashboards tell you how things looked.</p><p>Agents help you respond to how things are changing right now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*JYseVj402CF6RopegaCnPQ.png" /><figcaption>How Dashboards and Agents Differ</figcaption></figure><h3>4. How Agentic Analytics Works</h3><p>The loop is straightforward:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*sgLoVjBXsVM2ZU06GLG2_A.png" /></figure><p><strong>Monitor:</strong> Keep track of signals continuously (activity, stage changes, coverage, etc.).</p><p><strong>Detect:</strong> Spot patterns that look unusual — stalled deals, repeated pushouts, quiet accounts.</p><p><strong>Reason:</strong> Filter out noise (weekends, one-day blips) and compare against what’s normal.</p><p><strong>Recommend:</strong> Suggest the next step when something real is happening.</p><p><strong>Act:</strong> Trigger alerts, tasks, or workflows if needed.</p><p>Dashboards really only support Step 1 — and even then, only if someone remembers to look.</p><p>Agents cover the rest.</p><h3><strong>5. How the Agent Actually Monitors Signals</strong></h3><p>From an implementation standpoint, the “Monitor → Detect → Reason → Recommend → Act” loop is usually built on top of a <strong>streaming or event-driven layer</strong>.</p><p>A lightweight agent can subscribe to:</p><ul><li>CRM events (Stage change, last-touch timestamps)</li><li>Downstream signals (Forecast overrides, Product mix changes)</li><li>Operational metadata (Sales rep activity, Account touch frequency)</li></ul><p>These come through a polling interval or a streaming pipeline (Kafka/Change Data Capture/API-based deltas).<br>This allows the agent to evaluate state transitions continuously without scanning the entire dataset each time — <strong>a key difference from dashboards</strong>, which depend on scheduled, full refreshes.</p><h3>6. A Real Enterprise Use Case: Sales Pipeline Slippage</h3><p>Across industries, a lot of value quietly leaks mid-week. Not because data is missing, but because the people who need to react won’t see the shift until the next review cycle.</p><p>Sales teams experience this constantly.</p><p>Tiny movements begin early in the week: a deal pushes out, another goes quiet, a normally active account hasn’t responded in days, a rep forgets to update a next-step date, or a region’s pipeline coverage dips just a bit. None of these feel urgent that day, and no one has time to scan every opportunity afternoon after afternoon.</p><p>Give it four or five days, and those little shifts start to matter.</p><p>Coverage begins slipping, conversions soften, forecast confidence thins out, and a region can fall behind plan before anyone realizes what caused it.</p><p>These issues look harmless individually, which is why most organizations underestimate how quickly they compound.</p><p>By Monday, the full drift becomes clear, but Monday is already late.</p><h3>What the agent does differently</h3><p>An agent watches continuously. It learns the usual rhythm of deals and notices when something stays stalled or moves out of pattern for a few days. When it sees that, it nudges the owner directly:</p><ul><li>“This deal has been quiet longer than usual.”</li><li>“Three Stage 2 opportunities pushed out this week.”</li><li>“Pipeline coverage for next quarter dropped below threshold.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MBgXEiLW_JJ3ylXy0D6gww.png" /></figure><p>A dashboard can show all of this. But it doesn’t show up unless someone opens them.</p><p>Agents close that gap.</p><h3>7. A Practical Way to Adopt Agentic Analytics</h3><p>You don’t need to rebuild your BI stack to get started. Begin with one place where timing matters.</p><p>Pick a dashboard that people depend on often.</p><p>Decide which movements truly deserve a nudge — drop the rest. Too many alerts will make people tune out.</p><p>Add guardrails so the agent doesn’t react to noise. Ignore single-day dips and predictable weekend patterns. Pay attention only to shifts that last 3+ days or break a pattern you already trust.</p><p>Connect the action path: who should know, and what should happen next? Sometimes it’s just a message. Other times it might be a task or a workflow action.</p><p>Once one use case works well, expand gradually.</p><p>Agentic programs thrive on trust — deliver value once, and the next step is easy.</p><h3>Conclusion</h3><p>Dashboards aren’t going away. They’re reliable and essential for alignment.</p><p>But visibility alone can’t keep up with the pace of today’s work.</p><p>Agentic AI brings the layer enterprises have been missing — the one that watches, reasons, and nudges while everyone else is busy doing the actual work.</p><p>Dashboards look back. Agentic AI moves the business forward.</p><p>And the real shift isn’t about replacing dashboards.</p><p>It’s about giving teams the chance to act at the moment it matters, not at the next review cycle.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72e2744237d3" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/dashboards-look-back-agentic-ai-moves-the-enterprise-analytics-forward-72e2744237d3">Dashboards Look Back. Agentic AI Moves the Enterprise Analytics Forward.</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OCR at Scale: What We Learned While Processing 10,000+ Documents]]></title>
            <link>https://levelup.gitconnected.com/ocr-at-scale-what-we-learned-while-processing-10-000-documents-77d005d2652e?source=rss-41ad5e84221a------2</link>
            <guid isPermaLink="false">https://medium.com/p/77d005d2652e</guid>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[scalability]]></category>
            <dc:creator><![CDATA[Dr. Punitha Ponnuraj]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 04:29:29 GMT</pubDate>
            <atom:updated>2025-12-24T04:29:29.700Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Lessons from building a production-grade OCR pipeline that processed over 10,000 scanned documents — reliably, and without manual restarts.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjoroBMQBwNFtGIM2APY8w.png" /></figure><p>When we first automated document scanning for a real-world data ingestion project, we assumed scaling was about <em>speed</em> — more CPUs, more threads, more throughput.<br> We were wrong.</p><p>What we learned was that scaling <strong>OCR isn’t a compute problem — it’s a <em>systems</em> problem</strong>. It’s about<strong> </strong>fault tolerance, consistency, and building pipelines that can survive bad data, unstable nodes, and the occasional PDF from the 90s.</p><p>We faced this while automating data extraction from scanned menus and PDFs. The OCR model itself (Tesseract) wasn’t the hard part. The real challenge was making it scale — handling retries, corrupted files, slow I/O, and random timeouts.</p><p>This wasn’t a deep learning problem. It was an engineering one.</p><h3>1. It started as a small script</h3><p>Like most experiments, it started simple — and it worked fine for a few files.</p><pre>from pytesseract import image_to_string<br>from PIL import Image<br>import os<br><br>for f in os.listdir(&quot;menus&quot;):<br>    text = image_to_string(Image.open(os.path.join(&quot;menus&quot;, f)))<br>    with open(f&quot;{f}.txt&quot;, &quot;w&quot;) as out:<br>        out.write(text)</pre><p>The code ran perfectly for around 50 images. Then things started failing — some files took forever, others returned blank text, and the process stopped mid-run.</p><blockquote>That’s when it became clear: scaling OCR isn’t about making it faster. It’s about making it <em>reliable.</em></blockquote><h3>2. Parallel processing helped, to an extent</h3><p>We added multiprocessing to speed things up:</p><pre>from multiprocessing import Pool<br>from pytesseract import image_to_string<br>from PIL import Image<br>import os<br><br>def ocr_image(file):<br>    path = os.path.join(&quot;menus&quot;, file)<br>    return {file: image_to_string(Image.open(path))}<br><br>if __name__ == &quot;__main__&quot;:<br>    files = os.listdir(&quot;menus&quot;)<br>    with Pool(8) as p:<br>        results = p.map(ocr_image, files)</pre><p>This gave a good speed boost — roughly 6–8× faster. But we also noticed unpredictable slowdowns. Some files finished instantly; others hung indefinitely.<br> The cause: image quality, resolution, and text density vary wildly. OCR runtime is never uniform.</p><p>Parallelism helped, but it wasn’t the real solution. The process still wasn’t fault-tolerant.</p><h3>3. Making it fault-tolerant</h3><p>When you process thousands of images, something <em>will</em> fail — missing files, bad encodings, or low-memory crashes.<br> We added simple retry logic and error logging:</p><pre>import logging, time<br><br>logging.basicConfig(filename=&quot;ocr_errors.log&quot;, level=logging.WARNING)<br><br>def safe_ocr(file, retries=3):<br>    for i in range(retries):<br>        try:<br>            return ocr_image(file)<br>        except Exception as e:<br>            logging.warning(f&quot;{file} failed (attempt {i+1}): {e}&quot;)<br>            time.sleep(1)<br>    return {file: None}</pre><p>This made the system much more stable. A single bad image no longer stopped the entire batch.<br> The process just retried or logged and continued.</p><h3>4. Shifting to cloud storage</h3><p>As we scaled up, local folders became a bottleneck — slow reads, limited I/O, and file locks between processes.<br> We switched to Amazon S3 to decouple storage from processing.</p><pre>import boto3, io<br>from pytesseract import image_to_string<br>from PIL import Image<br><br>s3 = boto3.client(&quot;s3&quot;)<br><br>def ocr_from_s3(bucket, key):<br>    img_bytes = s3.get_object(Bucket=bucket, Key=key)[&quot;Body&quot;].read()<br>    img = Image.open(io.BytesIO(img_bytes))<br>    text = image_to_string(img)<br>    s3.put_object(Bucket=&quot;ocr-results&quot;, Key=f&quot;{key}.txt&quot;, Body=text)</pre><p>This small change let multiple workers process in parallel across machines. It also simplified monitoring and recovery.</p><h3>5. Normalizing output</h3><p>OCR text is messy — unexpected spaces, broken lines, inconsistent encodings. We added a small normalization function:</p><pre>def normalize_text(text):<br>    return (<br>        text.replace(&quot;\r\n&quot;, &quot;\n&quot;)<br>            .strip()<br>            .encode(&quot;utf-8&quot;, errors=&quot;ignore&quot;)<br>            .decode()<br>    )</pre><p>Each result was stored with minimal metadata — filename, character count, and timestamp — to make validation and debugging easier.</p><pre>{<br>  &quot;file&quot;: &quot;menu_1241.jpg&quot;,<br>  &quot;status&quot;: &quot;success&quot;,<br>  &quot;chars&quot;: 612,<br>  &quot;processed_at&quot;: &quot;2025-12-12T10:20Z&quot;<br>}</pre><p>This metadata saved hours of guesswork later when something broke.</p><h3>6. Adding basic monitoring</h3><p>At small scale, you can just check the logs.<br> At scale, you need visibility.</p><p>We started tracking:</p><ul><li>Total processed files per hour</li><li>Average OCR time per file</li><li>Failures and retries</li></ul><p>Simple time-based logging helped initially; later, metrics went to CloudWatch.<br> Seeing a sudden drop in throughput usually pointed to a corrupted batch or unreadable file format.</p><h3>7. Orchestrating the flow</h3><p>We wrapped everything into a simple Airflow DAG:</p><pre>[Fetch Files] → [Preprocess] → [OCR Workers] → [Normalize] → [Upload]</pre><p>Each step could fail and retry independently.<br> This made the process repeatable — and maintainable — without manual restarts.</p><h3>8. What changed</h3><p>It wasn’t about speed anymore — it was about <em>consistency</em>.<br> Once the pipeline stabilized, everything else (including performance) followed naturally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*6-aIlkUD_ojtkCFW9Q7FYg.png" /><figcaption>Pipeline Stability Improvements After Scaling</figcaption></figure><h3>9. Lessons</h3><ul><li>Scaling OCR is about reliability, not speed.</li><li>Failures should be expected, not exceptional.</li><li>Metadata matters. You can’t debug what you don’t record.</li><li>Automation should survive the worst file in the batch.</li></ul><h3>Final thoughts</h3><p>OCR seems simple until you try to make it run unattended.<br> The real challenge isn’t extracting text — it’s making sure your pipeline can run tomorrow morning without anyone watching it.</p><p>That’s where the real engineering lies.</p><blockquote>Anyone can run OCR once.<br> The real work is building something that runs 10,000 times — and keeps going.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77d005d2652e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/ocr-at-scale-what-we-learned-while-processing-10-000-documents-77d005d2652e">OCR at Scale: What We Learned While Processing 10,000+ Documents</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Multi-Signal Fuzzy Matching Engine for Messy Enterprise Data]]></title>
            <link>https://levelup.gitconnected.com/how-to-build-a-multi-signal-fuzzy-matching-engine-for-messy-enterprise-data-d0f07118d0b2?source=rss-41ad5e84221a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0f07118d0b2</guid>
            <category><![CDATA[enterprise-software]]></category>
            <category><![CDATA[data-engineering-101]]></category>
            <category><![CDATA[data-quality]]></category>
            <category><![CDATA[fuzzy-matching]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Dr. Punitha Ponnuraj]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 03:36:12 GMT</pubDate>
            <atom:updated>2025-12-03T03:36:12.817Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Im4LvS7Qp50lTjCZ" /><figcaption>Photo by <a href="https://unsplash.com/@alishahlakhani?utm_source=medium&amp;utm_medium=referral">Ali Shah Lakhani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you have worked in a company that runs multiple ERPs and inherited older systems, you know this : <strong>Real enterprise data is messy</strong>. The same customer shows up under slightly different names, different address formats &amp; system specific abbreviations.</p><p>In such cases, a simple string comparison alone isn’t enough. Instead of matching just names or addresses in isolation, the best approach is to combine a few signals — name, address, geo proximity and phone number and turn them into one confidence score.</p><p>This post will walk you through building the below — a small, multi signal, fuzzy matching engine you can plug into any messy data set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwmU-M6q1ih71PeCMYIZcA.png" /><figcaption>Fuzzy matching pipeline : From raw data to golden record</figcaption></figure><p>We’ll take a messy csv and rebuild the key parts of the matching engine from scratch. Once we have the raw data loaded, we will clean it up, generate similarity scores, combine then and finally group related records into clusters.</p><h3>1. Start With a Messy Dataset</h3><p>Here is an example of how you can populate a small csv with intentionally inconsistent entries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*sN6jaSKzAYZIQeDrjUsl1g.png" /></figure><p>Names vary, City is misspelled, address, phone &amp; lat/long formats differ. Load it using the below code.</p><pre>import pandas as pd<br>df = pd.read_csv(&quot;customers.csv&quot;)</pre><h3>2. Normalize the Inputs</h3><p>Before comparing anything, we need to standardize the inputs — name, address and phone number</p><p><strong>Name normalization:</strong></p><p>This results in clean business names — removes suffixes like LLC, punctuation, spacing and coverts everything to lower case so comparisons are consistent.</p><pre>mport re<br>def normalize_name(name):<br>   name = name.lower()<br>   name = re.sub(r&quot;(llc|inc|restaurant)&quot;, &quot;&quot;, name)<br>   name = re.sub(r&quot;[^a-z0-9\s]&quot;, &quot;&quot;, name)<br>   return re.sub(r&quot;\s+&quot;, &quot; &quot;, name).strip()</pre><p><strong>Address normalization</strong></p><p>This process standardizes the address “Street” — “St”, normalizes punctuation and spacing so ‘123 MainStreet’ and ‘123, Main St’ are not treated differently.</p><pre>def normalize_address(addr):<br>   addr = addr.lower()<br>   addr = addr.replace(&quot;street&quot;, &quot;st&quot;).replace(&quot;st.&quot;, &quot;st&quot;)<br>   addr = re.sub(r&quot;[^a-z0-9\s]&quot;, &quot;&quot;, addr)<br>   return addr.strip()</pre><p><strong>Phone normalization</strong></p><p>Extracts the consistent 10-digit format</p><pre>def normalize_phone(phone):<br>   digits = re.sub(r&quot;\D&quot;, &quot;&quot;, phone)<br>   return digits[-10:] if len(digits) &gt;= 10 else &quot;&quot;</pre><p>Apply these transformations across your dataset:</p><pre>df[&quot;name_norm&quot;] = df[&quot;name&quot;].apply(normalize_name)<br><br>df[&quot;addr_norm&quot;] = df[&quot;address&quot;].apply(normalize_address)<br><br>df[&quot;phone_norm&quot;] = df[&quot;phone&quot;].apply(normalize_phone)</pre><h3>3. Compute Similarity Signals</h3><p>Each field contributes partial evidence. Combining them gives a stronger match than relying on any single signal.</p><p>Install the necessary libraries</p><pre>pip install jellyfish geopy python-Levenshtein</pre><h3>✓ Name similarity ( Jaro-Winkler)</h3><p>Jaro-Wrinkler handles small spelling and formatting variations that we normally see across ERPs.</p><pre>import jellyfish<br>def name_similarity(a, b):<br>   return jellyfish.jaro_winkler(a, b)</pre><h4>✓ Address similarity (Levenshtein ratio)</h4><p>Levenshtein ratio captures how close two strings really are character by character.</p><pre>import Levenshtein<br>def address_similarity(a, b):<br>   return Levenshtein.ratio(a, b)</pre><h3>✓ Geo proximity (Distance → Similarity score)</h3><p>Even when names and addresses differ, using locations in the similarity score helps match records that refer to the same place.</p><pre>from geopy.distance import geodesic<br>def geo_similarity(lat1, lon1, lat2, lon2):<br>   d = geodesic((lat1, lon1), (lat2, lon2)).meters<br>   return max(0, 1 - d/100)   # degrade at ~100m</pre><h3>✓ Phone similarity (Simple 1/0 match)</h3><p>Phone numbers are either the same or not, making it the clearest signal.</p><pre>def phone_similarity(a, b):<br>   return 1.0 if a == b and a != &quot;&quot; else 0.0</pre><h3>4. Combine Signals Into a Weighted Score</h3><p>Choose a weight to each of the signal based on their importance and compute a final score based on all similarity metrics.</p><p>Rule-based weighting works extremely well, especially early on. It gives you a controllable, explainable and tunable model before moving to ML-based approaches.</p><pre>def combined_score(a, b):<br>   return (<br>       0.40 * name_similarity(a[&quot;name_norm&quot;], b[&quot;name_norm&quot;]) +<br>       0.30 * address_similarity(a[&quot;addr_norm&quot;], b[&quot;addr_norm&quot;]) +<br>       0.20 * geo_similarity(a[&quot;lat&quot;], a[&quot;lon&quot;], b[&quot;lat&quot;], b[&quot;lon&quot;]) +<br>       0.10 * phone_similarity(a[&quot;phone_norm&quot;], b[&quot;phone_norm&quot;])<br>   )</pre><h3>5. Classify Matches</h3><p>You’ll need thresholds to decide:</p><ul><li>MATCH</li><li>REVIEW</li><li>NO MATCH</li></ul><p>Thresholds vary by dataset, but the idea is simple — high scores are automatic matches, borderline scores got to review and low scores are considered non-matches.</p><pre>def classify(score, high=0.85, low=0.70):<br>   if score &gt;= high:<br>       return &quot;MATCH&quot;<br>   if score &gt;= low:<br>       return &quot;REVIEW&quot;<br>   return &quot;NO MATCH&quot;</pre><h3>6. Avoid O(N²) With Blocking</h3><p>Instead of comparing all records with each other, block comparisons by locality (e.g., ZIP code), so that you don’t unnecessarily compare records that are not related at all.</p><p>This dramatically reduces compute time.</p><pre>pairs = []<br>for z in df[&quot;zip&quot;].unique():<br>   block = df[df[&quot;zip&quot;] == z]<br>   for i in range(len(block)):<br>       for j in range(i+1, len(block)):<br>           a, b = block.iloc[i], block.iloc[j]<br>           score = combined_score(a, b)<br>           pairs.append((a.erp_id, b.erp_id, score, classify(score)))</pre><h3>7. Form Clusters Using Union-Find</h3><p>Once you identify matched pairs, use union-find (disjoint set) to build clusters of records belonging to the same entity.</p><pre>parent = {}<br>def find(x):<br>   if parent.get(x, x) == x:<br>       return x<br>   parent[x] = find(parent[x])<br>   return parent[x]<br>def union(a, b):<br>   ra, rb = find(a), find(b)<br>   if ra != rb:<br>       parent[rb] = ra</pre><p>Apply merges:</p><pre>for a, b, score, tag in pairs:<br>   if tag == &quot;MATCH&quot;:<br>       union(a, b)</pre><p>Group clusters:</p><pre>clusters = {}<br>for id_ in df[&quot;erp_id&quot;]:<br>   root = find(id_)<br>   clusters.setdefault(root, []).append(id_)</pre><p>This transforms pairwise matches into unified “golden records.”</p><h3>8. Output Golden Record Clusters</h3><p>Once clusters are formed, print or inspect the final merged entities.</p><pre>print(&quot;\nFinal Clusters:\n&quot;)<br>for root, members in clusters.items():<br>   print(f&quot;Cluster {root}: {members}&quot;)</pre><p>These clusters act as your “golden records” — the unified view that downstream systems (CRM, analytics, modeling) would consume.</p><h3>Key Takeaways</h3><ul><li>The mismatches come more from messy inputs, than the algorithm — so invest time in normalizing or standardizing names, addresses, and phone numbers before tuning scores.</li><li>No single field is reliable across ERPs. Names &amp; addresses vary, and phone formats are unpredictable — multiple signals are the only stable approach.</li><li>Address data is always the hardest and varies too much. So, don’t try to make it a strict match.</li><li>Phone numbers are reliable, once you strip them to digits and often helps identifying the borderline matches.</li><li>Without blocking comparisons explode and fuzzy matching becomes impossible at scale.</li><li>Thresholds are never one-size-fits-all; Commissions or incentives workflow would need a higher threshold than a CRM workflow. Tune based on your needs.</li><li>Clusters rarely look perfect on the first try; reviewing edge cases teaches you more about your data than any algorithm ever will.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0f07118d0b2" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-to-build-a-multi-signal-fuzzy-matching-engine-for-messy-enterprise-data-d0f07118d0b2">How to Build a Multi-Signal Fuzzy Matching Engine for Messy Enterprise Data</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>