Bangla News Topic Classifier
A fine-tuned BanglaBERT Large (ELECTRA-large architecture)
model for 20-class Bangla news topic classification.
Model Details
| Property |
Value |
| Base model |
csebuetnlp/banglabert_large |
| Architecture |
ELECTRA-large (ElectraForSequenceClassification) |
| Language |
Bengali (bn) |
| Task |
Single-label text classification (20 classes) |
| Max input length |
128 tokens |
| Training epochs |
3 |
| Batch size |
16 |
| Learning rate |
2e-5 |
| Training device |
NVIDIA GeForce RTX 4070 Ti SUPER |
Training Data
20,073 labeled Bangla news articles split as:
| Split |
Samples |
| Train |
16,058 |
| Val |
2,007 |
| Test |
2,008 |
Label distribution (train+val+test):
| Label |
Count |
| রাজনীতি |
5,145 |
| অন্যান্য |
3,140 |
| অপরাধ |
2,479 |
| আন্তর্জাতিক |
1,234 |
| মতামত |
951 |
| আইন-শৃঙ্খলা |
843 |
| ধর্ম |
690 |
| বিনোদন |
685 |
| ব্যবসা-বাণিজ্য |
632 |
| শিক্ষা |
589 |
| সমাজ |
588 |
| পরিবেশ |
581 |
| প্রযুক্তি |
394 |
| অবকাঠামো |
390 |
| চাকরি |
351 |
| লাইফস্টাইল |
345 |
| খেলাধুলা |
320 |
| অর্থনীতি |
304 |
| স্বাস্থ্য |
273 |
| বিজ্ঞান |
139 |
Evaluation (Test Set)
Overall: Accuracy = 0.7311 · Macro F1 = 0.6411
| Label |
Precision |
Recall |
F1 |
Support |
| অন্যান্য |
0.751 |
0.624 |
0.682 |
314 |
| অপরাধ |
0.815 |
0.766 |
0.790 |
248 |
| অবকাঠামো |
0.571 |
0.718 |
0.636 |
39 |
| অর্থনীতি |
0.552 |
0.533 |
0.542 |
30 |
| আইন-শৃঙ্খলা |
0.592 |
0.718 |
0.649 |
85 |
| আন্তর্জাতিক |
0.828 |
0.855 |
0.841 |
124 |
| খেলাধুলা |
0.818 |
0.844 |
0.831 |
32 |
| চাকরি |
0.600 |
0.686 |
0.640 |
35 |
| ধর্ম |
0.828 |
0.768 |
0.797 |
69 |
| পরিবেশ |
0.793 |
0.793 |
0.793 |
58 |
| প্রযুক্তি |
0.735 |
0.641 |
0.685 |
39 |
| বিজ্ঞান |
0.000 |
0.000 |
0.000 |
14 |
| বিনোদন |
0.694 |
0.725 |
0.709 |
69 |
| ব্যবসা-বাণিজ্য |
0.583 |
0.556 |
0.569 |
63 |
| মতামত |
0.504 |
0.600 |
0.548 |
95 |
| রাজনীতি |
0.843 |
0.876 |
0.859 |
515 |
| লাইফস্টাইল |
0.520 |
0.382 |
0.441 |
34 |
| শিক্ষা |
0.704 |
0.644 |
0.673 |
59 |
| সমাজ |
0.371 |
0.559 |
0.446 |
59 |
| স্বাস্থ্য |
0.679 |
0.704 |
0.691 |
27 |
| macro avg |
0.639 |
0.650 |
0.641 |
2008 |
| weighted avg |
0.735 |
0.731 |
0.730 |
2008 |
Note: বিজ্ঞান (Science) has only 14 test samples and the model failed to predict
any correctly in this run, likely due to severe class imbalance (139 total samples).
Training Curve
| Epoch |
Train Loss |
Val Accuracy |
Val Macro F1 |
| 1 |
1.8825 |
0.6114 |
0.3303 |
| 2 |
1.0085 |
0.6996 |
0.5946 |
| 3 |
0.6104 |
0.7285 |
0.6432 |
Labels
| ID |
Label (Bengali) |
English |
| 0 |
অন্যান্য |
Other |
| 1 |
অপরাধ |
Crime |
| 2 |
অবকাঠামো |
Infrastructure |
| 3 |
অর্থনীতি |
Economy |
| 4 |
আইন-শৃঙ্খলা |
Law & Order |
| 5 |
আন্তর্জাতিক |
International |
| 6 |
খেলাধুলা |
Sports |
| 7 |
চাকরি |
Jobs |
| 8 |
ধর্ম |
Religion |
| 9 |
পরিবেশ |
Environment |
| 10 |
প্রযুক্তি |
Technology |
| 11 |
বিজ্ঞান |
Science |
| 12 |
বিনোদন |
Entertainment |
| 13 |
ব্যবসা-বাণিজ্য |
Business / Trade |
| 14 |
মতামত |
Opinion |
| 15 |
রাজনীতি |
Politics |
| 16 |
লাইফস্টাইল |
Lifestyle |
| 17 |
শিক্ষা |
Education |
| 18 |
সমাজ |
Society |
| 19 |
স্বাস্থ্য |
Health |
Usage
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="arafatfahim/bangla-news-topic-classifier",
)
result = classifier("বাংলাদেশে নতুন প্রযুক্তি উদ্ভাবন")
print(result)