Instructions to use institutional/institutional-newspapers-crop-classifier-text-model2vec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use institutional/institutional-newspapers-crop-classifier-text-model2vec with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("institutional/institutional-newspapers-crop-classifier-text-model2vec") - Notebooks
- Google Colab
- Kaggle
base_model: minishlab/potion-base-32m
library_name: model2vec
license: mit
tags:
- model2vec
- static-embeddings
- text-classification
- newspaper-classification
- crop-classification
- historical-newspapers
- newspapers
datasets:
- institutional/institutional-newspapers-bpl
📰 Institutional Newspapers Crop Classifier (Text)
A text-based classifier that categorizes crops extracted from historical newspaper scans into high-level categories. This model is a Model2Vec fine-tune of minishlab/potion-base-32m with a classifier head, which makes it light and efficient.
We recommend using this model alongside institutional/institutional-newspapers-crop-classifier-image-yolo26m-cls, as neither visual nor textual signal alone is sufficient to classify newspaper crops accurately.
More information:
See also:
- 🗂️ Institutional Newspapers Collection
- ⚙️ Pipeline
- 🤖 Segmentation model
- 🤖 Crop-type image classifier
The Institutional Data Initiative at the Harvard Law School Library works with knowledge institutions—from libraries and museums to cultural groups and government agencies—to refine and publish their collections as data. Reach out to collaborate on your collections.
Evaluation results
Evaluated on a held-out test set of 31,015 crops:
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Advertisement | 0.95 | 0.94 | 0.95 | 11,244 |
| Cartoon | 0.85 | 0.57 | 0.68 | 430 |
| Content | 0.90 | 0.96 | 0.93 | 11,245 |
| Masthead, nameplate or running head | 0.93 | 0.86 | 0.89 | 2,250 |
| Photograph or illustration | 0.63 | 0.38 | 0.48 | 551 |
| Section heading | 0.94 | 0.93 | 0.94 | 5,295 |
| Metric | Score |
|---|---|
| Accuracy | 0.92 |
| Macro avg F1 | 0.81 |
| Weighted avg F1 | 0.92 |
Training data
This model was trained on part of Boston Public Library's newspapers collection.
- Total annotated crops: 185,900
- Classes: 6
- Split: ~67% train / ~17% val / ~17% test
Usage
from model2vec.inference import StaticModelPipeline
model_name = "institutional/institutional-newspapers-crop-classifier-text-model2vec"
model = StaticModelPipeline.from_pretrained(model_name)
texts = ["CLASSIFIED ADVERTISING — Rooms for rent, furnished apartments..."]
predictions = model.predict(texts, max_length=None)
print(predictions)
# ['Advertisement']
Recommended inference parameters
| Parameter | Value | Note |
|---|---|---|
max_length |
None |
Do not truncate input text |
Citation
TODO