Coder Social home page Coder Social logo

shunyaoshih / rl-playlist-generation Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 5.0 14 KB

A RNN-LM-based model for playlist generation with reinforcement learning (ISMIR 2018)

Makefile 0.58% Python 99.22% Shell 0.20%
nlp-machine-learning reinforcement-learning playlist-generator

rl-playlist-generation's Introduction

rl-playlist-generation

Original implementation of "Automatic, Personalized, and Flexible Playlist Generation using Reinforcement Learning".

Dependencies

  • python3

You can check and install other dependencies in requirements.txt

$ pip3 install -r requirements.txt
# to install TensorFlow, you can refer to https://www.tensorflow.org/install/

Files you should prepare

Pretrain

The following are files you should prepare to train this playlist generation model. Besides, you can check sample files we prepare as a reference of formats.

data/raw/raw_data.txt

[date_of_created_playlist] [song_id1] [song_id2] ....

data/embedding.txt

# embedding: [value1 value2 value3 ...]
[song_id] [value1] [value2] [value3] ...

Reinforcement Learning

data/metrics.txt

[song_id] [popularity_score] [artist_id] [release_date]

Test

results/in.txt

[seed_song_id]

Usage

You can add argument --debug 1 for each mode to check everything is fine before you prepare your own data.

Prepare data

# files mentioned above should be created first
$ ./prepare_data.sh

Pretrain

$ python3 main.py --mode pretrain [--debug 1]

Reinforcement Learning

$ python3 main.py --mode rl [--debug 1]

Test

# input file: results/in.txt
# output file: results/out.txt
$ python3 main.py --mode test [--debug 1]

Other Arguments

If you would like some different settings for this model, you can refer to lib/config.py.

rl-playlist-generation's People

Contributors

shunyaoshih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rl-playlist-generation's Issues

About Embedding and Vocabulary

The data util script makes use of a vocabulary file that is created started from the raw_dat.txt ([date_of_created_playlist] [song_id1] [song_id2]... format) file. Is that correct?
And what about creating embedding? How shall I extract it from the song info?
According to the paper

With the users and songs graph, we can
calculate embedding features of songs and thus obtain the
baseline playlist for each songs by finding their k-nearest
neighbors.

Does this mean that I can use low-level or high-level song features? Maybe the spectrum?

Thank you.

About Input Dataset for Pretrain

Hello, according to the reference paper the first step is about to generate baseline playlists based on the preferences of users about songs. Now assumed that the paper makes use of KKBox dataset, while here the dataset format has been specified, where shall I put user_id for each song_id i.e. the user listening?

Thank you.

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.