DistilBERT Fine-Tuned on AG News

This model classifies news articles into 4 categories: World, Sports, Business, and Sci/Tech.

Model Details

  • Base model: distilbert-base-cased
  • Dataset: AG News (120,000 training samples)
  • Task: Multi-class text classification (4 classes)
  • Framework: PyTorch + HuggingFace Transformers

Performance

Metric Score
Accuracy 0.9447
F1 Score 0.9447

Classes

ID Label
0 World
1 Sports
2 Business
3 Sci/Tech

How to Use

from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="samandar1105/news-classifier"
)

result = classifier("Apple reported record quarterly earnings.")
print(result)  # [{'label': 'Business', 'score': 0.98}]

Training Details

  • Learning rate: 2e-5
  • Epochs: 4
  • Batch size: 32
  • Max sequence length: 128
  • Warmup ratio: 0.1
  • Weight decay: 0.01
Downloads last month
-
Safetensors
Model size
65.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train samandar1105/news-classifier

Space using samandar1105/news-classifier 1

Evaluation results