Downloads · 30 days
53
72% of all-time downloads
Borson/BanglaBERT
BanglaBERT is a machine learning model from Borson. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a fine-tuned csebuetnlp/banglabert model for Bangla sentiment analysis. The model was fine-tuned on a custom dataset with three labels: negative, neutral, positive.
Downloads · 30 days
53
72% of all-time downloads
All-time downloads
74
Public
Parameters
111M
443 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors443 MB · 100%
From the Hugging Face model README
This is a fine-tuned csebuetnlp/banglabert model for Bangla sentiment analysis.
The model was fine-tuned on a custom dataset with three labels: negative, neutral, positive.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo_id = "Borson/BanglaBERT"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)
# Example usage
text = "এই সিনেমাটা খুব ভালো লেগেছে!" # This movie was very good!
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
predicted_label = model.config.id2label[predicted_class_id]
print(f"Text: {text}")
print(f"Predicted label: {predicted_label}")