Instructions to use SAIRANaseem/news-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SAIRANaseem/news-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="SAIRANaseem/news-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("SAIRANaseem/news-classifier") model = AutoModelForSequenceClassification.from_pretrained("SAIRANaseem/news-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
News Topic Classifier
Model Description
This model classifies news articles into 4 categories using DistilBERT.
Developed by: SAIRA NASEEM
Model type: Text Classification
Base Model: distilbert-base-uncased
Dataset: AG News (fancyzhx/ag_news)
Results
| Metric | Score |
|---|---|
| Accuracy | 91.25% |
| F1-Score | 91.23% |
| Precision | 91.44% |
| Recall | 91.25% |
How to Use
from transformers import pipeline classifier = pipeline("text-classification", model="SAIRANaseem/news-classifier") result = classifier("Your news text here") print(result)
Classes
- LABEL_0: World
- LABEL_1: Sports
- LABEL_2: Business
- LABEL_3: Sci/Tech
- Downloads last month
- 9