Commit ·
5031089
0
Parent(s):
document-classification-v2 — commercial open-vocab document classifier
Browse files- .gitattributes +35 -0
- README.md +90 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: nutrient-commercial
|
| 4 |
+
pipeline_tag: zero-shot-image-classification
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- zero-shot-image-classification
|
| 9 |
+
- image-classification
|
| 10 |
+
- document-ai
|
| 11 |
+
- document-image-classification
|
| 12 |
+
- open-vocabulary
|
| 13 |
+
datasets:
|
| 14 |
+
- nutrientdocs/document-classification-benchmark
|
| 15 |
+
metrics:
|
| 16 |
+
- accuracy
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# document-classification-v2 · _commercial_
|
| 20 |
+
|
| 21 |
+
**Classify any document image against labels you choose at runtime.** `document-classification-v2` is an
|
| 22 |
+
open-vocabulary, zero-shot document classifier: supply one label + a short description per class at
|
| 23 |
+
inference, and it scores a document page against *any* such set — invoices, letters, memos, forms,
|
| 24 |
+
scientific articles, resumes, and whatever label you type next. No fixed class list, no per-class training.
|
| 25 |
+
|
| 26 |
+
It is the document specialist in a field of generalists. General open-vocab models were trained on web
|
| 27 |
+
photos; this one is built for document pages — and it shows on the
|
| 28 |
+
[leaderboard](https://huggingface.co/spaces/nutrientdocs/document-classification-leaderboard). **Weights are
|
| 29 |
+
commercial** (not downloadable here); this page is a spec + scorecard.
|
| 30 |
+
|
| 31 |
+
- 🎯 **Try it:** [document-classification-demo](https://huggingface.co/spaces/nutrientdocs/document-classification-demo)
|
| 32 |
+
- 🏆 **Leaderboard:** [document-classification-leaderboard](https://huggingface.co/spaces/nutrientdocs/document-classification-leaderboard)
|
| 33 |
+
- 📊 **Benchmark:** [document-classification-benchmark](https://huggingface.co/datasets/nutrientdocs/document-classification-benchmark)
|
| 34 |
+
|
| 35 |
+
## Results
|
| 36 |
+
|
| 37 |
+
Macro-F1, zero-shot, on the held-out benchmark — higher is better. The flagship vs the previously-shipped
|
| 38 |
+
in-house model and a cloud frontier VLM reference.
|
| 39 |
+
|
| 40 |
+
<!-- RESULTS-TABLE:START — filled from leaderboard/leaderboard.json by the scoring run -->
|
| 41 |
+
| Benchmark (macro-F1) | `document-classification-v2` | best generalist | best cloud VLM |
|
| 42 |
+
| --- | ---: | ---: | ---: |
|
| 43 |
+
| **DocLayNet** (page types) | **0.88** | 0.63 | 0.83 |
|
| 44 |
+
| **Forms** | **1.00** | 0.11 | 1.00 |
|
| 45 |
+
| **Tobacco** (doc types) | 0.69 | 0.43 | **0.85** |
|
| 46 |
+
| **OOD** (unseen doc types) | **0.97** | — | — |
|
| 47 |
+
| **OOV** (synonym wording) | **0.80** | — | — |
|
| 48 |
+
|
| 49 |
+
Latency: **~8 docs/s on an A40** (p50 106 ms / p95 194 ms). The open-weight
|
| 50 |
+
[`v1`](https://huggingface.co/nutrientdocs/document-classification-v1) runs ~3–7 docs/s on the same GPU.
|
| 51 |
+
<!-- RESULTS-TABLE:END -->
|
| 52 |
+
|
| 53 |
+
Every model — ours and cloud — is scored by the same open macro-F1 scorer; full per-model ranking on the
|
| 54 |
+
[leaderboard](https://huggingface.co/spaces/nutrientdocs/document-classification-leaderboard).
|
| 55 |
+
|
| 56 |
+
- **Matches/leads the cloud on visual document-type tracks** (DocLayNet, Forms) at **zero per-request API
|
| 57 |
+
cost** — and runs on a single GPU.
|
| 58 |
+
- **Trails on Tobacco** (0.69 vs 0.85): that track rewards *reading* fine header text (memo vs letter vs
|
| 59 |
+
email) — a large VLM reads it; an embedding model can't.
|
| 60 |
+
- **OOD robustness:** on document types absent from training (invoices, handwriting, charts, tables), 0.97
|
| 61 |
+
macro-F1. **Open-vocab (OOV):** under never-seen synonym label wording, 0.80 — matches the *concept*, not
|
| 62 |
+
your exact string. (Cloud VLMs train on ~all data, so these held-out axes aren't reported for them.)
|
| 63 |
+
|
| 64 |
+
## Intended use & limits
|
| 65 |
+
|
| 66 |
+
- **Use it for:** zero-shot classification of document page images in a free-label setting — the caller
|
| 67 |
+
supplies the candidate labels (and optional descriptions). Multi-page documents supported; optional page
|
| 68 |
+
OCR sharpens fine-grained form / tax-code distinctions.
|
| 69 |
+
- **Limits:** optimized for **document** imagery; English label strings are the primary target. Scores are
|
| 70 |
+
per-label match probabilities (independent per label), not a softmax across the set.
|
| 71 |
+
|
| 72 |
+
## License & data
|
| 73 |
+
|
| 74 |
+
The model **weights** are offered under a commercial Nutrient license — deployed on-prem, so your documents
|
| 75 |
+
never leave your infrastructure. The training set is not redistributed. Evaluation runs on the held-out
|
| 76 |
+
[document-classification-benchmark](https://huggingface.co/datasets/nutrientdocs/document-classification-benchmark).
|
| 77 |
+
|
| 78 |
+
> ### 📩 Get access
|
| 79 |
+
>
|
| 80 |
+
> `document-classification-v2` is commercial and its weights are not downloadable here. To run it on-prem —
|
| 81 |
+
> open-vocabulary, calibrated, private — **contact Nutrient:
|
| 82 |
+
> [nutrient.io/contact-sales](https://www.nutrient.io/contact-sales/).**
|
| 83 |
+
|
| 84 |
+
## About the author
|
| 85 |
+
|
| 86 |
+
<a href="https://nutrient.io/">
|
| 87 |
+
<img src="https://avatars2.githubusercontent.com/u/1527679?v=3&s=200" height="80" />
|
| 88 |
+
</a>
|
| 89 |
+
|
| 90 |
+
This project is maintained and funded by [Nutrient](https://nutrient.io/) - The deterministic document infrastructure enterprises run their highest-stakes workflows on: replayable output, clear exceptions, and full audit trails on the messy, regulated documents where AI alone breaks.
|