CoolFace
Modelpublic

oneryalcin/finepdfs-purpose-neomme-frozen-head

sourceHugging Faceupdated 16d agoView on Hugging Face
0likes12downloads
Model Card

FinePDFs document purpose — frozen NeoMME embeddings + logistic head

This is a frozen-body baseline, not a contrastively fine-tuned SetFit model. NeoMME weights are untouched; only a scikit-learn logistic-regression head (C=100, no class weighting) was fit on L2-normalised page embeddings. It is packaged as a SetFitModel so it loads and predicts with the standard API.

Task: classify a PDF by its primary purpose from the rendered first page only (800 px JPEG), using the six labels of Daniel van Strien's FinePDFs-Edu purpose classifier: administration_policy, exercise_assessment, instruction_reference, news_promotion, research_analysis, other.

Data

`oneryalcin/finepdfs-purpose-pages-v2`: PDFs sampled from davanstrien/finepdfs-edu-purpose, re-fetched from their source URLs, page 1 rendered with pdftoppm. Labels are not the text classifier's predictions: every page was relabelled by DeepSeek-V4.1-Flash given the page image plus a start/middle/end text excerpt and the purpose guide (the judge agreed with the text classifier's label on 67% of documents). 4,972 train / 702 test.

Results (702 held-out pages, judge labels as reference)

modelinputaccuracymacro-F1 (6 classes)
davanstrien/finepdfs-edu-purpose-classifiertext excerpt0.6790.570
this modelpage-1 image0.6940.634

Per-class F1: administrationpolicy 0.61, exerciseassessment 0.74, instructionreference 0.70, newspromotion 0.69, research_analysis 0.75, other 0.32. The 702-document test set gives roughly ±3.5 points; treat the two models as on par. The head's C was chosen on this same test split.

Usage

python
from PIL import Image
from setfit import SetFitModel  # needs the image-input patch: https://github.com/huggingface/setfit/pull/653
model = SetFitModel.from_pretrained("oneryalcin/finepdfs-purpose-neomme-frozen-head", task="document")
model.predict([Image.open("page-1.jpg")])

Requires sentence-transformers>=6, transformers>=5.16 (NeoMME). Runs at ~20 pages/s on an Apple M-series GPU.