Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Song Recommender

A professional Streamlit-based collaborative recommendation application that trains a Word2Vec model on song sequences. The system supports raw text files containing token sequences, as well as CSV exports directly from Spotify playlists. It automatically cleans and maps metadata (Song Name, Singer/Artist) into dense embeddings to provide accurate, real-time song recommendations.

Live Application: musicrecommendersystem.streamlit.app


Features

  • Multi-Format Support: Ingests playlist data in .txt (space/comma delimited) or standard Spotify .csv formats.
  • Auto-Cleaning & Mapping: Automatically detects Spotify CSV exports, cleans, and narrows the attributes to song_id (serial ID), song_name, and singer.
  • Live Data Preview: Inspect the raw playlist structures and generated token mappings directly in the Streamlit UI before initiating training.
  • Word2Vec Collaborative Filtering: Implements real-time embedding training using Word2Vec with interactive hyperparameters (Vector Size, Context Window, and Minimum Token Count).
  • Proper Metadata Recommendations: Filters model output to return only song items and maps recommendation scores back to readable song names and artists.

Exporting Spotify Playlist Data (via Exportify)

To get your personal Spotify playlists into the system, you can extract the tracks using Exportify:

  1. Visit Exportify in your web browser.
  2. Click "Get Started" and authenticate with your Spotify account credentials.
  3. Once logged in, a list of your personal playlists will be displayed.
  4. Click "Export" next to the desired playlist to download its .csv file.
    • Exportify outputs columns such as Track URI, Track Name, and Artist Name(s) which this recommender parses and cleans automatically.

Project Structure

02Chapter/
├── README.md                   # Project documentation and guide
├── requirements.txt            # Python dependencies (pandas, gensim, streamlit, etc.)
├── app.py                      # Main Streamlit web application
├── src/
│   └── recommender/
│       ├── __init__.py         # Recommender package initialization
│       ├── data_io.py          # Data loaders, filters, and Spotify CSV parsers
│       └── model.py            # Word2Vec training wrapper and recommendation filters
└── tests/
    └── main.ipynb              # Notebook demonstrating large-scale training pipelines

Setup & Local Installation

  1. Clone the repository and navigate to the project root:

    cd 02Chapter
  2. Create and activate a virtual environment:

    python -m venv .venv
    # On Windows (PowerShell):
    .venv\Scripts\Activate.ps1
    # On macOS/Linux:
    source .venv/bin/activate
  3. Install the dependencies:

    pip install -r requirements.txt

Running the Web App

Start the Streamlit interface locally:

streamlit run app.py

Data Pipeline Flow

[Upload Spotify CSV / TXT] ➔ [Detect Columns & Extract Track details] ➔ [Generate Serial IDs]
                                                                                │
[Render Recommendations] 🗠 [Query Similarity Engine] 🗠 [Train Word2Vec] ➔ [Preview Data]

Advanced Usage

To run validation checks or experiment with larger datasets (e.g., training with the yes_complete training corpus), inspect the notebooks inside the tests/ folder.

About

A professional Streamlit-based collaborative recommendation application that trains a Word2Vec model on song sequences. The system supports raw text files containing token sequences, as well as CSV exports directly from Spotify playlists.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages