heegyu/news-category-dataset
Viewer • Updated • 210k • 444 • 2
How to use kurcontko/modernbert-news-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="kurcontko/modernbert-news-classifier") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("kurcontko/modernbert-news-classifier")
model = AutoModelForSequenceClassification.from_pretrained("kurcontko/modernbert-news-classifier")Fine-tuned ModernBERT for classifying news text into multiple categories.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="kurcontko/modernbert-news-classifier",
top_k=3
)
print(classifier("Apple unveils new AI models on latest iPhone"))
| Metric | Score |
|---|---|
| Accuracy | 0.72 |
| Macro F1 | 0.63 |
Evaluated on the validation split of the HuffPost News Category dataset.
Max sequence length: 512
Batch size: 32
Epochs: 3
Early stopping enabled
Input was constructed as headline + short_description.
Base model
answerdotai/ModernBERT-large