HeadlinesBriefing favicon HeadlinesBriefing.com

Noisy Text in RAG: Fixing Typos, OCR, and Transcription Errors

Towards Data Science •
×

The user types “assurance décénale” and the document says “décennale.” One missing letter, and a literal search finds nothing. Real questions arrive with typos, and real documents have their own; before retrieval can match anything, someone has to fix the spelling on both sides. This article is a bonus in Enterprise Document Intelligence, a series that builds an enterprise RAG system from four bricks. It tackles noisy text across the pipeline: user typos, fast-typing transcription noise, OCR character errors, what classical spell-check fixes, and what embeddings have to carry. New to the series? Every article in this series sits on our two Towards Data Science author pages, Angela Shi and Kezhan Shi. That is the shortest way to see what is covered and where this one sits.

The same problem shows up on both sides of a pipeline. On the question side, type “wat is teh covarge for fyre damge?” into a chatbot built over a company knowledge base: three typos and a missing letter, and the chatbot returns nothing useful until the question is retyped carefully. On the document side, dump 50,000 customer support tickets into the same pipeline for retrieval: half of them are written in fragments, abbreviations, mixed case, with the same kind of errors, and the pipeline that worked for clean queries against clean documents starts returning noise.

This is the noisy-text problem in enterprise RAG. It looks like a spell-check problem from the outside, but the actual cause splits three ways. The user mistyped a word (a typo). The user typed under pressure on mobile and scrambled boundaries, dropped accents, abbreviated (transcription noise). The document came through OCR and a scanner silently replaced O with 0, broke a fi ligature, split policyholder into policy holder (OCR noise). All three end with the same symptom downstream: a token in the query or in the document does not literally match what it should, even though the meaning is intact.

The classical spell-correction toolbox was built for one of the three. The other two are the ones that hurt enterprise pipelines, and the ones embeddings are quietly built to absorb.