CN111949892A - A Multi-Relation Aware Temporal Interaction Network Prediction Method - Google Patents

A Multi-Relation Aware Temporal Interaction Network Prediction Method Download PDF

Info

Publication number
CN111949892A
CN111949892A CN202010797094.5A CN202010797094A CN111949892A CN 111949892 A CN111949892 A CN 111949892A CN 202010797094 A CN202010797094 A CN 202010797094A CN 111949892 A CN111949892 A CN 111949892A
Authority
CN
China
Prior art keywords
interaction
relationship
representation
neighbor
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010797094.5A
Other languages
Chinese (zh)
Other versions
CN111949892B (en
Inventor
陈岭
余珊珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN202010797094.5A priority Critical patent/CN111949892B/en
Publication of CN111949892A publication Critical patent/CN111949892A/en
Application granted granted Critical
Publication of CN111949892B publication Critical patent/CN111949892B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9536Search customisation based on social or collaborative filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种多关系感知的时态交互网络预测方法,包括:(1)将时态交互网络中的交互作为样本;(2)按交互发生时间依次处理每个交互,基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点构建当前交互前的局部关系图;(3)根据用户上一次交互后的表示以及通过层次化多关系感知聚合得到的用户基于邻居的表示预测当前交互前物品的表示;(4)根据交互节点上一次交互后的表示、上一次交互和当前交互的时间间隔以及基于邻居的表示来更新交互节点的表示;(5)对时态交互网络预测模型进行训练后,利用参数调优后的时态交互网络预测模型预测用户可能会发生交互的物品。

Figure 202010797094

The invention discloses a multi-relation-aware temporal interaction network prediction method, comprising: (1) taking the interaction in the temporal interaction network as a sample; (2) processing each interaction in sequence according to the interaction occurrence time, and based on historical interaction information Mining nodes with historical interaction, common interaction and interaction sequence similarity with interactive nodes, and constructs a local relationship graph before the current interaction for the interaction node; (3) According to the user's last interaction representation and through hierarchical The relationship-aware aggregation obtained by the user predicts the representation of the item before the current interaction based on the representation of the neighbors; (4) According to the representation of the interaction node after the last interaction, the time interval between the last interaction and the current interaction, and the neighbor-based representation, update the interaction node's representation. (5) After training the temporal interaction network prediction model, use the parameter-tuned temporal interaction network prediction model to predict items that users may interact with.

Figure 202010797094

Description

一种多关系感知的时态交互网络预测方法A Multi-Relation Aware Temporal Interaction Network Prediction Method

技术领域technical field

本发明涉及时态交互网络预测领域,具体涉及一种多关系感知的时态交互网络预测方法。The invention relates to the field of temporal interaction network prediction, in particular to a multi-relation-aware temporal interaction network prediction method.

背景技术Background technique

在现实生活许多领域中,例如电子商务(顾客购买商品)、教育平台(学生参加慕课教程)和社交网络平台(用户在社区中发布帖子),用户会在不同时间和不同物品发生交互,用户和物品之间的交互形成了时态交互网络。与静态交互网络相比,时态交互网络增加了对交互时间的关注。时态交互网络预测指在交互发生前预测用户会和哪个物品进行交互,对于商品推荐、课程推荐、社区推荐等任务具有重要意义。In many real-life areas, such as e-commerce (customers buy goods), educational platforms (students take MOOCs), and social networking platforms (users post in communities), users interact with different items at different times, and users The interaction with objects forms a temporal interaction network. Compared with static interaction networks, temporal interaction networks increase the focus on interaction time. Temporal interaction network prediction refers to predicting which item the user will interact with before the interaction occurs, which is of great significance for tasks such as product recommendation, course recommendation, and community recommendation.

现有基于时态交互网络的预测方法包括两类,一类是不基于图结构的预测方法,另一类是基于图结构的预测方法。不基于图结构的预测方法是指不以图结构而以矩阵或序列等其他形式表示用户和物品之间的交互,可以分为基于隐语义模型的预测方法和基于序列模型的预测方法。基于隐语义模型的预测方法在传统隐语义模型的基础上引入时间信息来建模用户兴趣和物品属性的变化,得到用户和物品的表示从而进行预测。然而,这类工作没有考虑用户和物品之间发生交互的顺序。在时态交互网络中往往存在着丰富的序列信息,为了利用这些信息,许多基于序列模型的预测方法被提出,然而,这些方法都利用物品静态的表示作为输入来更新用户的表示,忽略了物品的当前状态信息。此外,这些方法大部分只考虑了用户兴趣的动态变化,忽略了物品属性的动态变化。Existing prediction methods based on temporal interaction networks include two categories, one is a prediction method not based on graph structure, and the other is a prediction method based on graph structure. Prediction methods not based on graph structure refer to representing the interaction between users and items in other forms such as matrices or sequences instead of graph structures. They can be divided into prediction methods based on latent semantic models and prediction methods based on sequence models. The prediction method based on the latent semantic model introduces time information on the basis of the traditional latent semantic model to model the changes of user interests and item attributes, and obtains the representation of users and items for prediction. However, this type of work does not consider the order in which interactions between users and items occur. There is often rich sequence information in temporal interaction networks. In order to utilize this information, many prediction methods based on sequence models have been proposed. However, these methods all use the static representation of items as input to update the user's representation, ignoring the items. current status information. In addition, most of these methods only consider the dynamic changes of user interests and ignore the dynamic changes of item attributes.

为了挖掘到用户和物品交互中更加丰富的信息,许多基于图结构的预测方法被提出。传统基于图结构的预测方法虽然将时间段作为图中节点,但其本质上还是静态图,无法很好建模用户和物品属性的动态性。为了解决这一问题,许多基于时态交互网络嵌入的预测方法被提出。基于时态交互网络嵌入的预测方法对时态交互网络进行嵌入得到用户和物品的表示从而进行预测。根据嵌入时是否聚合邻居信息,基于时态交互网络嵌入的预测方法可分为不考虑邻居信息的预测方法和考虑邻居信息的预测方法。不考虑邻居信息的预测方法虽然建模了交互节点的属性变化,但忽略了邻居信息的影响。现有的考虑邻居信息的预测方法考虑邻居信息时,只将具有历史交互关系的节点作为邻居节点,忽略了历史交互信息中的其他关系类型(共同交互关系、交互序列相似关系等)。In order to mine richer information in user-item interactions, many prediction methods based on graph structure have been proposed. Although traditional prediction methods based on graph structure use time periods as nodes in the graph, they are essentially static graphs and cannot model the dynamics of user and item attributes well. To address this issue, many prediction methods based on temporal interaction network embeddings have been proposed. Prediction methods based on temporal interaction network embeddings embed temporal interaction networks to obtain representations of users and items for prediction. According to whether neighbor information is aggregated during embedding, prediction methods based on temporal interaction network embedding can be divided into prediction methods that do not consider neighbor information and prediction methods that consider neighbor information. Although the prediction method without considering neighbor information models the attribute changes of interacting nodes, it ignores the influence of neighbor information. When the existing prediction methods considering neighbor information consider neighbor information, only nodes with historical interaction relationship are regarded as neighbor nodes, ignoring other relationship types (common interaction relationship, interaction sequence similarity relationship, etc.) in the historical interaction information.

发明内容SUMMARY OF THE INVENTION

鉴于上述,本发明提供了一种多关系感知的时态交互网络预测方法,通过有效利用邻居信息提升时态交互网络预测的准确性。In view of the above, the present invention provides a multi-relation-aware temporal interaction network prediction method, which improves the accuracy of temporal interaction network prediction by effectively utilizing neighbor information.

本发明的技术方案为:The technical scheme of the present invention is:

一种多关系感知的时态交互网络预测方法,包括以下步骤:A multi-relation-aware temporal interaction network prediction method, comprising the following steps:

(1)以用户ui和物品vj在时刻t发生的交互(ui,vj,t)作为一个样本构建训练数据集,并对训练数据集进行分批;(1) The interaction (u i , v j , t) between user ui and item v j at time t is used as a sample to construct a training data set, and the training data set is divided into batches;

(2)对于交互(ui,vj,t),基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点ui和vj构建当前交互前的局部关系图

Figure BDA0002626046320000021
Figure BDA0002626046320000022
(2) For interaction (u i , v j , t), based on historical interaction information mining nodes with historical interaction relationship, common interaction relationship and interaction sequence similarity relationship between interaction nodes, and construct for interaction nodes u i and v j Local relationship graph before the current interaction
Figure BDA0002626046320000021
and
Figure BDA0002626046320000022

(3)根据局部关系图

Figure BDA0002626046320000023
Figure BDA0002626046320000024
通过层次化多关系感知聚合得到用户ui基于邻居的表示
Figure BDA0002626046320000031
和物品vj基于邻居的表示
Figure BDA0002626046320000032
(3) According to the local relationship diagram
Figure BDA0002626046320000023
and
Figure BDA0002626046320000024
Neighbor-based representation of user ui is obtained through hierarchical multi-relation-aware aggregation
Figure BDA0002626046320000031
and neighbor-based representation of item v j
Figure BDA0002626046320000032

(4)根据用户ui上一次交互后的表示

Figure BDA0002626046320000033
和用户ui基于邻居的表示
Figure BDA0002626046320000034
利用全连接层计算当前交互前物品vj预测的表示
Figure BDA0002626046320000035
(4) According to the representation of user ui after the last interaction
Figure BDA0002626046320000033
and the neighbor-based representation of user ui
Figure BDA0002626046320000034
Using a fully connected layer to compute a representation of the prediction of the item v j before the current interaction
Figure BDA0002626046320000035

(5)根据用户ui和物品vj上一次交互后的表示

Figure BDA0002626046320000036
Figure BDA0002626046320000037
上一次交互和当前交互的时间间隔
Figure BDA0002626046320000038
Figure BDA0002626046320000039
以及基于邻居的表示
Figure BDA00026260463200000310
Figure BDA00026260463200000311
利用两个循环神经网络层分别计算用户ui和物品vj当前交互后的表示
Figure BDA00026260463200000312
Figure BDA00026260463200000313
(5) According to the last interaction between user ui and item v j
Figure BDA0002626046320000036
and
Figure BDA0002626046320000037
The time interval between the last interaction and the current interaction
Figure BDA0002626046320000038
and
Figure BDA0002626046320000039
and a neighbor-based representation
Figure BDA00026260463200000310
and
Figure BDA00026260463200000311
Use two recurrent neural network layers to calculate the current interaction representation of user ui and item v j respectively
Figure BDA00026260463200000312
and
Figure BDA00026260463200000313

(6)根据当前交互前物品vj预测的表示

Figure BDA00026260463200000314
和真实的表示
Figure BDA00026260463200000315
之间的误差、用户ui正则化损失和物品vj正则化损失,计算整体损失
Figure BDA00026260463200000316
根据批次中所有样本的损失
Figure BDA00026260463200000317
对时态交互网络预测模型中的网络参数进行调整,直到所有批次都参与了模型训练,所述时态交互网络预测模型包括步骤(2)~(6)用到的所有全连接层和循环神经网络层;(6) Representation predicted according to the current pre-interaction item v j
Figure BDA00026260463200000314
and true representation
Figure BDA00026260463200000315
The error between, user ui regularization loss and item v j regularization loss, calculate the overall loss
Figure BDA00026260463200000316
Loss based on all samples in the batch
Figure BDA00026260463200000317
Adjust the network parameters in the temporal interaction network prediction model until all batches participate in model training, and the temporal interaction network prediction model includes all fully connected layers and loops used in steps (2) to (6). neural network layer;

(7)利用参数调优后的时态交互网络预测模型预测用户可能会发生交互的物品。(7) Use the temporal interaction network prediction model after parameter tuning to predict the items that users may interact with.

本发明基于历史交互信息挖掘节点之间的多关系,为交互节点构建当前交互前的局部关系图,通过层次化多关系感知聚合来考虑邻居节点根据不同关系类型传播过来的交互影响。与现有方法相比,其优点在于:The present invention mines multi-relationships between nodes based on historical interaction information, constructs a local relationship graph before current interaction for interaction nodes, and considers the interaction effects propagated by neighbor nodes according to different relationship types through hierarchical multi-relational perceptual aggregation. Compared with existing methods, its advantages are:

1)基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点构建当前交互前的局部关系图,通过层次化多关系感知聚合得到交互节点基于邻居的表示来预测物品的表示以及更新交互节点的表示,考虑了节点之间的多关系,有效利用邻居信息,从而提升时态交互网络预测的准确性;1) Based on historical interaction information mining and nodes with historical interaction relationship, common interaction relationship and interaction sequence similarity relationship between interaction nodes, construct a local relationship graph before current interaction for interaction nodes, and obtain interaction nodes through hierarchical multi-relationship perception aggregation Predicting the representation of items and updating the representation of interactive nodes based on the representation of neighbors, considering multiple relationships between nodes, effectively utilizing neighbor information, thereby improving the accuracy of temporal interaction network prediction;

