Inspiration:
People are using social media in their day-to-day lives, where they express their thoughts. Alongside sharing achievements or good moments, they also express stress, anxiety, and frustration through everyday posts. Yet, such posts are widely present across social media platforms, in a very unstructured way, and are difficult to interpret. While NLP models can effectively detect emotions, there remains a gap in transforming these signals into measurable indicators of stress. Thus, we got inspired by a key question: Can we convert everyday text into a quantifiable signal of community stress? At scale, this kind of approach can help identify broader stress patterns across communities, enabling early awareness and more informed responses.
What it does:
'Community Stress Tracker AI' converts unstructured text into structured stress insight. Instead of classifying isolated posts, the system focuses on collective patterns, enabling a shift from individual signals to community-level understanding.
- At first, it detects emotional states using a fine-tuned DistilBERT model.
- Then, it maps emotions into numerical stress scores based on their severity level.
- Furthermore, it aggregates multiple inputs into an estimate of community-level stress.
- Finally, it gives an interpretable output level (Low/Medium/High). Unlike traditional approaches that stop at emotional classification, this system converts predictions into measurable, aggregated stress indicators.
How we built it:
Our proposed pipeline follows:
Social Media Text + Labels
⏷
Data Formation (Preprocessing)
⏷
DistilBERT
⏷
Emotion Classification
_(Suicidal, Depressed, Anxious, Frustrated, Others)_
⏷
Stress Scoring (1-5)
⏷
Aggregation (average stress score across posts)
⏷
Normalization
⏷
Final Stress Level
_(Low Stress / Medium Stress / High Stress)_
The model was evaluated using Macro F1-Score as the primary evaluation metric, ensuring reliable and balanced performance across imbalanced classes.
To make the stress score more interpretable, we scaled it from the original 1-5 range to a 0-10 scale. This helps present the results more intuitively and allows for easier comparison across different inputs.
$$ \text{Normalized Score} = \frac{\text{Score} - 1}{5 - 1} \times 10 $$
This normalized value is then used to assign the final stress level (Low, Medium, or High).
In short, our pipeline processes raw text using a fine-tuned DistilBERT transformer model for emotion classification, then maps predictions to stress scores, aggregates them across posts, and normalizes the result to produce a clear community-level stress indicator. The key idea lies in combining classification with aggregation, allowing individual predictions to be transformed into a meaningful community-level signal.
Impact:
This work contributes to SDG 3 (Good Health and Well-being) by enabling the measurement and analysis of mental health-related signals, supporting awareness and informed decision-making at the community level.
Challenges we ran into:
- Class Imbalance in the dataset
- Noisy texts (emoji, emoticon, slang, mentions)
- Going beyond classification
Accomplishments of 'Community Stress Tracker AI':
- Handled the class imbalance through a class balancing strategy, 'class-weights.'
- Applied robust preprocessing to overcome the noisy text.
- Designed a batch-based aggregation strategy for community-level stress estimation.
- Focused on measurable signals instead of direct intervention.
- Successfully deployed the model as an interactive Streamlit app for real-time stress assessment.
What we learned:
NLP is not just classification; it's about representation and interpretation. Combining classification with aggregation can turn simple predictions into meaningful insights.
What's next for 'Community Stress Tracker AI':
- Add temporal trend detection (track stress over time).
- Integrate real-time data sources.
- Improve interpretability of predictions.
- Extend to multilingual data.
Built With
- distilbert
- hugging-face-transformers
- numpy
- pandas
- python
- pytorch
- scikit-learn
- streamlit
Log in or sign up for Devpost to join the conversation.