Mood Analysis Powered by Azure AI Language Service
Moodify is an intelligent mood analysis application that uses Microsoft Azure's AI Language Service to analyze text input and provide personalized recommendations based on detected emotions. Whether you're journaling, seeking mood insights, or looking for tailored suggestions, Moodify helps you understand and respond to your emotional state.
Try out the app : https://moooodify.streamlit.app/
- Sentiment Analysis: Detect positive, neutral, and negative sentiments with confidence scores
- Key Phrase Extraction: Identify the most important phrases and topics
- Named Entity Recognition: Extract people, places, organizations, and other entities
- Language Detection: Automatically identify the language of your text
- PII Detection: Identify and protect personally identifiable information
- Advanced emotion mapping using keyword analysis and sentiment scores
- Detects: Joy, Sadness, Anger, Fear, Surprise, Disgust, and Neutral states
- Combines Azure AI results with custom emotion classification
Based on your detected emotion, get tailored suggestions for:
- 🎵 Music Suggestions: Music recommendations to improve your mood
- 📚 Inspirational Quotes: Motivational and relevant quotes
- 🏃 Activities: Suggested actions to help process or enhance your emotional state
- Python 3.8 or higher
- Azure for Students Subscription
- Required Python packages (see requirements below)
-
Clone the repository
git clone https://github.com/saishagoel27/moodify cd moodify
-
Install dependencies
pip install streamlit azure-ai-textanalytics python-dotenv
-
Set up Azure credentials
Create a
.env
file in the project root:AZURE_LANGUAGE_ENDPOINT="your_azure_endpoint_here" AZURE_LANGUAGE_KEY="your_azure_key_here"
To get these credentials:
- Go to Azure Portal
- Create your Language Service resource
- Copy the endpoint and key from the "Keys and Endpoint" section
-
Run the application
streamlit run main.py
-
Open your browser Navigate to
http://localhost:8501
to start using Moodify!
- Enter your text: Describe your mood, feelings, or experiences in the text area
- Choose recommendation type: Select whether you want song, quote, or activity suggestions
- Analyze: Click "Analyze Mood" to get comprehensive results
- Explore results: View your detected emotion and browse detailed analysis
- "Today was challenging but rewarding. I completed a major project at work, but I'm feeling anxious about the presentation tomorrow."
- "I'm so excited about my upcoming vacation! Everything is going perfectly."
- "I've been feeling down lately and need some motivation to get back on track."
- Sentiment Analysis: Overall emotional tone detection
- Key Phrase Extraction: Important topics and themes
- Entity Recognition: People, places, and organisations mentioned
- Language Detection: Automatic language identification
- PII Detection: Privacy-focused personal information detection
moodify/
├── main.py # Main Streamlit application
├── azure_service.py # Azure AI Language Service integration
├── config.py # Configuration management
├── emotion_analyzer.py # Emotion detection and mapping
├── recommendations.py # Mood-based recommendation engine
├── test.py # Simple testing script
├── .env # Environment variables (create this)
├── requirements.txt # Python dependencies
└── README.md # This file
Handles all Azure AI Language Service operations including sentiment analysis, key phrase extraction, entity recognition, language detection, and PII detection.
Maps Azure analysis results to specific emotions using keyword matching and sentiment score thresholds.
Provides curated recommendations (music, quotes, activities) based on detected emotions.
Run the simple test script to verify your Azure connection:
python test.py
This project is licensed under the MIT License - free to use and modify
Try Moodify with these sample texts:
Positive Mood:
"I just got promoted at work! I'm so grateful for this opportunity and excited about the new challenges ahead."
Mixed Emotions:
"Moving to a new city is exciting but also nerve-wracking. I'm looking forward to new adventures but worried about leaving friends behind."
Seeking Support:
"I've been struggling with motivation lately. Work feels overwhelming and I'm not sure how to get back on track."
Built with ❤️ using Azure AI and Streamlit
Moodify - Understanding emotions, one text at a time.