Skip to content

krishmishraghub/Project-Hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Navigate to the backend directory:
cd backend
  1. Create a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the server:
python main.py

The API will be available at http://localhost:8000

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

The app will be available at http://localhost:3000

Usage

  1. Start both the backend and frontend servers
  2. Open the web app in your browser
  3. Enter or paste text (journal entries, chat messages, etc.)
  4. Select the source type (Journal or Chat)
  5. Click "Analyze Emotions" to get:
    • Emotional pattern analysis
    • Sentiment breakdown
    • Stress indicators
    • Wellness score
    • Personalized wellness suggestions
  6. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors