Learning Rules Rule Selection
iPhone MacBook
item
iPhone’s
charger
Apple
Entity
Apple’s
charger
MacBook
iPhone
Knowledge graph
Google
Linking items
Pixel
Relations
Buy Together
Phones.
Manufacturer
Accessories.
Manufacturer
Accessories.
Manufacturer
Also View
Phones.
Manufacturer
Rivals
Buy Together
Rules 𝒘
phones.manufacturer, rivals,
phones.manufacturer, rivals,
earsets..manufacture𝑟
#$
)
→&Buy Also
0.14
…
Purchase
history
iPhone
Battery
Monitor
…
Rule Learning Module
Rules
Recommended
items
Earset
Laptop
….
Recommendation Module
Black edges: Relations
Colored edges: Item associations
𝒘
0.12
0.21
0.03
0.14
…
Heterogeneous Graph Construction
Figure 2: Overview of the Proposed RuleRec Framework
. First, we build a heterogeneous graph from items and a knowledge graph. The rule learning
module learns the importance of rules and the recommendation module learns the importance at the same time by sharing a parameter vector w.
!
"
Entities
Items
#
$
#
%
#
&
#
'
#
(
#
)
Paths between ! and ":
*
+
, -
+
#
$
-
.
*
%
, -
/
#
%
-
0
#
&
-
1
#
'
-
2
*
&
, -
/
#
%
-
3
#
(
-
4
#
)
-
5
Edge type:
-
$
6 -
%
6 -
(
6 -
2
6 -
5
7 8
$
-
&
6 -
'
7 8
%
-
1
6 -
4
7 8
&
-
$
-
%
-
&
-
'
-
(
-
1
-
2
-
4
-
5
Related reasoning rules:
Rules for *
$
9: ;
$
, 8
$
8
$
Rules for *
%
6 *
&
9: ;
/
, 8
$
8
%
8
&
8
$
Figure 3:
An example of a heterogeneous graph which consists of items
and entities in a knowledge graph. The dashed lines are links between items
and entities generated by an entity linking algorithm.
respectively. The prediction equation of NCF is dened in Eq
(5)
,
in which the outputs of GMF and MLP parts are concatentated to
get the nal score. And we modied the objective function of NCF
into Eq (6) in this paper.
S
u, i
= ϕ(α · h
u, i
⊕ (1 − α) · g
u, i
) (5)
O
N C F
= σ (
Õ
u ∈U
Õ
p ∈I
u
,n <I
u
(S
u, p
− S
u, n
))
(6)
3 THE RULEREC FRAMEWORK
Framework Overview.
Recommendation with rule learning con-
sists of two sub-tasks: 1) rule learning in a knowledge graph based
on item associations; 2) recommending items for each user
u
with
his/her purchase history I
u
and the derived rules R.
To cope with these tasks, we design a multi-task learning frame-
work. The framework consists of two modules, a rule learning
module and a recommendation module. The rule learning module
aims to derive useful rules through reasoning rules with ground-
truth item associations in the knowledge graph. Based on the rule
set, we can generate an item-pair feature vector whose each entry
is an encoded value of each rule. The recommendation module
takes the item-pair feature vector as additional input to enhance
recommendation performances and give explanations for the rec-
ommendation. We introduce a shared rule weight vector
w
which
indicates the importance of each rule in predicting user preference,
and shows the eectiveness of each rule in predicting item pair
associations. Besides, based on the assume that useful rules per-
form consistently in both modules with higher weights, we design
a objective function to conduct jointly learning:
min
V ,W
O = min
V ,W
{O
r
+ λO
l
} (7)
where
V
denotes the parameters of the recommendation module,
and
W
represents the shared parameters of the rule learning and
the recommendation module. The objective function consists of two
terms:
O
r
is the objective of the recommendation module, which
recommends items based on the induced rules.
O
l
is the objective
of the rule learning module, in which we leverage the given item
associations to learn useful rules. λ is a trade-o parameter.
3.1 Heterogeneous Graph Construction
First, we build a heterogeneous graph containing items for the
recommendation and a knowledge graph. For some items, we can
conduct exactly mapping between the item and the entity, such as
“iPhone", “Macbook". For other items, it is hard to nd an entity
that represents the items, such iPhone’s charger. Thus, we adopt
entity linking algorithm [
6
] to nd the related entities of an item
from its title, brand, and description in the shopping website. In this
way, we can add new nodes to the knowledge graph that represents
items and add some edges for it according to entity linking results.
Then, we get a heterogeneous graph which contains the items and
the original knowledge graph. Fig. 3 is an example.
3.2 Rule Learning Module
The rule learning module aims to nd the reliable rule set
R
A
asso-
ciated with given item associations A in the heterogeneous graph.
Rule learning.
For any item pair (
a
,
b
) in the heterogeneous graph,
we use a random walk based algorithm to compute the probabilities
of nding paths which follow certain rules between the item pair,
similar to [
16
,
17
]. Then, we obtain feature vectors for item pairs.
Each entry of the feature vector is the probability of a rule between
the item pair. Here, we focus on relation types between the item
pair to obtain rules such as
R
1
in Fig. 3, because it is general to the
entities to capture the rules between items.