Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tutorial - Recommender systems meet linked open data - ICWE 2016 - Lugano - 07 June 2016 v1.1

983 views

Published on

An introduction to Recommender Systems and how to use them to build a recommendation engine.

Published in: Data & Analytics
  • Be the first to comment

Tutorial - Recommender systems meet linked open data - ICWE 2016 - Lugano - 07 June 2016 v1.1

  1. 1. Recommender Systems meet Linked Open Data Tommaso Di Noia 16th International Conference on Web Engineering June 7th, 2016 tommaso.dinoia@poliba.it @TommasoDiNoia
  2. 2. Agenda • Linked Open Data • What is a Recommender System and how does it work? • Evaluating a Recommender System • Recommender Systems and Linked Open Data
  3. 3. LINKED OPEN DATA A quick introduction to
  4. 4. Linking Open Data cloud diagram2014, by Max Schmachtenberg, Christian Bizer, Anja Jentzsch and Richard Cyganiak. http://lod-cloud.net/
  5. 5. Linked (Open) Data Some definitions: – A method of publishing data on the Web – (An instance of) the Web of Data – A huge database distributed in the Web – Linked Data is the Semantic Web done right
  6. 6. Web vs Linked Data Web Linked Data Analogy File System Database Designed for Men Machines (Software Agents) Main elements Documents Things Links between Documents Things Semantics Implicit Explicit Courtesy of Prof. Enrico Motta, The Open University, Milton Keynes – Uk – Semantic Web: Technologies and Applications.
  7. 7. LOD is the Web
  8. 8. Which technologies?
  9. 9. Which technologies? Data Language Query Language Schema Languages
  10. 10. URI • Every resource/entity/thing/relation is identified by a (unique) URI – URI: <http://dbpedia.org/resource/Lugano> – CURIE: dbr:Lugano – URI: <http://purl.org/dc/terms/subject> – CURIE: dct:subject
  11. 11. Which vocabularies/ontologies? • Most popular on http://prefix.cc (June 6, 2016) – YAGO: http://yago-knowledge.org/resource/ – FOAF: http://xmlns.com/foaf/0.1/ – DBpedia Ontology: http://dbpedia.org/ontology/ – DBpedia Properties: http://dbpedia.org/property/ – Dublin Core: http://dublincore.org/
  12. 12. Which vocabularies/ontologies? • Most popular on http://lov.okfn.org (June 6, 2016) – VANN: http://purl.org/vocab/vann/ – SKOS: http://www.w3.org/2004/02/skos/core – FOAF – DCTERMS – DCE: http://purl.org/dc/elements/1.1/
  13. 13. RDF – Resource Description Framework • Basic element: triple [subject] [predicate] [object] URI URI URI | Literal "string"@lang| "string"^^datatype
  14. 14. RDF – Resource Description Framework dbr:Lugano dbo:country dbr:Switzerland . dbr:Lugano rdfs:label "Lugano"@en . dbr:Lugano rdfs:label "Lugano"@it . dbr:Lugano dbo:populationTotal "67201"^^xsd:integer . dbr:Lugano dct:subject dbc:Cities_in_Switzerland . dbr:Lugano rdf:type yago:PopulatedPlacesOnLakeLugano. dbr:Switzerland dbo:leaderParty dbr:Ticino_League . dbr:Switzerland dbp:neighboringMunicipalities dbr:Melide,_Switzerland .
  15. 15. RDF – Resource Description Framework Switzerland Lugano Melide,_Switzerland Ticino_League Cities_in_Switzerland PopulatedPlacesOnLakeLu gano "Lugano"@en "Lugano"@it "67201"^^xsd:integer country leaderParty neighboringMunicipalities type subject label populationTotal
  16. 16. RDFS and OWL in two statements dbo:country rdfs:range dbo:Country . dbr:Lugano owl:sameAs wikidata:Lugano .
  17. 17. SPARQL PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dct: <http://purl.org/dc/terms/> PREFIX dbc: <http://dbpedia.org/resource/Category:> SELECT DISTINCT ?city ?name WHERE { ?city dct:subject dbc:Cities_in_Switzerland. ?city rdfs:label?name. ?city dbo:populationTotal?population . FILTER (?population < 70000) . FILTER (lang(?name) = 'en') }
  18. 18. SPARQL curl -g -H 'Accept: application/json' 'http://dbpedia.org/sparql?default-graph- uri=http%3A%2F%2Fdbpedia.org&query=PREFIX+dbo%3A%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E+PREFIX+rdfs%3A%3Chttp% 3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdfschema%23%3E+PREFIX+dct%3A%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E+PREFI X+dbc%3A%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FCategory%3A%3E+SELECT+DISTINCT+%3Fcity+%3Fname+WHERE%7B%3Fcity+d ct%3Asubject+dbc%3ACities_in_Switzerland.%3Fcity+rdfs%3Alabel+%3Fname.%3Fcity+dbo%3ApopulationTotal+%3Fpopulation.FILTER%28% 3Fpopulation+%3C+70000%29.FILTER+%28lang%28%3Fname%29%3D%27en%27%29%7D'
  19. 19. RECOMMENDER SYSTEMS The information overload problem
  20. 20. 60 seconds in the Web
  21. 21. Personalized Information Access • Help the user in finding the information they might be interestedin • Consider their preferences/pastbehaviour • Filter irrelevant information
  22. 22. Recommender Systems • Help users in dealing with Information/Choice Overload • Help to match users with items
  23. 23. Some definitions – In its most common formulation, the recommendation problem is reduced to the problem of estimating ratings for the items that have not been seen by a user. [G. Adomavicius and A. Tuzhilin. Toward the Next Generation of Recommender Systems: A survey of the State-of-the-Art and Possible Extension. TKDE, 2005.] – Recommender Systems (RSs) are software tools and techniques providing suggestions for items to be of use to a user. [F. Ricci, L. Rokach, B. Shapira, and P. B. Kantor, editors. Recommender Systems Handbook. Springer, 2015.]
  24. 24. The problem • Estimate a utility function to automatically predict how much a user will like an item which is unknown to them. Input Set of users Set of items Utility function 𝑈 = {𝑢%,…, 𝑢(} 𝑋 = {𝑥%,… , 𝑥,} 𝑓: 𝑈×𝑋 → 𝑅 ∀ 𝑢 ∈ 𝑈, 𝑥5 6 = arg 𝑚𝑎𝑥<∈= 𝑓(𝑢, 𝑥) Output
  25. 25. The rating matrix 5 1 2 4 3 ? 2 4 5 3 5 2 4 3 2 4 1 3 3 5 1 5 2 4 4 4 5 3 5 2 The Matrix Titanic I love shopping Argo Love Actually The hangover Tommaso Francesco Vittoria Jessica Paolo
  26. 26. The rating matrix (in the real world) 5 ? ? 4 3 ? 2 4 5 ? 5 ? ? 3 ? 4 ? 3 3 5 ? 5 2 ? 4 ? 5 ? 5 2 The Matrix Titanic I love shopping Argo Love Actually The hangover Tommaso Francesco Vittoria Jessica Paolo
  27. 27. How sparse is a rating matrix? 𝑠𝑝𝑎𝑟𝑠𝑖𝑡𝑦 = 1 − |𝑅| 𝑋 ⋅ 𝑈
  28. 28. Ratings Explicit Implicit
  29. 29. Rating Prediction vs Ranking Best Worst
  30. 30. Recommendation techniques • Content-based • Collaborative filtering • Demographic • Knowledge-based • Community-based • Hybrid recommendersystems
  31. 31. Collaborative RS Collaborative RSs recommend items to a user by identifying other users with a similar profile Recommender System User profile Users Item7 Item15 Item11 … Top-N Recommendations Item1, 5 Item2, 1 Item5, 4 Item10, 5 …. …. Item1, 4 Item2, 2 Item5, 5 Item10, 3 …. Item1, 4 Item2, 2 Item5, 5 Item10, 3 …. Item1, 4 Item2, 2 Item5, 5 Item10, 3 ….
  32. 32. Content-based RS Recommender System User profile Item7 Item15 Item11 … Top-N Recommendations Item1, 5 Item2, 1 Item5, 4 Item10, 5 …. Items Item1 Item2 Item100 Item’s descriptions …. CB-RSs recommend items to a user based on their description and on the profile of the user’s interests
  33. 33. Knowledge-based RS Recommender System Item7 Item15 Item11 … Top-N Recommendations Items Item1 Item2 Item100Item’s descriptions …. KB-RSs recommend items to a user based on their description and domain knowledge encoded in a knowledge base Knowledge-base
  34. 34. Collaborative Filtering • Memory-based – Mainly based on k-NN – Does not requireany preliminary model building phase • Model-based – Learn a predictive model beforecomputing recommendations
  35. 35. User-based Collaborative Recommendation 5 1 2 4 3 ? 2 4 5 3 5 2 4 3 2 4 1 3 3 5 1 5 2 4 4 4 5 3 5 2 The Matrix Titanic I love shopping Argo Love Actually The hangover Tommaso Francesco Vittoria Jessica Paolo 𝑠𝑖𝑚 𝑢J, 𝑢K = ∑ 𝑟5M,< − 𝑟5M ∗ 𝑟K,< − 𝑟5O<∈= ∑ 𝑟5M,< − 𝑟5M Q <∈= ∗ ∑ 𝑟5O,< − 𝑟5O Q <∈= Pearson’s correlation coefficient Rate prediction 𝑟̃ 𝑢J , 𝑥6 = 𝑟5M + ∑ 𝑠𝑖𝑚 𝑢J, 𝑢K ∗ 𝑟5O,<T − 𝑟5O5O∈, ∑ 𝑠𝑖𝑚(𝑢J, 𝑢K)5O∈, = 𝑋
  36. 36. k-Nearest Neighbors k = 5 N A neighborhood of 20 to 50 neighbors is a reasonable choice [Herlocker et al. An empirical analysis of design choices in neighborhood-based collaborative filtering algorithms, Information Retrieval 5 (2002), no. 4, 287–310.]
  37. 37. Item-based Collaborative Recommendation 5 1 2 4 3 ? 2 4 5 3 5 2 4 3 2 4 1 3 3 5 1 5 2 4 4 4 5 3 5 2 The Matrix Titanic I love shopping Argo Love Actually The hangover 𝑠𝑖𝑚 𝑥J, 𝑥K = 𝑥J ⋅ 𝑥K |𝑥J| ∗ |𝑥K| = ∑ 𝑟5,<M ∗ 𝑟5,<O5 ∑ 𝑟5,<M Q 5 ∗ ∑ 𝑟5,< Q 5 Cosine Similarity Rate prediction 𝑟̃ 𝑢J, 𝑥6 = ∑ 𝑠𝑖𝑚 𝑥⃗, 𝑥⃗′ ∗ 𝑟<,5M<∈=WM ∑ 𝑠𝑖𝑚 𝑥⃗, 𝑥⃗′<∈=WM 𝑠𝑖𝑚 𝑥J, 𝑥K = ∑ 𝑟5,<M − 𝑟5X ∗ 𝑟5,<O − 𝑟5X5 ∑ 𝑟5,<M − 𝑟5X Q 5 ∗ ∑ 𝑟5,<O − 𝑟5X Q 5 Adjusted Cosine Similarity = 𝑋5M Tommaso Francesco Vittoria Jessica Paolo
  38. 38. CF drawbacks • Sparsity / Cold-start – New user – New item • Grey sheep problem
  39. 39. Content-Based RS • Items are described in terms of attributes/features • A finite set of values is associated to each feature • Item representation is a (Boolean) vector
  40. 40. Content-based CB-RSs try to recommend items similar* to those a given user has liked in the past [M. de Gemmis et al. Recommender Systems Handbook. Springer. 2015] • Heuristic-based – Usually adopt techniques borrowed from IR • Model-based – Often we have a model for each user (*) similar from a content-based perspective
  41. 41. CB drawbacks • Content overspecialization • Portfolio effect • Sparsity / Cold-start – New user
  42. 42. Knowledge-based RS • Conversational approaches • Reasoning techniques – Case-based reasoning – Constraint reasoning
  43. 43. Hybrid recommender systems [Robin D. Burke. Hybrid recommender systems: Survey and experiments. User Model. User-Adapt. Interact., 12(4):331–370, 2002.] Weighted The scores (or votes) of several recommendation techniques are combined together to produce a single recommendation. Switching The system switches between recommendation techniques depending on the current situation. Mixed Recommendations from several different recommenders are presented at the same time Feature combination Features from different recommendation data sources are thrown together into a single recommendation algorithm. Cascade One recommender refines the recommendations given by another. Feature augmentation Output from one technique is used as an input feature to another. Meta-level The model learned by one recommender is used as input to another.
  44. 44. EVALUATION
  45. 45. Dataset split 20%80% … hold-out k-fold cross-validation Training Set Test Set (TS)
  46. 46. Protocols • Rated test-items • All unrated items: compute a score for every item not rated by the user (also items not appearing in the user test set)
  47. 47. Accuracy metrics for rating prediction 𝑀𝑒𝑎𝑛 𝐴𝑏𝑠𝑜𝑙𝑢𝑡𝑒 𝐸𝑟𝑟𝑜𝑟 𝑀𝐴𝐸 = 1 |𝑇𝑆| c d |𝑟̃5,<M − 𝑟5,<M | 5,<M ∈ef 𝑅𝑜𝑜𝑡 𝑀𝑒𝑎𝑛 𝑆𝑞𝑢𝑎𝑟𝑒𝑑 𝐸𝑟𝑟𝑜𝑟 𝑅𝑀𝑆𝐸 = 1 |𝑇𝑆| c d (𝑟̃5,<M − 𝑟5,<M )Q 5,<M ∈ef
  48. 48. MAE and RMSE drawback • Not very suitable for top-N recommendation – Errorsin the highest part of the recommendation list are considered in the same way as the ones in the lowest part
  49. 49. Accuracy metrics for top-N recommendation 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 @ 𝑁 𝑃5@𝑁 = |𝐿5 𝑁 ∩ 𝑇𝑆5 o | 𝑁 𝑅𝑒𝑐𝑎𝑙𝑙 @ 𝑁 𝑅5@𝑁 = |𝐿5 𝑁 ∩ 𝑇𝑆5 o | |𝑇𝑆5 o | 𝑛𝑜𝑟𝑚𝑎𝑙𝑖𝑧𝑒𝑑 𝐷𝑖𝑠𝑐𝑜𝑢𝑛𝑡 𝐶𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑣𝑒 𝐺𝑎𝑖𝑛 @ 𝑁 𝑛𝐷𝐶𝐺5@𝑁 = 1 𝐼𝐷𝐶𝐺@𝑁 d 2wW,x − 1 logQ(1 + 𝑘) , |}% 𝐿5 𝑁 is the recommendation list up to the N-th element 𝑇𝑆5 o is the set of relevant test items for 𝑢 𝐼𝐷𝐶𝐺@𝑁 indicates the score Obtained by an ideal ranking of 𝐿5 𝑁
  50. 50. Is all about precision?
  51. 51. Is all about precision? • Novelty – Recommend items in the long tail • Diversity – Avoid to recommend only items in a small subset of the catalog – Suggest diverse items in the recommendation list • Serendipity – Suggest unexpected but interesting items
  52. 52. Novelty 𝐸𝑛𝑡𝑟𝑜𝑝𝑦 − 𝐵𝑎𝑠𝑒𝑑 𝑁𝑜𝑣𝑒𝑙𝑡𝑦 𝐸𝐵𝑁5@𝑁 = − d 𝑝J ⋅ logQ 𝑝J <∈•W(,) 𝑝J = | 𝑢 ∈ 𝑈 𝑥 𝑖𝑠 𝑟𝑒𝑙𝑒𝑣𝑎𝑛𝑡 𝑡𝑜 𝑢 }| |𝑈|
  53. 53. Diversity 𝐼𝑛𝑡𝑟𝑎 − 𝐿𝑖𝑠𝑡 𝐷𝑖𝑣𝑒𝑟𝑠𝑖𝑡𝑦 𝐼𝐿𝐷5@𝑁 = 1 2 ⋅ d d 1 − 𝑠𝑖𝑚 𝑥J, 𝑥K <O∈•W ,<M∈•W € 𝐼𝐿𝐷@𝑁 = 1 |𝑈| ⋅ d 𝐼𝐿𝐷5@𝑁 5∈• 𝐴𝑔𝑔𝑟𝑒𝑔𝑎𝑡𝑒 𝐷𝑖𝑣𝑒𝑟𝑠𝑖𝑡𝑦 𝐴𝐷𝑖𝑛@𝑁 = | ⋃ 𝐿5(𝑁)5∈• | |𝑋|
  54. 54. RECOMMENDER SYSTEMS AND LINKED OPEN DATA
  55. 55. Content-Based Recommender Systems P. Lops, M. de Gemmis, G. Semeraro. Content-based recommender Systems: State of the Art and Trends. In: P. Kantor, F. Ricci, L. Rokach, B. Shapira, editors, Recommender Systems Hankbook: A complete Guide for Research Scientists & Practitioners
  56. 56. Content-Based Recommender Systems P. Lops, M. de Gemmis, G. Semeraro. Content-based recommender Systems: State of the Art and Trends. In: P. Kantor, F. Ricci, L. Rokach, B. Shapira, editors, Recommender Systems Hankbook: A complete Guide for Research Scientists & Practitioners
  57. 57. Need of domain knowledge! We need rich descriptions of the items! No suggestion is available if the analyzed content does not contain enough information to discriminate items the user might like from items the user might not like.* (*) M. de Gemmis et al. Recommender Systems Handbook. Springer. 2015 The quality of CB recommendations are correlated with the quality of the features that are explicitly associated with the items. Limited Content Analysis
  58. 58. Traditional Content-based RSs • Base on keyword/attribute -based item representations • Rely on the quality of the content-analyzer to extract expressive item features • Lack of knowledge about the items
  59. 59. Semantics-aware approaches Traditional Ontological/Semantic Recommender Systems make use of limited domain ontologies;
  60. 60. What about Linked Data? Use Linked Data to mitigate the limited content analysis issue • Plenty of structured data available • No Content Analyzer required Linking Open Data cloud diagram2014, by Max Schmachtenberg, Christian Bizer, Anja Jentzsch and Richard Cyganiak. http://lod-cloud.net/
  61. 61. Why RS + LOD • Multi-Domain knowledge
  62. 62. Why RS + LOD • Standardized (distributed) access to data PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX dbo: <http://dbpedia.org/ontology/> SELECT ?actor WHERE { dbpedia:Pulp_Fiction dbo:starring ?actor . } PREFIX yago: <http://yago-knowledge.org/resource/> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> CONSTRUCT{ ?book ?p ?o . ?book yago:linksTo ?yagolink . } WHERE{ SERVICE <http://live.dbpedia.org/sparql> { ?book rdf:type dbpedia-owl:Book . ?book ?p ?o . ?book owl:sameAs ?yago . FILTER(regex(str(?yago),"http://yago-knowledge.org/resource/")) . } SERVICE <http://lod2.openlinksw.com/sparql> { ?yago yago:linksTo ?yagolink . } }
  63. 63. Why RS + LOD • Semantic Analysis
  64. 64. A high level architecture V. C. Ostuni et al., Sound and Music Recommendation with Knowledge Graphs. ACM Transactions on Intelligent Systems and Technology (TIST) – 2016 – http://sisinflab.poliba.it/publications/2016/OODSD16/
  65. 65. Item Linker • Direct Item Linking • Item Description Linking
  66. 66. Direct item Linking dbr:I_Am_Legend_(film)
  67. 67. Direct item Linking dbr:Troy_(film) dbr:Troy dbr:I_Am_Legend_(film)
  68. 68. Direct item Linking dbr:Scarface_(1983_film) dbr:Scarface:_The_World_Is_Yours dbr:Troy_(film) dbr:Troy dbr:I_Am_Legend_(film)
  69. 69. Direct Item Linking dbr:Divine_Comedy
  70. 70. Direct Item Linking dbr:The_Da_Vinci_Code dbr:Divine_Comedy
  71. 71. Direct Item Linking ??? dbr:The_Da_Vinci_Code dbr:Divine_Comedy
  72. 72. Direct Item Linking • The easy way SELECT DISTINCT ?uri, ?title WHERE { ?uri rdf:type dbpedia-owl:Film. ?uri rdfs:label ?title. FILTER langMatches(lang(?title), "EN") . FILTER regex(?title, "matrix", "i") }
  73. 73. Direct item Linking • Other approaches – DBpedia Lookup https://github.com/dbpedia/lookup – Silk Framework http://silk-framework.com/
  74. 74. Direct Item Linking
  75. 75. Item Description Linking
  76. 76. Item Description Linking
  77. 77. Item Description Linking
  78. 78. Item Description Linking
  79. 79. Item Graph Analyzer • Build your own knowledge graph – Select relevant properties. Possible solutions: • Ontologicalproperties • Categorical properties • Frequent properties • Feature selection techniques – Explore the graph up to a limited depth
  80. 80. Which LOD RSs? • Content-based – Heuristic-based – Model based • Hybrid • Knowledge-based
  81. 81. Common features
  82. 82. Linked Data as a structured information source for item descriptions Rich item descriptions
  83. 83. Different item features representations • Direct properties • Property paths • Node paths • Neighborhoods • …
  84. 84. Datasets Subset of Movielensmapped to DBpedia Subset of Last.fm mapped to DBpedia Subset of The Library Thing mapped to DBpedia Mappings https://github.com/sisinflab/LODrecsys-datasets
  85. 85. Direct properties
  86. 86. Jaccard similarity 𝑠𝑖𝑚K„……„w† 𝑥J, 𝑥K = |𝑁† 𝑥J ∩ 𝑁† 𝑥K | |𝑁† 𝑥J ∪ 𝑁†(𝑥K)|
  87. 87. Content-based prediction 𝑟ˆ 𝑢, 𝑥K = ∑ 𝑟 𝑢, 𝑥J ⋅ 𝑠𝑖𝑚(𝑥J, 𝑥K)<M∈,∩‰wŠ‹JŒ•(5) ∑ 𝑠𝑖𝑚(𝑥J, 𝑥K)<M∈,∩‰wŠ‹JŒ•(5)
  88. 88. Vector Space Model for LOD Righteous Kill starring director subject/broader genre Heat RobertDe Niro John Avnet Serial killer films Drama Al Pacino Brian Dennehy Heist films Crimefilms starring RobertDe Niro Al Pacino Brian Dennehy Righteous Kill Heat … …
  89. 89. Vector Space Model for LOD Righteous Kill STARRING Al Pacino (v1) Robert De Niro (v2) Brian Dennehy (v3) Righteous Kill (m1) X X X Heat (m2) X X Heat Righteous Kill (x1) wv1,x1 wv2,x1 wv3,x1 Heat (x2) wv1,x2 wv2,x2 0 𝑤•Œ‰„…J€Š,••„‘ = 𝑡𝑓•Œ‰„…J€Š,••„‘ ∗ 𝑖𝑑𝑓•Œ‰„…J€Š
  90. 90. Vector Space Model for LOD Righteous Kill STARRING Al Pacino (v1) Robert De Niro (v2) Brian Dennehy (v3) Righteous Kill (m1) X X X Heat (m2) X X Heat Righteous Kill (x1) wv1,x1 wv2,x1 wv3,x1 Heat (x2) wv1,x2 wv2,x2 0 𝑤•Œ‰„…J€Š,••„‘ = 𝑡𝑓•Œ‰„…J€Š,••„‘ ∗ 𝑖𝑑𝑓•Œ‰„…J€Š 𝑡𝑓 ∈ {0,1}
  91. 91. Vector Space Model for LOD + + + … = 𝒔𝒊𝒎 𝒔𝒕𝒂𝒓𝒓𝒊𝒏𝒈(𝒙𝒊, 𝒙𝒋) = 𝒘 𝒗 𝟏,𝒙𝒊 ∗ 𝒘 𝒗 𝟏,𝒙𝒋 + 𝒘 𝒗 𝟐,𝒙𝒊 ∗ 𝒘 𝒗 𝟐,𝒙𝒋 + 𝒘 𝒗 𝟑,𝒙𝒊 ∗ 𝒘 𝒗 𝟑,𝒙𝒋 𝒘 𝒗 𝟏,𝒙𝒊 𝟐 + 𝒘 𝒗 𝟐,𝒙𝒊 𝟐 + 𝒘 𝒗 𝟑,𝒙𝒊 𝟐 ∗ 𝒘 𝒗 𝟏,𝒙𝒋 𝟐 + 𝒘 𝒗 𝟐,𝒙𝒋 𝟐 + 𝒘 𝒗 𝟑,𝒙𝒋 𝟐 𝜶 𝒔𝒕𝒂𝒓𝒓𝒊𝒏𝒈 ∗ 𝒔𝒊𝒎 𝒔𝒕𝒂𝒓𝒓𝒊𝒏𝒈(𝒙𝒊, 𝒙𝒋) 𝜶 𝒅𝒊𝒓𝒆𝒄𝒕𝒐𝒓 ∗ 𝒔𝒊𝒎 𝒅𝒊𝒓𝒆𝒄𝒕𝒐𝒓 (𝒙𝒊, 𝒙𝒋) 𝜶 𝒔𝒖𝒃𝒋𝒆𝒄𝒕 ∗ 𝒔𝒊𝒎 𝒔𝒖𝒃𝒋𝒆𝒄𝒕(𝒙𝒊, 𝒙𝒋) 𝒔𝒊𝒎 (𝒙𝒊, 𝒙𝒋)
  92. 92. VSM Content-based Recommender Predict the rating using a Nearest Neighbor Classifier wherein the similarity measure is a linear combination of local property similarities 𝑟̃ 𝑢, 𝑥K = ∑ 𝑟 𝑢, 𝑥J ⋅ ∑ 𝛼ª ⋅ 𝑠𝑖𝑚ª(𝑥J, 𝑥K)ª∈‰ |𝑃|<M∈‰wŠ‹JŒ•(5) |𝑝𝑟𝑜𝑓𝑖𝑙𝑒(𝑢)| Tommaso Di Noia, Roberto Mirizzi, Vito Claudio Ostuni, Davide Romito, Markus Zanker. Linked Open Data to supportContent-based Recommender Systems. 8th International Conference on SemanticSystems (I-SEMANTICS) -2012 (Best Paper Award)
  93. 93. VSM Content-based Recommender We predict the rating using a Nearest Neighbor Classifier wherein the similarity measure is a linear combination of local property similarities 𝑟̃ 𝑢, 𝑥K = ∑ 𝑟 𝑢, 𝑥J ⋅ ∑ 𝛼ª ⋅ 𝑠𝑖𝑚ª(𝑥J, 𝑥K)ª∈‰ |𝑃|<M∈‰wŠ‹JŒ•(5) |𝑝𝑟𝑜𝑓𝑖𝑙𝑒(𝑢)| Selected properties
  94. 94. VSM Content-based Recommender We predict the rating using a Nearest Neighbor Classifier wherein the similarity measure is a linear combination of local property similarities 𝑟̃ 𝑢, 𝑥K = ∑ 𝑟 𝑢, 𝑥J ⋅ ∑ 𝛼ª ⋅ 𝑠𝑖𝑚ª(𝑥J, 𝑥K)ª∈‰ |𝑃|<M∈‰wŠ‹JŒ•(5) |𝑝𝑟𝑜𝑓𝑖𝑙𝑒(𝑢)| heuristic-based → model-based
  95. 95. Property subset evaluation The subject+broader solution is better than only subject or subject+more broaders. The best solution is achieved with subject+broader+ genres. Too many broaders introduce noise. Ratedtest items protocol
  96. 96. Evaluation against other content-based approaches Ratedtest items protocol
  97. 97. Evaluation against other approaches Ratedtest items protocol
  98. 98. Property paths
  99. 99. Path-based features Analysis of complex relations between the user preferences and the target item T. Di Noia et al., SPRank: Semantic Path-based Ranking for Top-N Recommendations using Linked Open Data. ACM Transactions on Intelligent Systems and Technology (TIST) – 2016 -http://sisinflab.poliba.it/publications/2016/DOTD16/
  100. 100. Data model I1 i2 i3 i4 u1 1 1 0 0 u2 1 0 1 0 u3 0 1 1 0 u4 0 1 0 1 Implicit Feedback Matrix Knowledge Graph ^ S =
  101. 101. Data model Implicit Feedback Matrix Knowledge Graph ^ S = I1 i2 i3 i4 u1 1 1 0 0 u2 1 0 1 0 u3 0 1 1 0 u4 0 1 0 1
  102. 102. Data model Implicit Feedback Matrix Knowledge Graph ^ S = I1 i2 i3 i4 u1 1 1 0 0 u2 1 0 1 0 u3 0 1 1 0 u4 0 1 0 1
  103. 103. Path-based features Path: acyclic sequence of relations ( s , .. rl , .. rL ) Frequency of j-th path in the sub-graph related to u and x • The more the paths, the more the relevance of the item. • Different paths have different meaning. • Not all types of paths are relevant. u3 s i2 p2 e1 p1 i1 à (s, p2 ,p1) 𝑤5<(𝑗) = #𝑝𝑎𝑡ℎ5<(𝑗) ∑ #𝑝𝑎𝑡ℎ5<(𝑗)K
  104. 104. Problem formulation Feature vector Set of irrelevant items for u Set of relevant items for u Training Set Sample of irrelevant items for u 𝑋5 o = 𝑥 ∈ 𝑋 𝑠̂5< = 1} 𝑋5 ¯ = 𝑥 ∈ 𝑋 𝑠̂5< = 0} 𝑋5 ¯∗ ⊆ 𝑋5 ¯ 𝑤5< ∈ ℝ² TR = ⋃ < 𝑤5<, 𝑠̂5< > 𝑥 ∈ (𝑋5 o ∪ 𝑋5 ¯∗ )}5
  105. 105. u1 x1 u2 u3 x2 x3 e1 e3 e4 e2 e5 u4 x4 Path-based features wu3x1 ?
  106. 106. u1 u2 u3 e1 e3 e4 e2 e5 u4 Path-based features path(1) (s, s, s) : 1 x1 x2 x3 x4
  107. 107. u1 u2 u3 e1 e3 e4 e2 e5 u4 Path-based features path(1) (s, s, s) : 2 x1 x2 x3 x4
  108. 108. u1 u2 u3 e1 e3 e4 e2 e5 u4 Path-based features path(1) (s, s, s) : 2 path(2) (s, p2, p1) : 1 x1 x2 x3 x4
  109. 109. u1 u2 u3 e1 e3 e4 e2 e5 u4 Path-based features path(1) (s, s, s) : 2 path(2) (s, p2, p1) : 2 x1 x2 x3 x4
  110. 110. u1 u2 u3 e1 e3 e4 e2 e5 u4 Path-based features path(1) (s, s, s) : 2 path(2) (s, p2, p1) : 2 path(3) (s, p2, p3,p1) : 1 x1 x2 x3 x4
  111. 111. Path-based features path(1) (s, s, s) : 2 path(2) (s, p2, p1) : 2 path(3) (s, p2, p3,p1) : 1 u1 u2 u3 e1 e3 e4 e2 e5 u4 x1 x2 x3 x4 𝑤5µ<¶ 1 = 2 5 𝑤5µ<¶ 2 = 2 5 𝑤5µ<¶ 3 = 1 5
  112. 112. Evaluation of different ranking functions 0 0,1 0,2 0,3 0,4 0,5 0,6 given 5 given 10 given 20 given 30 given 50 given All recall@5 user profile size Movielens BagBoo GBRT Sum
  113. 113. Evaluation of different ranking functions 0 0,1 0,2 0,3 0,4 0,5 0,6 given 5 given 10 given 20 given All recall@5 user profile size Last.fm BagBoo GBRT Sum
  114. 114. Comparative approaches • BPRMF, Bayesian Personalized Ranking for Matrix Factorization • BPRLin, Linear Modeloptimized for BPR (Hybrid alg.) • SLIM, Sparse Linear Methodsfor Top-N Recommender Systems • SMRMF, Soft Margin Ranking Matrix Factorization MyMediaLite
  115. 115. Comparison with other approaches 0 0,1 0,2 0,3 0,4 0,5 0,6 given 5 given 10 given 20 given 30 given 50 given All user profile size Movielens SPrank BPRMF SLIM BPRLin SMRMF precision@5
  116. 116. Comparison with other approaches 0 0,1 0,2 0,3 0,4 0,5 0,6 given 5 given 10 given 20 given All user profile size Last.fm SPrank BPRMF SLIM BPRLin SMRMF precision@5
  117. 117. Neighborhoods
  118. 118. Graph-based Item Representation The Godfather Mafia_films Gangster_films American Gangster Films_about_organized_crime _in_the_United_States Best_Picture_Academy _Award_winners Best_Thriller_Empire _Award_winners Films_shot_in_New_York_City subject subject subject subject subject subject subject V. C. Ostuni et al., Sound and Music Recommendation with Knowledge Graphs. ACM Transactions on Intelligent Systems and Technology (TIST) – 2016 – http://sisinflab.poliba.it/publications/2016/OODSD16/
  119. 119. Graph-based Item Representation The Godfather Mafia_films Films_about_organized_crime Gangster_films American Gangster Films_about_organized_crime _in_the_United_States Films_about_organized_ crime_by_country Best_Picture_Academy _Award_winners Best_Thriller_Empire _Award_winners Awards_for_best_film Films_shot_in_New_York_City subject subject subject broader broader broader broader broader subject subject subject subject
  120. 120. Graph-based Item Representation The Godfather Mafia_films Films_about_organized_crime Gangster_films American Gangster Films_about_organized_crime _in_the_United_States Films_about_organized_ crime_by_country Best_Picture_Academy _Award_winners Best_Thriller_Empire _Award_winners Awards_for_best_film Films_shot_in_New_York_City subject subject subject broader broader broader broader broader broader subject subject subject subject
  121. 121. Graph-based Item Representation The Godfather Mafia_films Films_about_organized_crime Gangster_films American Gangster Films_about_organized_crime _in_the_United_States Films_about_organized_ crime_by_country Best_Picture_Academy _Award_winners Best_Thriller_Empire _Award_winners Awards_for_best_film Films_shot_in_New_York_City subject subject subject broader broader broader broader broader broader subject subject subject subject Exploit entities descriptions
  122. 122. h-hop Item Neighborhood Graph The Godfather Mafia_films Films_about_organized_crime Gangster_films Best_Picture_Academy _Award_winners Awards_for_best_film Films_shot_in_New_York_City subject subject subject broader broader broader
  123. 123. Kernel Methods Work by embedding data in a vector space and looking for linear patterns in such space 𝑥 → 𝜙(𝑥) [Kernel Methods for General Pattern Analysis. Nello Cristianini . http://www.kernel-methods.net/tutorials/KMtalk.pdf] 𝜙(𝑥) 𝜙 𝑥Input space Feature space We can work in the new space F by specifying an inner product function between points in it 𝑘 𝑥𝑖, 𝑥𝑗 = < 𝜙(𝑥𝑖), 𝜙(𝑥𝑗)>
  124. 124. h-hop Item Entity-based Neighborhood Graph Kernel Explicit computation of the feature map Importance of the entity 𝑒º in the neighborhood graph for the item 𝑥J 𝑘»¼ 𝑥J, 𝑥K = 𝜙»¼ 𝑥J , 𝜙»¼ 𝑥K 𝜙»¼ 𝑥J = (𝑤<M,•¶ , 𝑤<M,•½ , …, 𝑤<M,•¾ ,… , 𝑤<M,•¿ )
  125. 125. Explicit computation of the feature map # edges involving 𝑒º at l hops from 𝑥J a.k.a. frequency of the entityin the item neighborhood graph factor takinginto account at which hop the entity appears h-hop Item Entity-based Neighborhood Graph Kernel 𝑤<M,•¾ = d 𝛼Œ ⋅ 𝑐‰ÀÁ <M ,•¾  Œ}% 𝑘»¼ 𝑥J, 𝑥K = 𝜙»¼ 𝑥J , 𝜙»¼ 𝑥K 𝜙»¼ 𝑥J = (𝑤<M,•¶ , 𝑤<M,•½ , …, 𝑤<M,•¾ ,… , 𝑤<M,•¿ )
  126. 126. Weights computation i e1 e2 p3 p2 e4 e5 p3 p3 h=2 𝑐‰À¶ <M ,•¶ = 2 𝑐‰À¶ <M ,•½ = 1 𝑐‰À½ <M ,•Ã = 1 𝑐‰À½ <M ,•Ä = 2
  127. 127. Weights computation example i e1 e2 p3 p2 e4 e5 p3 p3 h=2 𝑐‰À¶ <M ,•¶ = 2 𝑐‰À¶ <M ,•½ = 1 𝑐‰À½ <M ,•Ã = 1 𝑐‰À½ <M ,•Ä = 2 Informative entity about the item even if not directly related to it
  128. 128. Experimental Settings • Trained a SVM Regression model for each user • Accuracy Evaluation: Precision, Recall • Novelty Evaluation: Entropy-based Novelty (All Items protocol) [the lower the better]
  129. 129. Comparative approaches •NB: 1-hop item neigh. + Naive Bayes classifier •VSM: 1-hop item neigh. Vector Space Model (tf-idf) + SVM regr •WK: 2-hop item neigh. Walk-based kernel + SVM regr
  130. 130. Comparison with other approaches (i) 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 Prec@10 [20/80] Prec@10 [40/60] Prec@10 [80/20] NK-bestPrec NK-bestEntr NB VSM WK Ratedtest items protocol
  131. 131. Comparison with other approaches (ii) 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 EBN@10 [20/80] EBN@10 [40/60] EBN@10 [80/20] NK-bestPrec NK-bestEntr NB VSM WK
  132. 132. Neighborhoods (path-based)
  133. 133. The FreeSound case study Vito Claudio Ostuni, Sergio Oramas, Tommaso Di Noia, Xavier Serra, Eugenio Di Sciascio. A Semantic Hybrid Approach for Sound Recommendation. 24th World Wide Web Conference - 2015
  134. 134. FreeSound Knowledge Graph Item textual descriptionsenrichment: EntityLinking tools can be used to enrich item textual descriptions with LOD
  135. 135. Explicit computation of the feature map # sequences and subsequences of nodes from 𝑥J to em Normalization factor h-hop Item Node-Based Neighborhood Graph Kernel 𝜙»¼ 𝑥J = (𝑤<M,ª∗¶ , …, 𝑤<M,ª∗¾ ,… , 𝑤<M,ª∗¿ ) 𝑘»¼ 𝑥J, 𝑥K = 𝜙»¼ 𝑥J , 𝜙»¼ 𝑥K 𝑤<M,ª∗¾ = #𝑝 ∗º (𝑥J) 𝑝º − 𝑝 ∗º
  136. 136. Hybrid Recommendation via Feature Combination The hybridizations is based on the combination of different data sources Final approach: collaborative + LOD + textual description + tags Users who ratedthe item u1 u2 u3 …. entity1 entity2 …. keyw1 keyw2 … tag1 … entities from the knowledge graph (explicit feature mapping) Keywords extractedfrom the textual description tags associated to the item Item Feature Vector
  137. 137. Accuracy All items protocol
  138. 138. Long Tail
  139. 139. Aggregate Diversity
  140. 140. Implementation • LODreclib – a Java library to build a LOD based recommendersystem https://github.com/sisinflab/lodreclib • Cinemappy (currently for iOS only) – a context-awaremobile recommender system https://itunes.apple.com/it/app/cinemappy/id6 81762350?mt=8
  141. 141. Implementation V. C. Ostuni et al., Mobile Movie Recommendations with Linked Data. CD-ARES 2013: 400-415
  142. 142. Dataset selection
  143. 143. Select the domain(s) of your RS SELECT count(?i) AS ?num ?c WHERE { ?i a ?c . FILTER(regex(?c, "^http://dbpedia.org/ontology")) . } ORDER BY DESC(?num)
  144. 144. Open issues • Generalize to graph pattern extraction to represent features • Automatically select the triples related to the domain of interest • Automatically select meaningful properties to represent items • Analysis with respect to «knowledge coverage» of the dataset – What is the best approach? • Cross-domain recommendation • More graph-based similarity/relatedness metrics
  145. 145. Does the LOD dataset selection matter? Phuong Nguyen, Paolo Tomeo, Tommaso Di Noia, Eugenio Di Sciascio. Content-based recommendations via DBpedia and Freebase: a case study in the music domain. The 14th International Semantic Web Conference - ISWC 2015
  146. 146. Conclusions • Linked Open Data to enrich the content descriptions of item • Exploit different characteristcs of the semantic network to represent/learn features • Improved accuracy • Improved novelty • Improved Aggregate Diversity • Entity linking for a better expoitation of text-based data • Select the right approach, dataset, set of properties to build your RS
  147. 147. Not covered here • User profile • Preferences • Context-aware • Knowledge-based approaches • Cross-domain • Feature selection • …
  148. 148. Q & A Tommaso Di Noia tommaso.dinoia@poliba.it @TommasoDiNoia

×