Downloads · 30 days
1
6% of all-time downloads
rkmakd2258-wq/bert-based-uncased-agnews4-v01
bert-based-uncased-agnews4-v01 is a machine learning model from rkmakd2258-wq. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
language: - en tags: - text-classification - ag-news - fine-tuning license: "mit" datasets: - agnews metrics: - accuracy - f1 basemodel: "bert-base-uncased"
Downloads · 30 days
1
6% of all-time downloads
All-time downloads
18
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
language:
This model is a fine-tuned version of a pre-trained BERT model, adapted for 4-category news classification using the AG News dataset.
It predicts one of four news topics based on input text (news headline or article).
| Label | Category |
|---|---|
| 0 | World |
| 1 | Sports |
| 2 | Business |
| 3 | Science/Technology |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "rkmakd2258-wq/agnews-bert-4class"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "Apple announced its latest earnings report."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
pred = outputs.logits.argmax(dim=1).item()
labels = ["World", "Sports", "Business", "Science/Technology"]
print("Prediction:", labels[pred])
(Update with actual results)
| Metric | Value |
|---|---|
| Accuracy | - |
| F1 Score | - |
MIT