Arabic-Nougat: Fine-Tuning Vision Transformers for Arabic OCR and Markdown Extraction

Mohamed Rashad
11/19/2024
cs.CLcs.AIcs.CV

Official code: MohamedAliRashad/arabic-nougat (53 stars, last commit 2024-11-28).

Abstract

We present Arabic-Nougat, a suite of OCR models for converting Arabic book pages into structured Markdown text. Based on Meta's Nougat architecture, Arabic-Nougat includes three specialized models: arabic-small-nougat, arabic-base-nougat, and arabic-large-nougat. These models are fine-tuned on a synthetic dataset, arabic-img2md, comprising 13.7k pairs of Arabic book pages and their Markdown representations. Key contributions include the Aranizer-PBE-86k tokenizer, designed for efficient tokenization, and the use of torch.bfloat16 precision with Flash Attention 2 for optimized training and inference. Our models achieve state-of-the-art performance, with arabic-large-nougat delivering the highest Markdown Structure Accuracy and the lowest Character Error Rate. Additionally, we release a large-scale dataset containing 1.1 billion Arabic tokens extracted from over 8,500 books using our best-performing model, providing a valuable resource for Arabic OCR research. All models, datasets, and code are open-sourced and available at https://github.com/MohamedAliRashad/arabic-nougat.

View on arXivView PDF

Code Implementations(1)

Code for Arabic Nougat

533PythonOct 8, 20241 years ago

Similar Papers

Cite this paper

@article{rashad2024arabicnougat,
  title  = {Arabic-Nougat: Fine-Tuning Vision Transformers for Arabic OCR and Markdown Extraction},
  author = {Mohamed Rashad},
  year   = {2024},
  eprint = {2411.17835},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.17835v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.17835.svg)](https://codeofpaper.com/paper/2411.17835)

Discussion