Downloads · 30 days
17
14% of all-time downloads
kmjun3203/bert-based-uncased-argnews4-v01
bert-based-uncased-argnews4-v01 is a text classification model from kmjun3203. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model fine-tunes the bert-base-uncased model on the AG News dataset for text classification. It classifies English news articles into one of four categories:
Downloads · 30 days
17
14% of all-time downloads
All-time downloads
119
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
This model fine-tunes the bert-base-uncased model on the AG News dataset for text classification.
It classifies English news articles into one of four categories:
| Label | English Category | Korean Label |
|---|---|---|
| 0 | World | 세계뉴스 |
| 1 | Sports | 스포츠 |
| 2 | Business | 비즈니스 |
| 3 | Science/Technology | 과학/기술 |
bert-base-uncasedBertTokenizer (uncased, max length 128)| Metric | Score |
|---|---|
| Accuracy | 82.5% |
from transformers import AutoTokenizer, AutoModelForSequenceClassification import torch
model_name = "your-username/bert-agnews-korean-labels" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "Apple announces the new iPhone at their annual event." inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True) outputs = model(**inputs) predicted_class = torch.argmax(outputs.logits).item()
label_map = { 0: "세계뉴스", 1: "스포츠", 2: "비즈니스", 3: "과학/기술" }
print("Predicted label:", label_map[predicted_class])
If you use this model, please cite the base paper: @article{devlin2018bert, title={BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding}, author={Devlin, Jacob and Chang, Ming-Wei and Lee, Kenton and Toutanova, Kristina}, journal={arXiv preprint arXiv:1810.04805}, year={2018} }