Downloads · 30 days
6
15% of all-time downloads
gulamsakaria/commentlens-banglishbert
commentlens-banglishbert is a text classification model from gulamsakaria. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Fine-tuned csebuetnlp/banglishbert (ELECTRA) for classifying Bangla/Banglish social media comments into 5 categories, with class-weighted loss to handle severe label imbalance.
Downloads · 30 days
6
15% of all-time downloads
All-time downloads
40
Public
Parameters
111M
554 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors443 MB · 80%
From the Hugging Face model README
Fine-tuned csebuetnlp/banglishbert (ELECTRA) for classifying Bangla/Banglish social media comments into 5 categories, with class-weighted loss to handle severe label imbalance.
Classes: claim | general | opinion | spam-scam | toxic
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| claim | 0.52 | 0.56 | 0.54 | 27 |
| general | 0.97 | 0.95 | 0.96 | 3768 |
| opinion | 0.84 | 0.92 | 0.88 | 875 |
| spam-scam | 0.96 | 0.93 | 0.95 | 28 |
| toxic | 0.77 | 0.79 | 0.78 | 197 |
Overall accuracy: 93% (macro avg F1: 0.82, weighted avg F1: 0.93) on a 4,895-row validation set.
Rare classes (claim, spam-scam) have low support and should be treated with caution in production.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("gulamsakaria/commentlens-banglishbert")
model = AutoModelForSequenceClassification.from_pretrained("gulamsakaria/commentlens-banglishbert")
text = "এই পেজে সবাই মিথ্যা কথা বলে"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1)
pred = model.config.id2label[int(probs.argmax())]
print(pred, float(probs.max()))
Built by Gulam Sakaria as part of the CommentLens project on Bangla comment moderation and misinformation detection.