Skip to content

NBPub/SimilarArtistMap

Repository files navigation

Similar Artist Map

Visualize similar artist maps for musical artists in your library.

  • hosted on render, deployed by Gunicorn
    • --workers=2
    • speed may be limited by free tier hosting, can workers/threads be optimized for performance?
  • source code for site is located on another repository, differences for deployment:
    • define server in Dash app
    • set Debug=False
Screenshot - Widescreen

wide

Screenshot - Tallscreen

tall

Screenshot - Tallscreen, no neighbors

no neighbors

Features

  • Choose an Artist, then view it and its Similar Artists on an interactive network map. See images above.
    • Artists are colored to indicate whether they are in or out of the library. Learn how artists you know are connected, and find other artists to explore.
    • If a Similar Artist also has associated data, it will be added to the map, with the option to add even more similar artists: add neighbors
  • Information for each connection is provided by hovering over its midpoint.
  • Five network layout options are available, and a sixth, Random, produces a new result each time.

Background

This section describes how data was prepared and visualized for Similar Artist Map. A detailed example is provided in two notebooks.

Note that packages were used in the notebooks that are not listed in requirements.txt, as they are not needed for the site's deployment


Data Collection

The data collection process is exemplified in detail in the example notebook. A brief overview is listed below, as well as some challenges.

  1. Gather list of musical artists from a library
  2. Query last.fm API to find up to 10 similar artists for each artist in library
  3. Save matches as JSON file

Some challenges were worked around rudimentarily, and could be improved by using last.fm API's search feature to properly match artists.

  • if an artist was not found and contained + or &, the symbols were replaced by and and the search was tried again
    • a list of alias names were saved to make data selection for graphing easier
    • alias names were not extensively used to determine if a found similar artist was in or out of the library
  • without using last.fm Search, I could not fix queries for obvious artists, and they were not found, ex: Jay-Z
  • some similar artists with a perfect match score, 1, were simply
    • alternate names / alternate representations of names Jay Dee <> J Dilla
    • closely related side-projects MF Doom

Network Mapping using NetworkX

Network Graphs of Artists, Similar Artists, and their match scores were created using NetworkX. Each artist was treated as a node and was connected to each of its similar artists by edges with weights related to match scores. When the networks were drawn, artist nodes were colored:

  • special color for artist of interest
  • another color for artists in library
  • another color for artists not in library

Various network options are discussed and displayed in the example notebook, as well as code for plotting in matplotlib and Plotly. The interactive Plotly figures were easily integrated into the demonstration site, which is a Dash application.

Local Installation

  1. Create and activate a virtual environment in a directory
cd path/to/your/directory
python -m venv venv
. venv/bin/activate # UNIX
venv\Scripts\activate # Windows
  1. Copy source code into your directory

  2. Install requirements via requirements.txt or install packages listed below without version specification

pip install -r requirements.txt
  1. Use sample artist data or generate your own data. Refer to Jupyter Notebooks for guidance. Artist data should be saved in the /artist_data/ directory.

  2. Run Dash application

python -m app

Optional: Delete unneeded files and folders from your directory

Requirements

dependencies of the listed packages are not provided, see requirements.txt for full list of packages installed

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages