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
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: transformers
|
| 4 |
+
---
|
| 5 |
+
# TextClassifier
|
| 6 |
+
|
| 7 |
+
<div align="center">
|
| 8 |
+
<img src="figures/fig1.png" width="70%" alt="Training Curves" />
|
| 9 |
+
</div>
|
| 10 |
+
|
| 11 |
+
## Model Description
|
| 12 |
+
|
| 13 |
+
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.
|
| 14 |
+
|
| 15 |
+
## Training Details
|
| 16 |
+
|
| 17 |
+
- **Base Model**: bert-base-uncased
|
| 18 |
+
- **Best Run ID**: run-def456
|
| 19 |
+
- **Best Run Name**: sweep-lr5e5-bs16
|
| 20 |
+
- **Learning Rate**: 5e-05
|
| 21 |
+
- **Batch Size**: 16
|
| 22 |
+
- **Weight Decay**: 0.01
|
| 23 |
+
- **Best Epoch**: 10
|
| 24 |
+
|
| 25 |
+
## Evaluation Results
|
| 26 |
+
|
| 27 |
+
- **Validation F1**: 0.851
|
| 28 |
+
- **Validation Accuracy**: 0.865
|
| 29 |
+
- **Final Validation Loss**: 0.487
|
| 30 |
+
|
| 31 |
+
<div align="center">
|
| 32 |
+
<img src="figures/fig2.png" width="60%" alt="Validation Metrics" />
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
### Run Comparison (sorted by val_f1 descending)
|
| 36 |
+
|
| 37 |
+
| Run ID | Run Name | Learning Rate | Batch Size | Weight Decay | Val F1 | Val Accuracy | Val Loss | Best Epoch |
|
| 38 |
+
|--------|----------|---------------|------------|--------------|--------|--------------|----------|-------------|
|
| 39 |
+
| run-def456 | sweep-lr5e5-bs16 | 5e-05 | 16 | 0.01 | 0.851 | 0.865 | 0.487 | 10 |
|
| 40 |
+
| run-pqr678 | sweep-lr5e5-bs16-wd005 | 5e-05 | 16 | 0.005 | 0.841 | 0.855 | 0.512 | 10 |
|
| 41 |
+
| run-jkl012 | sweep-lr5e5-bs32-wd0 | 5e-05 | 32 | 0.0 | 0.829 | 0.841 | 0.583 | 8 |
|
| 42 |
+
| run-abc123 | sweep-lr3e5-bs32 | 3e-05 | 32 | 0.01 | 0.811 | 0.826 | 0.585 | 10 |
|
| 43 |
+
| run-ghi789 | sweep-lr2e5-bs64 | 2e-05 | 64 | 0.02 | 0.782 | 0.796 | 0.649 | 10 |
|
| 44 |
+
| run-mno345 | sweep-lr1e4-bs32 | 0.0001 | 32 | 0.01 | 0.735 | 0.751 | 0.821 | 7 |
|
| 45 |
+
|
| 46 |
+
<div align="center">
|
| 47 |
+
<img src="figures/fig3.png" width="60%" alt="Confusion Matrix" />
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
## Intended Use
|
| 51 |
+
|
| 52 |
+
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.
|
| 53 |
+
|
| 54 |
+
## Limitations
|
| 55 |
+
|
| 56 |
+
The model's performance is benchmark-specific and may not generalize to out-of-distribution inputs or domains not seen during training.
|
| 57 |
+
|
| 58 |
+
## License
|
| 59 |
+
|
| 60 |
+
This model is released under the MIT License.
|