Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -2,23 +2,24 @@
|
|
| 2 |
tags:
|
| 3 |
- ocr
|
| 4 |
- document-processing
|
| 5 |
-
-
|
| 6 |
- markdown
|
| 7 |
- uv-script
|
| 8 |
- generated
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# Document OCR using
|
| 12 |
|
| 13 |
-
This dataset contains OCR results from images in [NationalLibraryOfScotland/medical-history-of-british-india](https://huggingface.co/datasets/NationalLibraryOfScotland/medical-history-of-british-india) using
|
| 14 |
|
| 15 |
## Processing Details
|
| 16 |
|
| 17 |
- **Source Dataset**: [NationalLibraryOfScotland/medical-history-of-british-india](https://huggingface.co/datasets/NationalLibraryOfScotland/medical-history-of-british-india)
|
| 18 |
-
- **Model**: [
|
|
|
|
| 19 |
- **Number of Samples**: 10
|
| 20 |
-
- **Processing Time**:
|
| 21 |
-
- **Processing Date**: 2026-02-14 18:
|
| 22 |
|
| 23 |
### Configuration
|
| 24 |
|
|
@@ -26,76 +27,37 @@ This dataset contains OCR results from images in [NationalLibraryOfScotland/medi
|
|
| 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**:
|
| 32 |
-
- **Temperature**: 0.
|
| 33 |
-
- **Top P**:
|
| 34 |
- **GPU Memory Utilization**: 80.0%
|
| 35 |
|
| 36 |
## Model Information
|
| 37 |
|
| 38 |
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
-
|
| 42 |
-
-
|
| 43 |
-
-
|
| 44 |
-
-
|
| 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
|
| 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/
|
| 89 |
NationalLibraryOfScotland/medical-history-of-british-india \
|
| 90 |
<output-dataset> \
|
| 91 |
--image-column image \
|
| 92 |
-
--batch-size 16
|
|
|
|
| 93 |
```
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
- **Processing Speed**: ~0.04 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)
|
|
|
|
| 2 |
tags:
|
| 3 |
- ocr
|
| 4 |
- document-processing
|
| 5 |
+
- glm-ocr
|
| 6 |
- markdown
|
| 7 |
- uv-script
|
| 8 |
- generated
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Document OCR using GLM-OCR
|
| 12 |
|
| 13 |
+
This dataset contains OCR results from images in [NationalLibraryOfScotland/medical-history-of-british-india](https://huggingface.co/datasets/NationalLibraryOfScotland/medical-history-of-british-india) using GLM-OCR, a compact 0.9B OCR model achieving SOTA performance.
|
| 14 |
|
| 15 |
## Processing Details
|
| 16 |
|
| 17 |
- **Source Dataset**: [NationalLibraryOfScotland/medical-history-of-british-india](https://huggingface.co/datasets/NationalLibraryOfScotland/medical-history-of-british-india)
|
| 18 |
+
- **Model**: [zai-org/GLM-OCR](https://huggingface.co/zai-org/GLM-OCR)
|
| 19 |
+
- **Task**: text recognition
|
| 20 |
- **Number of Samples**: 10
|
| 21 |
+
- **Processing Time**: 6.2 min
|
| 22 |
+
- **Processing Date**: 2026-02-14 18:31 UTC
|
| 23 |
|
| 24 |
### Configuration
|
| 25 |
|
|
|
|
| 27 |
- **Output Column**: `markdown`
|
| 28 |
- **Dataset Split**: `train`
|
| 29 |
- **Batch Size**: 16
|
|
|
|
| 30 |
- **Max Model Length**: 8,192 tokens
|
| 31 |
+
- **Max Output Tokens**: 8,192
|
| 32 |
+
- **Temperature**: 0.01
|
| 33 |
+
- **Top P**: 1e-05
|
| 34 |
- **GPU Memory Utilization**: 80.0%
|
| 35 |
|
| 36 |
## Model Information
|
| 37 |
|
| 38 |
+
GLM-OCR is a compact, high-performance OCR model:
|
| 39 |
+
- 0.9B parameters
|
| 40 |
+
- 94.62% on OmniDocBench V1.5
|
| 41 |
+
- CogViT visual encoder + GLM-0.5B language decoder
|
| 42 |
+
- Multi-Token Prediction (MTP) loss for efficiency
|
| 43 |
+
- Multilingual: zh, en, fr, es, ru, de, ja, ko
|
| 44 |
+
- MIT licensed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
## Reproduction
|
| 53 |
|
|
|
|
|
|
|
| 54 |
```bash
|
| 55 |
+
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/glm-ocr.py \
|
| 56 |
NationalLibraryOfScotland/medical-history-of-british-india \
|
| 57 |
<output-dataset> \
|
| 58 |
--image-column image \
|
| 59 |
+
--batch-size 16 \
|
| 60 |
+
--task ocr
|
| 61 |
```
|
| 62 |
|
| 63 |
+
Generated with [UV Scripts](https://huggingface.co/uv-scripts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|