Commit
Β·
7593b9a
1
Parent(s):
fa7a872
Add Nanonets-OCR2 documentation to README
Browse files- Add Nanonets OCR2 (nanonets-ocr2.py) to available scripts section
- Highlight 3.75B params, enhanced quality, and Qwen2.5-VL base
- Add HF Jobs example for Nanonets OCR2
- Add local usage example
- Position as next-generation quality option
π€ Generated with Claude Code
README.md
CHANGED
|
@@ -51,6 +51,19 @@ State-of-the-art document OCR using [nanonets/Nanonets-OCR-s](https://huggingfac
|
|
| 51 |
- πΌοΈ **Images** - Captions and descriptions included
|
| 52 |
- βοΈ **Forms** - Checkboxes rendered as β/β
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
### SmolDocling (`smoldocling-ocr.py`)
|
| 55 |
|
| 56 |
Ultra-compact document understanding using [ds4sd/SmolDocling-256M-preview](https://huggingface.co/ds4sd/SmolDocling-256M-preview) with only 256M parameters:
|
|
@@ -155,6 +168,15 @@ hf jobs uv run \
|
|
| 155 |
--max-model-len 16384 \
|
| 156 |
--batch-size 128
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
# NuMarkdown with reasoning traces for complex documents
|
| 159 |
hf jobs uv run \
|
| 160 |
--flavor l4x4 \
|
|
@@ -202,6 +224,9 @@ uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \
|
|
| 202 |
uv run rolm-ocr.py documents extracted-text
|
| 203 |
uv run rolm-ocr.py images texts --shuffle --max-samples 100 # Random sample
|
| 204 |
|
|
|
|
|
|
|
|
|
|
| 205 |
```
|
| 206 |
|
| 207 |
## π Works With
|
|
|
|
| 51 |
- πΌοΈ **Images** - Captions and descriptions included
|
| 52 |
- βοΈ **Forms** - Checkboxes rendered as β/β
|
| 53 |
|
| 54 |
+
### Nanonets OCR2 (`nanonets-ocr2.py`)
|
| 55 |
+
|
| 56 |
+
Next-generation Nanonets OCR using [nanonets/Nanonets-OCR2-3B](https://huggingface.co/nanonets/Nanonets-OCR2-3B) with improved accuracy:
|
| 57 |
+
|
| 58 |
+
- π― **Enhanced quality** - 3.75B parameters for superior OCR accuracy
|
| 59 |
+
- π **LaTeX equations** - Mathematical formulas preserved in LaTeX format
|
| 60 |
+
- π **Advanced tables** - Improved HTML table extraction
|
| 61 |
+
- π **Document structure** - Headers, lists, formatting maintained
|
| 62 |
+
- πΌοΈ **Smart image captions** - Intelligent descriptions and captions
|
| 63 |
+
- βοΈ **Forms** - Checkboxes rendered as β/β
|
| 64 |
+
- π **Multilingual** - Enhanced language support
|
| 65 |
+
- π§ **Based on Qwen2.5-VL** - Built on state-of-the-art vision-language model
|
| 66 |
+
|
| 67 |
### SmolDocling (`smoldocling-ocr.py`)
|
| 68 |
|
| 69 |
Ultra-compact document understanding using [ds4sd/SmolDocling-256M-preview](https://huggingface.co/ds4sd/SmolDocling-256M-preview) with only 256M parameters:
|
|
|
|
| 168 |
--max-model-len 16384 \
|
| 169 |
--batch-size 128
|
| 170 |
|
| 171 |
+
# Nanonets OCR2 - Next-gen quality with 3B model
|
| 172 |
+
hf jobs uv run \
|
| 173 |
+
--flavor l4x1 \
|
| 174 |
+
--secrets HF_TOKEN \
|
| 175 |
+
https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr2.py \
|
| 176 |
+
your-input-dataset \
|
| 177 |
+
your-output-dataset \
|
| 178 |
+
--batch-size 16
|
| 179 |
+
|
| 180 |
# NuMarkdown with reasoning traces for complex documents
|
| 181 |
hf jobs uv run \
|
| 182 |
--flavor l4x4 \
|
|
|
|
| 224 |
uv run rolm-ocr.py documents extracted-text
|
| 225 |
uv run rolm-ocr.py images texts --shuffle --max-samples 100 # Random sample
|
| 226 |
|
| 227 |
+
# Nanonets OCR2 for highest quality
|
| 228 |
+
uv run nanonets-ocr2.py documents ocr-results
|
| 229 |
+
|
| 230 |
```
|
| 231 |
|
| 232 |
## π Works With
|