stckmn commited on
Commit
11bdfbb
ยท
verified ยท
1 Parent(s): 622cc30

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +97 -27
README.md CHANGED
@@ -1,29 +1,99 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: image
5
- dtype: image
6
- - name: page_num
7
- dtype: int64
8
- - name: source_file
9
- dtype: string
10
- - name: source_path
11
- dtype: string
12
- - name: total_pages
13
- dtype: int64
14
- - name: markdown
15
- dtype: string
16
- - name: inference_info
17
- dtype: string
18
- splits:
19
- - name: train
20
- num_bytes: 235658705
21
- num_examples: 21
22
- download_size: 16684734
23
- dataset_size: 235658705
24
- configs:
25
- - config_name: default
26
- data_files:
27
- - split: train
28
- path: data/train-*
29
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ tags:
3
+ - ocr
4
+ - document-processing
5
+ - lighton-ocr
6
+ - markdown
7
+ - uv-script
8
+ - generated
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
+
11
+ # Document OCR using LightOnOCR-0.9B-32k-1025
12
+
13
+ This dataset contains OCR results from images in [stckmn/ocr-input-Directive017-1761353279](https://huggingface.co/datasets/stckmn/ocr-input-Directive017-1761353279) using LightOnOCR, a fast and compact 1B OCR model.
14
+
15
+ ## Processing Details
16
+
17
+ - **Source Dataset**: [stckmn/ocr-input-Directive017-1761353279](https://huggingface.co/datasets/stckmn/ocr-input-Directive017-1761353279)
18
+ - **Model**: [lightonai/LightOnOCR-0.9B-32k-1025](https://huggingface.co/lightonai/LightOnOCR-0.9B-32k-1025)
19
+ - **Vocabulary Size**: 32k tokens
20
+ - **Number of Samples**: 21
21
+ - **Processing Time**: 1.2 min
22
+ - **Processing Date**: 2025-10-25 00:50 UTC
23
+
24
+ ### Configuration
25
+
26
+ - **Image Column**: `image`
27
+ - **Output Column**: `markdown`
28
+ - **Dataset Split**: `train`
29
+ - **Batch Size**: 32
30
+ - **Target Image Size**: 1288px (longest dimension)
31
+ - **Max Model Length**: 8,192 tokens
32
+ - **Max Output Tokens**: 6,500
33
+ - **Temperature**: 0.2
34
+ - **Top P**: 0.9
35
+ - **GPU Memory Utilization**: 80.0%
36
+
37
+ ## Model Information
38
+
39
+ LightOnOCR is a fast, compact OCR model that excels at:
40
+ - โšก **Production Speed** - 5.71 pages/second on H100 GPU
41
+ - ๐ŸŽฏ **Compact Size** - Only 1B parameters
42
+ - ๐Ÿ“ **LaTeX formulas** - Mathematical notation in LaTeX format
43
+ - ๐Ÿ“Š **Tables** - Extracted and formatted as markdown
44
+ - ๐Ÿ“ **Document structure** - Hierarchy and layout preservation
45
+ - ๐ŸŒ **Multilingual** - Optimized for European languages
46
+ - ๐Ÿ”ค **Flexible vocabulary** - 151k/32k/16k token variants
47
+
48
+ ### Vocabulary Variants
49
+
50
+ - **151k tokens**: Full vocabulary, supports all languages
51
+ - **32k tokens**: European languages optimized (~12% faster decoding)
52
+ - **16k tokens**: European languages optimized (~12% faster decoding)
53
+
54
+ ## Dataset Structure
55
+
56
+ The dataset contains all original columns plus:
57
+ - `markdown`: The extracted text in markdown format with LaTeX formulas
58
+ - `inference_info`: JSON list tracking all OCR models applied to this dataset
59
+
60
+ ## Usage
61
+
62
+ ```python
63
+ from datasets import load_dataset
64
+ import json
65
+
66
+ # Load the dataset
67
+ dataset = load_dataset("{output_dataset_id}", split="train")
68
+
69
+ # Access the markdown text
70
+ for example in dataset:
71
+ print(example["markdown"])
72
+ break
73
+
74
+ # View all OCR models applied to this dataset
75
+ inference_info = json.loads(dataset[0]["inference_info"])
76
+ for info in inference_info:
77
+ print(f"Column: {info['column_name']} - Model: {info['model_id']}")
78
+ ```
79
+
80
+ ## Reproduction
81
+
82
+ This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) LightOnOCR script:
83
+
84
+ ```bash
85
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr.py \
86
+ stckmn/ocr-input-Directive017-1761353279 \
87
+ <output-dataset> \
88
+ --vocab-size 32k \
89
+ --image-column image \
90
+ --batch-size 32
91
+ ```
92
+
93
+ ## Performance
94
+
95
+ - **Processing Speed**: ~0.29 images/second
96
+ - **Benchmark Score**: 76.1% overall (across diverse document types)
97
+ - **Optimization**: Native resolution ViT + lightweight decoder
98
+
99
+ Generated with ๐Ÿค– [UV Scripts](https://huggingface.co/uv-scripts)