Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The...

25
+ Personalized Recommendations using Knowledge Graphs Rose Catherine Kanjirathinkal & Prof. William Cohen Carnegie Mellon University

Transcript of Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The...

Page 1: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+

Personalized Recommendations using Knowledge Graphs

Rose Catherine Kanjirathinkal & Prof. William Cohen

Carnegie Mellon University

Page 2: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+The Problem

n  Generate content-based recommendations on sparse real world data using knowledge graphs (KG)

n  Knowledge Graph: n  Think of the content (also referred to as entities) as nodes

n  Add links between:

n  Items-Entities: e.g. Bridge of Spies ßà Tom Hanks

n  User-Items: e.g. Alice ßà Saving Private Ryan

n  Entities-Entities: e.g. Tom Hanks ßà Best Actor

n  Items-Items: e.g. Finding Nemo ßà Finding Dory

2

Page 3: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Example

3

Bob Alice Kumar

Inferno Saving Private Ryan

The Terminal

The Da Vinci Code

Tom Hanks

Actor

Felicity Jones

Actor

Matt Damon

Actor

Steven Spielberg

Director

Good Will Hunting

Oscars

Award Golden Globe

Award

User-Item

Item-Entity

Item-Item

Entity-Entity

Page 4: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Example

4

Bob Alice Kumar

Inferno Saving Private Ryan

The Terminal

The Bridge of Spies

The Da Vinci Code

Tom Hanks

Actor

Felicity Jones

Actor

Matt Damon

Actor

Steven Spielberg

Director

Good Will Hunting

Oscars

Award Golden Globe

Award

User-Item

Item-Entity

Item-Item

Entity-Entity

?

Page 5: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Proposed Approach

n  Given that a user has liked specific movies and entities in the past, rank new movies (e.g. The Bridge of Spies) for that user using ProPPR

n  ProPPR: Programming with Personalized PageRank

n  First order probabilistic logic system

n  Accepts rules and queries in a language similar to stochastic logic programs

n  Inference using a variant of personalized PageRank

n  During training, can learn weights of edges for performing the walk

5

Page 6: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

●  The search space is a graph ! ●  Score for a query soln (e.g.,

“Z=sport” for “about(a,Z)”) depends on random walk probability of reaching a ☐ node

6

Page 7: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Observe:

7

User 1

User 2

User 3

Item 1 Item 2 …

Entity 1 Entity 2

Entity 3

Category A Entity Y

Entity X KB

Page 8: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Want to learn:

8

User 1

User 2

User 3

Item P Item Q

Entity 1 Entity 2

Entity 3

Category A Entity Y

Entity X KB

Page 9: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Proposed Approach Step 1: SeedSet

n  Step 1: Generate a seedset

seedset(U,E) :- reviewed(U,M), link(M,X), related(X,E), isEntity(E).

related(X,X) :- .

related(X,E) :- link(X,Z), related(Z,E).

n  E.g. seedset(Alice,E) à E = TomHanks, StevenSpielberg

9

Page 10: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Approach 1: EntitySim

reviewed(U,M) :- seedset(U,E1), likesEntity(U,E1), related(E1,E2), link(E2,M), isApplicable(U,M).

likesEntity(U,E) :- { f(U,E)}.

10

Page 11: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+

reviewed(Alice, M)

seedset(Alice, TomHanks),likesEntity(Alice, TomHanks),

related(TomHanks, X), link(X, M),isApplicable(Alice, M)

seedset(Alice, SSpielberg),likesEntity(Alice, SSpielberg),

related(SSpielberg, X), link(X, M),isApplicable(Alice, M)

link(TomHanks, M),isApplicable(Alice, M)

link(SSpielberg, M),isApplicable(Alice, M)

BridgeOfSpies

E = TomHanks E = SSpielberg

wt = l(Alice,TomHanks)X = TomHanks

wt = l(Alice,SSpielberg)X = SSpielberg

M = BridgeOfSpies M = BridgeOfSpies

seedset(Alice, E), likesEntity(Alice, E),

related(E, X), link(X, M),isApplicable(Alice, M)

CaptainPhillips

M = CaptainPhillips

11

Page 12: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Approach 2: TypeSim

n  Types of entities/nodes available

n  E.g. Tom Hanks is an Actor, Pittsburgh is a City

n  Additional Rule A: Learn the popularity/predictability of each type and entity

n  E.g. predictive power of Actor > Country, Tom Hanks > lesser known

n  Additional Rule B: Learn Type Associations – general traversal probability between types

n  E.g. Actor à Movie > Country à Movie

12

Page 13: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Approach 2: TypeSim - RuleSet

reviewed(U,M) :- seedset(U,E), likesEntity(U,E), popularEntity(E), related(E,X), link(X,M), isApplicable(U,M).

popularEntity(E) :- entityOfType(E,T), popularType(T) { p(E)}.

popularType(T) :- { p(T)}.

related(X,X) :- .

related(X,E) :- link(X,Z), typeAssoc(X,Z), related(Z,E).

