MoodSync is an intelligent music recommendation system that suggests songs from your own Spotify playlists based on the mood detected in the text you provide. By leveraging sentiment analysis and learning from your feedback, MoodSync creates a personalized listening experience that adapts to your emotional state and preferences over time.
- Input Your Mood: Enter a text describing how you feel (e.g., "I feel happy and energetic today!").
- Mood Detection: The app uses advanced sentiment analysis (powered by transformer models and keyword matching) to classify your mood into categories like Upbeat, Calming, Melancholy, Romantic, Motivational, Intense, or Focused.
- Personalized Recommendations: Songs are recommended from your Spotify library and recently played tracks that best match your detected mood.
- Interactive Feedback: For each recommendation, you can provide feedback (Like, Dislike, Skip). If you dislike a song for a specific mood, MoodSync learns not to suggest it again in similar situations, improving recommendations over time.
- Continuous Learning: The system updates your preferences, tracks your feedback, and adapts future recommendations based on your evolving musical tastes and moods.
- Spotify Integration: Connects to your Spotify account to access your playlists, saved tracks, and listening history.
- Sentiment & Mood Analysis: Uses NLP models (transformers, BERTweet) and custom keyword mapping for robust mood detection.
- Adaptive Learning: Remembers your feedback for different moods and avoids recommending disliked tracks in the future.
- User Preferences Storage: Stores your mood-song preferences locally for fast and private adaptation.
- Dashboard: Intuitive Streamlit dashboard with embedded Spotify player, audio feature visualization, and easy feedback buttons.
- Privacy-First: All user preferences are stored locally; your Spotify credentials are managed securely with
.envvariables.
- Python (core language)
- Streamlit (interactive dashboard)
- Transformers (
transformers,torch) - Spotipy (Spotify Web API integration)
- Gradio (optional for alternative UI)
- Pandas, Numpy (data handling)
- python-dotenv (environment variable management)
See requirements.txt for full package versions.
app.py— Main Streamlit dashboard and app logicutils/mood_analyzer.py— Mood detection and sentiment analysisspotify_helper.py— Spotify API integration and track filteringuser_preferences.py— User feedback management and learning
user_preferences.json— Stores user feedback and preferences.env— Spotify API credentials (not included in repo)static/— For dashboard images and resources
- Clone the repo
git clone https://github.com/krishaga/moodsync_project.git cd moodsync_project - Install dependencies
pip install -r requirements.txt
- Set up Spotify API credentials
- Create a
.envfile in the project root:SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret SPOTIFY_REDIRECT_URI=http://localhost:8080
- Create a
- Run the app
streamlit run app.py
MoodSync — Personalized music for every mood.
