Views
No views yet
| Model | Params | SST-2 Accuracy | TweetEval 3-class Macro-F1 |
|---|---|---|---|
| DistilBERT-SST2 | 66M | 91.06% | 36.53% |
| BERT-base-SST2 | 110M | 92.43% | 38.53% |
| Twitter-RoBERTa | 125M | 86.12% | 72.40% ✅ |
| DeBERTa-v3-base | 184M | 96.44% ✅ | 40.64% |
DeBERTa-v3 achieves 96.44% on movie reviews but only 40.64% on real tweets. Twitter-RoBERTa, pre-trained on 124M tweets, achieves 72.40% — nearly 2x better on social media.
├── paper/
│ ├── Social_Media_Sentiment_Analysis_IEEE_v2.pdf # ★ Updated IEEE PDF (6 pages, 5 figures)
│ ├── Social_Media_Sentiment_Analysis_IEEE.pdf # Original version
│ └── ieee_sentiment_paper.tex # LaTeX source
├── figures/
│ ├── fig1_confusion_roberta.{png,pdf} # Confusion matrix: Twitter-RoBERTa
│ ├── fig2_confusion_deberta.{png,pdf} # Confusion matrix: DeBERTa-v3
│ ├── fig3_model_comparison.{png,pdf} # Bar chart: SST-2 vs TweetEval
│ ├── fig4_data_distribution.{png,pdf} # Dataset class distributions
│ └── fig5_per_class_f1.{png,pdf} # Per-class F1 comparison
├── code/
│ ├── comprehensive_eval.py # Full evaluation + figure generation
│ ├── train_sentiment.py # Training pipeline
│ ├── evaluate_models.py # Multi-model evaluation
│ ├── eval_deberta.py # DeBERTa-specific evaluation
│ └── generate_pdf_v2.py # PDF generation with figures
├── results/
│ ├── comprehensive_results.json # TweetEval + SST-2 results
│ └── eval_results.json # Initial SST-2 results
└── README.md| Dataset | Domain | Samples | Classes | Source |
|---|---|---|---|---|
| TweetEval Sentiment | Real tweets | 12,284 test | 3 (neg/neutral/pos) | cardiffnlp/tweet_eval |
| SST-2 | Movie reviews | 872 val | 2 (neg/pos) | stanfordnlp/sst2 |
1# Best for social media sentiment:
2from transformers import pipeline
3classifier = pipeline("sentiment-analysis",
4 model="cardiffnlp/twitter-roberta-base-sentiment-latest")
5result = classifier("Love this new feature! #excited")
6print(result) # [{'label': 'positive', 'score': 0.97}]
7
8# Best for formal text sentiment:
9classifier_formal = pipeline("text-classification",
10 model="cliang1453/deberta-v3-base-sst2")
11result = classifier_formal("This movie was absolutely brilliant")
12print(result) # [{'label': 'positive', 'score': 0.99}]1@inproceedings{vivan2026sentiment,
2 title={Transformer-Based Social Media Sentiment Analysis: A Comprehensive Evaluation on Real Tweet Data},
3 author={Vivan, Raj},
4 year={2026},
5 note={Available at: https://huggingface.co/rajvivan/social-media-sentiment-analysis-paper}
6}