Datasets:
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationError
Exception: ChunkedEncodingError
Message: ('Connection broken: IncompleteRead(2172911 bytes read, 3080517 more expected)', IncompleteRead(2172911 bytes read, 3080517 more expected))
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 779, in _error_catcher
yield
File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 925, in _raw_read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(2172911 bytes read, 3080517 more expected)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 820, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 1091, in stream
data = self.read(amt=amt, decode_content=decode_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 1008, in read
data = self._raw_read(amt)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 903, in _raw_read
with self._error_catcher():
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/usr/local/lib/python3.12/site-packages/urllib3/response.py", line 803, in _error_catcher
raise ProtocolError(arg, e) from e
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(2172911 bytes read, 3080517 more expected)', IncompleteRead(2172911 bytes read, 3080517 more expected))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1816, in _prepare_split_single
for key, table in generator:
^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 609, in wrapped
for item in generator(*args, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/csv/csv.py", line 198, in _generate_tables
for batch_idx, df in enumerate(csv_file_reader):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 1843, in __next__
return self.get_chunk()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 1985, in get_chunk
return self.read(nrows=size)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 1923, in read
) = self._engine.read( # type: ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 234, in read
chunks = self._reader.read_low_memory(nrows)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas/_libs/parsers.pyx", line 850, in pandas._libs.parsers.TextReader.read_low_memory
File "pandas/_libs/parsers.pyx", line 905, in pandas._libs.parsers.TextReader._read_rows
File "pandas/_libs/parsers.pyx", line 874, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 891, in pandas._libs.parsers.TextReader._check_tokenize_status
File "pandas/_libs/parsers.pyx", line 2053, in pandas._libs.parsers.raise_parser_error
File "/usr/local/lib/python3.12/site-packages/datasets/utils/file_utils.py", line 844, in read_with_retries
out = read(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 728, in track_read
out = f_read(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/huggingface_hub/hf_file_system.py", line 1015, in read
return super().read(length)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/fsspec/spec.py", line 1846, in read
out = self.cache._fetch(self.loc, self.loc + length)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/fsspec/caching.py", line 189, in _fetch
self.cache = self.fetcher(start, end) # new block replaces old
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/huggingface_hub/hf_file_system.py", line 969, in _fetch_range
r = http_backoff(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/huggingface_hub/utils/_http.py", line 310, in http_backoff
response = session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 724, in send
history = [resp for resp in gen]
^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 265, in resolve_redirects
resp = self.send(
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 746, in send
r.content
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 902, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 822, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(2172911 bytes read, 3080517 more expected)', IncompleteRead(2172911 bytes read, 3080517 more expected))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1343, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 907, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1683, in _prepare_split
for job_id, done, content in self._prepare_split_single(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1869, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
image_name string | chunk string | font_name string | image_base64 string | sample_id string | article_link string |
|---|---|---|---|---|---|
dataset_Alukah_Arabic_font_Amiri_article_1_part_1.png | "الغلو في نظرية المؤامرة الحمد لله خالقِ السماوات والأ(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzddWBT1//4/5O0tBQrLsOGDIa7O8MZNhyGDjrcJ8i(...TRUNCATED) | font_Amiri_article_1_part_1 | https://www.alukah.net//culture/0/166612/%d8%a7%d9%84%d8%ba%d9%84%d9%88-%d9%81%d9%8a-%d9%86%d8%b8%d8%b1%d9%8a%d8%a9-%d8%a7%d9%84%d9%85%d8%a4%d8%a7%d9%85%d8%b1%d8%a9/ |
dataset_Alukah_Arabic_font_Amiri_article_1_part_2.png | "كيفية تعامل الناس مع الأزمات، من المحتمل أن يكون للأزم(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzddXxTV9z48ZO0tKWF4g7DvbjDYNgoLsPdGe4bDGc(...TRUNCATED) | font_Amiri_article_1_part_2 | https://www.alukah.net//culture/0/166612/%d8%a7%d9%84%d8%ba%d9%84%d9%88-%d9%81%d9%8a-%d9%86%d8%b8%d8%b1%d9%8a%d8%a9-%d8%a7%d9%84%d9%85%d8%a4%d8%a7%d9%85%d8%b1%d8%a9/ |
dataset_Alukah_Arabic_font_Amiri_article_1_part_3.png | "أمرها، وكل ما يحدث من شرٍّ فهو تحت تدبيرها؟! إن مما تُو(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzddWBT1//4/5PUaItT3N3dhssYUtwZMnQ4wxk2ZAw(...TRUNCATED) | font_Amiri_article_1_part_3 | https://www.alukah.net//culture/0/166612/%d8%a7%d9%84%d8%ba%d9%84%d9%88-%d9%81%d9%8a-%d9%86%d8%b8%d8%b1%d9%8a%d8%a9-%d8%a7%d9%84%d9%85%d8%a4%d8%a7%d9%85%d8%b1%d8%a9/ |
dataset_Alukah_Arabic_font_Amiri_article_1_part_4.png | "تدبيره، أو يتمنَّوا سواه، وهم أعلم به وأعرف بأسمائه وص(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzdZWAbR7io4ZE5dthhZmZmZoY2zAxN03Cbpk3Shpk(...TRUNCATED) | font_Amiri_article_1_part_4 | https://www.alukah.net//culture/0/166612/%d8%a7%d9%84%d8%ba%d9%84%d9%88-%d9%81%d9%8a-%d9%86%d8%b8%d8%b1%d9%8a%d8%a9-%d8%a7%d9%84%d9%85%d8%a4%d8%a7%d9%85%d8%b1%d8%a9/ |
dataset_Alukah_Arabic_font_Amiri_article_2_part_1.png | "الاختلاف: مفهومه في اللغة والاصطلاح وفي القرآن الكريم (...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzddXwUx//48bkkxHAI7iVoIEUKNLgXp1AcWtydDxQ(...TRUNCATED) | font_Amiri_article_2_part_1 | https://www.alukah.net//culture/0/166610/%d8%a7%d9%84%d8%a7%d8%ae%d8%aa%d9%84%d8%a7%d9%81-%d9%85%d9%81%d9%87%d9%88%d9%85%d9%87-%d9%81%d9%8a-%d8%a7%d9%84%d9%84%d8%ba%d8%a9-%d9%88%d8%a7%d9%84%d8%a7%d8%b5%d8%b7%d9%84%d8%a7%d8%ad-%d9%88%d9%81%d9%8a-%d8%a7%d9%84%d9%82%d8%b1%d8%a2%d9%86-%d8%a7%d9%84%d9%83%d8%b1%d9%8a%d9%85%d... |
dataset_Alukah_Arabic_font_Amiri_article_2_part_2.png | "إلا فيما لا دليل عليه\" [12] . وهذا التفريق سبقه إليه أبو ا(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzdZWAU1/uw4bMbI4Hg7sEdAgWKB5dQ3KW4W7FSpGh(...TRUNCATED) | font_Amiri_article_2_part_2 | https://www.alukah.net//culture/0/166610/%d8%a7%d9%84%d8%a7%d8%ae%d8%aa%d9%84%d8%a7%d9%81-%d9%85%d9%81%d9%87%d9%88%d9%85%d9%87-%d9%81%d9%8a-%d8%a7%d9%84%d9%84%d8%ba%d8%a9-%d9%88%d8%a7%d9%84%d8%a7%d8%b5%d8%b7%d9%84%d8%a7%d8%ad-%d9%88%d9%81%d9%8a-%d8%a7%d9%84%d9%82%d8%b1%d8%a2%d9%86-%d8%a7%d9%84%d9%83%d8%b1%d9%8a%d9%85%d... |
dataset_Alukah_Arabic_font_Amiri_article_2_part_3.png | "النظر... ولهذا لا تجد فرقًا بينهما في استعمال الفقهاء\" [(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzdZ1wU1/v4/bOAINixd1HsWLBh712TWLHHhjX2aIz(...TRUNCATED) | font_Amiri_article_2_part_3 | https://www.alukah.net//culture/0/166610/%d8%a7%d9%84%d8%a7%d8%ae%d8%aa%d9%84%d8%a7%d9%81-%d9%85%d9%81%d9%87%d9%88%d9%85%d9%87-%d9%81%d9%8a-%d8%a7%d9%84%d9%84%d8%ba%d8%a9-%d9%88%d8%a7%d9%84%d8%a7%d8%b5%d8%b7%d9%84%d8%a7%d8%ad-%d9%88%d9%81%d9%8a-%d8%a7%d9%84%d9%82%d8%b1%d8%a2%d9%86-%d8%a7%d9%84%d9%83%d8%b1%d9%8a%d9%85%d... |
dataset_Alukah_Arabic_font_Amiri_article_2_part_4.png | "التفكير، وتنويع التصرف في وضع اللغات، وتبدل كيفياتها (...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzdd2BTVdzw8ZPuwWjZe29K2SBUQBFBhgiWvUFkKnu(...TRUNCATED) | font_Amiri_article_2_part_4 | https://www.alukah.net//culture/0/166610/%d8%a7%d9%84%d8%a7%d8%ae%d8%aa%d9%84%d8%a7%d9%81-%d9%85%d9%81%d9%87%d9%88%d9%85%d9%87-%d9%81%d9%8a-%d8%a7%d9%84%d9%84%d8%ba%d8%a9-%d9%88%d8%a7%d9%84%d8%a7%d8%b5%d8%b7%d9%84%d8%a7%d8%ad-%d9%88%d9%81%d9%8a-%d8%a7%d9%84%d9%82%d8%b1%d8%a2%d9%86-%d8%a7%d9%84%d9%83%d8%b1%d9%8a%d9%85%d... |
dataset_Alukah_Arabic_font_Amiri_article_2_part_5.png | "عبدالرؤوف بن تاج العارفين ابن علي بن زين العابدين الحد(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzdZXwUV/vw8RMnwaFYcEhxglPkxt1di7e4U7R4cYc(...TRUNCATED) | font_Amiri_article_2_part_5 | https://www.alukah.net//culture/0/166610/%d8%a7%d9%84%d8%a7%d8%ae%d8%aa%d9%84%d8%a7%d9%81-%d9%85%d9%81%d9%87%d9%88%d9%85%d9%87-%d9%81%d9%8a-%d8%a7%d9%84%d9%84%d8%ba%d8%a9-%d9%88%d8%a7%d9%84%d8%a7%d8%b5%d8%b7%d9%84%d8%a7%d8%ad-%d9%88%d9%81%d9%8a-%d8%a7%d9%84%d9%82%d8%b1%d8%a2%d9%86-%d8%a7%d9%84%d9%83%d8%b1%d9%8a%d9%85%d... |
dataset_Alukah_Arabic_font_Amiri_article_3_part_1.png | "[21] المحرر الوجيز في تفسير الكتاب العزيز، ابن عطية الأن(...TRUNCATED) | Amiri | "iVBORw0KGgoAAAANSUhEUgAACbEAAA20CAIAAABOHAVkAAEAAElEQVR4nOzdZYATV/v4/ZOsw+LutrguFHco7kWLuzsUWqRAabF(...TRUNCATED) | font_Amiri_article_3_part_1 | https://www.alukah.net//culture/0/166602/%d8%a5%d8%b7%d9%84%d8%a7%d9%84%d8%a9-%d8%b9%d9%84%d9%89-%d9%83%d8%aa%d8%a7%d8%a8-%d8%a7%d9%84%d8%a3%d8%b1%d8%a8%d8%b9%d9%88%d9%86-%d8%a7%d9%84%d9%82%d8%b1%d8%a2%d9%86%d9%8a%d8%a9/ |
SARD: Synthetic Arabic Recognition Dataset
Overview
SARD (Synthetic Arabic Recognition Dataset) is a large-scale, synthetically generated dataset designed for training and evaluating Optical Character Recognition (OCR) models for Arabic text. This dataset addresses the critical need for comprehensive Arabic text recognition resources by providing controlled, diverse, and scalable training data that simulates real-world book layouts.
Key Features
Massive Scale: 2,621,075 document images containing 794.6 million words
Typographic Diversity: Five distinct Arabic fonts (Amiri, Sakkal Majalla, Arial, Calibri, Scheherazade New and Traditional Arabic)
Structured Formatting: Designed to mimic real-world book layouts with consistent typography
Clean Data: Synthetically generated with no scanning artifacts, blur, or distortions
Content Diversity: Text spans multiple domains including culture, literature, Shariah, social topics, and more
Storage Size: 1.54 TB
Dataset Structure
The dataset is divided into five splits based on font name:
- Amiri: ~488585 document images
- Sakkal Majalla: ~488585 document images
- Arial: ~321683 document images
- Calibri: ~321683 document images
- Scheherazade New: ~572863 document images
- Traditional Arabic: ~428676 document images document images
📋 Sample Images
![]() |
![]() |
![]() |
![]() |
Each split contains data specific to a single font with the following attributes:
image_name: Unique identifier for each imagechunk: The text content associated with the imagefont_name: The font used in text renderingimage_base64: Base64-encoded image representationsample_id: Unique IDarticle_link: Link of the source article
Content Distribution
| Category | Number of Articles |
|---|---|
| Culture | 13,253 |
| Fatawa & Counsels | 8,096 |
| Literature & Language | 11,581 |
| Bibliography | 26,393 |
| Publications & Competitions | 1,123 |
| Shariah | 46,665 |
| Social | 8,827 |
| Translations | 443 |
| Muslim's News | 16,724 |
| Total Articles | 133,105 |
Font Specifications
| Font | Words Per Page | Font Size |
|---|---|---|
| Sakkal Majalla | 50–300 | 14 pt |
| Arial | 50–500 | 12 pt |
| Calibri | 50–500 | 12 pt |
| Amiri | 50–300 | 12 pt |
| Scheherazade | 50–250 | 12 pt |
| Traditional Arabic | 50–350 | 14 pt |
Page Layout
| Specification | Measurement |
|---|---|
| Left Margin | 0.9 inches |
| Right Margin | 0.9 inches |
| Top Margin | 1.0 inch |
| Bottom Margin | 1.0 inch |
| Gutter Margin | 0.2 inches |
| Page Width | 8.27 inches (A4) |
| Page Height | 11.69 inches (A4) |
Usage Example
from datasets import load_dataset
import base64
from io import BytesIO
from PIL import Image
import matplotlib.pyplot as plt
# Load dataset with streaming enabled
ds = load_dataset("riotu-lab/SARD", streaming=True)
print(ds)
# Iterate over a specific font dataset (e.g., Amiri)
for sample in ds["Amiri"]:
image_name = sample["image_name"]
chunk = sample["chunk"] # Arabic text transcription
font_name = sample["font_name"]
# Decode Base64 image
image_data = base64.b64decode(sample["image_base64"])
image = Image.open(BytesIO(image_data))
# Display the image
plt.figure(figsize=(10, 10))
plt.imshow(image)
plt.axis('off')
plt.title(f"Font: {font_name}")
plt.show()
# Print the details
print(f"Image Name: {image_name}")
print(f"Font Name: {font_name}")
print(f"Text Chunk: {chunk}")
# Break after one sample for testing
break
Applications
SAND is designed to support various Arabic text recognition tasks:
- Training and evaluating OCR models for Arabic text
- Developing vision-language models for document understanding
- Fine-tuning existing OCR models for better Arabic script recognition
- Benchmarking OCR performance across different fonts and layouts
- Research in Arabic natural language processing and computer vision
Acknowledgments
The authors thank Prince Sultan University for their support in developing this dataset.
Citation
If you use SARD in your work, please cite the following paper:
APA:
Nacar, O., Al-Habashi, Y., Sibaee, S., Ammar, A., & Boulila, W. (2025). SARD: A Large-Scale Synthetic Arabic OCR Dataset for Book-Style Text Recognition. arXiv preprint arXiv:2505.24600.
https://arxiv.org/abs/2505.24600
BibTeX:
@misc{nacar2025sard,
title={SARD: A Large-Scale Synthetic Arabic OCR Dataset for Book-Style Text Recognition},
author={Omer Nacar and Yasser Al-Habashi and Serry Sibaee and Adel Ammar and Wadii Boulila},
year={2025},
eprint={2505.24600},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2505.24600},
}
Usage Note:
This dataset includes text sourced from Alukah. Use is limited to non-commercial purposes in accordance with the source terms. Redistribution, republication, or commercial use is not permitted without permission and proper attribution to the original source and author.
- Downloads last month
- 2,795



