fancyzhx/ag_news
Viewer • Updated • 128k • 119k • 190
How to use martian786/agnews-roberta-seed42-fulltext-50pct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="martian786/agnews-roberta-seed42-fulltext-50pct") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("martian786/agnews-roberta-seed42-fulltext-50pct")
model = AutoModelForSequenceClassification.from_pretrained("martian786/agnews-roberta-seed42-fulltext-50pct")This model is a fine-tuned roberta-base sequence classifier for the AG News four-class classification task.
roberta-base| Label ID | Label |
|---|---|
| 0 | World |
| 1 | Sports |
| 2 | Business |
| 3 | Sci/Tech |
| Metric | Value |
|---|---|
| Test accuracy | 0.947237 |
| Test macro F1 | 0.947215 |
| Accuracy 95% Wilson CI | 0.941981–0.952041 |
| Misclassified examples | 401 |
| Single-example latency mean | 12.267 ms |
| Training time | 1285.03 s |
| Class | F1 |
|---|---|
| World | 0.955263 |
| Sports | 0.988421 |
| Business | 0.919222 |
| Sci/Tech | 0.925955 |
repo_id = "martian786/agnews-roberta-seed42-fulltext-50pct"
Use AutoTokenizer.from_pretrained(repo_id) and AutoModelForSequenceClassification.from_pretrained(repo_id).
This model was fine-tuned on AG News and is intended for controlled academic comparison rather than production deployment.
Base model
FacebookAI/roberta-base