Downloads · 30 days
0
Koushim/distilbert-agnews
distilbert-agnews is a text classification model from Koushim. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This repository provides two fine-tuned DistilBERT models for topic classification on the AG News dataset:
Downloads · 30 days
0
Access
Public
Updated May 29, 2025
Repo size
536 MB
Likes
0
Public
Click a slice to open those files.
.safetensors536 MB · 100%
From the Hugging Face model README
This repository provides two fine-tuned DistilBERT models for topic classification on the AG News dataset:
model_no_smoothing: Fine-tuned without label smoothingmodel_label_smoothing: Fine-tuned with label smoothing (smoothing=0.1)Both models use the same tokenizer (distilbert-base-uncased) and were trained using PyTorch and Hugging Face Trainer.
| Model Name | Label Smoothing | Validation Loss | Epochs | Learning Rate |
|---|---|---|---|---|
model_no_smoothing | ❌ No | 0.1792 | 1 | 2e-5 |
model_label_smoothing | ✅ Yes (0.1) | 0.5413 | 1 | 2e-5 |
distilbert-base-uncased
/
├── model\_no\_smoothing/ # Model A - no smoothing
├── model\_label\_smoothing/ # Model B - label smoothing
├── tokenizer/ # Tokenizer files (shared)
└── README.md
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "Koushim/distilbert-agnews/model_no_smoothing"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
inputs = tokenizer("Breaking news in the tech world!", return_tensors="pt")
outputs = model(**inputs)
pred = outputs.logits.argmax(dim=1).item()
model_name = "Koushim/distilbert-agnews/model_label_smoothing"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
Apache 2.0
transformers.Trainer