Views
No views yet
| 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% |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3# Load tokenizer and model
4tokenizer = AutoTokenizer.from_pretrained("samiur-r/BanglishSentiment-Llama3-8B")
5model = AutoModelForCausalLM.from_pretrained("samiur-r/BanglishSentiment-Llama3-8B")
6
7# Example text
8text = "Ami onek happy, this is the best day ever!"
9
10# Tokenize input
11inputs = tokenizer(text, return_tensors="pt")
12
13# Generate output
14output = model.generate(**inputs, max_new_tokens=256)
15
16# Decode output
17sentiment = tokenizer.decode(output[0], skip_special_tokens=True)
18print("Predicted Sentiment:", sentiment)