typeAssoc(X,Z) :- entityOfType(X,S), entityOfType(Z,T), typeSim(S,T).

typeSim(S,T) :- { t(S,T)}.

13

Page 14: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Approach 3: GraphLF

n  Latent Factor models – successful in Collaborative Filtering

n  Map users and items to the same feature space of hidden dimensions

n  E.g. comedy vs. drama, amount of action, depth of character development, un-interpretable

n  Each factor measures user’s preference for movies that are high in that factor

n  Predict based on rating data; no user/item information required

14

Page 15: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Approach 3: GraphLF - RuleSet

reviewed(U,M) :- related(U,E), related(E,X), link(X,M), isApplicable(U,M).

related(U,E) :- seedset(U,E), simLF(U,E).

related(X,X) :- .

related(X,Y) :- link(X, Z), simLF(X, Z), related(Z, Y).

simLF(X, Y) :- isDim(D), val(X, D), val(Y, D).

val(X,D) :- { v(X,D)}.

15

Page 16: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Model Complexity

n  Model Complexity = number of parameters learned

n  EntitySim: O(n), n = #users n  Because of constant seedset size

n  TypeSim: O(n + e + t2), e = #entities, t = #types n  t2 : Because of type association between pairs of types

n  GraphLF: O(n + e + m), m = #items

n  Typically, m >> t

n  EnitySim < TypeSim < GraphLF

16

Page 17: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Recommendation using KG: State-of-the-art method

n  HeteRec_p [X. Yu, X. Ren, Y. Sun, Q. Gu, B. Sturt, U. Khandelwal, B. Norick, and J. Han. Personalized entity recommendation: A heterogeneous information network approach. In Proc. 7th ACM Int. Conf. on Web Search and Data Mining, WSDM ’14 ]

n  Main Idea: Find user-item preferences when the rating is not explicitly available, using Metapaths n  Metapath : a path on the TYPE / schema of the KG.

n  E.g. User à Movie à Actor à Movie

n  Drawbacks: n  Choose & tune hyper parameters: (a) Metapaths (b) number of

clusters

n  Requires a rich KB with types for entities and links.

17

Page 18: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Experiments

Dataset #Users #Items #Reviews

Yelp (2013) 43,873 11,537 229,907

IM100K-UIUC 943 1360 89,626

IM100K* 940 1566 93,948

n  Timestamp sort and 80% earlier à Training, 20% newer à Test

n  Content in Yelp: location city/state, type of business (restaurant, hospital, shopping), cuisine (american, sushi, indian), …

n  Content in IM100K: actor, director, studio, genre, country, language

18

Page 19: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Additional Baselines

n  Popularity: Recommend the popular items to users.

n  Co-Click: Estimate conditional probabilities between items and recommend items with an aggregated conditional probability calculated using the training data of the target user.

n  NMF: Non-negative matrix factorization – without using the paths

n  Hybrid-SVM: Use SVM-based ranking function to learn a global recommendation model with user implicit feedback and meta-paths based similarity measures

n  Naïve bayes – uses the content of items as features

19

Page 20: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+ Yelp: Performance Comparison Method P@1 MRR

Popularity 0.0074 0.0228

Co-Click 0.0147 0.0371

NMF 0.0162 0.0382

Hybrid SVM 0.0122 0.0337

HeteRec_p 0.0213 0.0513

EntitySim 0.0221 0.0641

TypeSim 0.0444 0.0973 [↑ 89%]

GraphLF 0.0482 [↑126%] 0.0966

NB 0 0.0087

n  Using Type info & Latent Factorization gives improvements

n  TypeSim vs. GraphLF: No clear winner

n  NB: Using content without graph – poor performance

20

Page 21: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+ IM100K: Performance Comparison

n  Slightly different datasets: Methods cannot be compared directly – appear to be comparable

n  EntitySim & NB: good performance

n  Conjecture: simple methods suffice with enough training examples per user, enough content per item

Method P@1 MRR

Popularity 0.0731 0.1923

Co-Click 0.0668 0.2041

NMF 0.2064 0.4938

Hybrid SVM 0.2087 0.4493

HeteRec_p 0.2121 0.5530

EntitySim 0.3485 0.5010

TypeSim 0.353 [↑ 66%] 0.5053

GraphLF 0.3248 0.4852 [↓ −12%]

NB 0.312 0.4069

21 (o

n IM

100K

-UIU

C)

Page 22: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Rating Matrix Density

n  Density = #Ratings / (#Users x #Items)

n  Density of Yelp = 0.00077

n  Density of IM100K* = 0.06382 n  (82 times more dense)

n  Study the performance as density increases: n  Create datasets by filtering out users and businesses with lesser

than k ratings, where k = 10, 25, 50, 100

Algorithm 1: Learning Personalized RecommendationModels// input: implicit feedback and information

network// output: recommendation models for user

clustersInput: R, GOutput: θ{·}

Prepare L meta-paths in the format of user − item− ∗ − item// User preference diffusion along meta-pathsfor q ← 1 to L do

foreach ui and ej doR

(q)ui,ej = s(ui, ej |P

(q)) (Equation (2))end

