Newswire: A Large-Scale Structured Database of a Century of Historical News
Paper • 2406.09490 • Published
How to use dell-research-harvard/topic-politics with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="dell-research-harvard/topic-politics") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("dell-research-harvard/topic-politics")
model = AutoModelForSequenceClassification.from_pretrained("dell-research-harvard/topic-politics")This model is a finetuned RoBERTa-large, for classifying whether news articles are about politics.
from transformers import pipeline
classifier = pipeline("text-classification", model="dell-research-harvard/topic-politics")
classifier("Kennedy wins election")
The model was trained on a hand-labelled sample of data from the NEWSWIRE dataset.
| Split | Size |
|---|---|
| Train | 2418 |
| Dev | 498 |
| Test | 1473 |
| Metric | Result |
|---|---|
| F1 | 0.8492 |
| Accuracy | 0.9593 |
| Precision | 0.9086 |
| Recall | 0.7972 |
You can cite this dataset using
@misc{silcock2024newswirelargescalestructureddatabase,
title={Newswire: A Large-Scale Structured Database of a Century of Historical News},
author={Emily Silcock and Abhishek Arora and Luca D'Amico-Wong and Melissa Dell},
year={2024},
eprint={2406.09490},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2406.09490},
}
We applied this model to a century of historical news articles. You can see all the classifications in the NEWSWIRE dataset.