2)引入带注意力层的图神经网络,根据邻居节点传播过来的交互影响和节点之间的关系类型为邻居节点赋予相应权重,层次化地聚合根据不同关系类型传播过来的交互影响。2) Introduce a graph neural network with an attention layer, assign corresponding weights to neighbor nodes according to the interaction influences propagated by neighbor nodes and the relationship types between nodes, and hierarchically aggregate the interaction influences propagated according to different relationship types.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动前提下,还可以根据这些附图获得其他附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative efforts.

图1是实施例提供的多关系感知的时态交互网络预测方法整体流程图;1 is an overall flowchart of a multi-relation-aware temporal interaction network prediction method provided by an embodiment;

图2是实施例提供的多关系感知的时态交互网络预测方法整体框架图;2 is an overall framework diagram of a multi-relation-aware temporal interaction network prediction method provided by an embodiment;

图3是实施例提供的层次化多关系感知聚合示意图。FIG. 3 is a schematic diagram of hierarchical multi-relationship-aware aggregation provided by an embodiment.

具体实施方式Detailed ways

为使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例对本发明进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本发明,并不限定本发明的保护范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and do not limit the protection scope of the present invention.

图1是实施例提供的多关系感知的时态交互网络预测方法整体流程图。图2是实施例提供的多关系感知的时态交互网络预测方法整体框架图。如图1和图2所示,实施例提供的多关系感知的时态交互网络预测方法包括以下步骤:FIG. 1 is an overall flowchart of a multi-relation-aware temporal interaction network prediction method provided by an embodiment. FIG. 2 is an overall framework diagram of a multi-relation-aware temporal interaction network prediction method provided by an embodiment. As shown in FIG. 1 and FIG. 2 , the multi-relation-aware temporal interaction network prediction method provided by the embodiment includes the following steps:

步骤1,输入时态交互网络

Figure BDA0002626046320000041
表示按时间排序的N个交互,i为交互的索引,将每个交互s作为样本得到训练数据集,其中s=(u,v,t)表示用户
Figure BDA0002626046320000042
和物品
Figure BDA0002626046320000043
Figure BDA0002626046320000044
时刻发生的交互,
Figure BDA0002626046320000045
Figure BDA0002626046320000046
分别为用户集合、物品集合和交互时间集合。将训练数据集按照t-n-Batch算法进行分批,批次总数为C。Step 1, input the temporal interaction network
Figure BDA0002626046320000041
Represents N interactions sorted by time, i is the index of the interaction, and each interaction s is used as a sample to obtain a training data set, where s=(u, v, t) represents the user
Figure BDA0002626046320000042
and items
Figure BDA0002626046320000043
exist
Figure BDA0002626046320000044
interactions that take place all the time,
Figure BDA0002626046320000045
and
Figure BDA0002626046320000046
They are user set, item set and interaction time set respectively. The training data set is divided into batches according to the tn-Batch algorithm, and the total number of batches is C.

实施例中,利用t-n-Batch算法对训练数据集进行分批,使同一个批次中的交互可以并行处理,并且按批次的索引顺序处理所有批次时可以保持交互之间的时间依赖。In the embodiment, the t-n-Batch algorithm is used to batch the training data set, so that the interactions in the same batch can be processed in parallel, and the time dependency between the interactions can be maintained when all batches are processed in the order of the index of the batch.

利用t-n-Batch算法对训练数据集进行分批的过程为:The process of batching the training data set using the t-n-Batch algorithm is as follows:

