Alysonhower commited on
Commit
9e38911
·
verified ·
1 Parent(s): f32cd2a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +92 -19
README.md CHANGED
@@ -1,21 +1,94 @@
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: 156551
13
- num_examples: 1
14
- download_size: 150485
15
- dataset_size: 156551
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
+ - 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 [Alysonhower/test](https://huggingface.co/datasets/Alysonhower/test) using Nanonets-OCR2-3B.
15
+
16
+ ## Processing Details
17
+
18
+ - **Source Dataset**: [Alysonhower/test](https://huggingface.co/datasets/Alysonhower/test)
19
+ - **Model**: [nanonets/Nanonets-OCR2-3B](https://huggingface.co/nanonets/Nanonets-OCR2-3B)
20
+ - **Model Size**: 3.75B parameters
21
+ - **Number of Samples**: 1
22
+ - **Processing Time**: 4.4 minutes
23
+ - **Processing Date**: 2025-10-14 21:10 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
+ Alysonhower/test \
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.0 images/second
92
+ - **GPU Configuration**: vLLM with 80% GPU memory utilization
93
+
94
+ Generated with 🤖 [UV Scripts](https://huggingface.co/uv-scripts)