davanstrien HF Staff commited on
Commit
c8a89f7
·
verified ·
1 Parent(s): ced0c17

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +90 -47
README.md CHANGED
@@ -1,49 +1,92 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: text
5
- dtype: string
6
- - name: mean_ocr
7
- dtype: float64
8
- - name: std_ocr
9
- dtype: float64
10
- - name: title
11
- dtype: string
12
- - name: date
13
- dtype: string
14
- - name: language
15
- list: string
16
- - name: item_iiif_url
17
- dtype: string
18
- - name: multi_language
19
- dtype: bool
20
- - name: issue_uri
21
- dtype: string
22
- - name: id
23
- dtype: string
24
- - name: image
25
- dtype: image
26
- - name: download_status
27
- dtype: string
28
- - name: download_retries
29
- dtype: int64
30
- - name: download_url
31
- dtype: string
32
- - name: markdown
33
- dtype: string
34
- - name: olmocr_metadata
35
- dtype: string
36
- - name: inference_info
37
- dtype: string
38
- splits:
39
- - name: train
40
- num_bytes: 110898315
41
- num_examples: 100
42
- download_size: 110686805
43
- dataset_size: 110898315
44
- configs:
45
- - config_name: default
46
- data_files:
47
- - split: train
48
- path: data/train-*
49
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ viewer: false
3
+ tags:
4
+ - ocr
5
+ - document-processing
6
+ - olmocr
7
+ - markdown
8
+ - uv-script
9
+ - generated
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
+
12
+ # Document OCR using olmOCR-2-7B-1025-FP8
13
+
14
+ This dataset contains markdown-formatted OCR results from images in [davanstrien/newspapers-with-images](https://huggingface.co/datasets/davanstrien/newspapers-with-images) using olmOCR-2-7B.
15
+
16
+ ## Processing Details
17
+
18
+ - **Source Dataset**: [davanstrien/newspapers-with-images](https://huggingface.co/datasets/davanstrien/newspapers-with-images)
19
+ - **Model**: [allenai/olmOCR-2-7B-1025-FP8](https://huggingface.co/allenai/olmOCR-2-7B-1025-FP8)
20
+ - **Number of Samples**: 100
21
+ - **Processing Time**: 0h 9m 29s
22
+ - **Processing Date**: 2025-10-22 18:57 UTC
23
+
24
+ ### Configuration
25
+
26
+ - **Image Column**: `image`
27
+ - **Output Column**: `markdown`
28
+ - **Dataset Split**: `train`
29
+ - **Batch Size**: 4
30
+ - **Max Model Length**: 16,384 tokens
31
+ - **Max Output Tokens**: 8,192
32
+ - **GPU Memory Utilization**: 80.0%
33
+
34
+ ## Model Information
35
+
36
+ olmOCR-2-7B is a high-quality document OCR model based on Qwen2.5-VL-7B-Instruct, fine-tuned on olmOCR-mix-1025 dataset and optimized with GRPO reinforcement learning.
37
+
38
+ Key features:
39
+ - 📐 **LaTeX equations** - Mathematical formulas in LaTeX format
40
+ - 📊 **HTML tables** - Structured table extraction
41
+ - 📝 **Document structure** - Headers, lists, formatting preserved
42
+ - 🖼️ **Figure descriptions** - Charts and figures labeled with descriptions
43
+ - 🔄 **Rotation detection** - Metadata about document orientation
44
+ - 📑 **Natural reading order** - Handles multi-column and complex layouts
45
+ - 🎯 **High accuracy** - Scores 82.4 ± 1.1 on olmOCR-Bench
46
+
47
+ ## Output Format
48
+
49
+ Each row contains:
50
+ - Original image from source dataset
51
+ - `markdown`: Extracted document content in markdown format
52
+ - `olmocr_metadata`: JSON with document metadata (language, rotation, table/diagram flags)
53
+
54
+ ## Columns
55
+
56
+ - `image`: Original document image
57
+ - `markdown`: Extracted text and structure in markdown
58
+ - `olmocr_metadata`: Document metadata (primary_language, is_rotation_valid, rotation_correction, is_table, is_diagram)
59
+ - `inference_info`: Processing metadata (model, script version, timestamp)
60
+
61
+ ## Reproduction
62
+
63
+ ```bash
64
+ # Using HF Jobs (recommended)
65
+ hf jobs uv run --flavor l4x1 \
66
+ -s HF_TOKEN \
67
+ https://huggingface.co/datasets/uv-scripts/ocr/raw/main/olmocr2-vllm.py \
68
+ davanstrien/newspapers-with-images \
69
+ your-username/output-dataset
70
+
71
+ # Local with GPU
72
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/olmocr2-vllm.py \
73
+ davanstrien/newspapers-with-images \
74
+ your-username/output-dataset
75
+ ```
76
+
77
+ ## Citation
78
+
79
+ ```bibtex
80
+ @misc{olmocr,
81
+ title={{olmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models}},
82
+ author={Jake Poznanski and Jon Borchardt and Jason Dunkelberger and Regan Huff and Daniel Lin and Aman Rangapur and Christopher Wilhelm and Kyle Lo and Luca Soldaini},
83
+ year={2025},
84
+ eprint={2502.18443},
85
+ archivePrefix={arXiv},
86
+ primaryClass={cs.CL},
87
+ url={https://arxiv.org/abs/2502.18443},
88
+ }
89
+ ```
90
+
91
+ ---
92
+ *Generated with [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr)*