首先,初始化N个空批次,然后遍历训练数据集,将每个交互划分到相应的批次中。令lastU和lastV分别记录用户和物品所在批次的最大索引。以交互(ui,vj,t)为例,lastU[ui]表示用户ui所在批次的最大索引,即索引为lastU[ui]的批次中的交互涉及到用户ui,且该批次为涉及到该用户的批次中索引最大的。同理lastV[vj]表示物品vj所在批次的最大索引,idxN为用户ui和物品vj的所有邻居节点所在batch的最大索引。由于每个节点在一个批次中最多只能出现一次,并且每个节点的第i个和第i+1个交互需要分别被划分到第k个批次Bk和第l个批次Bl,其中k<l,因此交互(ui,vj,t)会被划分到索引为max(lastU[ui],lastV[vj],idxN)+1的批次。批次划分结束后,去掉多余的空批次,剩余批次总数为C。First, N empty batches are initialized, and then the training dataset is traversed, dividing each interaction into a corresponding batch. Let lastU and lastV record the maximum index of the batch in which the user and item are located, respectively. Taking the interaction (u i , v j , t) as an example, lastU[u i ] represents the maximum index of the batch where the user ui is located, that is, the interaction in the batch with the index lastU[u i ] involves the user ui , And the batch has the largest index among the batches involving the user. Similarly lastV[v j ] represents the maximum index of the batch where item v j is located, and idxN is the maximum index of the batch where user ui and all neighbor nodes of item v j are located. Since each node can only appear at most once in a batch, and the i-th and i+1-th interactions of each node need to be divided into the k-th batch B k and the l-th batch B l respectively , where k<l, so interactions (u i ,v j ,t) are divided into batches with index max(lastU[u i ],lastV[v j ],idxN)+1. After the batch division is completed, the redundant empty batches are removed, and the total number of remaining batches is C.

步骤2,从训练数据集中顺序选取索引为k的一批训练样本,其中k∈{1,2,…,C}。对该批次中的每一个训练样本,进行步骤3-7。Step 2, sequentially select a batch of training samples with index k from the training dataset, where k∈{1,2,…,C}. For each training sample in the batch, proceed to steps 3-7.

步骤3,对于交互(ui,vj,t),基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点ui和vj构建当前交互前的局部关系图

Figure BDA0002626046320000051
Figure BDA0002626046320000052
Step 3: For interaction (u i , v j , t), based on historical interaction information, mine the nodes with historical interaction, common interaction and interaction sequence similarity with interaction nodes, and construct for interaction nodes ui and vj . Local relationship graph before the current interaction
Figure BDA0002626046320000051
and
Figure BDA0002626046320000052

本实施例中,以节点ni为例,局部关系图

Figure BDA0002626046320000053
其中
Figure BDA0002626046320000054
Figure BDA0002626046320000055
分别表示与节点ni相关的节点集合、边集合、关系类型集合和关系属性集合。边e定义为三元组
Figure BDA0002626046320000058
表示节点ni与节点nj之间存在关系,关系类型为
Figure BDA0002626046320000056
包括历史交互关系、共同交互关系和交互序列相似关系三种类型,关系属性为
Figure BDA0002626046320000057
其中q=(t,w),t表示时间属性,w表示权重属性。In this embodiment, taking the node n i as an example, the local relationship diagram
Figure BDA0002626046320000053
in
Figure BDA0002626046320000054
and
Figure BDA0002626046320000055
Respectively represent the node set, edge set, relation type set and relation attribute set related to node n i . Edge e is defined as a triple
Figure BDA0002626046320000058
Indicates that there is a relationship between node n i and node n j , and the relationship type is
Figure BDA0002626046320000056
It includes three types of historical interaction relationship, common interaction relationship and interaction sequence similarity relationship. The relationship attributes are
Figure BDA0002626046320000057
Where q=(t, w), t represents the time attribute, and w represents the weight attribute.

多关系导出的具体方法如下:The specific method of multi-relation export is as follows:

1)历史交互关系1) Historical interaction

若两个节点历史上发生过交互,则两个节点之间存在历史交互关系,历史交互关系的时间属性t为两个节点最后一次交互的时刻,权重属性w为历史发生交互的次数。If the two nodes have interacted in the history, there is a historical interaction relationship between the two nodes. The time attribute t of the historical interaction relationship is the last interaction time between the two nodes, and the weight attribute w is the number of historical interactions.

2)共同交互关系2) Common interaction

若两个节点在T时间段内和同一个节点发生过交互,则两个节点之间存在共同交互关系。共同交互关系的时间属性t为两个节点最后一次共同交互的时刻,其中共同交互的时刻为两个节点和同一个节点交互的时刻中离当前最近的时刻,权重属性w为历史共同交互次数。If the two nodes have interacted with the same node within the T time period, there is a common interaction relationship between the two nodes. The time attribute t of the common interaction relationship is the last time when the two nodes interact together, where the time of common interaction is the closest moment to the current moment when the two nodes interact with the same node, and the weight attribute w is the number of historical common interactions.

3)交互序列相似关系3) Reciprocal sequence similarity

将所有交互序列看成“文档”,每个交互序列看成“句子”,交互序列中的节点看成“词”,利用Doc2Vec模型分别对用户交互序列和物品交互序列进行嵌入后,可以得到每个用户基于交互序列的表示和每个物品基于交互序列的表示。All interaction sequences are regarded as "documents", each interaction sequence is regarded as "sentence", and the nodes in the interaction sequence are regarded as "words". interaction-sequence-based representation of each user and interaction-sequence-based representation of each item.

由于用户和物品之间不断发生交互,使用增量训练的方式来更新Doc2Vec模型,得到新的用户和物品基于交互序列的表示。给定两个同类型节点(两个用户或两个物品)ni和nj基于交互序列的表示

Figure BDA0002626046320000061
Figure BDA0002626046320000062
计算两者之间的余弦相似度,计算方式如下:Due to the continuous interaction between users and items, incremental training is used to update the Doc2Vec model to obtain new representations of users and items based on interaction sequences. Given two nodes of the same type (two users or two items) n i and n j based on the interaction sequence representation
Figure BDA0002626046320000061
and
Figure BDA0002626046320000062
Calculate the cosine similarity between the two as follows:

Figure BDA0002626046320000063
Figure BDA0002626046320000063

其中,·表示点积。where · represents the dot product.

设置阈值μ,只有当余弦相似度cosSim

Figure BDA0002626046320000064
大于阈值μ时,两个节点之间存在交互序列相似关系。交互序列相似关系的时间属性t为两个节点交互序列中最后发生的交互的时刻,权重属性w为余弦相似度。Set the threshold μ, only when the cosine similarity cosSim
Figure BDA0002626046320000064
When it is greater than the threshold μ, there is an interaction sequence similarity relationship between the two nodes. The time attribute t of the interaction sequence similarity relationship is the moment of the last interaction in the interaction sequence of the two nodes, and the weight attribute w is the cosine similarity.

通过上述多关系导出具体方法挖掘与交互节点存在历史交互关系、共同交互关系和交互序列相似关系的节点后,即可以为交互节点ui和vj构建当前交互前的局部关系图

Figure BDA0002626046320000071
Figure BDA0002626046320000072
After mining the nodes that have historical interaction relationship, common interaction relationship and interaction sequence similarity relationship with interactive nodes through the above specific method of multi-relation derivation, the local relationship graph before the current interaction can be constructed for the interaction nodes u i and v j
Figure BDA0002626046320000071
and
Figure BDA0002626046320000072

步骤4,根据局部关系图

Figure BDA0002626046320000073
Figure BDA0002626046320000074
通过层次化多关系感知聚合得到用户ui基于邻居的表示
Figure BDA0002626046320000075
和物品vj基于邻居的表示
Figure BDA0002626046320000076
Step 4, according to the local relationship diagram
Figure BDA0002626046320000073
and
Figure BDA0002626046320000074
Neighbor-based representation of user ui is obtained through hierarchical multi-relation-aware aggregation
Figure BDA0002626046320000075
and neighbor-based representation of item v j
Figure BDA0002626046320000076

实施例中,层次化多关系感知聚合共包含两层聚合过程:关系内聚合和关系间聚合。图3给出了层次化多关系感知聚合示意图。In the embodiment, the hierarchical multi-relationship-aware aggregation includes a total of two layers of aggregation processes: intra-relational aggregation and inter-relational aggregation. Figure 3 presents a schematic diagram of hierarchical multi-relation-aware aggregation.

为简化运算,将邻居节点上一次交互后的表示作为其传播过来的交互影响。以节点ni为例,构建该节点在当前交互前的局部关系图

