Emotion & Wellness Analyzer
An AI-powered tool that analyzes text input (journals, chats) to detect emotional patterns and suggest personalized wellness actions. Built to help identify early signs of stress or burnout.
Features
- Emotion Detection: Analyzes text for multiple emotions (anxiety, sadness, anger, joy, fear, etc.)
- Sentiment Analysis: Provides detailed sentiment scores (positive, negative, neutral)
- Stress Indicator Detection: Identifies keywords and patterns indicating stress or burnout
- Wellness Scoring: Calculates an overall wellness score (0-100) based on emotional patterns
- Personalized Suggestions: Provides actionable wellness recommendations based on analysis
- Pattern Tracking: Visualizes emotional patterns and trends over time
- Modern UI: Beautiful, responsive web interface
Tech Stack
Backend
- FastAPI: Modern Python web framework
- NLTK: Natural language processing
- TextBlob: Sentiment analysis
- VADER Sentiment: Valence Aware Dictionary and sEntiment Reasoner
Frontend
- React: UI framework
- Vite: Build tool
- Recharts: Data visualization
- Lucide React: Icons
Setup Instructions
Backend Setup
- Navigate to the backend directory:
- Create a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the server:
The API will be available at http://localhost:8000
Frontend Setup
- Navigate to the frontend directory:
- Install dependencies:
- Start the development server:
The app will be available at http://localhost:3000
Usage
- Start both the backend and frontend servers
- Open the web app in your browser
- Enter or paste text (journal entries, chat messages, etc.)
- Select the source type (Journal or Chat)
- Click “Analyze Emotions” to get:
- Emotional pattern analysis
- Sentiment breakdown
- Stress indicators
- Wellness score
- Personalized wellness suggestions
- View patterns over time in the visualization section
API Endpoints
POST /analyze - Analyze text for emotions and wellness
GET /history - Get analysis history
GET /patterns - Get emotional patterns over time
DELETE /history - Clear analysis history
Example Analysis
Input text:
"I've been feeling really overwhelmed lately with all the deadlines.
I can't seem to catch up and I'm constantly anxious about everything.
I haven't been sleeping well and I feel exhausted all the time."
The tool will detect:
- High anxiety levels
- Multiple stress indicators (overwhelmed, exhausted, anxious)
- Negative sentiment
- Low wellness score
- Provide suggestions like breathing exercises, taking breaks, and sleep hygiene
Project Structure
.
├── backend/
│ ├── main.py # FastAPI application
│ ├── emotion_analyzer.py # Emotion detection logic
│ ├── wellness_suggestions.py # Wellness suggestion engine
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── App.jsx # Main app component
│ │ └── main.jsx # Entry point
│ ├── package.json # Node dependencies
│ └── vite.config.js # Vite configuration
└── README.md
Future Enhancements
- Machine learning models for more accurate emotion detection
- Integration with journaling apps
- Mobile app version
- Export analysis reports
- Reminder notifications for wellness activities
- Integration with calendar for scheduling wellness activities
License
MIT License