Music Playlist Title Generation Using Artist Information
Abstract
Automatically generating or captioning music playlist titles given a set of tracks is of significant interest in music streaming services as customized playlists are widely used in per- sonalized music recommendation, and well-composed text titles attract users and help their music discovery.
We present an encoder-decoder model that generates a playlist title from a sequence of music tracks.
While previous work takes track IDs as tokenized input for playlist title generation, we use artist IDs corresponding to the tracks to mitigate the is- sue from the long-tail distribution of tracks included in the playlist dataset.
Also, we introduce a chronological data split method to deal with newly-released tracks in real-world scenarios.
Comparing the track IDs and artist IDs as input se-
quences, we show that the artist-based approach significantly enhances the performance in terms of word overlap, semantic relevance, and diversity.
Introduction
With the popularization of music streaming services, music playlists have become essential resources in helping music discovery from huge collections of music (Dias, Gonc¸alves, and Fonseca 2017).
Because of the expected difficulty of browsing a large number of music playlists, a music playlist title that depicts the content information is often provided to attract users and help their discovery.
For example, a title could be used to describe genre (e.g., “ send this playlist to your friend who doesn’t know what indie rock is ”), situation (e.g., “ best jogging music for motivation ”), originality (e.g., “ playlist that will make you feel like an Arabian princess ”) and so on.
Making an informative and attractive title, however, does not come easily to everybody; we have seen a lot of titles that do not contain musically meaningful information (e.g., “ my favorites ”) or simply consist of a few related words (e.g., “ meditation, zen, yoga, sleep, study, focus ”).
Thus, if a descriptive playlist title could be generated automatically, it would help make the playlist more inviting and discoverable.
Severalapproaches have been proposed to automatically generate a playlist’s title or description.
They are mainly based on a neural machine translation model, which encodes a whole sequence of musical information into fixed-length latent vectors and then decodes them into text (Bahdanau,
Cho, and Bengio 2014; Vaswani et al. 2017).
Specifically, they used an RNN-based sequence-to-sequence model that learns from audio and supplementary text data (e.g., genre) (Choi et al. 2016) or a transformer-based model that takes a series of track IDs (unique IDs given to each track) (Doh,
Lee, and Nam 2021) to generate a title for a music playlist.
From the previous work, we observe two major issues.
One is that a significant amount of the data is rarely-seen, making it difficult to capture the semantics for the model.
As a result, the model has a tendency to repetitively produce musically meaningless titles such as “ my favorite songs ”.
Another issue is that it does not reflect real-world settings in which the model makes inferences from playlists containing new releases.
An ideal music playlist title generation system should generalize well across different types of music playlists; its performance should not deviate when inferring from playlists with rarely appearing tracks or new releases.
To address these limitations, we introduce a music playlist title generation model that takes artist IDs instead of track
IDs as input (Section 2).
Because tracks by the same artist all use the same input embedding vector, the model is capable of capturing the semantics of songs regardless of their frequency of appearance in playlists.
To better represent realworld settings, we propose a chronological data split method to simulate the case of inferring from tracks that are newly released (Section 3).
Furthermore, we perform a systematic evaluation regarding word overlap, semantic relevance, and diversity (Section 4).
Section 5 shows that the artist ID embedding approach improves the ability to deal with unpopular tracks or artists without compromising the ability to handle popular tracks or artists. Finally, Section 6 concludes this paper by discussing its limitations and future work. Reproducible code is available online 1 .
Music Playlist Title Generation Encoder-Decoder Model
Similar to the previous work (Doh, Lee, and Nam 2021), our music playlist title generation model is based on an encoderdecoder framework: an encoder network for obtaining the semantics of music tracks and a decoder for generating a sequence of natural language.
We use the Transformer architecture (Vaswani et al. 2017), which has two or three sub-layers: multi-head attention sub-layers, fully-connected sub-layers, and the masked multi-head attention layer in the case of the decoder.
As illustrated Figure 1, the architecture takes unique token IDs from a sequence of music tracks.
In the proposed systems, a music track sequence is a collection of track or artist information x , with each track or artist represented as a unique token ( x 1 , ..., x n ) .
The tokenized
IDs are initialized by d model dimension random vectors and processed by the encoder network f : X (cid:55)→ Z .
The vectors are transformed into a sequence of latent representations z
= ( z 1 , ..., z n ) , which is fed to the decoder g : Z (cid:55)→ Y , and it generates an output sequence ˆ y =
(ˆ y 1 , .., ˆ y m ) where ˆ y refers to a generated music playlist title and each element in (ˆ y 1 , .., ˆ y m ) refers to each token in the title.
We used the softmax cross-entropy loss for comparing the ground truth with the prediction.
Music Track Representations
We use music track sequences as input for the encoders.
Each element of the track sequence was represented with metadata, such as a track ID and an artist ID.
Tracks provide more specific information than artists.
Such high specificity may capture the detail of music semantics, but it often causes the issue that the system cannot extract meaningful semantics if the track was infrequently seen in the training phase.
For example, in the playlist datasets in our experiment, more than 17% of tracks do not appear more than two times in the training phase.
On the other hand, only less than 5.0% artist IDs appear more than twice.
Therefore, using artist IDs may allow the system to extract the semantics from the information obtained from prior songs by the same artists. Doh al. Proposed
Melon
[Table]
[Table]
Dataset and Experiment
We used two different datasets: the Melon Playlist Dataset (Melon) (Ferraro et al. 2021) and the Spotify Million Playlist
Dataset (MPD) (Chen et al. 2018).
The dominant languages used are Korean and English, respectively.
Originally created for the automatic playlist continuation (APC) tasks, the datasets contain playlist titles, music track sequences
[Table]
and music metadata (track, artist name), along with the last modification date.
Using both datasets, the previous work (Doh,
Lee, and Nam 2021) suggested a random data split scheme and a noise-cleaning strategy for generating playlist titles.
However, this approach has two limitations – First, validating and testing on randomly divided data does not mimic the circumstance of making inferences from newly released tracks and artists.
Second, the filtering strategy considered the structural quality of titles only, while overlooking the semantic quality.
This would reduce the usability of the system in practice.
To address the problem, we propose a new data split and noise-filtering strategy.
Chronological Data Split
In the real world, the model makes predictions on playlists with new releases as a large number of music tracks are uploaded to music streaming platforms every day.
Validating and testing on randomly split sets does not represent this reality.
To overcome this limitation, we performed training, validation, and testing on data that was chronologically divided, as shown in Figure 2 and replaced a new release with [Figure] a special token, < UNK > .
For the Melon Playlist Dataset, we used playlists made in 2020 as validation and test sets.
Any playlist created before that was used as training data.
For the
Million Playlist Dataset, playlists made in the last quarter of 2017 were used as validation and test sets.
Those created before that were used as training data.
The approximated ratio of train sets to validation/test sets is 83:17 and 82:18, respectively.
As Table 2 shows, the proportion of < UNK > token is significantly higher when using track IDs as input than artist
IDs, which implies that the model is more likely to handle unseen data when taking track IDs as input.
Filtering Out Noisy Data
As the previous study (Doh, Lee, and Nam 2021) suggested, some playlists in datasets come with undesirable titles or a very small number of tracks (including playlists with no tracks).
Therefore, they only used playlists that met the following criteria: i)
The title should have at least three tokens after white space tokenization.
ii)
The average character length of tokens should be at least three.
iii)
The playlist should contain at least ten tracks.
We modified the criteria by mitigating the second and third criteria and adding a newly introduced one.
The new criterion was introduced to avoid generating titles without musically meaningful information, such as “good music to listen to” or “best music ever” .
Therefore, we only used playlists that contained at least one word from a pre-defined list of music tags.
The following steps were taken to obtain the list of music tags.
Korean : The list of music tags in Korean is based on the 30,652 unique tags provided by the Melon Playlist Dataset.
We only considered tags that appeared at least fifty times in the entire dataset.
Tags that are musically meaningless, such as “recommendation” and “compilation” were excluded.
The total number of tags in Korean is 731.
English : The Million Playlist Dataset does not provide music tags.
We obtained the tag list in English from two publicly available music tag datasets for music auto-tagging research (the MTG-Jamendo Dataset (Bogdanov et al. 2019) and the Million Song Dataset (Bertin-Mahieux et al. 2011)).
Since they do not contain a large number of genres that have recently gained popularity (e.g., “trap” ), we gained additional tags from frequently appearing words on YouTube
Music.
Again, we removed tags that are not suitable for music playlist descriptions.
As a result, we obtained a total of 1,013 English tags.
To summarize, we filtered out playlists that did not meet the following criteria: i)
The title should have at least three tokens after white space tokenization.
ii)
The average character length of tokens should be at least two.
iii)
The playlists should contain at least two tracks.
iv)
The title should contain at least one musically meaningful word.
As a result of our modification of criteria, we were able to collect titles with meaningful information, as all of the titles include at least one musically relevant term without reducing the average title length (see Table 1).
Training Details
The model was optimized with the Adam optimizer with a 0.005 learning rate and 10 − 4 learning rate decay (Kingma and Ba 2014).
The rate was scheduled with the cosine annealing scheduler with a minimum learning rate of 10 −(Loshchilov and Hutter 2017).
We used a batch size ofand performed validation at the end of every epoch.
Following previous research, we ignored the position of the input sequence because the order of tracks or artists in a music playlist does not provide crucial information when generating a title in most circumstances.
Evaluation Metrics
For our evaluation, we use text generation evaluation metrics (Celikyilmaz, Clark, and Gao 2020) and grouped them into three categories: (i) n -gram based overlap metrics (ii)
BERT-based neural metrics (iii) n -gram based diversity metrics.
Using these metrics, we assess the overall performance.
In addition, we measure the robustness which we define as the degree to which the model’s performance changes when dealing with data that appears infrequently versus frequently.
n -gram Overlap Metrics
Counting the number of overlapping n -gram between a reference y =
( y 1 , ..., y l ) and a candidate ˆ y
=
(ˆ y 1 , ..., ˆ y m ) is one of the most common ways to evaluate models for text generation.
This paper uses three popular n -gram overlap metrics to evaluate the model performance — BLEU,
ROUGE, and METEOR.
Bilingual Evaluation Understudy (BLEU) was proposed to assess machine translation performance, and this includes modified n -gram precision (Papineni et al. 2002).
The computation of the modified precision score for one reference sentence and one candidate sentence is done by counting the number of n -gram matches and dividing it by the number of candidate n -grams.
In this paper, we calculated BLEU for two different values of n ( n = 1 , 2 ).
Recall-Oriented Understudy for Gisting Evaluation (ROUGE) was proposed for text summarization evaluation and has also been used for evaluating short text generation (Lin 2004).
Whereas BLEU focuses on precision, ROUGE
Dataset
Input
Loss
[Table]
Metrics
BERT-Based Metrics
[Table]
[Figure]
Metric for Evaluation of Translation with Explicit
ORdering (METEOR) was proposed to address some limitations of BLEU for machine translation evaluation (Banerjee and Lavie 2005).
In a similar fashion to ROUGE, this metric considers both recall and precision.
It could be obtained by calculating the harmonic mean of the unigram precision score and the unigram recall score, with weighting recall nine times more than precision.
The final score combines this with the chunk penalty.
The penalty increases if the number of chunks (consecutive unigrams) increases.
When there is no bi-gram match, the maximum number of penalty (0.5) is given.
BERT-Based Neural Metrics
Instead of counting the number of exact matches, BERTbased metrics use the pre-trained contextual embeddings generated by the model to capture the semantic similarity between a reference sentence y =
( y 1 , ..., y l ) and a candidate sentence ˆ y =
(ˆ y 1 , ..., ˆ y m ) .
BERT Score is obtained by computing the cosine similarity between each token in a reference sentence and in a candidate sentence and using greedy matching to maximize the score (Zhang et al. 2019).
In this paper, we used the pretrained KcBert-Base model (Lee 2020) for evaluating the Melon Playlist Dataset and the pretrained RoBERTa-large model (Zhuang et al. 2021) for evaluating the Million Playlist Dataset to get the contextual embeddings.
Sentence BERT (SentBERT) was proposed for semantic textual similarity evaluation tasks (Reimers and Gurevych 2019).
The SentBERT uses a siamese pre-trained BERT network to derive semantically meaningful sentence embeddings.
Each embedding is calculated by taking the mean of all vector representations of each token and computing the cosine similarity between them.
In this paper, we adopted the embeddings of KLEU RoberTa small (Park et al.
2021) for evaluating the Melon Playlist Dataset and the all-MiniLM-L6-v2 (Wang et al. 2020) for evaluating the Million Playlist Dataset.
n -gram-Based Diversity Metrics
A successful music playlist title generation model should avoid generating repetitive titles and instead produce diverse outputs.
Researchers suggested n -gram-based diversity metrics show a high correlation with lexical diversity (Tevet and Berant 2021).
One of the n -gram based metrics used for diversity evaluation is distinct- n , the number of distinct n -grams divided by the total number of n grams (Li et al.
In this paper, we evaluated lexical variations using
[Figure] [Figure]
distinct- n with
Results and Discussion Word Overlap and Semantic Relevance
Table 3 compares all n -gram overlap performances (BLEU,
ROUGE, and METEOR) of different input models (Track
ID, Artist ID).
The artist ID embedding model shows a clear performance improvement over the track ID embedding model.
In the case of the Melon Playlist Dataset, the change in BLEU-2 was not noticeable because of the grammatical characteristics of Korean (that post-positional particles immediately follow a noun or pronoun without white space).
We observed a similar trend on the Negative Loglikelihood (NLL) loss and the BERT-based neural metrics (BERT Score and Sentence BERT).
This indicates that utilizing artist IDs lessens the problem of dealing with infrequently appearing tracks, enabling the system to extract more musically meaningful information.
Diversity
Figure 6 shows an increase in distinct- n when using artist
ID embedding regardless of the value of n .
Despite the better specificity of track IDs, the artist ID embedding model produces more lexically diverse outputs.
This indicates that the high < UNK > token ratio in track ID (Table 2) lowers not only semantic relevance but also diversity performance.
[Figure]
Robustness
We assessed the model’s robustness by comparing its performance when dealing with infrequently appearing data versus frequently appearing data.
We defined the frequency of appearances from two perspectives: average track frequency and average artist frequency.
Based on these points of view, we equally divided the entire playlist into four groups and compared the model’s performance on the top 25% and bottom 25%.
In this paper, we denote them as F t and F a , respectively.
The average track frequency F t and the average artist frequency F a are calculated in the following way.
When a playlist consists of tracks ( t 1 , ..., t m ) and artists ( a 1 , ..., a n ), the average track frequency F t is ob-
PID
[Table]
[Equation]
[Table]
permeates
[Table]
[Equation] [Table] [Equation] [Table]
[Table]
tained by taking the mean of track frequency
Similarly, we can calculate the average artist frequency score
F a by averaging the frequency of each artist in the train sets ( ˆ f 1 , ..., ˆ f n ) (The numbers of m and n could be different because there could be multiple artists on a single track).
[Equation]
As shown in figure 3, there were a much greater number of playlists with low F t than those with low F a .
The artist ID embedding model shows remarkably better performance on the lowest F t score group (those from 0% to 25%) than the track ID embedding in terms of semantic relevance, as shown in figure 4.
The improvement is made without impairing the performance on the highest F t score group (those from 75% to 100%).
In fact, the performance on the highest F t group improves when using artist ID embedding, as in the case of the Million Playlist Dataset.
As a consequence of this, the performance gap between the subgroups is mitigated.
We also observed that the artist ID embedding improved the performance on the lowest F a score group (those from 0% to 25%) and alleviated the performance gap, as shown in Table 5.
Qualitative Results
We provide four inference examples on playlists from the
Melon Playlist Dataset, along with their PIDs (unique identification numbers assigned to each playlist) in Table 4 and 5, with English translation.
Each playlist is from the group that has the highest 25% F t , the lowest 25% F t , the highest 25% F a , and the lowest 25% F a .
Regardless of the inputs, the model successfully generated a phrase-like title describing the mood (e.g., touching ) or location (e.g., cafe ) of the playlists from the highest 25% F t and highest 25% F a group.
The model trained with artist ID embedding produced informative titles that represent the mood ( soothing ), originality ( Korean ) and genre ( hip-hop ) of the playlists from the lowest 25% F t and lowest 25% F a group.
However, when trained with track IDs, the model could not generate a title with the correct information for the playlist from the lowest 25% F t and lowest 25% F a groups (PID: 75870).
Whereas the ground truth defines each playlist as calming melodies and Korean hip-hop , the model predicts them as movie soundtracks and rock music in the movie , respectively.
Conclusions
In this paper, we proposed a model for music playlist title generation using a series of artist IDs as input.
Throughout our assessment, we showed that the artist ID embedding can improve the performance in terms of word overlap, semantic similarity, and diversity.
We also proved that the artist ID embedding improves the model’s robustness because rarely or never-before-seen data are less likely to be handled by the model.
Our findings were supported by two datasets in different languages.
However, our research has two limitations.
First, in the real world, a single artist might cover multiple genres and styles over time.
A fixed artist ID embedding does not reflect such variety.
Second, the artist ID embedding model would still need to deal with unseen data (new artists).
One approach to solving this problem is to use content-based audio embedding for encoder input and observe the model’s performance.
For future work, we plan to experiment with different inputs such as audio, genre labels, or a mixture of multiple inputs.