BanglaBERT

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.

Usage

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}")
Downloads last month
18
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support