Text Classification
Model2Vec
Safetensors
static-embeddings
newspaper-classification
crop-classification
historical-newspapers
newspapers
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](https://github.com/MinishLab/model2vec) fine-tune of [minishlab/potion-base-32m](https://huggingface.co/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`](https://huggingface.co/institutional/institutional-newspapers-crop-classifier-image-yolo26m-cls), as neither visual nor textual signal alone is sufficient to classify newspaper crops accurately. | |
| **More information:** | |
| - 📄 [Full analysis available in our technical report](https://arxiv.org/abs/2608.18972) | |
| **See also:** | |
| - 🗂️ [Institutional Newspapers Collection](https://huggingface.co/collections/institutional/institutional-newspapers) | |
| - ⚙️ [Pipeline](https://github.com/institutional/institutional-newspapers-pipeline) | |
| - 🤖 [Segmentation model](https://huggingface.co/institutional/institutional-newspapers-segmenter-yolo26x) | |
| - 🤖 [Crop-type image classifier](https://huggingface.co/institutional/institutional-newspapers-crop-classifier-image-yolo26m-cls) | |
| 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](https://institutional.org/). | |
| ## 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 | |
| ```python | |
| 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 | |
| ```bibtex | |
| TODO | |
| ``` |