Evaluating In-Context Learning and Retrieval Strategies for Devanagari Post-OCR Correction
作者: Abhishek Bhandari, Gaurav Harit
分类: cs.CL, cs.CV
发布日期: 2026-09-18
🔗 代码/项目: HUGGINGFACE
💡 一句话要点
提出CharBM25策略以提升德瓦纳加里后OCR校正效果
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 后OCR校正 德瓦纳加里脚本 大型语言模型 字符n-gram 检索策略 印地语 马拉地语 无训练校正
📋 核心要点
- 现有的后OCR校正方法在德瓦纳加里脚本中缺乏有效性评估,尤其是在印地语和马拉地语的应用上存在挑战。
- 论文提出了一种新的检索策略CharBM25,通过字符n-gram BM25相似性检索示例,针对共享错误模式进行校正。
- 实验结果显示,CharBM25在印地语和马拉地语上分别提高了2.8-4.0pp和2.9-3.8pp的绝对字错误率(WER),且大规模模型表现优异。
📝 摘要(中文)
使用大型语言模型(LLMs)的上下文学习为无训练的后OCR校正提供了有力的途径,但其在德瓦纳加里脚本中的有效性尚未被探索。本文首次系统评估了LLMs(3B-32B)在印地语和马拉地语后OCR校正中的表现,比较了三种上下文示例检索策略:领域随机选择、密集语义检索和我们提出的CharBM25。研究表明,检索策略是校正质量的决定性因素,CharBM25在印地语和马拉地语上均显著优于领域随机选择。通过对20,000句的基准测试,CharBM25在性能上表现出色,且结合12B以上的通用LLM可实现无任务特定微调的可靠校正。
🔬 方法详解
问题定义:本文旨在解决德瓦纳加里脚本后OCR校正的有效性问题,现有方法在此领域的应用效果不佳,尤其是在印地语和马拉地语中。
核心思路:论文提出的CharBM25策略通过字符n-gram BM25相似性检索示例,旨在捕捉与测试句子共享的错误模式,从而提高校正效果。
技术框架:整体流程包括数据预处理、示例检索、模型校正和结果评估。主要模块包括字符n-gram提取、BM25相似性计算和LLM校正。
关键创新:CharBM25作为一种有效的检索策略,能够在计算成本极低的情况下,与密集检索方法相媲美或超越,显著提升后OCR校正的质量。
关键设计:在实验中,使用字符三元组进行检索,且模型规模需达到12B以上才能实现可靠的性能提升,3B模型在马拉地语上甚至会导致性能下降。
🖼️ 关键图片
📊 实验亮点
实验结果表明,CharBM25在印地语和马拉地语的字错误率(WER)分别降低了55.0%和33.3%。与领域随机选择相比,CharBM25在印地语上提高了2.8-4.0pp,马拉地语上提高了2.9-3.8pp,显示出显著的性能提升。
🎯 应用场景
该研究的潜在应用领域包括文本识别、自然语言处理和机器翻译等,尤其是在处理德瓦纳加里脚本的OCR校正任务中。其无训练的校正方法可降低计算资源需求,具有广泛的实际价值和未来影响。
📄 摘要(原文)
In-context learning using Large Language Models (LLMs) offers a compelling path to training-free post-OCR correction, yet its effectiveness for Devanagari script remains entirely unexplored. We present the first systematic evaluation of LLMs (3B-32B) for post-OCR correction in Hindi and Marathi, comparing three in-context example retrieval strategies: domain-random selection, dense semantic retrieval, and our proposed CharBM25, which retrieves examples by character n-gram BM25 similarity over OCR inputs to target shared error patterns with the test sentence. Across a 20,000-sentence benchmark spanning five news domains, retrieval strategy is the decisive factor in correction quality: CharBM25 outperforms domain-random selection by 2.8-4.0pp absolute WER on Hindi and 2.9-3.8pp on Marathi, using character trigrams, which consistently outperform bigrams and unigrams. Scale dominates performance: Gemma-3-27B achieves WER reductions of 55.0% for Hindi and 33.3% for Marathi under CharBM25-5. Few-shot gains are capacity-gated: models below 8B do not reliably improve over the OCR baseline, and on Marathi the smallest models (3B) degrade more sentences than they improve. Marathi is persistently harder to correct than Hindi across all scales, reflecting its greater morphological complexity. These findings establish CharBM25 as an effective, GPU-free retrieval strategy that matches or exceeds dense retrieval at negligible computational cost, and show that combining it with a general-purpose LLM of 12B+ parameters delivers reliable, training-free Devanagari post-OCR correction without task-specific fine-tuning. Dataset: https://huggingface.co/datasets/AbhishekBhandari/Devanagari-OCR-ICL-Benchmark