fancyzhx/ag_news
Viewer β’ Updated β’ 128k β’ 117k β’ 190
How to use martian786/agnews-salient-random-k16-seed-1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="martian786/agnews-salient-random-k16-seed-1") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("martian786/agnews-salient-random-k16-seed-1")
model = AutoModelForSequenceClassification.from_pretrained("martian786/agnews-salient-random-k16-seed-1")This repository contains one trained run from the AG News salience experiment.
random_k16randomroberta-base11612828500600076000: World1: Sports2: Business3: Sci/Tech| Metric | Value |
|---|---|
| Validation accuracy | 0.8825 |
| Validation macro F1 | 0.8823 |
| Test accuracy | 0.8699 |
| Test macro F1 | 0.8696 |
This repository includes:
test_data.csv β transformed test data used for this runval_data.csv β transformed validation data used for this runtrain_data_sample.csv β sample of transformed training datafull_test_predictions.csv β full test predictionsmetrics.json β run metricsclassification_report.json β per-class classification reportconfusion_matrix.csv β confusion matrixtrainer_log_history.csv β Trainer log history, if availableThis model is intended for experiment tracking and reproducibility of AG News classification runs.
It is not intended as a production classifier without further validation.
The original experiment used:
MODEL_NAME = "roberta-base"
SEED = 1
TOKEN_BUDGET = 16
MAX_SEQ_LEN = 128
TRAIN_SAMPLES = 28500
EPOCHS = 3
BATCH_SIZE = 16
LR = 2e-05
WEIGHT_DECAY = 0.01
from transformers import AutoTokenizer, AutoModelForSequenceClassification
repo_id = "martian786/agnews-salient-random-k16-seed-1"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)
Base model
FacebookAI/roberta-base