Welcome to SpotGPT, the ultimate music recommendation system that leverages the power of Spotify API, Retrieval-Augmented Generation (RAG), and Streamlit to provide you with personalized music recommendations like never before. This isn't just another music recommendation system; it's a sophisticated integration of cutting-edge technologies designed to enhance your music discovery experience.
SpotGPT is designed to help you find new music based on your queries. Simply enter the name of any artist and describe the kind of music you're in the mood for, and SpotGPT will do the rest. By harnessing the power of the Spotify API, we fetch real-time data on artists and their tracks, while our RAG system ensures that the recommendations are both relevant and unique.
- Artist-Agnostic Recommendations: Get music recommendations for any artist you like.
- Spotify Integration: Uses Spotify API to fetch up-to-date track data.
- Advanced Natural Language Processing: Employs Sentence Transformers and GPT-2 for natural and context-aware recommendations.
- Interactive User Interface: Built with Streamlit for an engaging and easy-to-use interface.
- Dynamic Data Retrieval: Continuously retrieves and updates track information for accurate recommendations.
- Educational Value: An excellent project for beginners to understand and implement Retrieval-Augmented Generation (RAG) in a real-world application.
- Programming Language: Python
- APIs: Spotify API
- Machine Learning: Sentence Transformers, GPT-2, FAISS
- Framework: Streamlit
- Environment Management: dotenv
Follow these steps to set up SpotGPT on your local machine:
-
Clone the Repository
git clone https://github.com/your-username/spotgpt.git cd spotgpt
-
Create a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Set Up Environment Variables
- Create a
.env
file in the root directory. - Add your Spotify API credentials:
SPOTIPY_CLIENT_ID=your_spotify_client_id SPOTIPY_CLIENT_SECRET=your_spotify_client_secret
- Create a
-
Run the Application
streamlit run main.py
- Start the Application: Run the command
streamlit run main.py
. - Enter Artist Name: In the input field, type the name of the artist you're interested in.
- Submit Your Query: Provide a description of the type of songs you want to hear.
- Get Recommendations: SpotGPT will fetch and display the recommended tracks based on your input.
SpotGPT uses the Spotify API to fetch detailed information about artists, albums, and tracks. This ensures that the data is always current and relevant.
The core of SpotGPT's recommendation system is based on RAG, which combines retrieval of relevant information with powerful language generation models. Here's a breakdown:
- Data Retrieval: Using the Spotify API, SpotGPT retrieves tracks and their metadata for the specified artist.
- Embedding Creation: Sentence Transformers generate embeddings for each track, capturing the essence of the song's description.
- FAISS Indexing: Embeddings are indexed using FAISS to enable fast and accurate similarity searches.
- Contextual Generation: GPT-2 generates personalized recommendations based on the retrieved tracks and user query.
spotGPT.working.mp4
The entire user experience is crafted using Streamlit, making it easy to interact with SpotGPT and receive recommendations in real-time.
We welcome contributions from the community! If you'd like to contribute to SpotGPT, please follow these steps:
- Fork the Repository
- Create a Branch
git checkout -b feature/your-feature-name
- Commit Your Changes
git commit -m 'Add some feature'
- Push to the Branch
git push origin feature/your-feature-name
- Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
With SpotGPT, dive into the world of music like never before. Discover, listen, and enjoy the tunes that resonate with your unique taste, powered by the synergy of Spotify's vast library and the intelligence of modern NLP models. This project is also an excellent opportunity for beginners to get hands-on experience with RAG and build a practical application using state-of-the-art technologies.