Transform your SMS conversations into personalized Spotify playlists using Natural Language Processing and emotion analysis.
Relaylist analyzes the emotional landscape of your text conversations and generates music recommendations that match the mood and energy of your chats. Using advanced NLP techniques and the Spotify API, it bridges the gap between conversational sentiment and musical expression.
- Emotion Detection: Identifies joy, sadness, anger, fear, surprise, and neutral emotions
- Sentiment Analysis: Tracks emotional polarity and trends over time
- Topic Modeling: Extracts key themes and conversation patterns
- Temporal Analysis: Discovers messaging patterns by hour and day
- Spotify Integration: Generates personalized playlists based on conversation mood
- Multiple Preference Methods: Genre selection, Spotify profile sync, or artist/track seeds
https://relaylist.streamlit.app (Pseudo data is included in the pasuedo_data folder in main, additionally song suggestion function will not work, link is just for app UI/UX and model analysis demo, please obtain own API key and run locally for song suggestion function)
User SMS Export → File Parser → NLP Analyzer → Emotion Mapper → Spotify API → Playlist
↓
Music Preferences ← User Input
- Frontend: Streamlit with custom Spotify-inspired UI
- NLP: NLTK, TextBlob for sentiment analysis
- Music API: Spotify Web API via Spotipy
- Database: SQLite for session storage
- Visualization: Plotly for interactive charts
- Python 3.8 or higher
- Spotify Developer Account
- SMS conversation export in CSV format
- Clone the repository
git clone https://github.com/yourusername/relaylist.git
cd relaylist- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Set up Spotify API credentials
Create a .env file in the root directory:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
SPOTIFY_REDIRECT_URI=http://localhost:8501/callbackSee API Setup Guide for detailed instructions.
- Run the application
streamlit run Home_Page.pyYour SMS export should contain these columns: (You can get the exports via a SMS Backup & Restore mobile app) (Pseudo data provided for testing purposes)
| Column | Description | Example |
|---|---|---|
| Type | Message direction | "Sent" or "Received" |
| Date | Timestamp | "9/1/2024 10:54" |
| Name / Number | Contact info | "John Doe (+15551234567)" |
| Sender | Sender name | "John Doe" or empty for sent |
| Content | Message text | "Hey, how are you?" |
- Upload: Export your SMS conversation and upload the CSV file
- Analyze: View emotional insights, sentiment trends, and conversation patterns
- Preferences: Set your music taste via genres, Spotify profile, or seed tracks
- Discover: Get personalized playlist recommendations
relaylist/
├── models/ # Core NLP and recommendation algorithms
├── services/ # External API integrations (Spotify)
├── utils/ # Helper functions and utilities
├── pages/ # Streamlit page components
└── styles/ # Custom CSS styling
Emotions are mapped to Spotify audio features:
- Joy: High valence (0.6-1.0), moderate-high energy
- Sadness: Low valence (0.0-0.4), low energy, acoustic
- Anger: Low valence, high energy (0.7-1.0), loud
- Surprise: Moderate-high valence and energy
- Neutral: Balanced features
- Tokenization (NLTK)
- Emotion keyword matching
- Sentiment polarity analysis (TextBlob)
- Topic extraction via frequency analysis
- Temporal pattern recognition
- Support for WhatsApp exports
- Real-time conversation analysis
- Collaborative playlist generation
- Export to Apple Music
- Advanced topic modeling with LDA
- Emotion tracking dashboard
- Multi-language support
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Spotify Web API for music data
- NLTK and TextBlob for NLP capabilities
- Streamlit for the web framework
- The open-source community
Gordon - gordonbie2@gmail.com
Project Link: https://github.com/GordonBie123/relaylist
- All conversation data is processed locally
- No messages are stored on external servers
- Spotify authentication uses OAuth 2.0
- Session data stored in local SQLite database
- See Privacy Policy for details
Built with 💚 using Python, NLP, and Spotify API