Downloads · 30 days
0
0% of all-time downloads
samiur-r/BanglishSentiment-Llama3-8B
BanglishSentiment-Llama3-8B is a text classification model from samiur-r. Use it when you need a label for a piece of text. It is set up for transformers.
Fine-tuned Llama 3 for Sentiment Analysis of Banglish (Bengali-English Code-Switched Texts)
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
7
Public
Repo size
1.8 GB
Likes
1
Public
Click a slice to open those files.
.safetensors168 MB · 95%
From the Hugging Face model README
Fine-tuned Llama 3 for Sentiment Analysis of Banglish (Bengali-English Code-Switched Texts)
This model is a fine-tuned version of Meta Llama 3 (8B) specifically adapted for sentiment analysis on Banglish, a code-switched mix of Bengali and English frequently used in informal online communication in Bangladesh. Fine-tuning was performed on 11,673 manually curated Banglish sentences, balancing sentiment classes (positive, negative, and neutral). The model outperforms zero-shot capabilities of other state-of-the-art LLMs, making it a strong candidate for handling multilingual, low-resource, and code-mixed language tasks.
| Method | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| Zero-Shot (Llama 3) | 43.80% | 46.68% | 30.00% | 41.67% |
| Zero-Shot (GPT-3.5) | 55.90% | 61.00% | 56.00% | 48.00% |
| Zero-Shot (GPT-4) | 65.15% | 68.00% | 65.00% | 61.00% |
| Zero-Shot (Claude 3.5) | 47.68% | 73.00% | 48.00% | 43.00% |
| Few-Shot (Llama 3) | 49.14% | 52.01% | 49.00% | 48.00% |
| Dual-Phase (Translation + Sentiment) | 48.07% | 49.34% | 48.00% | 48.00% |
| Fine-Tuned (Ours) | 66.87% | 67.00% | 67.00% | 67.00% |
| Ensemble Approach | 66.78% | 66.75% | 66.78% | 66.45% |
This model can be used for Banglish sentiment classification in three categories:
Example Code for Inference:
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("samiur-r/BanglishSentiment-Llama3-8B")
model = AutoModelForCausalLM.from_pretrained("samiur-r/BanglishSentiment-Llama3-8B")
# Example text
text = "Ami onek happy, this is the best day ever!"
# Tokenize input
inputs = tokenizer(text, return_tensors="pt")
# Generate output
output = model.generate(**inputs, max_new_tokens=256)
# Decode output
sentiment = tokenizer.decode(output[0], skip_special_tokens=True)
print("Predicted Sentiment:", sentiment)