mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00
1.6 KiB
1.6 KiB
language | datasets | license | tags | ||||||
---|---|---|---|---|---|---|---|---|---|
|
|
mit |
|
bangla-bert-sentiment
bangla-bert-sentiment
is a pretrained model for bengali Sentiment Analysis using bangla-bert-base model.
Datasets Details
This model was trained with two combined datasets
Data Size | 10889 |
Positive | 4999 |
Negative | 5890 |
Train | 8711 |
Test | 2178 |
Training Details
Model trained with simpletransformers binary classification script with total of 3 epochs in google colab gpu
.
Evaluation Details
Model evaluate with 2178 sentences
Here is the evaluation result details in table
Eval Loss | TP | TN | FP | FN | F1 Score |
---|---|---|---|---|---|
0.3289 | 880 | 1158 | 59 | 81 | 92.63 |
Usage
Calculate sentiment from given sentence
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("sagorsarker/bangla-bert-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("sagorsarker/bangla-bert-sentiment")
nlp = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
sentence = "বাংলার ঘরে ঘরে আজ নবান্নের উৎসব"
nlp(sentence)