This project analyzes Reddit posts from mental health subreddits to identify patterns, trends, and insights that could help understand mental health discussions online. Using advanced natural language processing, machine learning techniques, and data visualization, we classify posts into different mental health categories and extract meaningful insights from user discussions.
- Data Collection: Gathered posts from various mental health subreddits
- Data Pre-processing: Clean, normalize, and prepare text data for analysis
- Feature Engineering: Extract meaningful features from post text using NLP techniques
- Semantic Sampling: Intelligently sample large datasets while preserving their semantic and temporal distribution
- Text Classification: Categorize posts into different mental health topics
- Advanced Visualization: Analyze patterns, trends, and distributions in the dataset
- Model Evaluation: Rigorous assessment of classification performance
Our analysis focuses on several key mental health topics including:
- Drug and Alcohol related discussions
- Existential/Life concerns
- Psychological Factors
- Temporal/Situational issues
- Python 3.11+
- Required libraries:
pandas numpy scikit-learn matplotlib seaborn sentence-transformers tqdm nltk spacy
- Clone this repository
git clone https://github.com/yourusername/reddit-mental-health-analysis.git
cd reddit-mental-health-analysis- Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- 📥 Data Collection: Reddit posts from mental health subreddits
- 🧹 Pre-processing: Cleaning text, handling missing values, normalization
- 🔍 Feature Extraction: TF-IDF, embeddings, linguistic features
- 🏗️ Model Building: Training classification models
- 📏 Evaluation: Performance metrics, confusion matrices, validation
- 📊 Visualization: Distribution analysis, temporal trends, topic modeling
The project aims to discover:
- Common linguistic patterns in mental health discussions
- How different mental health topics correlate
- Temporal trends in mental health discussions
- Effectiveness of different classification approaches
Contributions to improve the analysis or extend the project are welcome! Please feel free to submit a pull request or open an issue.