A content-based music recommendation web app that suggests similar songs based on lyrical content. This project leverages natural language processing and cosine similarity to help users discover new music that resonates with their favorite tracks.
- Enter a song name to get top 20 similar song suggestions.
- Content-based filtering using TF-IDF and cosine similarity.
- Responsive and stylish UI powered by Bootstrap.
- Preprocessed song lyrics from a Kaggle dataset.
This system uses a content-based filtering approach:
- Clean and preprocess song lyrics (lowercase, remove special characters, stemming).
- Convert lyrics into vectors using TF-IDF Vectorizer.
- Compute cosine similarity between song lyrics.
- Return top N similar songs based on similarity scores.
- Frontend: HTML, Bootstrap 5
- Backend: Flask (Python)
- ML/NLP: Scikit-learn, NLTK
- Data: Kaggle - Songs Recommendation Dataset
-
Clone the repository:
git clone https://github.com/AriyaArKa/Music-Recommendation-System.git cd Music-Recommendation-System
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Download dataset from Kaggle and prepare
df.pkl
andsimilarity.pkl
:from kaggle.api.kaggle_api_extended import KaggleApi api = KaggleApi() api.authenticate() api.dataset_download_files('noorsaeed/songs-recommendation-dataset', path='data/', unzip=True)
-
Run the app:
python app.py
-
Visit
http://127.0.0.1:5000
in your browser.
⚠️ Note: GitHub does not support files larger than 100MB. Make sure yoursimilarity.pkl
anddf.pkl
are under this limit or use Git LFS.
├── app.py
├── df.pkl
├── similarity.pkl
├── static/
│ ├── img.png
│ └── screenshot.png
├── templates/
│ └── index.html
├── data/
│ └── songdata.csv
├── README.md
└── requirements.txt
- Add audio previews using Spotify API.
- Enable fuzzy matching for typos in song search.
- Add user-based collaborative filtering support.
This project is open-source under the MIT License.
🔗 Connect with me on LinkedIn | 🌟 Star the repo if you found it helpful!