stckmn commited on
Commit
9f3e46b
Β·
verified Β·
1 Parent(s): 244553f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +92 -27
README.md CHANGED
@@ -1,29 +1,94 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: image
5
- dtype: image
6
- - name: page_num
7
- dtype: int64
8
- - name: source_file
9
- dtype: string
10
- - name: source_path
11
- dtype: string
12
- - name: total_pages
13
- dtype: int64
14
- - name: markdown
15
- dtype: string
16
- - name: inference_info
17
- dtype: string
18
- splits:
19
- - name: train
20
- num_bytes: 235667218
21
- num_examples: 21
22
- download_size: 16692412
23
- dataset_size: 235667218
24
- configs:
25
- - config_name: default
26
- data_files:
27
- - split: train
28
- path: data/train-*
29
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ tags:
3
+ - ocr
4
+ - document-processing
5
+ - nanonets
6
+ - nanonets-ocr2
7
+ - markdown
8
+ - uv-script
9
+ - generated
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
+
12
+ # Document OCR using Nanonets-OCR2-3B
13
+
14
+ This dataset contains markdown-formatted OCR results from images in [stckmn/ocr-input-Directive017-1761354068](https://huggingface.co/datasets/stckmn/ocr-input-Directive017-1761354068) using Nanonets-OCR2-3B.
15
+
16
+ ## Processing Details
17
+
18
+ - **Source Dataset**: [stckmn/ocr-input-Directive017-1761354068](https://huggingface.co/datasets/stckmn/ocr-input-Directive017-1761354068)
19
+ - **Model**: [nanonets/Nanonets-OCR2-3B](https://huggingface.co/nanonets/Nanonets-OCR2-3B)
20
+ - **Model Size**: 3.75B parameters
21
+ - **Number of Samples**: 21
22
+ - **Processing Time**: 3.2 minutes
23
+ - **Processing Date**: 2025-10-25 01:05 UTC
24
+
25
+ ### Configuration
26
+
27
+ - **Image Column**: `image`
28
+ - **Output Column**: `markdown`
29
+ - **Dataset Split**: `train`
30
+ - **Batch Size**: 16
31
+ - **Max Model Length**: 8,192 tokens
32
+ - **Max Output Tokens**: 4,096
33
+ - **GPU Memory Utilization**: 80.0%
34
+
35
+ ## Model Information
36
+
37
+ Nanonets-OCR2-3B is a state-of-the-art document OCR model that excels at:
38
+ - πŸ“ **LaTeX equations** - Mathematical formulas preserved in LaTeX format
39
+ - πŸ“Š **Tables** - Extracted and formatted as HTML
40
+ - πŸ“ **Document structure** - Headers, lists, and formatting maintained
41
+ - πŸ–ΌοΈ **Images** - Captions and descriptions included in `<img>` tags
42
+ - β˜‘οΈ **Forms** - Checkboxes rendered as ☐/β˜‘
43
+ - πŸ”– **Watermarks** - Wrapped in `<watermark>` tags
44
+ - πŸ“„ **Page numbers** - Wrapped in `<page_number>` tags
45
+ - 🌍 **Multilingual** - Supports multiple languages
46
+
47
+ ## Dataset Structure
48
+
49
+ The dataset contains all original columns plus:
50
+ - `markdown`: The extracted text in markdown format with preserved structure
51
+ - `inference_info`: JSON list tracking all OCR models applied to this dataset
52
+
53
+ ## Usage
54
+
55
+ ```python
56
+ from datasets import load_dataset
57
+ import json
58
+
59
+ # Load the dataset
60
+ dataset = load_dataset("{{output_dataset_id}}", split="train")
61
+
62
+ # Access the markdown text
63
+ for example in dataset:
64
+ print(example["markdown"])
65
+ break
66
+
67
+ # View all OCR models applied to this dataset
68
+ inference_info = json.loads(dataset[0]["inference_info"])
69
+ for info in inference_info:
70
+ print(f"Column: {{info['column_name']}} - Model: {{info['model_id']}}")
71
+ ```
72
+
73
+ ## Reproduction
74
+
75
+ This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) Nanonets OCR2 script:
76
+
77
+ ```bash
78
+ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr2.py \
79
+ stckmn/ocr-input-Directive017-1761354068 \
80
+ <output-dataset> \
81
+ --model nanonets/Nanonets-OCR2-3B \
82
+ --image-column image \
83
+ --batch-size 16 \
84
+ --max-model-len 8192 \
85
+ --max-tokens 4096 \
86
+ --gpu-memory-utilization 0.8
87
+ ```
88
+
89
+ ## Performance
90
+
91
+ - **Processing Speed**: ~0.1 images/second
92
+ - **GPU Configuration**: vLLM with 80% GPU memory utilization
93
+
94
+ Generated with πŸ€– [UV Scripts](https://huggingface.co/uv-scripts)