Figure BDA0002626046320000077
若节点ni为用户,对应用户为uj,则该节点上一次交互后的表示为
Figure BDA0002626046320000078
若节点ni为物品,对应物品为vj,则该节点上一次交互后的表示为
Figure BDA0002626046320000079
为简化符号,将节点ni上一次交互后的表示记为
Figure BDA00026260463200000710
当节点ni发生交互时,给定该节点在上一次交互和当前交互的时间间隔内,局部关系图
Figure BDA00026260463200000711
中发生了交互的邻居节点传播过来的交互影响,即邻居节点发生交互后的表示
Figure BDA00026260463200000712
其中M为邻居节点中发生了交互的节点数量,层次化多关系感知聚合的具体过程为:In order to simplify the operation, the representation of the neighbor node after the last interaction is taken as its propagated interaction influence. Taking node n i as an example, construct the local relationship graph of this node before the current interaction
Figure BDA0002626046320000077
If the node n i is a user and the corresponding user is u j , the representation of the node after the last interaction is:
Figure BDA0002626046320000078
If the node n i is an item and the corresponding item is v j , the representation of the node after the last interaction is
Figure BDA0002626046320000079
To simplify the notation, denote the representation of node n i after the last interaction as
Figure BDA00026260463200000710
When node n i interacts, given the time interval between the last interaction and the current interaction of this node, the local relationship graph
Figure BDA00026260463200000711
The interactive influence propagated by the interacting neighbor nodes, that is, the representation after the neighbor nodes interact
Figure BDA00026260463200000712
where M is the number of nodes that interact with neighbor nodes, and the specific process of hierarchical multi-relationship-aware aggregation is:

第一层为关系内聚合,聚合邻居节点根据同一种关系类型传播过来的交互影响,为不同的邻居节点赋予相应的权重,得到节点基于特定关系类型的邻居表示。为区分节点之间的关系类型,利用三个参数不同的包含K个头的多头注意力机制分别对历史交互关系、共同交互关系和交互序列相似关系进行关系内聚合,得到节点ni基于历史交互关系的邻居表示

Figure BDA00026260463200000713
基于共同交互关系的邻居表示
Figure BDA00026260463200000714
和基于交互序列相似关系的邻居表示
Figure BDA0002626046320000081
The first layer is intra-relational aggregation, which aggregates neighbor nodes according to the interactive influences propagated by the same relationship type, assigns corresponding weights to different neighbor nodes, and obtains a node’s neighbor representation based on a specific relationship type. In order to distinguish the relationship types between nodes, three multi-head attention mechanisms including K heads with different parameters are used to aggregate historical interaction, common interaction and interaction sequence similarity respectively, and get node n i based on historical interaction. neighbors said
Figure BDA00026260463200000713
Neighbor Representation Based on Common Interactions
Figure BDA00026260463200000714
and neighbor representations based on interaction sequence similarity
Figure BDA0002626046320000081

对于给定节点ni的邻居节点nj,多头注意力机制的输入为

Figure BDA0002626046320000082
则第k个头的注意力机制的输入
Figure BDA0002626046320000083
计算如下:For the neighbor nodes n j of a given node n i , the input of the multi-head attention mechanism is
Figure BDA0002626046320000082
Then the input of the attention mechanism of the kth head
Figure BDA0002626046320000083
The calculation is as follows:

Figure BDA0002626046320000084
Figure BDA0002626046320000084

其中,

Figure BDA0002626046320000085
表示第k个头输入参数矩阵,不同关系类型
Figure BDA0002626046320000086
相同。根据该邻居节点的输入
Figure BDA0002626046320000087
第k个头的注意力系数计算如下:in,
Figure BDA0002626046320000085
Represents the kth head input parameter matrix, different relation types
Figure BDA0002626046320000086
same. According to the input of this neighbor node
Figure BDA0002626046320000087
The attention coefficient of the k-th head is calculated as follows:

Figure BDA0002626046320000088
Figure BDA0002626046320000088

其中,

Figure BDA0002626046320000089
表示第k个头的注意力权重矩阵,不同关系类型
Figure BDA00026260463200000810
不同。T表示矩阵转置,‖表示向量连接操作。
Figure BDA00026260463200000811
表示与关系属性q相关的权重,计算过程如公式(4)所示。in,
Figure BDA0002626046320000089
Represents the attention weight matrix of the kth head, different relation types
Figure BDA00026260463200000810
different. T stands for matrix transpose, and ‖ stands for vector join operation.
Figure BDA00026260463200000811
represents the weight related to the relationship attribute q, and the calculation process is shown in formula (4).

将关系属性q=(t,w)输入全连接层,得到输出值

Figure BDA00026260463200000812
若关系类型r为历史交互关系,则t属性表示节点ni和邻居节点nj最后一次交互的时刻,w属性表示两个节点历史发生交互的次数;若关系类型r为共同交互关系,则t属性为两个节点最后一次共同交互的时刻,w属性为历史共同交互次数;若关系类型r为交互序列相似关系,则t属性为两个节点交互序列中最后发生的交互的时刻,w属性为余弦相似度。计算公式如下:Input the relational attribute q=(t, w) into the fully connected layer to get the output value
Figure BDA00026260463200000812
If the relationship type r is a historical interaction relationship, the t attribute represents the last interaction moment between the node n i and its neighbor node n j , and the w attribute represents the number of historical interactions between the two nodes; if the relationship type r is a common interaction relationship, then t The attribute is the last mutual interaction time between the two nodes, and the w attribute is the number of historical mutual interactions; if the relationship type r is an interaction sequence similarity relationship, the t attribute is the last interaction time in the interaction sequence of the two nodes, and the w attribute is Cosine similarity. Calculated as follows:

Figure BDA00026260463200000813
Figure BDA00026260463200000813

其中Wfeat为全连接层的参数矩阵,bfeat为全连接层的偏置,不同关系类型不同头共享该全连接层。Among them, W feat is the parameter matrix of the fully connected layer, and b feat is the bias of the fully connected layer. Different relationship types and different heads share the fully connected layer.

对给定节点ni所有关系类型为历史交互关系的邻居节点做权重归一化,得到邻居节点nj归一化后的第k个头的注意力系数:Normalize the weights of all neighbor nodes whose relationship type is historical interaction relationship for a given node n i , and obtain the attention coefficient of the k-th head after the normalization of neighbor node n j :

Figure BDA00026260463200000814
Figure BDA00026260463200000814

其中,

Figure BDA00026260463200000815
是给定节点ni关系类型为历史交互关系的邻居节点集合。基于上述计算,第k个头的隐向量
Figure BDA0002626046320000091
计算如下:in,
Figure BDA00026260463200000815
is the set of neighbor nodes for a given node n i whose relationship type is historical interaction relationship. Based on the above calculation, the hidden vector of the kth head
Figure BDA0002626046320000091
The calculation is as follows:

Figure BDA0002626046320000092
Figure BDA0002626046320000092

对于给定节点ni通过K个头得到的隐向量

Figure BDA0002626046320000093
求均值后得到节点ni基于历史交互关系的邻居表示
Figure BDA0002626046320000094
计算过程如公式(7)所示:For a given node n i the hidden vector obtained through the K heads
Figure BDA0002626046320000093
After averaging, the neighbor representation of node n i based on the historical interaction relationship is obtained
Figure BDA0002626046320000094
The calculation process is shown in formula (7):

Figure BDA0002626046320000095
Figure BDA0002626046320000095

将关系类型为历史交互关系的相关参数换成共同交互关系的相关参数,利用公式(2)~(7)获得基于共同交互关系的邻居表示

Figure BDA0002626046320000096
同样,将关系类型为历史交互关系的相关参数换成交互序列相似关系的相关参数,利用公式(2)~(7)获得基于交互序列相似关系的邻居表示
Figure BDA0002626046320000097
涉及到的相关参数包括关系属性q、每种关系类型的邻居节点集合、注意力权重矩阵
Figure BDA0002626046320000098
Replace the relevant parameters of the historical interaction relationship with the relevant parameters of the common interaction relationship, and use formulas (2) to (7) to obtain the neighbor representation based on the common interaction relationship
Figure BDA0002626046320000096
Similarly, replace the relevant parameters of the historical interaction relationship with the relevant parameters of the interaction sequence similarity relationship, and use formulas (2) to (7) to obtain the neighbor representation based on the interaction sequence similarity relationship.
Figure BDA0002626046320000097
The relevant parameters involved include the relationship attribute q, the set of neighbor nodes for each relationship type, and the attention weight matrix
Figure BDA0002626046320000098

