The World Wide Web is moving from a Web of hyper-linked documents to a Web of linked data. Thanks to the Semantic Web technological stack and to the more recent Linked Open Data (LOD) initiative, a vast amount of RDF data have been published in freely accessible datasets connected with each other to form the so called LOD cloud. As of today, we have tons of RDF data available in the Web of Data, but only a few applications really exploit their potential power. The availability of such data is for sure an opportunity to feed personalized information access tools such as recommender systems. We will show how to plug Linked Open Data in a recommendation engine in order to build a new generation of LOD-enabled applications.
(Lecture given @ the 11th Reasoning Web Summer School - Berlin - August 1, 2015)
1. Recommender Systems
and
Linked Open Data
Tommaso Di Noia
Polytechnic University of Bari
ITALY
11th Reasoning Web Summer School – Berlin August 1, 2015
tommaso.dinoia@poliba.it
@TommasoDiNoia
2. Agenda
• A quick introduction to Linked Open Data
• Recommender systems
• Evaluation
• Recommender Systems and Linked Open Data
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. 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.
10. URI
• Every resource/entity/thing/relation is
identified by a (unique) URI
– URI: <http://dbpedia.org/resource/Berlin>
– CURIE: dbpedia:Berlin
– URI: <http://purl.org/dc/terms/subject>
– CURIE: dcterms:subject
11. Which vocabularies/ontologies?
• Most popular on http://prefix.cc (July 25, 2015)
– 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/
12. Which vocabularies/ontologies?
• Most popular on http://lov.okfn.org (July 25,
2015)
– 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. RDF – Resource Description Framework
• Basic element: triple
[subject] [predicate] [object]
URI URI
URI | Literal
"string"@lang | "string"^^datatype
21. Personalized Information Access
• Help the user in finding the information they
might be interested in
• Consider their preferences/past behaviour
• Filter irrelevant information
22. Recommender Systems
• Help users in dealing with Information/Choice Overload
• Help to match users with items
23.
24.
25.
26.
27. 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-Artand
Possible Extension. TKDE, 2005.]
– Recommender Systems (RSs) are software tools and techniques
providingsuggestions for items to be of use to a user.
[F. Ricci, L. Rokach, B. Shapira, and P. B. Kantor, editors. Recommender Systems Handbook. Springer, 2011.]
28. 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
𝑈 = {𝑢1, … , 𝑢 𝑀}
𝑋 = {𝑥1, …, 𝑥 𝑁}
𝑓: 𝑈 × 𝑋 → 𝑅
∀ 𝑢 ∈ 𝑈, 𝑥 𝑢
′
= arg 𝑚𝑎𝑥 𝑥∈𝑋 𝑓(𝑢, 𝑥)
Output
35. Collaborative Recommender Systems
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
….
36. Content-based Recommender Systems
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
38. Collaborative Filtering
• Memory-based
– Mainly based on k-NN
– Does not require any preliminary model building
phase
• Model-based
– Learn a predictive model before computing
recommendations
43. Content-Based Recommender Systems
• Items are described in terms of
attributes/features
• A finite set of values is associated to each
feature
• Item representation is a (Boolean) vector
44. Content-based
CB-RSs try to recommend items similar* to
those a given user has liked in the past
[P. Lops, M. de Gemmis, G. Semeraro. Content-based Recommender Systems: Stateof the Art and Trends. Recommender
Systems Handbook. 2011]
• Heuristic-based
– Usually adopt techniques borrowed from IR
• Model-based
– Often we have a model for each user
(*) similar from a content-based perspective
45. CB drawbacks
• Content overspecialization
• Portfolio effect
• Sparsity / Cold-start
– New user
50. 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)
52. MAE and RMSE drawback
• Not very suitable for top-N recommendation
– Errors in the highest part of the recommendation
list are considered in the same way as the ones in
the lowest part
53. Accuracy metrics for top-N
recommendation
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 @ 𝑁
𝑃𝑢@𝑁 =
|𝐿 𝑢 𝑁 ∩ 𝑇𝑆 𝑢
+
|
𝑁
𝑅𝑒𝑐𝑎𝑙𝑙 @ 𝑁
𝑅 𝑢@𝑁 =
|𝐿 𝑢 𝑁 ∩ 𝑇𝑆 𝑢
+|
|𝑇𝑆 𝑢
+
|
𝑛𝑜𝑟𝑚𝑎𝑙𝑖𝑧𝑒𝑑 𝐷𝑖𝑠𝑐𝑜𝑢𝑛𝑡 𝐶𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑣𝑒 𝐺𝑎𝑖𝑛 @ 𝑁
𝐿 𝑢 𝑁 is the recommendation list
up to the N-th element
𝑇𝑆 𝑢
+ is the set of relevant test
items for 𝑢
𝐼𝐷𝐶𝐺@𝑁 indicates the score
Obtained by an ideal ranking of 𝐿 𝑢 𝑁
55. Is all about precision?
• Diversity
– Avoid to recommend only items in a small subset
of the catalog
– Suggest diverse items in the recommendation list
• Novelty
– Recommend items in the long tail
• Serendipity
– Suggest unexpected but interesting items
59. 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
60. 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
61. Need of domain knowledge!
We need rich descriptionsof the items!
No suggestion is availableif the analyzed content does not contain enough
information to discriminateitems the user might like from items the user
might not like.*
(*) P. Lops,M. de Gemmis,G.Semeraro.Content-basedRecommenderSystems:State of the ArtandTrends.In:P.Kantor,F.Ricci,L. Rokach andB. Shapira,
editors,RecommenderSystemsHandbook:A CompleteGuide forResearchScientists&Practitioners
The quality of CB recommendations are correlated with the quality of the
features that are explicitly associated with the items.
Limited Content Analysis
62. Traditional Content-based RecSys
• 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
64. What about Linked Data?
Use Linked Datato mitigate
the limitedcontent analysis
issue
• Plenty of structureddata
available
• No Content Analyzer
required
Linking Open Data cloud diagram 2014, by Max Schmachtenberg, Christian Bizer, Anja Jentzsch and Richard Cyganiak. http://lod-cloud.net/
81. Item Graph Analyzer
• Build your own knowledge graph
– Select relevant properties. Possible solutions:
• Ontological properties
• Categorical properties
• Frequent properties
– Explore the graph up to a limited depth
82. Which LOD RSs?
• Content-based
– Heuristic-based
– Model based
• Hybrid
• Knowledge-based
86. Datasets
Subset of Movielens mapped to DBpedia
Subset of Last.fm mapped to DBpedia
Subset of The Library Thing mapped to DBpedia
Mappings
http://sisinflab.poliba.it/semanticweb/lod/recsys/datasets/
90. Vector Space Model for LOD
Righteous Kill
starring
director
subject/broader
genre
Heat
RobertDeNiro
JohnAvnet
Serialkillerfilms
Drama
AlPacino
BrianDennehy
Heistfilms
Crimefilms
starring
RobertDeNiro
AlPacino
BrianDennehy
Righteous Kill
Heat
… …
91. 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
𝑤 𝐴𝑙𝑃𝑎𝑐𝑖𝑛𝑜,𝐻𝑒𝑎𝑡 = 𝑡𝑓𝐴𝑙𝑃𝑎𝑐𝑖𝑛𝑜,𝐻𝑒𝑎𝑡 ∗ 𝑖𝑑𝑓𝐴𝑙𝑃𝑎𝑐𝑖𝑛𝑜
92. 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
𝑤 𝐴𝑙𝑃𝑎𝑐𝑖𝑛𝑜,𝐻𝑒𝑎𝑡 = 𝑡𝑓𝐴𝑙𝑃𝑎𝑐𝑖𝑛𝑜,𝐻𝑒𝑎𝑡 ∗ 𝑖𝑑𝑓𝐴𝑙𝑃𝑎𝑐𝑖𝑛𝑜
𝑡𝑓 ∈ {0,1}
94. VSM Content-based Recommender
We predict the rating using a Nearest NeighborClassifier wherein the similarity
measure is a linear combination of localpropertysimilarities
TommasoDi Noia,Roberto Mirizzi,VitoClaudioOstuni,Davide Romito, Markus Zanker.LinkedOpenDatatosupportContent-basedRecommenderSystems.8th
International Conference on SemanticSystems(I-SEMANTICS) - 2012
95. VSM Content-based Recommender
We predict the rating using a Nearest NeighborClassifier wherein the similarity
measure is a linear combination of localpropertysimilarities
Selected properties
96. VSM Content-based Recommender
We predict the rating using a Nearest NeighborClassifier wherein the similarity
measure is a linear combination of localpropertysimilarities
heuristic-based → model-based
97. 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.
Rated test items protocol
101. Path-based features
Analysis of complex relations between the user preferences and the
target item
Vito ClaudioOstuni, Tommaso Di Noia, Eugenio Di Sciascio, Roberto Mirizzi. Top-N Recommendations from Implicit Feedback leveragingLinked Open Data.
7th Conference on Recommender Systems (RecSys ) – 2013
102. 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
103. 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
104. 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
105. 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)
106. Problem formulation
Feature vector
Set of irrelevant items for u
Set of relevantitems for u
Training Set
Sample of irrelevant items for u
𝑋 𝑢
+ = 𝑥 ∈ 𝑋 𝑠Ƹ 𝑢 𝑥 = 1}
𝑋 𝑢
−
= 𝑥 ∈ 𝑋 𝑠Ƹ 𝑢 𝑥 = 0}
𝑋 𝑢
−∗ ⊆ 𝑋 𝑢
−
𝑤𝑢𝑥 ∈ ℝ 𝐷
TR = ڂ < 𝑤𝑢𝑥, 𝑠Ƹ 𝑢 𝑥 > 𝑥 ∈ (𝑋 𝑢
+
∪ 𝑋 𝑢
−∗
)}𝑢
114. 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
userprofile size
Movielens
BagBoo
GBRT
Sum
115. 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
userprofile size
Last.fm
BagBoo
GBRT
Sum
116. Comparative approaches
• BPRMF, Bayesian Personalized Ranking for Matrix Factorization
• BPRLin, Linear Model optimized for BPR (Hybrid alg.)
• SLIM, Sparse Linear Methods for Top-N Recommender Systems
• SMRMF, Soft Margin Ranking Matrix Factorization
MyMediaLite
126. Kernel Methods
Work by embedding data in a vector space and looking for linear
patterns in such space
𝑥 → 𝜙(𝑥)
[Kernel Methods for General PatternAnalysis. 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
𝑘 𝑥𝑖, 𝑥𝑗 = < 𝜙(𝑥𝑖), 𝜙(𝑥𝑗)>
128. Explicit computation of the feature map
# edges involving 𝑒 𝑚 at l hops from 𝑥𝑖
a.k.a. frequency of the entity in the
item neighborhood graph
factor taking into account at which hop the entity appears
h-hop Item Entity-based
Neighborhood Graph Kernel
𝑘 𝐺ℎ 𝑥𝑖, 𝑥𝑗 = 𝜙 𝐺ℎ 𝑥𝑖 , 𝜙 𝐺ℎ 𝑥𝑗
𝜙 𝐺ℎ 𝑥𝑖 = (𝑤𝑥𝑖,𝑒1
, 𝑤𝑥𝑖,𝑒2
, …, 𝑤𝑥𝑖,𝑒 𝑚
, … , 𝑤 𝑥𝑖,𝑒 𝑡
)
131. 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]
137. The FreeSound case study
Vito ClaudioOstuni, Sergio Oramas, Tommaso Di Noia, Xavier Serra, Eugenio Di Sciascio. A Semantic Hybrid Approach for Sound Recommendation. 24th
World Wide Web Conference - 2015
138. FreeSound Knowledge Graph
Item textual descriptions enrichment: Entity Linking tools can be used
to enrich item textual descriptions with LOD
139. Explicit computation of the feature map
# sequences and subsequences of nodes
from 𝑥𝑖 to em
Normalization factor
h-hop Item Node-Based
Neighborhood Graph Kernel
𝜙 𝐺ℎ 𝑥𝑖 = (𝑤𝑥𝑖,𝑝∗1
, …, 𝑤𝑥𝑖,𝑝∗ 𝑚
, … , 𝑤 𝑥𝑖,𝑝∗ 𝑡
)
𝑘 𝐺ℎ 𝑥𝑖, 𝑥𝑗 = 𝜙 𝐺ℎ 𝑥𝑖 , 𝜙 𝐺ℎ 𝑥𝑗
140. 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 rated the item
u1 u2 u3 …. entity1 entity2 …. keyw1 keyw2 … tag1 …
entities from the knowledge
graph (explicit feature mapping)
Keywords extracted from
the textual description
tags associated to the item
Item Feature Vector
144. • Feature combination hybrid approach
• adding collaborative features to item contentfeature vectors can improve
considerably recommendation accuracy
• Semantic Enrichment
• semantics can help in improving differentperformances beyond accuracy
such as novelty and catalog coverage
Hybrid approaches:
some lessons learnt
146. 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)
148. A comparison between
DBpedia and Freebase
Accuracy Coverage Diversity Novelty
Freebase + + - -
DBpedia - - + +
Phuong Nguyen, Paolo Tomeo, Tommaso Di Noia, Eugenio Di Sciascio. Content-based recommendationsvia DBpedia and Freebase: a casestudy
in the music domain. The14th International Semantic Web Conference - ISWC 2015
149. A comparison between
DBpedia and Freebase
Accuracy Coverage Diversity Novelty
1-hop - - - +
2-hop + + + -
Phuong Nguyen, Paolo Tomeo, Tommaso Di Noia, Eugenio Di Sciascio. Content-based recommendationsvia DBpedia and Freebase: a casestudy
in the music domain. The14th International Semantic Web Conference - ISWC 2015
150. Conclusions
• Linked Open Data to enrich the contentdescriptionsof
item
• Exploit differentcharacteristcsof the semantic network
to represent/learnfeatures
• Improved accuracy
• Improved novelty
• Improved Aggregate Diversity
• Entity linking for a better expoitationof text-based
data
• Select the right approach, dataset,set of properties to
build your RS
151. 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?
152. Not covered here
• User profile
• Preferences
• Context-aware
• Knowledge-based approaches
• …
153. Many thanks to the
RecSys crew @ SisInf Lab
Roberto Mirizzi
now at Yahoo! CA
Vito Claudio Ostuni
now at
Jessica Rosati
Phd Fellowship Awardee @
Paolo Tomeo
Jindřich Mynarz
Phuong Nguyen
Sergio Oramas
Aleksandra Karpus
Visiting Students and PostDoc
154. Recommender Systems
and
Linked Open Data
Tommaso Di Noia
Polytechnic University of Bari
ITALY
11th Reasoning Web Summer School – Berlin August 1, 2015
tommaso.dinoia@poliba.it
@TommasoDiNoia