davanstrien HF Staff commited on
Commit
2a9dabd
·
verified ·
1 Parent(s): fb7585d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +57 -21
README.md CHANGED
@@ -2,54 +2,90 @@
2
  tags:
3
  - ocr
4
  - document-processing
5
- - unlimited-ocr
6
- - baidu
7
  - markdown
8
  - uv-script
9
  - generated
10
  ---
11
 
12
- # Document OCR using Unlimited-OCR
13
 
14
- This dataset contains OCR results for [davanstrien/encyclopaedia-britannica-1771](https://huggingface.co/datasets/davanstrien/encyclopaedia-britannica-1771)
15
- produced by [baidu/Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) with vLLM.
16
 
17
  ## Processing Details
18
 
19
  - **Source Dataset**: [davanstrien/encyclopaedia-britannica-1771](https://huggingface.co/datasets/davanstrien/encyclopaedia-britannica-1771)
20
- - **Model**: [baidu/Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR)
21
  - **Number of Samples**: 5
22
- - **Processing Time**: 2.5 min
23
- - **Processing Date**: 2026-07-07 23:07 UTC
 
 
 
 
24
  - **Output Column**: `markdown`
25
- - **Split**: `train`
 
 
 
 
 
 
 
 
 
 
 
26
 
27
- ## Output
 
 
 
 
 
 
28
 
29
- The column holds the model's raw layout-grounded markdown: text spans tagged `<|ref|>...<|/ref|>` with `<|det|>...<|/det|>` coordinate boxes (coords 0-1000). Strip them with `re.sub(r'<\|det\|>.*?<\|/det\|>', '', t)` then `re.sub(r'<\|/?ref\|>', '', t)`.
30
 
31
- Tables are returned as HTML and equations as LaTeX.
 
 
32
 
33
  ## Usage
34
 
35
  ```python
36
  from datasets import load_dataset
 
37
 
38
- ds = load_dataset("davanstrien/ocr-bench-smoke", split="train")
39
- print(ds[0]["markdown"])
 
 
 
 
 
 
 
 
 
 
40
  ```
41
 
42
  ## Reproduction
43
 
44
- Generated with the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) Unlimited-OCR
45
- vLLM recipe. Unlimited-OCR needs Baidu's dedicated vLLM image:
46
 
47
  ```bash
48
- hf jobs uv run --flavor l4x1 -s HF_TOKEN \
49
- --image vllm/vllm-openai:unlimited-ocr --python /usr/bin/python3 \
50
- -e PYTHONPATH=/usr/local/lib/python3.12/dist-packages \
51
- https://huggingface.co/datasets/uv-scripts/ocr/raw/main/unlimited-ocr-vllm.py \
52
- davanstrien/encyclopaedia-britannica-1771 <output-dataset>
53
  ```
54
 
 
 
 
 
 
55
  Generated with [UV Scripts](https://huggingface.co/uv-scripts)
 
2
  tags:
3
  - ocr
4
  - document-processing
5
+ - deepseek
6
+ - deepseek-ocr-2
7
  - markdown
8
  - uv-script
9
  - generated
10
  ---
11
 
12
+ # Document OCR using DeepSeek-OCR-2
13
 
14
+ This dataset contains markdown-formatted OCR results from images in [davanstrien/encyclopaedia-britannica-1771](https://huggingface.co/datasets/davanstrien/encyclopaedia-britannica-1771) using DeepSeek-OCR-2.
 
15
 
16
  ## Processing Details
17
 
18
  - **Source Dataset**: [davanstrien/encyclopaedia-britannica-1771](https://huggingface.co/datasets/davanstrien/encyclopaedia-britannica-1771)
19
+ - **Model**: [deepseek-ai/DeepSeek-OCR-2](https://huggingface.co/deepseek-ai/DeepSeek-OCR-2)
20
  - **Number of Samples**: 5
21
+ - **Processing Time**: 2.2 min
22
+ - **Processing Date**: 2026-07-07 23:42 UTC
23
+
24
+ ### Configuration
25
+
26
+ - **Image Column**: `image`
27
  - **Output Column**: `markdown`
28
+ - **Dataset Split**: `train`
29
+ - **Batch Size**: 8
30
+ - **Max Model Length**: 8,192 tokens
31
+ - **Max Output Tokens**: 8,192
32
+ - **GPU Memory Utilization**: 80.0%
33
+
34
+ ## Model Information
35
+
36
+ DeepSeek-OCR-2 is a 3B parameter vision-language model featuring Visual Causal
37
+ Flow architecture for more human-like visual encoding. Building on DeepSeek-OCR v1,
38
+ it offers enhanced document understanding with dynamic resolution up to
39
+ (0-6)x768x768 + 1x1024x1024 patches.
40
 
41
+ ### Capabilities
42
+ - LaTeX equations - Mathematical formulas preserved in LaTeX format
43
+ - Tables - Extracted and formatted as HTML/markdown
44
+ - Document structure - Headers, lists, and formatting maintained
45
+ - Image grounding - Spatial layout and bounding box information
46
+ - Complex layouts - Multi-column and hierarchical structures
47
+ - Multilingual - Supports multiple languages
48
 
49
+ ## Dataset Structure
50
 
51
+ The dataset contains all original columns plus:
52
+ - `markdown`: The extracted text in markdown format with preserved structure
53
+ - `inference_info`: JSON list tracking all OCR models applied to this dataset
54
 
55
  ## Usage
56
 
57
  ```python
58
  from datasets import load_dataset
59
+ import json
60
 
61
+ # Load the dataset
62
+ dataset = load_dataset("{{output_dataset_id}}", split="train")
63
+
64
+ # Access the markdown text
65
+ for example in dataset:
66
+ print(example["markdown"])
67
+ break
68
+
69
+ # View all OCR models applied to this dataset
70
+ inference_info = json.loads(dataset[0]["inference_info"])
71
+ for info in inference_info:
72
+ print(f"Column: {{info['column_name']}} - Model: {{info['model_id']}}")
73
  ```
74
 
75
  ## Reproduction
76
 
77
+ This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) DeepSeek-OCR-2 vLLM script:
 
78
 
79
  ```bash
80
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/deepseek-ocr2-vllm.py \\
81
+ davanstrien/encyclopaedia-britannica-1771 \\
82
+ <output-dataset> \\
83
+ --image-column image
 
84
  ```
85
 
86
+ ## Performance
87
+
88
+ - **Processing Speed**: ~0.0 images/second
89
+ - **Processing Method**: Batch processing with vLLM (2-3x speedup over sequential)
90
+
91
  Generated with [UV Scripts](https://huggingface.co/uv-scripts)