第二层为关系间聚合,由于根据不同关系类型传播过来的交互影响对给定节点的重要性是不同的,利用自注意力机制为不同的关系类型赋予相应的权重。给定节点ni,利用关系内聚合可以得到基于不同关系类型的邻居表示,将其通过自注意力机制进行聚合,得到节点ni基于邻居的表示。The second layer is the aggregation between relations. Since the importance of the interaction effects propagated by different relation types to a given node is different, the self-attention mechanism is used to assign corresponding weights to different relation types. Given a node n i , neighbor representations based on different relation types can be obtained by using intra-relational aggregation, and aggregated through a self-attention mechanism to obtain a neighbor-based representation of node n i .

对于节点ni基于历史交互关系的邻居表示

Figure BDA0002626046320000099
基于共同交互关系的邻居表示
Figure BDA00026260463200000910
和基于交互序列相似关系的邻居表示
Figure BDA00026260463200000911
拼接后得到自注意力机制的输入
Figure BDA00026260463200000912
自注意力机制的查询矩阵Q、键矩阵K和值矩阵V的计算过程如下:Neighbor representation based on historical interaction for node n i
Figure BDA0002626046320000099
Neighbor Representation Based on Common Interactions
Figure BDA00026260463200000910
and neighbor representations based on interaction sequence similarity
Figure BDA00026260463200000911
After splicing, the input of the self-attention mechanism is obtained
Figure BDA00026260463200000912
The calculation process of the query matrix Q, key matrix K and value matrix V of the self-attention mechanism is as follows:

Q=HWQ (8)Q=HW Q (8)

K=HWK (9)K=HW K (9)

V=HWV (10)V=HW V (10)

其中

Figure BDA0002626046320000101
Figure BDA0002626046320000102
分别为查询权重矩阵、键权重矩阵和值权重矩阵。自注意力机制的输出
Figure BDA0002626046320000103
如公式(11)所示:in
Figure BDA0002626046320000101
and
Figure BDA0002626046320000102
are the query weight matrix, key weight matrix and value weight matrix, respectively. The output of the self-attention mechanism
Figure BDA0002626046320000103
As shown in formula (11):

Figure BDA0002626046320000104
Figure BDA0002626046320000104

其中,

Figure BDA0002626046320000105
为比例因子,dk=dv。in,
Figure BDA0002626046320000105
is the scaling factor, d k =d v .

将上述注意力机制的输出Z输入到全连接层中,得到节点ni基于邻居的表示

Figure BDA0002626046320000106
计算过程如公式(12)所示:Input the output Z of the above attention mechanism into the fully connected layer to obtain the neighbor-based representation of node n i
Figure BDA0002626046320000106
The calculation process is shown in formula (12):

Figure BDA0002626046320000107
Figure BDA0002626046320000107

其中,Wout为全连接层的参数矩阵,bout为全连接层的偏置。Among them, W out is the parameter matrix of the fully connected layer, and b out is the bias of the fully connected layer.

根据局部关系图

Figure BDA0002626046320000108
Figure BDA0002626046320000109
利用上述层次化多关系感知聚合得到用户ui基于邻居的表示
Figure BDA00026260463200001010
和物品vj基于邻居的表示
Figure BDA00026260463200001011
According to the local relationship diagram
Figure BDA0002626046320000108
and
Figure BDA0002626046320000109
Using the above hierarchical multi-relation-aware aggregation to obtain the neighbor-based representation of user ui
Figure BDA00026260463200001010
and neighbor-based representation of item v j
Figure BDA00026260463200001011

步骤5,根据用户ui上一次交互后的表示

Figure BDA00026260463200001012
和用户ui基于邻居的表示
Figure BDA00026260463200001013
利用全连接层计算当前交互前物品vj预测的表示
Figure BDA00026260463200001014
Step 5, according to the representation of user ui after the last interaction
Figure BDA00026260463200001012
and the neighbor-based representation of user ui
Figure BDA00026260463200001013
Using a fully connected layer to compute a representation of the prediction of the item v j before the current interaction
Figure BDA00026260463200001014

实施例中,根据用户ui上一次交互后的表示

Figure BDA00026260463200001015
和用户ui基于邻居的表示
Figure BDA00026260463200001016
利用全连接层计算当前交互前物品vj预测的表示
Figure BDA00026260463200001017
计算过程如公式(13)所示:In the embodiment, according to the representation of the user ui after the last interaction
Figure BDA00026260463200001015
and the neighbor-based representation of user ui
Figure BDA00026260463200001016
Using a fully connected layer to compute a representation of the prediction of the item v j before the current interaction
Figure BDA00026260463200001017
The calculation process is shown in formula (13):

Figure BDA00026260463200001018
Figure BDA00026260463200001018

其中,W1和W2为全连接层的参数矩阵,b为全连接层的偏置。Among them, W 1 and W 2 are the parameter matrices of the fully connected layer, and b is the bias of the fully connected layer.

步骤6,根据用户ui和物品vj上一次交互后的表示

Figure BDA00026260463200001019
Figure BDA00026260463200001020
上一次交互和当前交互的时间间隔
Figure BDA00026260463200001021
Figure BDA00026260463200001022
以及基于邻居的表示
Figure BDA00026260463200001023
Figure BDA00026260463200001024
利用两个循环神经网络层分别计算用户ui和物品vj当前交互后的表示
Figure BDA00026260463200001025
Figure BDA00026260463200001026
Step 6, according to the last interaction between user ui and item v j
Figure BDA00026260463200001019
and
Figure BDA00026260463200001020
The time interval between the last interaction and the current interaction
Figure BDA00026260463200001021
and
Figure BDA00026260463200001022
and a neighbor-based representation
Figure BDA00026260463200001023
and
Figure BDA00026260463200001024
Use two recurrent neural network layers to calculate the current interaction representation of user ui and item v j respectively
Figure BDA00026260463200001025
and
Figure BDA00026260463200001026

如图2所示,利用两个循环神经网络层RNNU和RNNV分别计算用户ui和物品vj当前交互后的表示

Figure BDA0002626046320000111
Figure BDA0002626046320000112
RNNU的输入为用户ui上一次交互后的表示
Figure BDA0002626046320000113
物品vj上一次交互后的表示
Figure BDA0002626046320000114
用户ui基于邻居的表示
Figure BDA0002626046320000115
以及用户上一次交互和当前交互的时间间隔
Figure BDA0002626046320000116
RNNV的输入为物品vj上一次交互后的表示
Figure BDA0002626046320000117
用户ui上一次交互后的表示
Figure BDA0002626046320000118
物品vj基于邻居的表示
Figure BDA0002626046320000119
以及物品上一次交互和当前交互的时间间隔
Figure BDA00026260463200001110
RNNU和RNNV的具体计算公式如下:As shown in Figure 2, two recurrent neural network layers RNN U and RNN V are used to calculate the current interaction representation of user ui and item v j , respectively
Figure BDA0002626046320000111
and
Figure BDA0002626046320000112
The input of RNN U is the representation of user u i after the last interaction
Figure BDA0002626046320000113
Representation of item v j after the last interaction
Figure BDA0002626046320000114
Neighbor-based representation of user u i
Figure BDA0002626046320000115
and the time interval between the user's last interaction and the current interaction
Figure BDA0002626046320000116
The input of RNN V is the representation of item v j after the last interaction
Figure BDA0002626046320000117
The representation of user u i after the last interaction
Figure BDA0002626046320000118
Neighbor-based representation of item v j
Figure BDA0002626046320000119
and the time interval between the item's last interaction and the current interaction
Figure BDA00026260463200001110
The specific calculation formulas of RNN U and RNN V are as follows:

Figure BDA00026260463200001111
Figure BDA00026260463200001111

Figure BDA00026260463200001112
Figure BDA00026260463200001112

其中,