Calculate latent features U (q), V (q) with R(q)

(Equation (3))end// Clustering users into subgroupsFactorize R and derive U , VC = k-means(U)// Learn recommendation modelsforeach Ck in C do

Optimize θ{k} with implicit feedback in usersubgroup Ck (Equation (9))

end

Name #Items #Users #Ratings #Entities #Links

IM100K 943 1360 89,626 60,905 146,013Yelp 11,537 43,873 229,907 285,317 570,634

(a) Datasets Description

(b) IMDb Feedback Distribu-tion

(c) Yelp Feedback Distribu-tion

Figure 5: IM100K and Yelp Datasets

6.1 DataTo demonstrate the effectiveness of the proposed recom-

mendation framework, we choose two datasets from differ-ent domains (movie and local business) for empirical stud-ies. The first dataset is built by combining the popularMovieLens-100K dataset and the corresponding IMDb datasettogether. We name this dataset IMDb-MovieLens-100K(IM100K). We use MovieLens user ratings as user feedbackand we build a corresponding heterogeneous informationnetwork from the IMDb dataset. If users watched a cer-tain movie and wrote a review about this movie, no matterwhether they liked the movie or not, we say we observed theuser-item interaction and we set this feedback as 1, other-wise, we set as 0. When building this dataset, we mappedtwo datasets using titles and release date of the movies,which could be erroneous on certain movies so the resultswe presented below are lower-bound of the actual perfor-mances.

Table 2: Meta-path examples (we set n = 1 and 2.“biz” is short for “local business”)

Network Meta-Path

IM100K

user−(movie−tag−movie)n

user−(movie−director−movie)n

user−(movie−genre−movie)n

user−movie−plot−movie

Yelp

user−(biz−category−movie)n

user−(biz−customer−biz)n

user−biz−checkin−bizuser−biz−location−biz

The second dataset is the Yelp challenge dataseta. Thisdataset contains both user reviews and local business in-formation (an information network). When a user wrote areview for a restaurant, we set the feedback as 1, otherwiseit would be set to 0. We summarize these two datasets inFigure 5(a) and the schema of which can be found in Fig-ure 2. Notice that the Yelp dataset is much sparser than theIM100K dataset, so the performances of all methods declineaccordingly. The distributions of the user feedback can befound in Figure 5.

Both datasets have timestamps with each user item inter-action. We split the feedback matrix R of both datasets foreach user into training and test based on timestamps, i.e.,we use 80% of the “past” feedback to predict 20% of “future”feedback. In Yelp dataset, we have to filter out all the userswho only have 1 review since we can not create training andtest data for such users.

6.2 Competitors and Evaluation MetricsWe implement several widely deployed or the state-of-the-

art recommendation approaches as comparison methods asfollows:

• Popularity: Recommend the popular items to users.

• Co-Click: Estimate conditional probabilities betweenitems and recommend items with an aggregated con-ditional probability calculated using the training dataof the target user.

• NMF: Non-negative matrix factorization on R, detailsof which is discussed in Section 2.3

• Hybrid-SVM: Use SVM-based ranking function [13]to learn a global recommendation model with user im-plicit feedback and meta-paths based similarity mea-sures [24].

We use HeteRec-g to denote the proposed global recommen-dation model and HeteRec-p to represent the personalizedrecommendation models derived from user subgroup recom-mendation models. We utilize 10 different meta-paths ineach information network, including the most simple meta-path user− item, which means user preferences can only bepropagated to items with observed positive feedback. We listsome other meta-paths and / or attribute similarity mea-sures in Table 6.1. For explicit feedback recommendationevaluation, measures like root mean square error (RMSE)are the standard evaluation metric. However, these met-rics do not suit the definition of implicit feedback problem.In this study, we test all methods as ranking models anduse the well-studied information retrieval metrics includ-ing precision-at-position and top-10 mean reciprocal rank(MRR, Equation (10)) to evaluate and compare the perfor-mance of these methods.

MRRK =1m

m∑

i=1

e∈test(ui)

1rank(ui, e)

⎠ (10)

ahttp://www.yelp.com/dataset_challenge/

22

Page 23: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Performance vs. Density

k0 20 40 60 80 100

MR

R

0

0.2

0.4

0.6

De

nsi

ty

0

0.05

0.1

0.15

EntitySimTypeSimGraphLFNBDensity

23

Page 24: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+Conclusions

n  Proposed 3 methods that use KGs for making personalized recommendations n  EntitySim: Uses the graph links

n  TypeSim: Uses additional type information

n  GraphLF: Combines Latent Factorization with Graphs

n  Our methods gave large improvements compared to the state-of-the art method that uses knowledge graphs

n  Studied the behavior of the methods as rating matrix density increased: n  Type info became redundant

n  In sparse datasets, KG is an important source of information, especially at low densities.

24

Page 25: Personalized Recommendations using Knowledge Graphsrkanjira/files/recsys_rose_sept2016.pdf · The Problem n Generate content-based recommendations on sparse real world data using

+

Thank You!

25