CoolFace
Modelpublic

spacesedan/reddit-sentiment-analysis-longformer

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes171downloads
Model Card

library_name: transformers tags:

  • autotrain
  • text-classification base_model: spacesedan/autotrain-iz7hp-zi6ki widget:
  • text: "I love AutoTrain" datasets:
  • spacesedan/goemotions-5point-sentiment ---

5-Point Sentiment Classifier (Longformer) — by spacesedan

A fine-tuned Longformer model for 5-point sentiment classification, optimized to analyze long-form user-generated content like Reddit posts. This model is ideal for understanding nuanced sentiment across a spectrum from very negative to very positive.


Labels

Label IndexSentiment
0Very Negative
1Negative
2Neutral
3Positive
4Very Positive

Datasets Used

This model was fine-tuned using a combination of diverse and reliable datasets:

  1. 1.[GoEmotions](https://huggingface.co/datasets/go_emotions) by Google → Converted 27 emotion labels into a 5-point sentiment scale.
  1. 1.[Amazon Reviews (fine-grained)](https://huggingface.co/datasets/yassiracharki/Amazon_Reviews_for_Sentiment_Analysis_fine_grained_5_classes) → Large-scale consumer review dataset with fine-grained sentiment labels.
  1. 1.[Kaggle: Twitter and Reddit Sentimental Analysis Dataset](https://www.kaggle.com/datasets/charangowda/twitter-and-reddit-sentimental-analysis-dataset) → Adapted into a 3-class and eventually 5-class format for compatibility.

Training Configuration

SettingValue
Model BaseLongformer (4096)
Max Sequence Length1024 tokens
Epochs4
Batch Size8
Gradient Accumulation4
Optimizeradamw_torch
Learning Rate2e-5
SchedulerLinear
Mixed PrecisionFP16
Weight Decay0.01
Warmup Proportion0.1
Early Stoppingpatience=5, threshold=0.01

Final Evaluation Metrics

MetricScore
Accuracy0.671
F1 Score (Macro)0.642
F1 Score (Weighted)0.673
Precision (Macro)0.642
Recall (Macro)0.646
Loss0.882

Use Cases

  • Tracking sentiment across Reddit posts, especially for news or trending headlines.
  • Analyzing long-form product reviews.
  • Building a sentiment dashboard for user forums or blogs.

Limitations

  • Model is trained on English text only.
  • Sentiment can be subjective, especially across edge cases (e.g., sarcasm or dark humor).
  • 5-class mapping from GoEmotions is heuristic and might introduce some overlap.

Acknowledgements

Special thanks to the original dataset creators:

  • Google (GoEmotions)
  • Yassir Acharki (Amazon Reviews fine-grained)
  • Charan Gowda et al. (Kaggle Reddit/Twitter Sentiment Dataset)

License

This model is available under the same license as the base model (Longformer) and is intended for research and educational use.


✅ Created and maintained by spacesedan