Music Playlist Recommendation via Preference Embedding Chih-Ming Chen1,2 , Chun-Yao Yang1 , Chih-Chun Hsia1 , Yian Chen3 , and Ming-Feng Tsai1 1 Department of Computer Science, National Chengchi University, Taipei 116, Taiwan 2 Research Center for Information Technology Innovation, Academia Sinica, Taipei 115, Taiwan 3 Research Center, KKBOX Inc., Taipei 115, Taiwan ABSTRACT The idea behind embedding techniques is to compress Music playlists usually contain some particular musical styles the contextual/surrounding information of an object into or atmospheres in which users would like to be involved. Mu- its vector representation. In the field of natural language sic streaming services, such as Spotify, Apple Music, and processing, the techniques are usually referred to as word KKBOX, even allow users to edit and listen to playlists online. embedding for language modeling and feature learning to While there have been some well-known methods that can map words or phrases into a low-dimensional vector space. nicely model the preference between users and songs, little In social network analysis, the similar idea has also been has been done in the literature to recommend music playlists, applied to learn the representations of vertices of a social each of which can be considered as a set of many individual graph that can keep the graph structure for further tasks songs, to users. In the light of this, this paper proposes a such as community detection. Inspired by the idea, the HPE preference embedding based on a user-song-playlist graph to method [1] develops the techniques for music recommendation learn the preference representations of these three entities. by learning the representations of user preference over items. After the embedding process, we then use the learned repre- Based on the HPE method, this paper proposes a preference sentations to perform the task of playlist recommendation. graph over three entities (i.e., users, songs, and playlists) Experiments conducted on a real-world dataset show that for embedding. Figure 1 plots the graph, in which the user the proposed embedding method outperforms the baseline preference over songs and playlists can be nicely embedded of popularity; in addition, we also make a comparison with into the subsequent representations. In the experiments, a DeepWalk and LINE for the recommendation task, and the real-world music streaming dataset containing 50,000 users, results show that the proposed method can stand comparison 400,000 songs, and 130,000 playlists is employed to verify the with the two state-of-the-art graph embedding techniques. effectiveness of the proposed method. As shown in the results, the network-embedding based methods all outperform the baseline of popularity; in addition, the proposed HPE method Keywords can bear comparison with the two state-of-the-art graph Graph Embedding; Music Playlist Recommendations embedding techniques, DeepWalk and LINE. 1. INTRODUCTION 2. METHODOLOGY Music streaming services usually provide various ways for Given the users of U = {u1 , ..., u|U | }, the songs of S = users to explore the music they may like, such as creating {s1 , ..., s|S| }, and the playlists of P = {p1 , ..., p|P | }, the task and sharing user playlists. Recommendation usually plays an of playlist recommendation is to predict a set of the playlists important role in the exploration via predicting songs toward matching the user preference. The proposed approach models users according to their listening logs. In the literature, the preference relationship as follows: each object is treated much has been studied about how to model the preference of as an individual vertex v of the graph; then, the model it- users and items for an effective recommender system, such eratively updates each vertex representation Φ according as [2, 4, 5]. However, little has been worked on how to to its proximity to the sampled vertices in the graph. The recommend a combined set of items (i.e., playlists) based update procedure can be summarized as the following pro- on user preference logs on individual items (i.e., songs). In cess of minimizing the set of sampled target-to-proximity light of this, we propose to use the Heterogeneous Preference pairs (vi , vj ) [1]: Embedding (HPE) approach [1] based on a user-song-playlist X graph toward the task. O=− log p(vj |Φ(vi )) (1) vj ∈proximity(vi ) To conduct the task of playlist recommendation, we con- struct a preference graph, shown in Figure 1, with the fol- lowing connections: 1. The user-song connection: a user is connected to a song if the user listens to the song more than t times. Copyright held by the author(s). This connection is mainly to record the user preference RecSys 2016 Poster Proceedings, September 15-19, 2016, USA, Boston. over songs. u1 s1 p1 u2 s2 p2 u3 s3 u4 p3 s4 s5 Users Songs Playlists Figure 1: The User-Song-Playlist Graph for Preference Embedding. Popularity (DeepWalk, w=2) (DeepWalk, w=6) (LINE, 2nd) (HPE, w=2) (HPE, w=6) Precision@5 1.88% 12.85% *13.19% 7.14% 10.39% 12.22% Precision@10 3.67% 12.16% 12.37% 6.66% 10.29% 12.52% Precision@15 5.39% 11.69% 11.88% 6.30% 10.12% *12.36% Precision@20 7.08% 11.32% 11.56% 6.05% 9.99% *12.35% Table 1: Performance of Playlist Recommendation. 2. The playlist-song connection: a playlist is connected to learned representations preserve each user previous listen- a song if the playlist contains the song, which records ing preference. So, the embedding based methods achieve the relations between songs and playlists. better recommendation quality in terms of precision. In ad- dition, the proposed HPE method obtains the most effective Figure 1 shows the proposed User-Song-Playlist graph performance of 12.52% in terms of Precision@10. for preference embedding. In the graph, if only the pairs with direct connection are sampled, the objective function of embedding process for a user or a playlist can be expressed 4. CONCLUSION AND FUTURE WORK as follows: In this paper, we propose a user-song-playlist graph for ( P playlist recommendation by applying the HPE method. In − s∈P ref (u) log p(s|Φ(u)) if v ∈ U the graph, songs can be considered as the connection be- Ov = P . (2) − s∈P list(p) log p(s|Φ(p)) if v ∈ P tween users with playlists, which is useful for the playlist recommendation. With the preference graph, the proposed In the process, songs can be considered as the connection method can achieve effective recommendation performance. between users and playlists. Therefore, the learned repre- Furthermore, the proposed method can also be extended to sentation of users and playlists can be matchable via the include other heterogeneous objects into the graph. So, in connection by means of some simple similarity metrics, such our future work, we will attempt to study how to construct as cosine distance and euclidean distance. Moreover, the other preference graphs with more heterogeneous information proposed method can be extended to consider the indirect to carry out more advanced context-aware recommendations. connections among vertexes, which is similar to the idea of traditional collaborative filtering. 5. REFERENCES 3. EXPERIMENTAL RESULTS [1] C.-M. Chen, M.-F. Tsai, Y.-C. Lin, and Y.-H. Yang. Query-based music recommendations via preference In our experiments, the dataset is collected from the embedding. In Proc. of ACM RecSys, 2016. KKBOX music streaming service, consisting of 50,000 users, 400,000 songs, 130,000 playlists with a total of 16,000,000 [2] J. L. Herlocker, J. A. Konstan, L. G. Terveen, and J. T. user-to-song listening logs. We split the dataset as training Riedl. Evaluating collaborative filtering recommender and testing with the 50-50 ruling. For evaluation, we assume systems. ACM Trans. Inf. Syst., 22(1):5–53, 2004. that, if a playlist contains over 70 percent songs that are [3] B. Perozzi, R. Al-Rfou, and S. Skiena. Deepwalk: Online listened by a user, the playlist is considered as the desired learning of social representations. In Proc. of ACM playlist for the user. The evaluation metrics we used in the SIGKDD, 2014. experiments is the Precision@n, which indicates the hit ratio [4] S. Rendle. Factorization machines with libFM. ACM of the top n recommended playlists. Trans. Intell. Syst. Technol., 3(3):57:1–57:22, May 2012. We compare different network embedding techniques, in- [5] J. D. M. Rennie and N. Srebro. Fast maximum margin cluding HPE [1], DeepWalk [3], LINE [6], and one baseline matrix factorization for collaborative prediction. In Proc. approach by the song popularity. From Table 1, we can of ICML, 2005. observe that the network-embedding based methods all out- [6] J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and perform the baseline. The w refers to window size which is Q. Mei. Line: Large-scale information network the model parameter. The larger w means adopting wider embedding. In Proc. of ACM WWW, 2015. context information. In the embedding based methods, the