All projects

UMass Amherst · 2026

What People Say About Mental Health on Reddit

I collected about 26,000 posts and comments from three mental health subreddits, then compared how three sentiment tools and three classifiers read them. The code and data are all in the repo.

Context
UMass Amherst
Year
2026
Method
Python

I built this to see what people actually talk about in online mental health communities. It's also the easiest project to check: the repository has the collection script, the raw and scored data, the model results and the dashboard.

I used the Reddit API to collect 6,398 posts and 19,488 comments from r/Anxiety, r/depression and r/mentalhealth, then scored every item with three sentiment methods: VADER, TextBlob and a HuggingFace transformer. I used three because lexicon-based tools and fine-tuned models often disagree on text this personal, and I wanted to see where.

Then I trained three classifiers on TF-IDF features. Logistic regression and the random forest tied at 91.25% accuracy (0.871 F1), and the linear SVM came in at 90.63% (0.868 F1). Those results are close enough that which model you pick matters less than what the labels actually capture.

The most interesting result came from the topic modeling. Most of the topics that came out weren't about mental health directly. They were about money, housing, politics and social media.

Classifier comparison, TF-IDF features. Figures are in ml_model_results.csv in the repo.
ModelAccuracyPrecisionRecallF1
Logistic Regression0.91250.83270.91250.8708
Random Forest0.91250.83270.91250.8708
Linear SVM0.90630.83220.90630.8676

Tools & methods

  • Python
  • PRAW
  • scikit-learn
  • NLTK VADER
  • Transformers
  • Plotly Dash