fancyzhx/ag_news
Viewer • Updated • 128k • 121k • 190
How to use kitrofimov/news-clf with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="kitrofimov/news-clf") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("kitrofimov/news-clf")
model = AutoModelForSequenceClassification.from_pretrained("kitrofimov/news-clf")Classifies English-language news into 4 categories: world, sports, business, and science / technology.
Fine-tuned version of distilbert/distilbert-base-uncased on fancyzhx/ag_news, trained for 3 epochs with 128 token truncation.
It achieves the following results on the evaluation set:
Made as a homework project for 4th lesson of the FastAI's Practical Deep Learning for Coders course. Hugging Face Spaces demo available here.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.2009 | 1.0 | 938 | 0.1998 | 0.9307 |
| 0.1773 | 2.0 | 1876 | 0.1804 | 0.9375 |
| 0.1418 | 3.0 | 2814 | 0.1759 | 0.9414 |
Base model
distilbert/distilbert-base-uncased