Mental Health Sentiment Analysis from Social Media with DistilRoBERTa
Abstract
An NLP study that reads social media posts to detect emotional signals linked to mental health, fine-tuning DistilBERT, DistilRoBERTa, and BETO on a public sentiment corpus across Positive, Neutral, Negative, and Irrelevant classes.
Introduction
Depression and anxiety affect huge numbers of people, yet many never get timely support. Stigma, cost, and limited access to care leave a wide gap between those who are struggling and the help they need.
At the same time, people share their feelings on social media every day, moments of sadness, hope, and frustration posted in real time. This project explores whether software can read those emotional signals responsibly and help spot people who might need support.
Problem Statement
Traditional screening relies on interviews and questionnaires, effective, but slow, costly, and hard to scale. Social media offers another window, but reading emotion from short posts is tricky:
- Everyday language is messy: full of slang: sarcasm, and emoji.
- The same word can mean very different things depending on context.
- Posts fall into several shades of sentiment: not a simple yes/no.
- Any use of this data must support care: never label or stigmatise people.
Objectives
- Sort social posts into a few sentiment categories.
- Compare a few modern language-understanding models on the same posts.
- Explore whether sentiment patterns hint at emotional well-being.
- Clean and prepare the text carefully so models can read it well.
- Judge the models on fair: side-by-side measures.
Dataset
The work is built around a set of labelled social posts. Depending on the client, this can be a public sentiment collection, licensed or private data, posts gathered from other trusted sources, or a custom set assembled for the project. The text is cleaned, tidied, and standardised before modelling, and privacy is respected throughout.
Methodology
The posts are cleaned and prepared, then three language models are trained to sort them by sentiment: DistilRoBERTa, DistilBERT, and BETO. Each is trained and tested the same way so the comparison is fair.
The novelty is applying context-aware language models to short, informal, everyday writing, where tone, sarcasm, and phrasing carry a lot of meaning that simpler methods miss. Handled responsibly, this turns freely shared text into a gentle early-awareness signal, meant to support human care rather than to diagnose anyone.