Figure BDA00026260463200001113
表示RNNU的网络参数,
Figure BDA00026260463200001114
表示RNNV的网络参数,
Figure BDA00026260463200001115
Figure BDA00026260463200001116
分别为时间间隔
Figure BDA00026260463200001117
Figure BDA00026260463200001118
通过全连接层得到的表示,不同时间间隔共享该全连接层。所有用户共享RNNU以更新用户的表示,所有物品共享RNNV以更新物品的表示。将RNNU和RNNV的隐状态分别作为用户和物品的表示。in,
Figure BDA00026260463200001113
represents the network parameters of RNN U ,
Figure BDA00026260463200001114
represents the network parameters of RNN V ,
Figure BDA00026260463200001115
and
Figure BDA00026260463200001116
time interval
Figure BDA00026260463200001117
and
Figure BDA00026260463200001118
A representation obtained through a fully connected layer, which is shared across different time intervals. All users share RNN U to update the user's representation, and all items share RNN V to update the item's representation. The hidden states of RNN U and RNN V are used as user and item representations, respectively.

步骤7,根据当前交互前物品vj预测的表示

Figure BDA00026260463200001119
和真实的表示
Figure BDA00026260463200001120
之间的误差、用户ui正则化损失和物品vj正则化损失,计算整体损失
Figure BDA00026260463200001121
Step 7, according to the predicted representation of the item v j before the current interaction
Figure BDA00026260463200001119
and true representation
Figure BDA00026260463200001120
The error between, user ui regularization loss and item v j regularization loss, calculate the overall loss
Figure BDA00026260463200001121

将物品vj上一次交互后的表示作为其当前交互前真实的表示

Figure BDA00026260463200001122
最小化物品vj预测的表示
Figure BDA00026260463200001123
和真实的表示
Figure BDA00026260463200001124
之间的均方误差得到预测损失,整体损失
Figure BDA00026260463200001125
计算如下:Take the representation of item v j after the last interaction as its real representation before the current interaction
Figure BDA00026260463200001122
Minimize the representation of item v j predictions
Figure BDA00026260463200001123
and true representation
Figure BDA00026260463200001124
The mean squared error between gets the predicted loss, the overall loss
Figure BDA00026260463200001125
The calculation is as follows:

Figure BDA00026260463200001126
Figure BDA00026260463200001126

其中,第一项为预测损失,后两项为正则化项,以避免用户和物品的表示变化过大,λU和λI为尺度参数,‖ ‖2表示L2距离。Among them, the first term is the prediction loss, the last two terms are regularization terms to avoid excessive variation in the representation of users and items, λ U and λ I are scale parameters, and ‖ ‖ 2 represents the L2 distance.

步骤8,根据批次中所有样本的损失

Figure BDA00026260463200001127
对整个模型中的网络参数进行调整。Step 8, according to the loss of all samples in the batch
Figure BDA00026260463200001127
Make adjustments to network parameters throughout the model.

计算批次中所有样本的损失

Figure BDA0002626046320000121
具体计算方式如下所示:Calculate the loss for all samples in the batch
Figure BDA0002626046320000121
The specific calculation method is as follows:

Figure BDA0002626046320000122
Figure BDA0002626046320000122

其中

Figure BDA0002626046320000123
为每个样本的损失,M为批次中样本的数量。在本发明中,根据损失
Figure BDA0002626046320000124
对整个模型中的网络参数进行调整。in
Figure BDA0002626046320000123
is the loss per sample, and M is the number of samples in the batch. In the present invention, according to the loss
Figure BDA0002626046320000124
Make adjustments to network parameters throughout the model.

步骤9,重复步骤2-8直到训练数据集的所有批次都参与了模型训练。Step 9, repeat steps 2-8 until all batches of the training dataset participate in model training.

步骤10,若达到指定的训练迭代次数,则训练结束;否则返回步骤2。Step 10: If the specified number of training iterations is reached, the training ends; otherwise, return to Step 2.

步骤11,利用参数调优后的时态交互网络预测模型预测用户可能会发生交互的物品。Step 11: Use the temporal interaction network prediction model after parameter tuning to predict items that the user may interact with.

基于上述训练结束后得到的用户和物品表示,以用户ui为例,给定用户ui上一次交互后的表示

Figure BDA0002626046320000125
和用户ui基于邻居的表示
Figure BDA0002626046320000126
计算交互涉及物品预测的表示
Figure BDA0002626046320000127
具体过程如公式(13)所示。计算物品预测的表示
Figure BDA0002626046320000128
与所有物品真实的表示
Figure BDA0002626046320000129
之间的L2距离,L2距离小的top-K个物品为该用户可能会发生交互的物品。Based on the user and item representations obtained after the above training, taking user ui as an example, given the representation of user ui after the last interaction
Figure BDA0002626046320000125
and the neighbor-based representation of user ui
Figure BDA0002626046320000126
Computational interactions involve representations of item predictions
Figure BDA0002626046320000127
The specific process is shown in formula (13). Compute the representation of item predictions
Figure BDA0002626046320000128
Authentic representation with all items
Figure BDA0002626046320000129
The L2 distance between them, the top-K items with the smallest L2 distance are the items that the user may interact with.

以上所述的具体实施方式对本发明的技术方案和有益效果进行了详细说明,应理解的是以上所述仅为本发明的最优选实施例,并不用于限制本发明,凡在本发明的原则范围内所做的任何修改、补充和等同替换等,均应包含在本发明的保护范围之内。The above-mentioned specific embodiments describe in detail the technical solutions and beneficial effects of the present invention. It should be understood that the above-mentioned embodiments are only the most preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, additions and equivalent substitutions made within the scope shall be included within the protection scope of the present invention.

Claims (8)

