Explainable Entity-based Recommendations with Knowledge Graphs Rose Catherine Kathryn Mazaitis School of Computer Science School of Computer Science Carnegie Mellon University, USA Carnegie Mellon University, USA rosecatherinek@cs.cmu.edu krivard@cs.cmu.edu Maxine Eskenazi William Cohen School of Computer Science School of Computer Science Carnegie Mellon University, USA Carnegie Mellon University, USA max@cs.cmu.edu wcohen@cs.cmu.edu ABSTRACT keyword matches between the user’s profile and the books being Explainable recommendation is an important task. Many methods recommended. Similarly, [11] proposed a method called ‘Tagspla- have been proposed which generate explanations from the content nations’, which showed the degree to which a tag is relevant to the and reviews written for items. When review text is unavailable, item, and the sentiment of the user towards the tag. generating explanations is still a hard problem. In this paper, we With the advent of social networks, explanations that leverage illustrate how explanations can be generated in such a scenario by social connections have also gained attention. For example, [10] leveraging external knowledge in the form of knowledge graphs. produced explanations that showed whether a good friend of the Our method jointly ranks items and knowledge graph entities using user has liked something, where friendship strength was computed a Personalized PageRank procedure to produce recommendations from their interactions on Facebook. together with their explanations. More recent research has focused on providing explanations that are extracted from user written reviews for the items. [14] extracted phrases and sentiments expressed in the reviews and used them to 1 INTRODUCTION generate explanations. [5] uses topics learned from the reviews as Improving the accuracy of predictions in recommender systems is aspects of the item, and uses the topic distribution in the reviews an important research topic. An equally important task is explaining to find useful or representative reviews. the predictions to the user. Providing an explanation has been Knowledge Graphs have been shown to improve the performance shown to build user’s trust in the recommender system [9]. of recommender systems in the past. [13] proposed a meta-path The focus of this paper is a system to generate explanations for based method that learned paths consisting of node types in a Knowledge Graph (KG) -based recommendation. Users and items graph. Similarly, [7] used paths to find the top-N recommendations are typically associated with factual data, referred to as content. For in a learning-to-rank framework. A few methods such as [3, 6] users, the content may include demographics and other profile data. rank items using Personalized PageRank. In these methods, the For items such as movies, it might include the actors, directors, entities present in the text of an item are first mapped to entities in genre, and the like. The KG encodes the interconnections between a knowledge graph. [2] proposed probabilistic logic programming such facts, and leveraging these links has been shown to improve models for recommendation on knowledge graphs. None of the recommender performance [2, 3, 13]. above KB-based recommenders attempted to generate explanations. Although a number of explanation schemes have been proposed in the past (Section 2), there has been no work which produces 3 EXPLANATION METHOD explanations for KG-based recommenders. In this paper, we present a method to jointly rank items and entities in the KG such that the In this section, we propose our method, which builds on the work entities can serve as an explanation for the recommendation. of [2] by using ProPPR [12] for learning to recommend. ProPPR Our technique can be run without training, thereby allowing (Programming with Personalized Page Rank) is a first order logic faster deployment in new domains. Once enough data has been system. It takes as input a set of rules and a database of facts, and collected, it can then be trained to yield better performance. The uses these to generate an approximate local grounding of each query proposed method can also be used in a dialog setting, where a user in a small graph. Candidate answers to the query are the nodes in interacts with the system to refine its suggestions. the graph that satisfy the rules. The candidates are then ranked by running a Personalized PageRank algorithm on the graph. 2 RELATED WORK Our technique proceeds in two main steps. First, it uses ProPPR to jointly rank items and entities for a user. Second, it consolidates Generating explanations for recommendations has been an active the results into recommendations and explanations. area of research for more than a decade. [4] was an early work that To use ProPPR to rank items and entities, we first define a notion assessed different ways of explaining recommendations in a collab- of similarity between nodes in the graph, using the same similarity orative filtering (CF) -based recommender system. In content-based rules as [2] (Figure 1). This simple rule states that two entities X recommenders, the explanations revolve around the content or pro- and E are similar if they are the same (Rule 1), or if there is a link file of the user and the item. The system of [1] simply displayed in the graph connecting X to another entity Z, which is similar to E RecSys ’17 Poster Proceedings, Como, Italy (Rule 2). Note that this definition of similarity is recursive. RecSys ’17 Poster Proceedings, August 27–31, 2017, Como, Italy Rose Catherine, Kathryn Mazaitis, Maxine Eskenazi, and William Cohen sim(X, X) ←true. (1) movie, the entities can be ranked according to their joint score. The sim(X, E) ←link(X, Z), sim(Z, E). (2) end result is a list of reasons which can be shown to the user: Figure 1: Similarity in a graph (1) bridge_of_spies, score = 0.4 + 0.3 = 0.7, reasons = { tom_hanks, drama_thriller } Next, the model has two sets of rules for ranking: one set for (2) snowden, score = 0.3, reasons = { drama_thriller } joint ranking of movies that the user would like, together with the (3) inferno, score = 0.4 - 0.2 = 0.2, reasons = { tom_hanks, most likely reason (Figure 2), and a similar set for movies that the (-ve) crime } user would not like. In Figure 2, Rule 3 states that a user U will like an entity E and a movie M if the user likes the entity, and the entity 4 REAL WORLD DEPLOYMENT is related (sim) to the movie. The clause isMovie ensures that the The proposed method is presently used as the backend of a personal variable M is bound to a movie, since sim admits all types of entities. agent running on mobile devices for recommending movies [8] un- Rule 3 invokes the predicate likes(U,E), which holds for an entity dergoing Beta testing. The knowledge graph for recommendations E if the user has explicitly stated that they like it (Rule 4), or if they is constructed from the weekly dump files released by imdb.com. have provided positive feedback (e.g. clicked, thumbs up, high star The personal agent uses a dialog model of interaction with the user. rating) for a movie M containing (via link(M,E)) the entity (Rule In this setting, users are actively involved in refining the recom- 5). The method for finding movies and entities that the user will mendations depending on what their mood might be. For example, dislike is similar to the above, except ‘like’ is replaced with ‘dislike’. for a fun night out with friends, a user may want to watch an action willLike(U, E, M) ←likes(U, E), sim(E, M), isMovie(M). (3) movie, whereas when spending time with her significant other, the likes(U, E) ←likesEntity(U, E). (4) same user may be in the mood for a romantic comedy. likes(U, E) ←likesMovie(U, M), link(M, E). (5) 5 CONCLUSIONS Figure 2: Predicting likes Knowledge graphs have been shown to improve recommender To jointly rank the items and entities, we use ProPPR to query system accuracy in the past. However, generating explanations to the willLike(U,E,M) predicate with the user specified and the help users make an informed choice in KG-based systems has not other two variables free. Then, the ProPPR engine will ground the been attempted before. In this paper, we proposed a method to query into a proof graph by replacing each variable recursively produce a ranked list of entities as explanations by jointly ranking with literals that satisfy the rules from the KG [2, 12]. A sample them with the corresponding movies. grounding when queried for a user alice who likes tom_hanks and the movie da_vinci_code is shown in Figure 3. ACKNOWLEDGMENTS This research was supported in part by Yahoo! through the CMU- willLike(alice,E,M) Rule 3 Yahoo InMind project. likes(alice, E), sim(E, M), isMovie(M) REFERENCES Rule 4 Rule 5 [1] Mustafa Bilgic and Raymond J. Mooney. 2005. Explaining Recommendations: likesEntity(alice, E), likesMovie(alice, M1), link(M1, E), Satisfaction vs. Promotion. In Beyond Personalization Workshop. sim(E, M), isMovie(M) sim(E,M), isMovie(M) [2] R. Catherine and W. Cohen. 2016. Personalized Recommendations Using Knowl- E = tom_hanks M1 = da_vinci_code edge Graphs: A Probabilistic Logic Programming Approach. In Proc. RecSys ’16. sim(tom_hanks, M), link(da_vinci_code, E), 325–332. isMovie(M) sim(E,M), isMovie(M) [3] S. Chaudhari, A. Azaria, and T. Mitchell. An Entity Graph Based Recommender Rule 2 E = drama_thriller System. In RecSys ’16 Posters. link(tom_hanks,Z),sim(Z,M), isMovie(M) sim(drama_thriller,M), isMovie(M) [4] J. Herlocker, J. Konstan, and J. Riedl. 2000. Explaining collaborative filtering Rule 2 recommendations.. In CSCW. 241–250. Z=M= bridge_of_spies Z=M= inferno [5] J. McAuley and J. Leskovec. Hidden Factors and Hidden Topics: Understanding link(drama_thriller,Z), sim(Z,M), isMovie(M) & Rule 1 & Rule 1 Rating Dimensions with Review Text. In RecSys ’13. 165–172. Z=M= bridge_of_spies Z=M= snowden & Rule 1 & Rule 1 [6] C. Musto, P. Basile, M. de Gemmis, P. Lops, G. Semeraro, and S. Rutigliano. tom_hanks, tom_hanks, drama_thriller, drama_thriller, Automatic Selection of Linked Open Data features in Graph-based Recommender bridge_of_spies inferno bridge_of_spies snowden Systems. In CBRecSys 2015. [7] V. Ostuni, T. Di Noia, E. Di Sciascio, and R. Mirizzi. Top-N Recommendations from Implicit Feedback Leveraging Linked Open Data. In RecSys ’13. 85–92. Figure 3: Sample grounding for predicting likes [8] F. Pecune, T. Baumann, Y. Matsuyama, O. Romero, S. Akoju, Y. Du, R. Catherine, J. Cassell, M. Eskenazi, A. Black, and W. Cohen. InMind Movie Agent - A Platform After constructing the proof graph, ProPPR runs a Personalized for Research (In Preparation). [9] P. Pu and L. Chen. Trust Building with Explanation Interfaces. In IUI ’06. 93–100. PageRank algorithm with willLike(alice, E, M) as the start [10] A. Sharma and D. Cosley. 2013. Do Social Explanations Work?: Studying and node. In this simple example, we will let the scores for (tom_hanks, Modeling the Effects of Social Explanations in Recommender Systems. In WWW bridge_of_spies), (tom_hanks, inferno), (drama_thriller, ’13. 1133–1144. [11] J. Vig, S. Sen, and J. Riedl. Tagsplanations: Explaining Recommendations Using bridge_of_spies), and (drama_thriller, snowden), be 0.4, 0.4, Tags. In IUI ’09. 47–56. 0.3 and 0.3 respectively. [12] W. Wang, K. Mazaitis, and W. Cohen. Programming with Personalized Pagerank: Now, let us suppose that alice has also specified that she dislikes A Locally Groundable First-order Probabilistic Logic. In Proc. CIKM ’13. [13] X. Yu, X. Ren, Y. Sun, Q. Gu, B. Sturt, U. Khandelwal, B. Norick, and J. Han. crime movies. If we follow the grounding procedure for dislikes and Personalized Entity Recommendation: A Heterogeneous Information Network rank the answers, we may obtain (crime, inferno) with score Approach. In WSDM ’14. 283–292. 0.2. Our system then proceeds to consolidate the recommendations [14] Y. Zhang, G. Lai, M. Zhang, Y. Zhang, Y. Liu, and S. Ma. Explicit Factor Models for Explainable Recommendation Based on Phrase-level Sentiment Analysis. In and the explanations by grouping by movie names, adding together SIGIR ’14. 83–92. their ‘like’ scores and deducting their ‘dislike’ scores. For each