Instructions to use BluSerK/bert-base-uncased-news-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BluSerK/bert-base-uncased-news-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="BluSerK/bert-base-uncased-news-classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("BluSerK/bert-base-uncased-news-classification") model = AutoModelForSequenceClassification.from_pretrained("BluSerK/bert-base-uncased-news-classification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
bert-base-uncased-news-classification
This model is a fine-tuned version of bert-base-uncased on the BBC-news dataset. It achieves the following results on the evaluation set:
- Loss: 0.2074
- F1: 0.9721
- Accuracy: 0.972
Model description
Intended uses: This model is intended for classifying English news articles into categories similar to those present in the BBC News dataset. It can be used as a baseline for text classification tasks on news content or as a component in larger NLP pipelines.
Intended uses & limitations
- Domain Specificity: The model's performance may degrade significantly when applied to text from domains vastly different from news articles.
- Bias: As with any model trained on real-world data, it may inherit biases present in the BBC News dataset. Users should be aware of potential biases in classification results.
Training and evaluation data
The model was trained and evaluated using the SetFit/bbc-news dataset.
- Training data: The 'train' split of the dataset, containing 1225 samples.
- Evaluation data: The 'test' split of the dataset, containing 500 samples (after being split from an initial test set of 1000 samples).
The dataset contains news articles with corresponding category labels (politics, sport, entertainment, tech, business). The label_text column was mapped to numerical IDs for training.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 3.0
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss | F1 | Accuracy |
|---|---|---|---|---|---|
| No log | 1.0 | 154 | 0.3715 | 0.9525 | 0.952 |
| No log | 2.0 | 308 | 0.1898 | 0.9741 | 0.974 |
| No log | 3.0 | 462 | 0.2168 | 0.9722 | 0.972 |
Framework versions
- Transformers 5.13.1
- Pytorch 2.11.0+cu128
- Datasets 4.0.0
- Tokenizers 0.22.2
- Downloads last month
- 22
Model tree for BluSerK/bert-base-uncased-news-classification
Base model
google-bert/bert-base-uncased