1. A multi-relation-aware temporal interaction network prediction method is characterized by comprising the following steps:
(1) with user uiAnd an article vjInteraction (u) occurring at time ti,vjT) constructing a training data set as a sample, and batching the training data set;
(2) for interaction (u)i,vjT), mining the nodes with historical interaction relationship, common interaction relationship and interaction sequence similarity relationship between the nodes based on historical interaction information to obtain interactive nodes uiAnd vjConstructing a local relationship graph before current interaction
Figure FDA0002626046310000011
And
Figure FDA0002626046310000012
(3) according to a local relationship diagram
Figure FDA0002626046310000013
And
Figure FDA0002626046310000014
obtaining user u through hierarchical multi-relation perception aggregationiNeighbor-based representation
Figure FDA0002626046310000015
And an article vjNeighbor-based representation
Figure FDA0002626046310000016
(4) According to user uiLast interactive representation
Figure FDA0002626046310000017
And user uiNeighbor-based representation
Figure FDA0002626046310000018
Calculating current pre-interaction item v by utilizing full connection layerjRepresentation of predictions
Figure FDA0002626046310000019
(5) According to user uiAnd an article vjLast interactive representation
Figure FDA00026260463100000110
And
Figure FDA00026260463100000111
time interval between last interaction and current interaction
Figure FDA00026260463100000112
And
Figure FDA00026260463100000113
and neighbor-based representation
Figure FDA00026260463100000114
And
Figure FDA00026260463100000115
respectively calculating user u by utilizing two recurrent neural network layersiAnd an article vjCurrently interacted with representation
Figure FDA00026260463100000116
And
Figure FDA00026260463100000117
(6) according to the current pre-interaction item vjRepresentation of predictions
Figure FDA00026260463100000118
And a real representation
Figure FDA00026260463100000119
Error between, user uiRegularization loss and article vjRegularization loss, calculating the overall loss
Figure FDA00026260463100000120
According to the loss of all samples in the batch
Figure FDA00026260463100000121
Adjusting network parameters in a temporal interaction network prediction model until all batches participate in model training, wherein the temporal interaction network prediction model comprises all full connection layers and a cyclic neural network layer used in the steps (2) to (6);
(7) and predicting the articles which are possibly interacted by the user by using the temporal interaction network prediction model after the parameters are adjusted.
2. The method of claim 1, wherein the training data set is batched using a t-n-Batch algorithm.
3. The method for predicting a temporal interaction network with multi-relationship awareness as claimed in claim 1, wherein the specific process of the step (2) is as follows:
local relationship diagram
Figure FDA0002626046310000021
Wherein
Figure FDA0002626046310000022
And
Figure FDA0002626046310000023
respectively represent and node niRelated node set, edge set, relation type set and relation attribute set, edge e is defined as triple
Figure FDA0002626046310000024
Representing a node niAnd node njThere is a relationship between them, the relationship type is
Figure FDA0002626046310000025
Comprises three types of historical interactive relationship, common interactive relationship and interactive sequence similarity relationship, and the relationship attribute is
Figure FDA0002626046310000026
Wherein q is (t, w), t represents a time attribute, and w represents a weight attribute;
the specific method of multi-relation derivation is as follows:
1) historical interaction relationships
If two nodes are interacted historically, a historical interaction relationship exists between the two nodes, the time attribute t of the historical interaction relationship is the last interaction time of the two nodes, and the weight attribute w is the historical interaction frequency;
2) mutual interaction relation
If two nodes interact with the same node in the T time period, a common interaction relationship exists between the two nodes. The time attribute t of the common interaction relationship is the time of the last common interaction of the two nodes, wherein the time of the common interaction is the closest time to the current time in the time of the interaction of the two nodes and the same node, and the weight attribute w is the historical common interaction times;
3) interaction sequence similarity relationship
All the interactive sequences are regarded as 'documents', each interactive sequence is regarded as 'sentences', nodes in the interactive sequences are regarded as 'words', and after the user interactive sequences and the article interactive sequences are respectively embedded by using a Doc2Vec model, the representation of each user based on the interactive sequences and the representation of each article based on the interactive sequences can be obtained;
as the interaction between the user and the article continuously occurs, the Doc2Vec model is updated in an incremental training mode, and a new representation of the user and the article based on the interaction sequence is obtained. Given two nodes n of the same typeiAnd njPresentation based on interaction sequences
Figure FDA0002626046310000031
And
Figure FDA0002626046310000032
calculating the cosine similarity between the two, wherein the calculation mode is as follows:
Figure FDA0002626046310000033
wherein, represents the dot product;
setting a threshold value mu only when the cosine similarity
Figure FDA0002626046310000034
And when the value is larger than the threshold value mu, the interaction sequence similarity relation exists between the two nodes. Interactive sequence phaseThe time attribute t of the similarity relation is the moment of interaction which occurs at last in the interaction sequence of the two nodes, and the weight attribute w is cosine similarity;
after the nodes with historical interaction relationship, common interaction relationship and interaction sequence similarity relationship with the interaction nodes are mined by the multi-relationship derivation concrete method, the interaction nodes u can be regarded as interaction nodes uiAnd vjConstructing a local relationship graph before current interaction
Figure FDA0002626046310000035
And
Figure FDA0002626046310000036
4. the method for predicting a temporal interaction network with multi-relationship awareness as claimed in claim 1, wherein the specific process of the step (3) is as follows:
if node niAs a user, the corresponding user is ujThen the last interactive representation of the node is
Figure FDA0002626046310000037
If node niIs an article, corresponding to the article vjThen the last interactive representation of the node is
Figure FDA0002626046310000038
Node niThe representation after the last interaction is recorded as
Figure FDA0002626046310000039
When node niWhen interaction occurs, the node is given a local relationship graph in the time interval between the last interaction and the current interaction
Figure FDA00026260463100000310
The interaction influence propagated by the neighbor node in which the interaction occurs, namely the representation of the neighbor node after the interaction occurs
Figure FDA00026260463100000311
Wherein M is the number of nodes interacted among the neighbor nodes, and the specific process of hierarchical multi-relationship perception aggregation is as follows:
the first layer is intra-relationship aggregation, neighbor nodes are aggregated according to the interaction influence transmitted by the same relationship type, corresponding weights are given to different neighbor nodes, and the neighbor representation of the node based on the specific relationship type is obtained, wherein the process is as follows:
for a given node niIs a neighbor node njThe input of the multi-head attention mechanism is
Figure FDA0002626046310000041
Then the input of attention mechanism of the kth head
Figure FDA0002626046310000042
The calculation is as follows:
Figure FDA0002626046310000043
wherein,
Figure FDA0002626046310000044
representing a matrix of k-th head input parameters, different relation types
Figure FDA0002626046310000045
The same is true. According to the input of the neighbor node
Figure FDA0002626046310000046
The attention coefficient for the kth head is calculated as follows:
Figure FDA0002626046310000047
wherein,
Figure FDA0002626046310000048
attention weight matrix representing kth head, different relation types
Figure FDA0002626046310000049
Instead, T represents the matrix transpose, | represents the vector join operation,
Figure FDA00026260463100000410
the weight associated with the relationship attribute q is represented and the calculation process is shown in equation (4).
Inputting the relation attribute q ═ t, w into the full-link layer to obtain an output value
Figure FDA00026260463100000411
If the relationship type r is a history interactive relationship, the t attribute represents the node niAnd a neighbor node njAt the last interaction time, the w attribute represents the historical interaction times of the two nodes; if the relationship type r is a common interaction relationship, the t attribute is the time of the last common interaction of the two nodes, and the w attribute is the historical common interaction times; if the relationship type r is an interaction sequence similarity relationship, the t attribute is the moment of interaction occurring at the last in the interaction sequences of the two nodes, and the w attribute is cosine similarity. The calculation formula is as follows:
Figure FDA00026260463100000412
wherein WfeatParameter matrix being a fully connected layer, bfeatFor the biasing of the fully connected layer, different heads of different relation types share the fully connected layer;
for a given node niAll the neighbor nodes with the relation types of the historical interaction relation are subjected to weight normalization to obtain neighbor nodes njNormalized kth head attention coefficient:
Figure FDA00026260463100000413
wherein,
Figure FDA0002626046310000051
is given node niThe relationship type is a neighbor node set of historical interaction relationship. Based on the above calculation, the hidden vector of the k-th head
Figure FDA0002626046310000052
The calculation is as follows:
Figure FDA0002626046310000053
for a given node niImplicit vectors obtained by K heads
Figure FDA0002626046310000054
Obtaining a node n after averagingiNeighbor representation based on historical interaction relationships
Figure FDA0002626046310000055
The calculation process is shown in formula (7):
Figure FDA0002626046310000056
the related parameters with the relationship type of the historical interactive relationship are converted into the related parameters of the common interactive relationship, and the neighbor expression based on the common interactive relationship is obtained by using the formulas (2) to (7)
Figure FDA0002626046310000057
Similarly, the related parameters with the relationship type of the historical interaction relationship are converted into the related parameters of the interaction sequence similarity relationship, and the neighbor expression based on the interaction sequence similarity relationship is obtained by using the formulas (2) to (7)
Figure FDA0002626046310000058
The related parameters comprise a relationship attribute q, a neighbor node set of each relationship type and an attention weight matrix
Figure FDA0002626046310000059
The second layer is inter-relationship aggregation, because the importance of the interaction influence propagated according to different relationship types to a given node is different, corresponding weights are given to the different relationship types by using a self-attention mechanism, and the specific process is as follows:
for node niNeighbor representation based on historical interaction relationships
Figure FDA00026260463100000510
Neighbor representation based on common interaction relationships
Figure FDA00026260463100000511
And neighbor representation based on inter-sequence similarity
Figure FDA00026260463100000512
Obtaining input of self-attention mechanism after splicing
Figure FDA00026260463100000513
The calculation process of the query matrix Q, the key matrix K and the value matrix V of the self-attention mechanism is as follows:
Q=HWQ (8)
K=HWK (9)
V=HWV (10)
wherein
Figure FDA0002626046310000061
And
Figure FDA0002626046310000062
respectively, an inquiry weight matrix, a key weight matrix and a value weight matrix;output of self-attention mechanism
Figure FDA0002626046310000063
As shown in formula (11):
Figure FDA0002626046310000064
wherein,
Figure FDA0002626046310000065
is a scale factor, dk=dv
Inputting the output Z of the attention mechanism into the full-connection layer to obtain a node niNeighbor-based representation
Figure FDA0002626046310000066
The calculation process is shown in formula (12):
Figure FDA0002626046310000067
wherein, WoutParameter matrix being a fully connected layer, boutA bias for a fully connected layer;
according to a local relationship diagram
Figure FDA0002626046310000068
And
Figure FDA0002626046310000069
user u is obtained by hierarchical multi-relation perception aggregationiNeighbor-based representation
Figure FDA00026260463100000610
And an article vjNeighbor-based representation
Figure FDA00026260463100000611
5. The method for predicting a temporal interaction network with multi-relationship awareness as claimed in claim 1, wherein the specific process of the step (4) is as follows:
according to user uiLast interactive representation
Figure FDA00026260463100000612
And user uiNeighbor-based representation
Figure FDA00026260463100000613
Calculating current pre-interaction item v by utilizing full connection layerjRepresentation of predictions
Figure FDA00026260463100000614
The calculation process is shown in formula (13):
Figure FDA00026260463100000615
wherein, W1And W2Is the parameter matrix of the fully-connected layer, and b is the bias of the fully-connected layer.
6. The method for predicting a temporal interaction network with multi-relationship awareness as claimed in claim 1, wherein the specific process of the step (5) is as follows:
using two recurrent neural network layers RNNUAnd RNNVCalculate user u separatelyiAnd an article vjCurrently interacted with representation
Figure FDA00026260463100000616
And
Figure FDA00026260463100000617
RNNUis input by user uiLast interactive representation
Figure FDA0002626046310000071
Article vjLast interactive representation
Figure FDA0002626046310000072
User uiNeighbor-based representation
Figure FDA0002626046310000073
And the time interval between the last interaction and the current interaction of the user
Figure FDA0002626046310000074
RNNVIs an item vjLast interactive representation
Figure FDA0002626046310000075
User uiLast interactive representation
Figure FDA0002626046310000076
Article vjNeighbor-based representation
Figure FDA0002626046310000077
And the time interval between the last interaction and the current interaction of the object
Figure FDA0002626046310000078
RNNUAnd RNNVThe specific calculation formula of (2) is as follows:
Figure FDA0002626046310000079
Figure FDA00026260463100000710
wherein,
Figure FDA00026260463100000711
denotes RNNUThe network parameters of (a) are set,
Figure FDA00026260463100000712
denotes RNNVThe network parameters of (a) are set,
Figure FDA00026260463100000713
and
Figure FDA00026260463100000714
respectively time interval
Figure FDA00026260463100000715
And
Figure FDA00026260463100000716
by means of the representation obtained by the full connection layer, the full connection layer is shared by different time intervals, and RNN is shared by all usersUTo update the user's representation, all items share the RNNVTo update the representation of the item, the RNNUAnd RNNVAs a representation of the user and the item, respectively.
7. The method of claim 1, wherein in step (6), the overall loss is reduced
Figure FDA00026260463100000717
The calculation is as follows:
Figure FDA00026260463100000718
the first term is prediction loss, and the last two terms are regularization terms to avoid excessive representation change of users and articles, namely lambdaUAnd λIIs a scale parameter, | |)2Indicating the L2 distance.
8. The method for predicting a temporal interaction network with multi-relationship awareness as claimed in claim 1, wherein the specific process of the step (7) is as follows:
given user uiLast interactive representation
Figure FDA00026260463100000719
And user uiNeighbor-based representation
Figure FDA00026260463100000720
Computing representations of interactions involving item predictions
Figure FDA00026260463100000721
Then, a representation of the item forecast is computed
Figure FDA00026260463100000722
Representation of all objects
Figure FDA00026260463100000723
The distance L2 between them, the top-K items with the small distance L2 are the items that the user may interact with.
CN202010797094.5A 2020-08-10 2020-08-10 A Multi-Relation Aware Temporal Interaction Network Prediction Method Active CN111949892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010797094.5A CN111949892B (en) 2020-08-10 2020-08-10 A Multi-Relation Aware Temporal Interaction Network Prediction Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010797094.5A CN111949892B (en) 2020-08-10 2020-08-10 A Multi-Relation Aware Temporal Interaction Network Prediction Method

