Alysonhower commited on
Commit
5bc8208
Β·
verified Β·
1 Parent(s): 0f2d992

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +96 -19
README.md CHANGED
@@ -1,21 +1,98 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: image
5
- dtype: image
6
- - name: markdown
7
- dtype: string
8
- - name: inference_info
9
- dtype: string
10
- splits:
11
- - name: train
12
- num_bytes: 146150
13
- num_examples: 1
14
- download_size: 149864
15
- dataset_size: 146150
16
- configs:
17
- - config_name: default
18
- data_files:
19
- - split: train
20
- path: data/train-*
21
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 [Alysonhower/test](https://huggingface.co/datasets/Alysonhower/test) using DeepSeek-OCR.
15
+
16
+ ## Processing Details
17
+
18
+ - **Source Dataset**: [Alysonhower/test](https://huggingface.co/datasets/Alysonhower/test)
19
+ - **Model**: [deepseek-ai/DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR)
20
+ - **Number of Samples**: 1
21
+ - **Processing Time**: 1.5 minutes
22
+ - **Processing Date**: 2025-10-23 13:06 UTC
23
+
24
+ ### Configuration
25
+
26
+ - **Image Column**: `image`
27
+ - **Output Column**: `markdown`
28
+ - **Dataset Split**: `train`
29
+ - **Resolution Mode**: gundam
30
+ - **Base Size**: 1024
31
+ - **Image Size**: 640
32
+ - **Crop Mode**: True
33
+
34
+ ## Model Information
35
+
36
+ DeepSeek-OCR is a state-of-the-art document OCR model that excels at:
37
+ - πŸ“ **LaTeX equations** - Mathematical formulas preserved in LaTeX format
38
+ - πŸ“Š **Tables** - Extracted and formatted as HTML/markdown
39
+ - πŸ“ **Document structure** - Headers, lists, and formatting maintained
40
+ - πŸ–ΌοΈ **Image grounding** - Spatial layout and bounding box information
41
+ - πŸ” **Complex layouts** - Multi-column and hierarchical structures
42
+ - 🌍 **Multilingual** - Supports multiple languages
43
+
44
+ ### Resolution Modes
45
+
46
+ - **Tiny** (512Γ—512): Fast processing, 64 vision tokens
47
+ - **Small** (640Γ—640): Balanced speed/quality, 100 vision tokens
48
+ - **Base** (1024Γ—1024): High quality, 256 vision tokens
49
+ - **Large** (1280Γ—1280): Maximum quality, 400 vision tokens
50
+ - **Gundam** (dynamic): Adaptive multi-tile processing for large documents
51
+
52
+ ## Dataset Structure
53
+
54
+ The dataset contains all original columns plus:
55
+ - `markdown`: The extracted text in markdown format with preserved structure
56
+ - `inference_info`: JSON list tracking all OCR models applied to this dataset
57
+
58
+ ## Usage
59
+
60
+ ```python
61
+ from datasets import load_dataset
62
+ import json
63
+
64
+ # Load the dataset
65
+ dataset = load_dataset("{{output_dataset_id}}", split="train")
66
+
67
+ # Access the markdown text
68
+ for example in dataset:
69
+ print(example["markdown"])
70
+ break
71
+
72
+ # View all OCR models applied to this dataset
73
+ inference_info = json.loads(dataset[0]["inference_info"])
74
+ for info in inference_info:
75
+ print(f"Column: {{info['column_name']}} - Model: {{info['model_id']}}")
76
+ ```
77
+
78
+ ## Reproduction
79
+
80
+ This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) DeepSeek OCR script:
81
+
82
+ ```bash
83
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/deepseek-ocr.py \
84
+ Alysonhower/test \
85
+ <output-dataset> \
86
+ --resolution-mode gundam \
87
+ --image-column image
88
+ ```
89
+
90
+ ## Performance
91
+
92
+ - **Processing Speed**: ~0.0 images/second
93
+ - **Processing Method**: Sequential (Transformers API, no batching)
94
+
95
+ Note: This uses the official Transformers implementation. For faster batch processing,
96
+ consider using the vLLM version once DeepSeek-OCR is officially supported by vLLM.
97
+
98
+ Generated with πŸ€– [UV Scripts](https://huggingface.co/uv-scripts)