The project has been refactored for improved modularity and maintainability:
main.py: Main script that orchestrates the entire applicationdata_processing.py: Handles data loading and initial processingrecommendation.py: Core recommendation enginechatbot_interface.py: Manages the Gradio-based chatbot interface
- Personalized song recommendations based on user input
- Interactive chatbot interface for music discovery
- Integration with Spotify API for up-to-date song information
- Natural language processing for understanding user queries
- Comprehensive music recommendation system based on song similarities
- Clone the repository:
git clone https://github.com/your-username/fizy_muzik_onerme.git cd fizy_muzik_onerme - Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` - Install required dependencies:
pip install -r requirements.txt - Set up the .env file:
- Create a file named
.envin the root directory of the project - Obtain Spotify API credentials:
a. Go to https://developer.spotify.com/ and log in or create an account
b. Create a new application to get your
client_idandclient_secret - Add your Spotify API credentials to the
.envfile in the following format:SPOTIFY_CLIENT_ID=your_client_id_here SPOTIFY_CLIENT_SECRET=your_client_secret_here - Keep your
.envfile secure and never share it publicly - Note: The
.envfile is crucial for the project to interact with the Spotify API
- Create a file named
-
Obtain Spotify API credentials:
- Create a Spotify Developer account at https://developer.spotify.com/
- Create a new application to get your
client_idandclient_secret - Add these credentials to your
.envfile as described in the installation steps
-
Prepare your data:
- Place the Spotify dataset CSV files in the
./data/directory - Ensure you have
data.csv,data_by_genres.csv, anddata_by_year.csv
- Place the Spotify dataset CSV files in the
-
Run the main script:
python main.py -
The script will perform the following actions:
- Load and process the data
- Launch the Gradio interface
-
Open the provided Gradio interface URL in your web browser
-
Interact with the chatbot:
- Enter song names (optionally with years) for recommendations
- Ask general music-related questions
- Explore recommended songs and their features
- pandas, numpy: Data manipulation and analysis
- scikit-learn: Machine learning algorithms for preprocessing
- spotipy: Spotify API integration
- gradio: Web interface for the chatbot
- transformers, torch: Natural language processing for the chatbot
The project uses the Spotify dataset available on Kaggle. You can find more information about the original dataset here.
This project is continuously evolving. Future plans include:
- Enhanced chatbot integration for a more intuitive user experience
- Improved recommendation algorithms incorporating user feedback
- Extended genre and mood-based recommendations
- Integration with more music streaming platforms
While the main functionality of song_recommendation repo focuses on the chatbot interface and music recommendations, the project originally included various data visualization features that may be of interest to researchers in the field of music information retrieval and recommendation systems.
These visualization features, although not part of the main chatbot functionality, can provide valuable insights into music trends, genre characteristics, and the underlying structure of the dataset. They include:
- Distribution of songs across decades
- Evolution of sound features over time
- Top genres based on popularity
- Feature correlation with song popularity
- Clustering of genres and songs
Researchers interested in exploring these visualizations can refer to the visualization.py and clustering.py files in the project repository. These modules contain functions for creating various plots and performing clustering analyses.
To use these visualization features:
- Ensure you have the necessary additional dependencies installed (matplotlib, seaborn, plotly, yellowbrick)
- Import the required functions from
visualization.pyandclustering.py - Call these functions with the processed dataset to generate visualizations
Please note that these visualization features are optional and separate from the main recommendation system. They are provided for research purposes and to offer a deeper understanding of the dataset and the factors influencing music popularity and recommendations.
Contributions to improve fizy_muzik_onerme are welcome. Please feel free to submit pull requests or open issues to discuss potential enhancements.
[MIT]
- Original Kaggle project by Vatsal Mavani
- Spotify API for providing music data
- Gradio for the web interface framework
- The open-source community for various libraries and tools used in this project