davanstrien HF Staff commited on
Commit
c58dd03
ยท
verified ยท
1 Parent(s): f901026

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +97 -49
README.md CHANGED
@@ -1,51 +1,99 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: volume_id
5
- dtype: string
6
- - name: page_number
7
- dtype: int32
8
- - name: file_identifier
9
- dtype: string
10
- - name: image
11
- dtype: image
12
- - name: text
13
- dtype: string
14
- - name: alto_xml
15
- dtype: string
16
- - name: has_image
17
- dtype: bool
18
- - name: has_alto
19
- dtype: bool
20
- - name: document_metadata
21
- dtype: string
22
- - name: has_metadata
23
- dtype: bool
24
- - name: edition
25
- dtype: string
26
- - name: volume_part
27
- dtype: string
28
- - name: publication_year
29
- dtype: string
30
- - name: editor
31
- dtype: string
32
- - name: full_title
33
- dtype: string
34
- - name: shelf_locator
35
- dtype: string
36
- - name: markdown
37
- dtype: string
38
- - name: inference_info
39
- dtype: string
40
- splits:
41
- - name: train
42
- num_bytes: 31762984
43
- num_examples: 100
44
- download_size: 18604220
45
- dataset_size: 31762984
46
- configs:
47
- - config_name: default
48
- data_files:
49
- - split: train
50
- path: data/train-*
51
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ tags:
3
+ - ocr
4
+ - document-processing
5
+ - deepseek
6
+ - deepseek-ocr
7
+ - markdown
8
+ - uv-script
9
+ - generated
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
+
12
+ # Document OCR using DeepSeek-OCR
13
+
14
+ This dataset contains markdown-formatted OCR results from images in [davanstrien/ency-test](https://huggingface.co/datasets/davanstrien/ency-test) using DeepSeek-OCR.
15
+
16
+ ## Processing Details
17
+
18
+ - **Source Dataset**: [davanstrien/ency-test](https://huggingface.co/datasets/davanstrien/ency-test)
19
+ - **Model**: [deepseek-ai/DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR)
20
+ - **Number of Samples**: 100
21
+ - **Processing Time**: 8.4 min
22
+ - **Processing Date**: 2025-10-22 17:28 UTC
23
+
24
+ ### Configuration
25
+
26
+ - **Image Column**: `image`
27
+ - **Output Column**: `markdown`
28
+ - **Dataset Split**: `train`
29
+ - **Batch Size**: 512
30
+ - **Resolution Mode**: large
31
+ - **Base Size**: 1280
32
+ - **Image Size**: 1280
33
+ - **Crop Mode**: False
34
+ - **Max Model Length**: 8,192 tokens
35
+ - **Max Output Tokens**: 8,192
36
+ - **GPU Memory Utilization**: 80.0%
37
+
38
+ ## Model Information
39
+
40
+ DeepSeek-OCR is a state-of-the-art document OCR model that excels at:
41
+ - ๐Ÿ“ **LaTeX equations** - Mathematical formulas preserved in LaTeX format
42
+ - ๐Ÿ“Š **Tables** - Extracted and formatted as HTML/markdown
43
+ - ๐Ÿ“ **Document structure** - Headers, lists, and formatting maintained
44
+ - ๐Ÿ–ผ๏ธ **Image grounding** - Spatial layout and bounding box information
45
+ - ๐Ÿ” **Complex layouts** - Multi-column and hierarchical structures
46
+ - ๐ŸŒ **Multilingual** - Supports multiple languages
47
+
48
+ ### Resolution Modes
49
+
50
+ - **Tiny** (512ร—512): Fast processing, 64 vision tokens
51
+ - **Small** (640ร—640): Balanced speed/quality, 100 vision tokens
52
+ - **Base** (1024ร—1024): High quality, 256 vision tokens
53
+ - **Large** (1280ร—1280): Maximum quality, 400 vision tokens
54
+ - **Gundam** (dynamic): Adaptive multi-tile processing for large documents
55
+
56
+ ## Dataset Structure
57
+
58
+ The dataset contains all original columns plus:
59
+ - `markdown`: The extracted text in markdown format with preserved structure
60
+ - `inference_info`: JSON list tracking all OCR models applied to this dataset
61
+
62
+ ## Usage
63
+
64
+ ```python
65
+ from datasets import load_dataset
66
+ import json
67
+
68
+ # Load the dataset
69
+ dataset = load_dataset("{{output_dataset_id}}", split="train")
70
+
71
+ # Access the markdown text
72
+ for example in dataset:
73
+ print(example["markdown"])
74
+ break
75
+
76
+ # View all OCR models applied to this dataset
77
+ inference_info = json.loads(dataset[0]["inference_info"])
78
+ for info in inference_info:
79
+ print(f"Column: {{info['column_name']}} - Model: {{info['model_id']}}")
80
+ ```
81
+
82
+ ## Reproduction
83
+
84
+ This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) DeepSeek OCR vLLM script:
85
+
86
+ ```bash
87
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/deepseek-ocr-vllm.py \\
88
+ davanstrien/ency-test \\
89
+ <output-dataset> \\
90
+ --resolution-mode large \\
91
+ --image-column image
92
+ ```
93
+
94
+ ## Performance
95
+
96
+ - **Processing Speed**: ~0.2 images/second
97
+ - **Processing Method**: Batch processing with vLLM (2-3x speedup over sequential)
98
+
99
+ Generated with ๐Ÿค– [UV Scripts](https://huggingface.co/uv-scripts)