Publications (2)

Publication Number Publication Date
CN111949892A true CN111949892A (en) 2020-11-17
CN111949892B CN111949892B (en) 2022-04-05

Family

ID=73331993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010797094.5A Active CN111949892B (en) 2020-08-10 2020-08-10 A Multi-Relation Aware Temporal Interaction Network Prediction Method

Country Status (1)

Country Link
CN (1) CN111949892B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541129A (en) * 2020-12-06 2021-03-23 支付宝(杭州)信息技术有限公司 Method and device for processing interaction event
CN113191400A (en) * 2021-04-14 2021-07-30 中国海洋大学 Method and device for retrieving corresponding three-dimensional model based on two-dimensional image
CN113537613A (en) * 2021-07-28 2021-10-22 浙江大学 A Motif-aware Temporal Network Prediction Method
CN114969540A (en) * 2022-06-10 2022-08-30 重庆大学 Method for predicting future interaction behavior of user in social network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140362091A1 (en) * 2013-06-07 2014-12-11 Ecole Polytechnique Federale De Lausanne Online modeling for real-time facial animation
CN110555469A (en) * 2019-08-15 2019-12-10 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
US10650432B1 (en) * 2016-11-28 2020-05-12 Amazon Technologies, Inc. Recommendation system using improved neural network
CN111159425A (en) * 2019-12-30 2020-05-15 浙江大学 A Temporal Knowledge Graph Representation Method Based on Historical Relation and Bi-Graph Convolutional Networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140362091A1 (en) * 2013-06-07 2014-12-11 Ecole Polytechnique Federale De Lausanne Online modeling for real-time facial animation
US10650432B1 (en) * 2016-11-28 2020-05-12 Amazon Technologies, Inc. Recommendation system using improved neural network
CN110555469A (en) * 2019-08-15 2019-12-10 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN111159425A (en) * 2019-12-30 2020-05-15 浙江大学 A Temporal Knowledge Graph Representation Method Based on Historical Relation and Bi-Graph Convolutional Networks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘辉等: "融合邻居选择策略和信任关系的兴趣点推荐", 《计算机工程与科学》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541129A (en) * 2020-12-06 2021-03-23 支付宝(杭州)信息技术有限公司 Method and device for processing interaction event
CN112541129B (en) * 2020-12-06 2023-05-23 支付宝(杭州)信息技术有限公司 Method and device for processing interaction event
CN113191400A (en) * 2021-04-14 2021-07-30 中国海洋大学 Method and device for retrieving corresponding three-dimensional model based on two-dimensional image
CN113537613A (en) * 2021-07-28 2021-10-22 浙江大学 A Motif-aware Temporal Network Prediction Method
CN113537613B (en) * 2021-07-28 2023-11-21 浙江大学 Temporal network prediction method for die body perception
CN114969540A (en) * 2022-06-10 2022-08-30 重庆大学 Method for predicting future interaction behavior of user in social network

Also Published As

Publication number Publication date
CN111949892B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN111949892B (en) A Multi-Relation Aware Temporal Interaction Network Prediction Method
Pálovics et al. Exploiting temporal influence in online recommendation
CN109062962B (en) Weather information fused gated cyclic neural network interest point recommendation method
CN115082147A (en) Sequence recommendation method and device based on hypergraph neural network
WO2021139415A1 (en) Data processing method and apparatus, computer readable storage medium, and electronic device
Shi et al. Long-term performance of collaborative filtering based recommenders in temporally evolving systems
Shakibian et al. Statistical similarity measures for link prediction in heterogeneous complex networks
CN112733027A (en) Hybrid recommendation algorithm based on local and global representation model joint learning
CN108573041A (en) Probabilistic matrix factorization recommendation method based on weighted trust relationship
Luo et al. BGNN: Behavior-aware graph neural network for heterogeneous session-based recommendation
CN113590964A (en) Deep neural network Top-N recommendation algorithm based on heterogeneous modeling
CN116071128A (en) A multi-task recommendation method based on multi-behavior feature extraction and self-supervised learning
Zareie et al. Centrality measures in fuzzy social networks
CN113569139A (en) A method and system for personalized session recommendation
CN106777123B (en) A Group Recommendation Method Based on Bidirectional Tensor Decomposition Model
CN112149734A (en) A Cross-Domain Recommendation Method Based on Stacked Autoencoders
Gao et al. Multi-objective pointer network for combinatorial optimization
CN118568301A (en) Sequential recommendation method based on global information and hybrid temporal query attention mechanism
Chetana et al. Handling massive sparse data in recommendation systems
CN114708064B (en) Commodity recommendation method based on meta learning and knowledge graph
CN109919219A (en) A Xgboost Multi-View Portrait Construction Method Based on Granular Computing ML-kNN
CN115310004A (en) Graph Neural Collaborative Filtering Recommendation Method Based on Item Time Series Relationship
Shams et al. IteRank: An iterative network-oriented approach to neighbor-based collaborative ranking
Yu et al. Movie Rating Prediction Recommendation Algorithm based on XGBoost-DNN
Lu et al. Trust-enhanced matrix factorization using PageRank for recommender system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant