Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -2,45 +2,23 @@
|
|
| 2 |
tags:
|
| 3 |
- ocr
|
| 4 |
- document-processing
|
| 5 |
-
-
|
| 6 |
- markdown
|
| 7 |
- uv-script
|
| 8 |
- generated
|
| 9 |
-
dataset_info:
|
| 10 |
-
features:
|
| 11 |
-
- name: image
|
| 12 |
-
dtype: image
|
| 13 |
-
- name: text
|
| 14 |
-
dtype: string
|
| 15 |
-
- name: lighton2
|
| 16 |
-
dtype: string
|
| 17 |
-
- name: inference_info
|
| 18 |
-
dtype: string
|
| 19 |
-
splits:
|
| 20 |
-
- name: train
|
| 21 |
-
num_bytes: 7940742
|
| 22 |
-
num_examples: 50
|
| 23 |
-
download_size: 7922609
|
| 24 |
-
dataset_size: 7940742
|
| 25 |
-
configs:
|
| 26 |
-
- config_name: default
|
| 27 |
-
data_files:
|
| 28 |
-
- split: train
|
| 29 |
-
path: data/train-*
|
| 30 |
---
|
| 31 |
|
| 32 |
-
# Document OCR using
|
| 33 |
|
| 34 |
-
This dataset contains OCR results from images in [technocreep/ussr_typewriter](https://huggingface.co/datasets/technocreep/ussr_typewriter) using
|
| 35 |
|
| 36 |
## Processing Details
|
| 37 |
|
| 38 |
- **Source Dataset**: [technocreep/ussr_typewriter](https://huggingface.co/datasets/technocreep/ussr_typewriter)
|
| 39 |
-
- **Model**: [
|
| 40 |
-
- **Task**: text recognition
|
| 41 |
- **Number of Samples**: 50
|
| 42 |
-
- **Processing Time**:
|
| 43 |
-
- **Processing Date**: 2026-02-25 11:
|
| 44 |
|
| 45 |
### Configuration
|
| 46 |
|
|
@@ -48,37 +26,76 @@ This dataset contains OCR results from images in [technocreep/ussr_typewriter](h
|
|
| 48 |
- **Output Column**: `markdown`
|
| 49 |
- **Dataset Split**: `train`
|
| 50 |
- **Batch Size**: 16
|
|
|
|
| 51 |
- **Max Model Length**: 8,192 tokens
|
| 52 |
-
- **Max Output Tokens**:
|
| 53 |
-
- **Temperature**: 0.
|
| 54 |
-
- **Top P**:
|
| 55 |
- **GPU Memory Utilization**: 80.0%
|
| 56 |
|
| 57 |
## Model Information
|
| 58 |
|
| 59 |
-
|
| 60 |
-
-
|
| 61 |
-
-
|
| 62 |
-
-
|
| 63 |
-
-
|
| 64 |
-
-
|
| 65 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
## Dataset Structure
|
| 68 |
|
| 69 |
The dataset contains all original columns plus:
|
| 70 |
-
- `markdown`: The extracted text in markdown format
|
| 71 |
- `inference_info`: JSON list tracking all OCR models applied to this dataset
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
## Reproduction
|
| 74 |
|
|
|
|
|
|
|
| 75 |
```bash
|
| 76 |
-
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/
|
| 77 |
technocreep/ussr_typewriter \
|
| 78 |
<output-dataset> \
|
| 79 |
--image-column image \
|
| 80 |
-
--batch-size 16
|
| 81 |
-
--task ocr
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
- ocr
|
| 4 |
- document-processing
|
| 5 |
+
- lighton-ocr-2
|
| 6 |
- markdown
|
| 7 |
- uv-script
|
| 8 |
- generated
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Document OCR using LightOnOCR-2-1B
|
| 12 |
|
| 13 |
+
This dataset contains OCR results from images in [technocreep/ussr_typewriter](https://huggingface.co/datasets/technocreep/ussr_typewriter) using LightOnOCR-2, a fast and compact 1B OCR model trained with RLVR.
|
| 14 |
|
| 15 |
## Processing Details
|
| 16 |
|
| 17 |
- **Source Dataset**: [technocreep/ussr_typewriter](https://huggingface.co/datasets/technocreep/ussr_typewriter)
|
| 18 |
+
- **Model**: [lightonai/LightOnOCR-2-1B](https://huggingface.co/lightonai/LightOnOCR-2-1B)
|
|
|
|
| 19 |
- **Number of Samples**: 50
|
| 20 |
+
- **Processing Time**: 2.0 min
|
| 21 |
+
- **Processing Date**: 2026-02-25 11:55 UTC
|
| 22 |
|
| 23 |
### Configuration
|
| 24 |
|
|
|
|
| 26 |
- **Output Column**: `markdown`
|
| 27 |
- **Dataset Split**: `train`
|
| 28 |
- **Batch Size**: 16
|
| 29 |
+
- **Target Image Size**: 1540px (longest dimension)
|
| 30 |
- **Max Model Length**: 8,192 tokens
|
| 31 |
+
- **Max Output Tokens**: 4,096
|
| 32 |
+
- **Temperature**: 0.2
|
| 33 |
+
- **Top P**: 0.9
|
| 34 |
- **GPU Memory Utilization**: 80.0%
|
| 35 |
|
| 36 |
## Model Information
|
| 37 |
|
| 38 |
+
LightOnOCR-2 is a next-generation fast, compact OCR model that excels at:
|
| 39 |
+
- ⚡ **Fastest Speed** - 42.8 pages/second on H100 GPU (7× faster than v1)
|
| 40 |
+
- 🎯 **High Accuracy** - 83.2 ± 0.9% on OlmOCR-Bench (+7.1% vs v1)
|
| 41 |
+
- 🧠 **RLVR Training** - Eliminates repetition loops and formatting errors
|
| 42 |
+
- 📚 **Better Dataset** - 2.5× larger training data with cleaner annotations
|
| 43 |
+
- 📐 **LaTeX formulas** - Mathematical notation in LaTeX format
|
| 44 |
+
- 📊 **Tables** - Extracted and formatted as markdown
|
| 45 |
+
- 📝 **Document structure** - Hierarchy and layout preservation
|
| 46 |
+
- 🌍 **Multilingual** - Optimized for European languages
|
| 47 |
+
- 💪 **Production-ready** - Outperforms models 9× larger
|
| 48 |
+
|
| 49 |
+
### Key Improvements over v1
|
| 50 |
+
|
| 51 |
+
- **7.5× faster**: 42.8 vs 5.71 pages/sec on H100
|
| 52 |
+
- **+7.1% accuracy**: 83.2% vs 76.1% on benchmarks
|
| 53 |
+
- **Better quality**: RLVR training eliminates common OCR errors
|
| 54 |
+
- **Cleaner output**: No repetition loops or formatting glitches
|
| 55 |
+
- **Simpler**: Single model (no vocabulary variants)
|
| 56 |
|
| 57 |
## Dataset Structure
|
| 58 |
|
| 59 |
The dataset contains all original columns plus:
|
| 60 |
+
- `markdown`: The extracted text in markdown format with LaTeX formulas
|
| 61 |
- `inference_info`: JSON list tracking all OCR models applied to this dataset
|
| 62 |
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from datasets import load_dataset
|
| 67 |
+
import json
|
| 68 |
+
|
| 69 |
+
# Load the dataset
|
| 70 |
+
dataset = load_dataset("{output_dataset_id}", split="train")
|
| 71 |
+
|
| 72 |
+
# Access the markdown text
|
| 73 |
+
for example in dataset:
|
| 74 |
+
print(example["markdown"])
|
| 75 |
+
break
|
| 76 |
+
|
| 77 |
+
# View all OCR models applied to this dataset
|
| 78 |
+
inference_info = json.loads(dataset[0]["inference_info"])
|
| 79 |
+
for info in inference_info:
|
| 80 |
+
print(f"Column: {info['column_name']} - Model: {info['model_id']}")
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
## Reproduction
|
| 84 |
|
| 85 |
+
This dataset was generated using the [uv-scripts/ocr](https://huggingface.co/datasets/uv-scripts/ocr) LightOnOCR-2 script:
|
| 86 |
+
|
| 87 |
```bash
|
| 88 |
+
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr2.py \
|
| 89 |
technocreep/ussr_typewriter \
|
| 90 |
<output-dataset> \
|
| 91 |
--image-column image \
|
| 92 |
+
--batch-size 16
|
|
|
|
| 93 |
```
|
| 94 |
|
| 95 |
+
## Performance
|
| 96 |
+
|
| 97 |
+
- **Processing Speed**: ~0.42 images/second
|
| 98 |
+
- **Benchmark Score**: 83.2 ± 0.9% on OlmOCR-Bench
|
| 99 |
+
- **Training**: RLVR (Reinforcement Learning with Verifiable Rewards)
|
| 100 |
+
|
| 101 |
+
Generated with 🤖 [UV Scripts](https://huggingface.co/uv-scripts)
|