Inspiration
For a long time, I’ve been fascinated by the subtle power of words, particularly how people express themselves on social media. We live in a world where emotions are poured into tweets, status updates, and posts—often without anyone realizing the depth of what’s being shared. In just 280 characters, people can convey happiness, frustration, anxiety, or even deep despair. But in the noise of the digital world, it’s easy to overlook the signs of emotional fragility.
I started noticing patterns in how people, including friends and family, would tweet. Sometimes their posts would shift from lighthearted comments to something darker, more subtle cries for help. And, like so many others, I saw how easy it was to miss the moment when someone’s emotional state turned fragile. There was always a feeling of “if only we had known sooner.”
What it does
SentinelEmotion is an AI-driven tool designed to detect shifts in emotional well-being through the analysis of social media activity, specifically tweets. By using advanced natural language processing (NLP) and sentiment analysis, the system monitors a user’s last 100 tweets and identifies subtle changes in their emotional state over time.
How we built it
The foundation of the system relies on natural language processing (NLP) models from Hugging Face, particularly the “j-hartmann/emotion-english-distilroberta-base” model, which is fine-tuned to analyze emotions from tweets.
The process involved several key steps:
Data Collection and Preprocessing: We gathered a dataset of tweets, labeling them with positive and negative sentiments. This served as our training data to fine-tune the model for our specific use case. Model Fine-Tuning: Using PyTorch, we adapted the pretrained emotion detection model to recognize and classify tweets as either positive or negative. We also mapped complex emotions like joy, anger, or sadness to simplified categories (positive/negative) based on their emotional polarity. Sentiment Analysis Pipeline: We implemented a system that analyzes the last 100 tweets from a user, identifying the dominant emotional trends and detecting patterns that could indicate an emotional shift toward a fragile state. Evaluation and Feedback: We used a variety of metrics like accuracy, precision, recall, and F1 scores to evaluate the performance of the model. This ensured that our system could reliably predict when a user’s emotional well-being might be in a delicate state. We leveraged cloud platforms like AWS Sagemaker to handle the training process, making sure it could be scalable and efficient. We integrated the emotion analysis pipeline with Twitter’s API to make it easy to gather real-time data and monitor users' emotional states over time.
Challenges we ran into
Building EmotionScope came with its fair share of challenges:
Emotional Complexity: One of the biggest challenges was simplifying the broad range of human emotions into positive and negative categories. While emotions are complex and nuanced, for the sake of practical analysis, we had to develop an efficient emotion-to-polarity mapping system that still preserved the core emotional meaning.
Data Limitations: Although we had access to a rich dataset of tweets, finding labeled data for emotional states proved difficult. This required careful curation of the data, and we also had to manually label tweets when pre-labeled data wasn’t available.
Model Fine-Tuning: Fine-tuning the pretrained emotion detection model to suit our specific use case took multiple iterations. Ensuring the model captured the nuances of different emotional expressions within 280 characters was especially tricky.
Built With
- jupyter
- python
- sklearn
- torch
Log in or sign up for Devpost to join the conversation.