Text Classification
Model2Vec
English
poster-sentry
document-classification
scientific-posters
multimodal
poster-detection
machine-actionable
FAIR-data
posters-science
quality-control
Instructions to use fairdataihub/poster-sentry with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use fairdataihub/poster-sentry with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("fairdataihub/poster-sentry") embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everybody."]) print(embeddings.shape) - Notebooks
- Google Colab
- Kaggle
Document the selectable PDF backend (pdfplumber default, pymupdf opt-in)
Browse files
README.md
CHANGED
|
@@ -81,6 +81,19 @@ Three feature channels concatenated into a **542-dimensional** vector, fed to a
|
|
| 81 |
|
| 82 |
Each classifier head is a single linear layer stored as a numpy `.npz` file (10 KB). Inference is pure numpy, no torch required at prediction time.
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
## Performance
|
| 85 |
|
| 86 |
Evaluated against human-validated labels (three-reviewer survey with blinded adjudication of contested documents):
|
|
|
|
| 81 |
|
| 82 |
Each classifier head is a single linear layer stored as a numpy `.npz` file (10 KB). Inference is pure numpy, no torch required at prediction time.
|
| 83 |
|
| 84 |
+
## PDF backend (speed vs license)
|
| 85 |
+
|
| 86 |
+
Feature extraction reads PDFs through a selectable backend:
|
| 87 |
+
|
| 88 |
+
| Backend | Libraries | License | Speed | Notes |
|
| 89 |
+
|---------|-----------|---------|-------|-------|
|
| 90 |
+
| `pdfplumber` (**default**) | pdfplumber + pypdfium2 | MIT + BSD-3-Clause | ~2.0 s/doc | The stack the released model is trained on; reproduces the paper. |
|
| 91 |
+
| `pymupdf` | PyMuPDF | AGPL-3.0 | ~1.2 s/doc (about 1.75x faster) | Faster, but AGPL. Install with `pip install poster-sentry[pymupdf]`. Its extracted features differ slightly, so retrain with this backend for best accuracy or accept minor prediction drift. |
|
| 92 |
+
|
| 93 |
+
Select the backend with `--backend`, the `backend=` constructor argument, or the `POSTER_SENTRY_BACKEND` environment variable. The default is `pdfplumber` so results match this model.
|
| 94 |
+
|
| 95 |
+
On a 40-document corpus sample, the dominant cost in the default stack is pdfplumber's pure-Python text and structure parsing (about 780 ms and 760 ms per document); page rendering with pypdfium2 adds about 490 ms. A pypdfium2-based text variant cuts the text step to about 75 ms and reaches roughly 1.3 s/doc, but it changes the extracted text, so it would require its own retrain; `pymupdf` is the recommended fast path when AGPL is acceptable.
|
| 96 |
+
|
| 97 |
## Performance
|
| 98 |
|
| 99 |
Evaluated against human-validated labels (three-reviewer survey with blinded adjudication of contested documents):
|