Inspiration
Mental health is one of the most pressing challenges in today’s society, yet emotional signals are often hidden in long-form texts—be it user journals, therapy transcripts, or anonymous feedback. My project aims to make these invisible emotions visible.
What it does
I’ve developed an Emotion Classification Web App using FastAPI that:
- Accepts
.csvor.xlsxfiles - Lets users select a column containing text
- Classifies emotions using a fine-tuned BERT model (
ayoubkirouane/BERT-Emotions-Classifier) - Visualizes the results with:
- Bar charts for emotion distribution
- WordClouds per emotion category
- Generates natural language insights using Google Gemini (Generative AI) to analyze each WordCloud’s sentiment patterns and provide an AI-driven summary of emotional trends
How we built it
- Backend: Built with FastAPI for handling file uploads, form inputs, and response rendering
- NLP & Modeling: Used HuggingFace’s Transformers pipeline with a fine-tuned BERT emotion classifier
- Visualization: Matplotlib and Seaborn for bar charts; WordCloud for visualizing keyword prominence per emotion
- Data Cleaning: Leveraged Polars for efficient text preprocessing including emoji removal, stopwords filtering, and token cleaning
- AI Integration: Used Google Gemini to interpret WordClouds and summarize overall emotional patterns
- Frontend: HTML + Bootstrap served from FastAPI routes for clean, interactive user interface
- Static Assets: Plots and WordClouds are saved and served from a
/staticfolder
Challenges we ran into
- Integrating multiple tools (Polars, HuggingFace, FastAPI, Gemini) while maintaining speed and reliability
- Handling diverse text inputs across languages and styles
- Ensuring compatibility across file formats and large datasets
- Keeping the model input length below 512 tokens to avoid truncation issues
Accomplishments that we're proud of
- Delivered an end-to-end emotion classification tool with zero manual labeling
- Created a seamless user experience from upload to visualization to AI analysis
- Integrated Google Gemini to go beyond basic NLP and deliver true insight generation
- Packaged everything into a reproducible and extendable codebase ready for deployment or research
What we learned
- How to streamline NLP pipelines using FastAPI
- How to combine classical visualization with cutting-edge generative AI
- The power of LLMs to derive contextual sentiment beyond surface-level metrics
- Advanced text preprocessing techniques with Polars and Python regex
What's next for Emotion Analyzer Web App
- Add support for real-time streaming input (e.g., chat logs, journaling apps)
- Implement user authentication and save analysis history
- Integrate more advanced LLMs for personalized emotion intervention suggestions
- Deploy on cloud platforms for broader accessibility and mobile access
Log in or sign up for Devpost to join the conversation.