ModernBERT — News Classifier

Fine-tuned ModernBERT for classifying news text into multiple categories.

  • Base model: answerdotai/ModernBERT-large
  • Task: Text classification
  • Dataset: HuffPost News Category
  • Input: headline + short description
  • Output: predicted category (top-k supported)

Usage

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"))

Evaluation

Metric Score
Accuracy 0.72
Macro F1 0.63

Evaluated on the validation split of the HuffPost News Category dataset.

Training

Max sequence length: 512
Batch size: 32
Epochs: 3 Early stopping enabled

Input was constructed as headline + short_description.

Downloads last month
20
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for kurcontko/modernbert-news-classifier

Finetuned
(228)
this model

Dataset used to train kurcontko/modernbert-news-classifier

Evaluation results