Instructions to use dusersad12/TextClassifier-BestRun with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dusersad12/TextClassifier-BestRun with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="dusersad12/TextClassifier-BestRun")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("dusersad12/TextClassifier-BestRun") model = AutoModelForSequenceClassification.from_pretrained("dusersad12/TextClassifier-BestRun", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 2,082 Bytes
b8a7a9d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ---
license: mit
library_name: transformers
---
# TextClassifier
<div align="center">
<img src="figures/fig1.png" width="70%" alt="Training Curves" />
</div>
## Model Description
This is a BERT-based text classification model fine-tuned on a 5-class dataset. The best checkpoint was selected based on validation F1 score across multiple hyperparameter sweeps.
## Training Details
- **Base Model**: bert-base-uncased
- **Best Run ID**: run-def456
- **Best Run Name**: sweep-lr5e5-bs16
- **Learning Rate**: 5e-05
- **Batch Size**: 16
- **Weight Decay**: 0.01
- **Best Epoch**: 10
## Evaluation Results
- **Validation F1**: 0.851
- **Validation Accuracy**: 0.865
- **Final Validation Loss**: 0.487
<div align="center">
<img src="figures/fig2.png" width="60%" alt="Validation Metrics" />
</div>
### Run Comparison (sorted by val_f1 descending)
| Run ID | Run Name | Learning Rate | Batch Size | Weight Decay | Val F1 | Val Accuracy | Val Loss | Best Epoch |
|--------|----------|---------------|------------|--------------|--------|--------------|----------|-------------|
| run-def456 | sweep-lr5e5-bs16 | 5e-05 | 16 | 0.01 | 0.851 | 0.865 | 0.487 | 10 |
| run-pqr678 | sweep-lr5e5-bs16-wd005 | 5e-05 | 16 | 0.005 | 0.841 | 0.855 | 0.512 | 10 |
| run-jkl012 | sweep-lr5e5-bs32-wd0 | 5e-05 | 32 | 0.0 | 0.829 | 0.841 | 0.583 | 8 |
| run-abc123 | sweep-lr3e5-bs32 | 3e-05 | 32 | 0.01 | 0.811 | 0.826 | 0.585 | 10 |
| run-ghi789 | sweep-lr2e5-bs64 | 2e-05 | 64 | 0.02 | 0.782 | 0.796 | 0.649 | 10 |
| run-mno345 | sweep-lr1e4-bs32 | 0.0001 | 32 | 0.01 | 0.735 | 0.751 | 0.821 | 7 |
<div align="center">
<img src="figures/fig3.png" width="60%" alt="Confusion Matrix" />
</div>
## Intended Use
This model is intended for text classification tasks with 5 output classes. It should not be used for generating text or for tasks outside its training distribution.
## Limitations
The model's performance is benchmark-specific and may not generalize to out-of-distribution inputs or domains not seen during training.
## License
This model is released under the MIT License. |