abdelazizeeeee commited on
Commit
eaab154
·
0 Parent(s):

first commit

Browse files
.gitattributes ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ configs:
3
+ - config_name: default
4
+ data_files:
5
+ - split: train
6
+ path: data/train-*
7
+ - split: validation
8
+ path: data/validation-*
9
+ - split: test
10
+ path: data/test-*
11
+ dataset_info:
12
+ features:
13
+ - name: id
14
+ dtype: string
15
+ - name: image
16
+ dtype: image
17
+ - name: output
18
+ dtype: string
19
+ splits:
20
+ - name: train
21
+ num_bytes: 2440808481
22
+ num_examples: 22435
23
+ - name: validation
24
+ num_bytes: 329337240
25
+ num_examples: 2804
26
+ - name: test
27
+ num_bytes: 328649745
28
+ num_examples: 2805
29
+ download_size: 3127169673
30
+ dataset_size: 3098795466
31
+ ---
32
+ # Arabic-Image2Html Dataset
33
+
34
+ A dataset of **28K image-HTML pairs** for training OCR models to transform Arabic documents into structured and semantic HTML.
35
+
36
+ ## Dataset Description
37
+
38
+ This dataset was created to address the lack of available open-source Arabic OCR datasets with image-to-semantic HTML pairs. It contains diverse Arabic document images paired with clean, semantic HTML output.
39
+
40
+ ### Dataset Composition
41
+
42
+ The dataset consists of two main components:
43
+
44
+ **1. Web-Scraped Wikipedia Content (~13K samples, 46%)**
45
+ - Extracted from Arabic Wikipedia articles
46
+ - Post-processed HTML with only semantic tags preserved
47
+ - Screenshots captured with real styling using Playwright
48
+ - Cleaned structure with proper semantic elements (section, header, main, etc.)
49
+
50
+ **2. Synthetically Generated Documents (~15K samples, 54%)**
51
+ - HTML documents rendered into images using CSS styling
52
+ - Mimics various real-world document types:
53
+ - Historical manuscripts
54
+ - Newspaper articles
55
+ - Scientific papers
56
+ - Invoices
57
+ - Recipes
58
+ - And more (~13 formats total)
59
+ - Diverse layouts, styles, noise levels, fonts, and text flows
60
+ - Filled with plain Arabic text from open datasets
61
+ - Multiple semantic tag combinations (footer, table, section, etc.)
62
+
63
+ ### Features
64
+
65
+ - **Total samples:** 28,000 image-HTML pairs
66
+ - **Language:** Arabic
67
+ - **Output format:** Semantic HTML (clean tags without id, class attributes)
68
+ - **Document diversity:** Multiple formats and layouts
69
+
70
+ ## Usage
71
+
72
+ ### Loading the Dataset
73
+
74
+ ```python
75
+ from datasets import load_dataset
76
+
77
+ dataset = load_dataset("OussamaBenSlama/arabic-image2html")
78
+ ```
79
+
80
+
81
+ ## Limitations
82
+
83
+ - Limited examples with diacritical marks (tashkeel), which may affect model performance on texts with extensive diacritics
84
+ - Wikipedia samples share similar design patterns
85
+ - Synthetic generation may not capture all real-world document variations
86
+
87
+ ## Related Resources
88
+
89
+ - **Model:** [Alef-OCR-Image2Html](https://huggingface.co/OussamaBenSlama/Alef-OCR-Image2Html)
90
+ - **Training Notebooks:** [Github Repository](https://github.com/OussamaBenSlama/Alef-OCR-Image2Html)
91
+
92
+ ## Citation
93
+
94
+ ```bibtex
95
+ @misc{arabic_image2html_2025,
96
+ title={Arabic-Image2Html: A Dataset for Arabic OCR to Semantic HTML},
97
+ author={Oussama Ben Slama},
98
+ year={2025},
99
+ howpublished={Hugging Face Datasets},
100
+ url={https://huggingface.co/datasets/OussamaBenSlama/arabic-image2html}
101
+ }
102
+ ```
103
+
104
+ ## License
105
+
106
+ Apache2.0
107
+ ## Acknowledgments
108
+
109
+ This work builds upon the excellent research by the NAMAA community and their state-of-the-art Qari-OCR model.
data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84393f5ad8b2126132f15747a97eae85dce43d597f7e59e824824f91e851d009
3
+ size 316971057
data/train-00000-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3596376b6293b7c9676ddd4103f040dc6da40dc5165ff6f050c5106145a8a356
3
+ size 488539972
data/train-00001-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d3424ed29492825e590cb2d808a9124cb7b054145403a7be68c7c7d8cfefac7
3
+ size 505226714
data/train-00002-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:908ea3cc8971d17fc2315a198c2ae7e606d96807216dab84985b1db73f7c1ecf
3
+ size 504461571
data/train-00003-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b01218d447387f9ff7c3bd6f465b3955a673edfe18d5a15fc3f2e33cff9e7b0f
3
+ size 493962267
data/train-00004-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4c4d5b59021c2fcc8e7e0cc5d91d0c55eb6c65f37b256777e9f044e0d533658
3
+ size 495211731
data/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db3881e833e7fae578710d5428fb720ee23fd5354fab15659591bfccc391d256
3
+ size 322796361