davanstrien HF Staff commited on
Commit
ec745ea
Β·
verified Β·
1 Parent(s): 3fab329

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +91 -51
README.md CHANGED
@@ -1,53 +1,93 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: image_id
5
- dtype: int64
6
- - name: image
7
- dtype: image
8
- - name: width
9
- dtype: int32
10
- - name: height
11
- dtype: int32
12
- - name: objects
13
- list:
14
- - name: bw_id
15
- dtype: string
16
- - name: category_id
17
- dtype:
18
- class_label:
19
- names:
20
- '0': Photograph
21
- '1': Illustration
22
- '2': Map
23
- '3': Comics/Cartoon
24
- '4': Editorial Cartoon
25
- '5': Headline
26
- '6': Advertisement
27
- - name: image_id
28
- dtype: string
29
- - name: id
30
- dtype: int64
31
- - name: area
32
- dtype: int64
33
- - name: bbox
34
- list: float32
35
- length: 4
36
- - name: iscrowd
37
- dtype: bool
38
- - name: markdown
39
- dtype: string
40
- - name: inference_info
41
- dtype: string
42
- splits:
43
- - name: train
44
- num_bytes: 43226365
45
- num_examples: 128
46
- download_size: 41020193
47
- dataset_size: 43226365
48
- configs:
49
- - config_name: default
50
- data_files:
51
- - split: train
52
- path: data/train-*
53
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ viewer: false
3
+ tags:
4
+ - ocr
5
+ - document-processing
6
+ - dots-ocr
7
+ - multilingual
8
+ - markdown
9
+ - uv-script
10
+ - generated
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
+
13
+ # Document OCR using dots.ocr
14
+
15
+ This dataset contains OCR results from images in [biglam/loc_beyond_words](https://huggingface.co/datasets/biglam/loc_beyond_words) using DoTS.ocr, a compact 1.7B multilingual model.
16
+
17
+ ## Processing Details
18
+
19
+ - **Source Dataset**: [biglam/loc_beyond_words](https://huggingface.co/datasets/biglam/loc_beyond_words)
20
+ - **Model**: [rednote-hilab/dots.ocr](https://huggingface.co/rednote-hilab/dots.ocr)
21
+ - **Number of Samples**: 128
22
+ - **Processing Time**: 5.2 min
23
+ - **Processing Date**: 2025-10-07 14:37 UTC
24
+
25
+ ### Configuration
26
+
27
+ - **Image Column**: `image`
28
+ - **Output Column**: `markdown`
29
+ - **Dataset Split**: `train`
30
+ - **Batch Size**: 128
31
+ - **Prompt Mode**: layout-all
32
+ - **Max Model Length**: 8,192 tokens
33
+ - **Max Output Tokens**: 8,192
34
+ - **GPU Memory Utilization**: 80.0%
35
+
36
+ ## Model Information
37
+
38
+ DoTS.ocr is a compact multilingual document parsing model that excels at:
39
+ - 🌍 **100+ Languages** - Multilingual document support
40
+ - πŸ“Š **Table extraction** - Structured data recognition
41
+ - πŸ“ **Formulas** - Mathematical notation preservation
42
+ - πŸ“ **Layout-aware** - Reading order and structure preservation
43
+ - ⚑ **Fast inference** - 2-3x faster than native HF with vLLM
44
+ - 🎯 **Compact** - Only 1.7B parameters
45
+
46
+ ## Dataset Structure
47
+
48
+ The dataset contains all original columns plus:
49
+ - `markdown`: The extracted text in markdown format
50
+ - `inference_info`: JSON list tracking all OCR models applied to this dataset
51
+
52
+ ## Usage
53
+
54
+ ```python
55
+ from datasets import load_dataset
56
+ import json
57
+
58
+ # Load the dataset
59
+ dataset = load_dataset("{output_dataset_id}", split="train")
60
+
61
+ # Access the markdown text
62
+ for example in dataset:
63
+ print(example["markdown"])
64
+ break
65
+
66
+ # View all OCR models applied to this dataset
67
+ inference_info = json.loads(dataset[0]["inference_info"])
68
+ for info in inference_info:
69
+ print(f"Column: {info['column_name']} - Model: {info['model_id']}")
70
+ ```
71
+
72
+ ## Reproduction
73
+
74
+ This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) DoTS OCR script:
75
+
76
+ ```bash
77
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/dots-ocr.py \
78
+ biglam/loc_beyond_words \
79
+ <output-dataset> \
80
+ --image-column image \
81
+ --batch-size 128 \
82
+ --prompt-mode layout-all \
83
+ --max-model-len 8192 \
84
+ --max-tokens 8192 \
85
+ --gpu-memory-utilization 0.8
86
+ ```
87
+
88
+ ## Performance
89
+
90
+ - **Processing Speed**: ~0.4 images/second
91
+ - **GPU Configuration**: vLLM with 80% GPU memory utilization
92
+
93
+ Generated with πŸ€– [UV Scripts](https://huggingface.co/uv-scripts)