File size: 2,671 Bytes
ea2c281 839cfff ea2c281 839cfff |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
---
viewer: false
tags:
- ocr
- document-processing
- nanonets
- markdown
- uv-script
- generated
---
# Document OCR using Nanonets-OCR-s
This dataset contains markdown-formatted OCR results from images in [/content/my_dataset](https://huggingface.co/datasets//content/my_dataset) using Nanonets-OCR-s.
## Processing Details
- **Source Dataset**: [/content/my_dataset](https://huggingface.co/datasets//content/my_dataset)
- **Model**: [nanonets/Nanonets-OCR-s](https://huggingface.co/nanonets/Nanonets-OCR-s)
- **Number of Samples**: 1
- **Processing Time**: 4.6 minutes
- **Processing Date**: 2025-08-11 09:33 UTC
### Configuration
- **Image Column**: `image`
- **Output Column**: `markdown`
- **Dataset Split**: `train`
- **Batch Size**: 1
- **Max Model Length**: 8,192 tokens
- **Max Output Tokens**: 4,096
- **GPU Memory Utilization**: 80.0%
## Model Information
Nanonets-OCR-s is a state-of-the-art document OCR model that excels at:
- π **LaTeX equations** - Mathematical formulas preserved in LaTeX format
- π **Tables** - Extracted and formatted as HTML
- π **Document structure** - Headers, lists, and formatting maintained
- πΌοΈ **Images** - Captions and descriptions included in `<img>` tags
- βοΈ **Forms** - Checkboxes rendered as β/β
- π **Watermarks** - Wrapped in `<watermark>` tags
- π **Page numbers** - Wrapped in `<page_number>` tags
## Dataset Structure
The dataset contains all original columns plus:
- `markdown`: The extracted text in markdown format with preserved structure
- `inference_info`: JSON list tracking all OCR models applied to this dataset
## Usage
```python
from datasets import load_dataset
import json
# Load the dataset
dataset = load_dataset("{output_dataset_id}", split="train")
# Access the markdown text
for example in dataset:
print(example["markdown"])
break
# View all OCR models applied to this dataset
inference_info = json.loads(dataset[0]["inference_info"])
for info in inference_info:
print(f"Column: {info['column_name']} - Model: {info['model_id']}")
```
## Reproduction
This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) Nanonets OCR script:
```bash
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \
/content/my_dataset \
<output-dataset> \
--image-column image \
--batch-size 1 \
--max-model-len 8192 \
--max-tokens 4096 \
--gpu-memory-utilization 0.8
```
## Performance
- **Processing Speed**: ~0.0 images/second
- **GPU Configuration**: vLLM with 80% GPU memory utilization
Generated with π€ [UV Scripts](https://huggingface.co/uv-scripts)
|