Coder Social home page Coder Social logo

themed-party-playlist's Introduction

Themed Party Playlist: Spotify AI

Web application written in Python using flask and deployed on Heroku.

‘Themed Party Playlist’ is a python program that uses NLP (Natural Language Processing) in tandem with the Spotipy and LyricsGenius APIs to create a themed-playlist based on a user-specified keyword (e.g. ‘food’ or ‘technology’). Various NLP tool kits such as GloVe (alongside pytorch) and Top2Vec (a python library that generates jointly embedded document and word vectors) are utilized to train a model that parses lyrics and identifies words that align with the given ‘theme’ or category. For example, if the theme were ‘food’, the program would ideally look for songs that mention words such as ‘hamburger’, ‘taste’, ‘whipped cream’, etc. The user can specify how they want the program to locate songs to analyze (saved songs, most listened to, etc.) through a nifty web interface that provides a visualization of the playlist creation while the code is running, with fun, interactive graphics. Once enough songs are found that match the given theme, the program accesses the user’s Spotify account and create a playlist.

Usage

Web

The application is deployed on the web at: themed-party-playlist.herokuapp.com/. This method of usage is not currently recommended, as the model is too large for the free tier of Heroku to work consistently without exceeding the memory limit. Instead, please use the local version for the full experience.

Local

For local usage, open a terminal and type the following commands:

git clone https://github.com/gabrielle-ohlson/themed-party-playlist.git

cd themed-party-playlist

pip install -r requirements.txt

python app.py

And then visit http://localhost:5000/ to use the app.

It is recommended that you create a virtual environment prior to installing the requirements since the program depends on particular versions of packages (i.e. numpy 1.20.0).

  1. Visit either: themed-party-playlist.herokuapp.com/ or http://localhost:5000/ (depending on your preferred method of usage).
  2. Login to your spotify account by following the login link.
  3. Input specifications for your session:
    • Party theme (e.g. 'animals'): a string denoting the theme/category on which to base the playlist generated by the program.
    • Method for finding songs (e.g. 'top tracks'): the program will use this method to find songs that match the given theme.
    • Condition for stopping the program (e.g. 'song count'): the program will continue adding songs that match the theme until this condition is met.
    • Save as (e.g. 'animals party'): the name of your AI-generated spotify playlist.
    • Training time ('e.g. 5 minutes'): how much time you're willing to allocate to training the model.
  4. Press the submit! button when you're ready.
  5. After the NLP models are loaded and you've hit submit, you will be presented with related terms to your theme. You can opt to include a number of these synonyms in the data used for finding songs that match your theme by checking the given terms. Submit when you're done.
  6. You will be redirected to the create-playlist page. Watch as the albums are removed/added to the bookshelf in the interactive visualization as your playlist is being built!
  7. Finally, when the model is done, you will see the header: Playlist created and the record in the interface will stop spinning. Check your spotify account to see the generated playlist.

Setup Notes

Dependencies are manage with an anaconda virtual environment and the pypi package oip-tools. After creating a 'requirements.in' file, we run the following commands:

$ pip-compile requirements.in #creates a requirements.txt file

$ pip-sync #updates virtual env accordingly (installing all packages listed in requirements and uninstall all others)

themed-party-playlist's People

Contributors

gabrielle-ohlson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.