AI Engineering OCR Onebot VAON

Vietnamese OCR for AI Chatbots: From 70% Accuracy to Zero Errors on the Tested Set

Friday, 11 Sep 2026 7 min read 88 views

Mainstream commercial OCR misreads 25-30% of Vietnamese diacritics, causing RAG-based AI chatbots to answer incorrectly or report no information found. Instead of using an LLM to fix errors, VAON fine-tuned a 132 MB CPU-only OCR engine on 500,000 real character samples, raising accuracy from 70% to a point with no errors on the tested set, and cutting infrastructure cost 80%.


Table of Contents

Why Vietnamese OCR fails for RAG-based AI chatbots

Vietnamese carries a complex tonal system (five tone marks) plus modified vowels like ă, ơ, ư. This is the part standard OCR handles worst.

The number: testing mainstream commercial OCR engines, including major cloud provider APIs, showed a 25-30% diacritic and character error rate on Vietnamese text. Engines repeatedly read "thanh toán" (payment) as "thanh toan," or turned "ký hợp đồng" (sign contract) into a meaningless string.

The failure does not stop at text recognition. When OCR misreads characters, the downstream RAG (Retrieval-Augmented Generation) pipeline binds the wrong vector context. The chatbot then answers incorrectly or reports "information not found" for critical queries, such as a contract clause or an invoice amount.

Real-world documents make this worse. Most invoices, contracts and legal records in live operations are smartphone photos: tilted, blurry, crumpled, or faded thermal receipts. Published OCR benchmarks measure clean scans and do not reflect these conditions.

Using an LLM to fix OCR errors: a tempting trap

A common workaround when OCR misreads text is routing it through an LLM, such as GPT-4, for spell-checking. This creates three problems in an enterprise setting.

Risk of fabricated financial figures. When an LLM "guesses" missing characters, it can invent a wrong amount or contract date. For accounting data, that risk is unacceptable.

Cost and latency spike. Routing millions of lines of broken text through an LLM just for spell-checking inflates API cost by 300-500% and pushes per-page latency from 0.5 seconds to 5-10 seconds.

Data security risk. Sending invoice data with personal information through a third-party API breaches standards such as APPI (Japan) and GDPR.

The takeaway: a broken ingestion layer (OCR) cannot be patched by fixing the output layer (LLM). The intervention has to happen at the root.

How VAON raised accuracy from 70% to zero errors: 4 steps

In a real project for a financial-retail client, VAON was tasked with extracting knowledge from over 50,000 Vietnamese invoices, contracts and legal records to feed a RAG-based AI chatbot. Swapping OCR engines or bolting on an LLM fixer would not solve it. VAON used four steps instead.

  1. Dedicated image pre-processing. Built a pipeline for denoising, dewarping, and adaptive thresholding before feeding images to the recognition model, clearing blur, skew, and faded thermal-receipt text.

  2. Fine-tuned the engine on real business data. Instead of using a general multilingual model as-is, VAON fine-tuned its proprietary 132 MB CPU-only OCR engine on more than 500,000 real Vietnamese character samples (administrative fonts, retail invoices, regional diacritic variants). Why fine-tune separately: a multilingual model optimizes for many languages on average and handles Vietnamese diacritics poorly. Real invoice and contract data matches the actual fonts and business context instead.

  3. Added a domain lexicon layer instead of an LLM. VAON built a filter using Levenshtein distance combined with a finance and retail terminology dictionary, automatically correcting invalid words from surrounding context. Rule-based correction was chosen over an LLM because rules do not fabricate figures, and every correction traces back to a reason.

  4. Closed the loop into RAG on CPU infrastructure. The cleaned text feeds directly into the RAG pipeline to produce accurate vector embeddings. The entire system, from OCR to RAG, runs on standard CPU servers, no GPU required.

Measured results from a real project

The figures below are measured against invoice and contract data reconciled during project deployment (2026), not a vendor-published benchmark. No OCR or AI system is accurate in every case; this reflects one specific tested dataset.

Metric Before After Change
Knowledge extraction accuracy 70% No errors observed on the tested set Substantial improvement
Diacritic/character error rate (baseline commercial OCR) 25-30% Resolved via fine-tuning + lexicon filter -
Infrastructure GPU servers Standard CPU servers -80% cost
Data processing Called a third-party cloud API 100% on-premises Meets APPI, GDPR

Three direct business gains from this result:

  • The chatbot answers complex business queries correctly from contracts, policies and invoice data, instead of reporting "information not found."
  • Opens the door to regulated sectors like banking and healthcare, thanks to 100% on-premises processing.
  • Creates an OEM/white-label path for agencies and SIers wanting to package Vietnamese and Japanese document-processing capability under their own brand.

When this approach is not enough

Three limitations to know before applying this to another project:

The lexicon layer must be rebuilt per industry. The filter above was built for finance and retail vocabulary. Deploying into banking or healthcare needs a sector-specific dictionary before reaching the same accuracy.

Fine-tuning data must match the real documents you will see. These results were measured on administrative fonts, retail invoices, and the phone-camera conditions in this project. Document types outside that range, such as free-form handwriting, have not been verified.

On-premises deployment needs internal CPU infrastructure, not a ready-to-call cloud API. Initial rollout takes longer than integrating a standard OCR API.

Frequently asked questions

How much worse is Vietnamese OCR compared to English or Japanese? Testing mainstream commercial OCR engines showed a 25-30% diacritic and character error rate on Vietnamese text, while English and Japanese showed no equivalent problem on the same engines. The cause is Vietnamese's tonal system and modified vowels.

Why not just use an LLM to fix OCR errors? Because an LLM can invent a wrong amount or contract date while guessing missing characters, and it raises API cost by 300-500% with per-page latency up to 5-10 seconds. For financial data, that risk is unacceptable.

Does higher accuracy increase infrastructure cost? No. In this project, the 132 MB OCR engine runs entirely on standard CPU servers, no GPU needed, cutting infrastructure cost by 80% versus a GPU-based option for the same volume.

Does this work outside finance and retail? The four-step architecture applies to other industries, but the domain lexicon layer needs to be rebuilt with that industry's terminology, such as banking or healthcare, before reaching the same accuracy.

Is customer data safe with this approach? Yes. The entire pipeline runs 100% on-premises, with no data sent out through a third-party cloud API, meeting security standards such as Japan's APPI and GDPR.

Conclusion

  • Mainstream commercial OCR misreads 25-30% of Vietnamese diacritics, causing RAG-based chatbots to answer incorrectly or report no information found.
  • Using an LLM to fix OCR errors is not the right fix: it adds 300-500% cost, raises latency, and risks fabricating financial figures.
  • VAON solved it at the OCR layer with four steps: image pre-processing, fine-tuning on real data, a domain lexicon layer, and closing the loop into RAG on CPU infrastructure. Result: accuracy from 70% to zero errors on the tested set, infrastructure cost down 80%.
  • This approach needs a rebuilt lexicon per industry and internal CPU infrastructure rather than a ready-to-call cloud API.

If you're facing a similar problem with Vietnamese or Japanese data for an AI chatbot, RAG pipeline, or document OCR, book a consultation with VAON. We share exactly what we did, limitations included.

Ready to Transform Your Business?

Let's discuss how we can help you leverage AI and digital transformation for your enterprise.

Frequently asked questions

How much worse is Vietnamese OCR compared to English or Japanese?
Testing mainstream commercial OCR engines showed a 25-30% diacritic and character error rate on Vietnamese text, while English and Japanese showed no equivalent problem on the same engines. The cause is Vietnamese's tonal system and modified vowels.
Why not just use an LLM to fix OCR errors?
Because an LLM can invent a wrong amount or contract date while guessing missing characters, and it raises API cost by 300-500% with per-page latency up to 5-10 seconds. For financial data, that risk is unacceptable.

Share this article