Conversation social recommendation method based on reconstructed social network

文档序号:1889433 发布日期:2021-11-26 浏览:7次 中文

阅读说明:本技术 一种基于重构社交网络的会话社交推荐方法 (Conversation social recommendation method based on reconstructed social network ) 是由 顾盼 祝凯林 于 2021-09-06 设计创作,主要内容包括:本发明公开了一种基于重构社交网络的会话社交推荐方法。该方法根据给定用户的当前会话和社交网络,对用户的兴趣以及朋友对用户的社交影响进行建模,来预测用户在下一步最可能感兴趣的物品。主要由四个部分组成:第一部分是基于当前用户,从社交网络中找到当前用户的真实朋友;第二部分是基于当前用户的当前会话和存储的会话集合,找到当前用户的潜在朋友;第三部分是得到当前用户、真实朋友和潜在朋友的兴趣表征;第四部分是结合当前用户的真实朋友和潜在朋友,得到朋友对用户的社交影响;第五部分是结合用户自身兴趣和社交影响,获得用户最终向量表征;最后,根据用户最终向量表征和物品向量表征,推荐物品。(The invention discloses a conversation social recommendation method based on a reconstructed social network. The method models the user's interests and the social influence of friends on the user based on the current session and social network of a given user to predict the items that the user is most likely to be interested in the next step. Mainly comprises four parts: the first part is to find the real friends of the current user from the social network based on the current user; the second part is to find potential friends of the current user based on the current session of the current user and the stored set of sessions; the third part is to obtain the interest representation of the current user, real friends and potential friends; the fourth part is that real friends and potential friends of the current user are combined to obtain the social influence of the friends on the user; the fifth part is that the final vector representation of the user is obtained by combining the interest of the user and the social influence; and finally, recommending the article according to the final vector representation of the user and the article vector representation.)

1. A conversation social recommendation method based on reconstructed social networks is characterized in that:

based on the current user, finding real friends of the current user from the social network; establishing a social network G according to the data record of the actual friend relationship in the platform, wherein the social network G is an undirected graph; finding out neighbor nodes of the current user from the social network G, namely a real friend set N (u) of the current user;

based on the current conversation of the current user and the stored conversation set, finding potential friends of the current user; storing the most recently occurring sessions by using a memory matrix M; current session s ═ { v ═ based on current user1,v2,…,v|s|Finding out the most similar k sessions from the memory matrix M by calculating cosine similarity between the current session and the candidate sessions in the memory matrix M, and ensuring that the similarity is greater than a threshold simthreThen extracting epsilon sessions randomly from the screened k sessions; finally, determining the users of the epsilon sessions as a potential friend set B (u) of the current user, wherein the extracted sessions represent the interests of potential friends;

obtaining interest representations of a current user, real friends and potential friends; extracting the interest of the corresponding user from the current conversation of the current user, the latest conversation of real friends and the screened conversation of potential friends, and respectively characterizing the conversation by adopting a gate control recurrent neural network (GRU) to obtain interest characterization; that is, the current conversation of the current user, the latest conversation of the real friendThe screened conversations of the potential friends are respectively used as the input of a gate control recurrent neural network (GRU), and the output of the gate control recurrent neural network (GRU) is respectively used as the interest of the current user, the interest of real friends and the interest of the potential friends; finally, the current user and any real friend u are obtainediAnd any potential friend ujAre respectively hu、hiAnd hj

Combining real friends and potential friends of the current user to obtain social influence of the friends on the user; the real friends and the potential friends are calculated separately, the effects of the real friends and the potential friends on the current user are calculated by an attention mechanism, and the effect of each friend on the current user is different; the importance of the real friends and the potential friends is controlled by a prior parameter lambda and needs to be set by an experimenter; ultimate social impact pfThe specific calculation method is as follows:

wherein alpha isuiRepresenting real friends uiEffect on the current user, αujRepresenting potential friends ujAs a function of the current user's role,is a collection of real friends and potential friendsInfluence of friends on the current user, pfIs toAdding a nonlinear perceptron layer is also the final social influence; h isu、hiAnd hjRespectively a current user and a real friend uiAnd potential friends ujIs characterized by the vector of (1), attention value alphauiAnd alphaujThe calculation is carried out by adopting a multiplication attention mechanism, and the normalization is carried out by using a softmax function; the prior parameter lambda belongs to [0,1 ]]Controlling weights of true friend roles and potential friend roles; wgIs a conversion matrix parameter, and the ReLU is a ReLU activation function;

obtaining a final vector representation of the user by combining the interest of the user and social influence; the interest of the user is jointly determined by the current conversation behavior and social influence, and the user final vector of the user is characterized by guThe two are merged by the full connection layer, such that:

wherein, WphIs a conversion matrix, pfIs a social influence, huIn order to be the current interest of the current user,performing vector splicing operation;

recommending the articles according to the final vector representation of the user and the vector representation of the articles; article vjVector x ofjMultiplying the representation by the final vector of the user, and then calculating the item v by applying a softmax functionjThe fraction of (c):

wherein, guAn interest vector representing the user is generated by the user,representative article vjThe possibility of becoming the next interactive item; at the same time according toThe log-likelihood function value of (a), calculating a loss function:

wherein, yjRepresents vjThe one-hot code of (a) is,the function is optimized using a gradient descent method.

2. The conversational social recommendation method based on restructuring social network according to claim 1, wherein: the cosine similarity calculation formula between the sessions is as follows:

wherein s isjIs any session stored in the memory matrix M;is a binary vector representation of the session s if an item appears

In the session, the corresponding position in s is 1, otherwise, the corresponding position is 0; in the same way, the method for preparing the composite material,is a conversation sjA binary vector representation of; l(s) and l(s)j) Respectively representing sessions s and sjLength of (d); for all sessions stored in the memory matrix M, the memory matrix M is updated with the formula sim (s,sj) Calculating cosine similarity with the current conversation s, and lowering the similarity to be lower than a threshold simthreFiltering out the sessions, sequencing the sessions from high to low according to the cosine similarity, finding out the first k sessions, and randomly extracting epsilon sessions from the sessions.

3. The conversational social recommendation method based on restructuring social network according to claim 1, wherein: the gate control recurrent neural network (GRU) is:

zi=σ(Wxz·xi+Whz·hi-1)

ri=σ(Wxr·xi+Whr·hi-1)

wherein r isiIs a reset gate (resetgate), ziTo update the gate (update gate), these two gating vectors determine which information can be used as the output of the gated loop unit;is the current memory content; x is the number ofiIs the node input of the current layer, i.e. the item viThe vector characterization of (2); wxz、Whz、WxrAnd WhrRespectively, control the update gate ziAnd a reset gate riThe parameters of (1); wxhAnd WhhIs to control the pre-memory contentThe parameters of (1); as a matrix multiplication at the element level, σ is a sigmoid function; the output of the last hidden layer of the gated recurrent neural network (GRU) isAnd (5) word characterization.

Technical Field

The invention belongs to the technical field of internet services, and particularly relates to a conversation social recommendation method based on a reconstructed social network.

Background

A Session (Session) is an interactive activity of a user over a period of time, and a Session-based recommendation is a recommendation of an item next clicked by the user based on the current Session. The session recommendation divides the historical interaction sequence of the user into a plurality of sessions according to certain logic, models the current session to obtain the current interest of the user, and predicts the next interested article of the user. In the e-commerce platform, a user has a lot of purchasing interests historically, but in the current session, the purchasing interests are single. The current session of the user is modeled, and the current interest of the user can be obtained, so that the current purchase purpose of the user can be captured more accurately. In addition, most online platforms will host social interaction into the infrastructure, allowing users to interact with other users and share their interests. When recommending articles for users, social influence is taken into consideration, and the sparsity of data can be reduced. The method has the starting point that potential friends of the current user are further mined, the social influence of the potential friends and real friends on the current user is considered, and the sparsity of data is further reduced.

At this time, two relationships are involved in the social network: the relationship between the real friend and the current user, and the relationship between the potential friend and the current user. These two relationships are different: the current user and the real friend generally have a lot of interests and hobbies and have common interests, and the extracted current interests of the current user and the real friend are not necessarily close to each other; and the potential friends are obtained by calculating the similarity between the current conversation of the user and the stored conversations of other users, so that the interests of the potential friends are close to the current user. Therefore, the effects of real friends and potential friends on the current user need to be computed separately and in parallel, and then combined to get a unified social impact. And then predicting the next interested item of the user according to the interest of the user.

Disclosure of Invention

The technical problem to be solved by the invention is to model the interests of a user and the social influence of friends on the user to predict the most likely items of interest of the user in the next step, given the current conversation and social network of the user. When modeling social influence, two relationships are involved: the relationship between the real friend and the current user, and the relationship between the potential friend and the current user. These two relationships are different: generally, the current user and the real friend have a lot of interests and hobbies and have common interests, and the current interests of the extracted current user and the extracted real friend are not necessarily close to each other; and the potential friends are obtained by calculating the similarity between the current conversation of the user and the stored conversations of other users, so that the interests of the potential friends are close to the current user. Therefore, the effects of real friends and potential friends on the current user need to be computed separately and in parallel, and then combined to get a unified social impact. And then predicting the next interested item of the user according to the interest of the user.

A conversation social recommendation method based on reconstructed social networks comprises the following steps:

based on the current user, the real friends of the current user are found from the social network. And establishing a social network G according to the data record of the actual friend relationship in the platform, wherein the social network G is an undirected graph. The neighbor nodes of the current user are found from the social network G, which is the current user's set of real friends n (u).

Potential friends of the current user are found based on the current conversation of the current user and the stored set of conversations. The memory matrix M is used to store the most recent sessions that occurred. Current session s ═ { v ═ based on current user1,v.,…,v|s|Finding out the most similar k sessions from the memory matrix M by calculating cosine similarity between the current session and the candidate sessions in the memory matrix M, and ensuring that the similarity is greater than a threshold simthreAnd then extracting epsilon sessions randomly from the screened k sessions. Finally, the users of the epsilon conversations are determined as the current user's potential friend set B (u), and the extracted conversations represent the interests of the potential friends. The similarity calculation formula is as follows:

wherein s isjIs any session stored in the memory matrix M.Is a binary vector representation of a session s, if an item is present in the session, the corresponding position in s is 1, otherwise it is 0. In the same way, the method for preparing the composite material,is a conversation sjIs represented by a binary vector. l(s) and l(s)j) Respectively representing sessions s and sjLength of (d). For all sessions stored in the memory matrix M, the formula sim (s, s)j) Calculating cosine similarity with the current conversation s, and lowering the similarity to be lower than a threshold simthreFiltering out the sessions, sequencing the sessions from high to low according to the cosine similarity, finding out the first k sessions, and randomly extracting epsilon sessions from the sessions.

And obtaining interest characteristics of the current user, the real friends and the potential friends. And extracting the interest of the corresponding user from the current conversation of the current user, the latest conversation of the real friend and the screened conversation of the potential friend, and respectively characterizing the conversation by adopting a gate control recurrent neural network (GRU) to obtain interest characterization. Namely, the current conversation of the current user, the latest conversation of the real friend and the screened conversation of the potential friend are respectively used as the input of a gate control recurrent neural network (GRU), and the output of the gate control recurrent neural network (GRU) is respectively used as the interest of the current user, the interest of the real friend and the interest of the potential friend:

zi=σ(Wxz·xi+Whz·hi-1)

ri=σ(Wxr·xi+Whr·hi-1)

wherein r isiIs a reset gate, ziTo update the gates (update gate), these two gating vectors determine which information can be used as the output of the gated loop unit.Is the current memory content. x is the number ofiIs at presentNodal inputs of layers, i.e. articles viIs used for vector characterization. Wxz、Whz、WxrAnd WhrRespectively, control the update gate ziAnd a reset gate riThe parameter (c) of (c). WxhAnd WhhIs to control the pre-memory contentThe parameter (c) of (c). As is the element-level matrix multiplication, σ is the sigmoid function. The output of the last hidden layer of the gated recurrent neural network (GRU) is the session characterization.

And combining the real friends and the potential friends of the current user to obtain the social influence of the friends on the user. The real friends and the potential friends are calculated separately, and the effects of the real friends and the potential friends on the current user are calculated by an attention mechanism, wherein the effect of each friend on the current user is different. The importance of real friends and potential friends is controlled by the prior parameter lambda and needs to be set by the experimenter. Ultimate social impact pfThe specific calculation method is as follows:

wherein alpha isuiRepresenting real friends uiEffect on the current user, αujRepresenting potential friends ujAs a function of the current user's role,is that the influence of real friends and potential friends on the current user is gathered, pfIs toAdding a nonlinear perceptron layer is also the final social influence; h isu、hiAnd hjRespectively a current user and a real friend uiAnd potential friends ujIs characterized by the vector of (1), attention value alphauiAnd alphaujCalculated using a multiplicative attention mechanism and normalized using the softmax function. The prior parameter lambda belongs to [0,1 ]]The weights controlling the true friend role and the potential friend role. WgIs a transformation matrix parameter and ReLU is a ReLU activation function.

And obtaining the final vector representation of the user by combining the interest of the user and the social influence. The interest of the user is jointly determined by the current conversation behavior and social influence, and the user final vector of the user is characterized by guThe two are merged by the full connection layer, such that:

wherein, WphIs a conversion matrix, pfIs a social influence, huIn order to be the current interest of the current user,is a vector stitching operation.

And recommending the item according to the final vector representation of the user and the item vector representation. Article vjVector x ofjMultiplying the representation by the final vector of the user, and then calculating the item v by applying a softmax functionjThe fraction of (c):

wherein, guAn interest vector representing the user is generated by the user,representative article vjThe possibility of becoming the next interactive item; at the same time according toThe log-likelihood function value of (a), calculating a loss function:

wherein, yjRepresents vjThe one-hot code of (a) is,the function is optimized using a gradient descent method.

The invention has the following beneficial technical effects:

(1) the social recommendation method is different from the traditional social recommendation method in that potential friends of the user are further mined, the social network of the user is expanded, and the sparsity of data is relieved.

(2) The present invention analyzes the differences of two relationships in a social network, which are: the relationship between the real friend and the current user, and the relationship between the potential friend and the current user. And modeling the relationship of the two by adopting an attention mechanism respectively, and finally combining the two to obtain social influence.

Drawings

FIG. 1 is a schematic flow chart of a conversational social recommendation method based on a reconstructed social network according to the present invention;

FIG. 2 is a model framework diagram of a conversational social recommendation method based on a reconstructed social network according to the present invention.

Detailed Description

For further understanding of the present invention, the following describes a conversational social recommendation method based on restructuring social network in detail with reference to specific embodiments, but the present invention is not limited thereto, and those skilled in the art may make insubstantial improvements and modifications under the core guidance of the present invention and still fall within the scope of the present invention.

First, the variables and formulas used need to be given relevant definitions.

Definition 1. V: set of articles, and V ═ V1,v2,…,v|V|And V represents the number of items in the collection of items.

Definition 2. s: current session of current user, session is all interactive item set s ═ v in current time period1,v2,…,v|s|And | s | represents the number of items in the conversation.

Definition 3. S: set of sessions in a system, S ═ S1,s2,…,s|S|And | S | represents the number of sessions in the session set.

Definition 4. G: social networks about users and user relationships.

Definition 5.N (u): the set of friends of the current user in social network G.

Definition 6.B (u): the algorithm mines a set of potential friends of the current user.

Definition 7.Article vjIs used for vector characterization.

In conjunction with the above variable definitions, the final problem is defined as: given the current conversation and social network of the current user, a set of potential friends similar to the user behavior is mined, a social influence is obtained by combining the real set of friends and the set of potential friends of the user, and items which are most likely to be interested in the next step of the current user are recommended by combining the interests of the user, wherein the items are a subset of the set V. When modeling social influence, two relationships are involved: the relationship between the real friend and the current user, and the relationship between the potential friend and the current user. The two relationships are different. Generally, the current users and real friends have many interests and have common interests. The extracted real friends and the current interests of the real friends are not necessarily close. And the potential friends are mined by calculating the similarity of the stored recent user session and the current user session, so that the interest of the potential friends is close to the current user. Therefore, the effects of real friends and potential friends on the current user need to be computed separately and in parallel, and then combined to get a unified social impact. And then predicting the next interested item of the user according to the interest of the user.

To this end, the present invention proposes a conversational social recommendation method based on restructuring a social network, as shown in fig. 2, a forward propagation (forward propagation) part of the method is mainly composed of four parts. The first part is to find the real friends of the current user from the social network based on the current user; the second part is to find potential friends of the current user based on the current session of the current user and the stored set of sessions; the third part is to obtain the interest representation of the current user, real friends and potential friends; the fourth part is that real friends and potential friends of the current user are combined to obtain the social influence of the friends on the user; the fifth part is that the final vector representation of the user is obtained by combining the interest of the user and the social influence; and finally, recommending the article according to the final vector representation of the user and the article vector representation.

As shown in fig. 1, according to one embodiment of the present invention, the method comprises the steps of:

and S100, finding out real friends of the current user from the social network based on the current user. And establishing a social network G according to the data record of the actual friend relationship in the platform, wherein the social network G is an undirected graph. The neighbor nodes of the current user are found from the social network G, which is the current user's set of real friends n (u).

S200, based on the current conversation of the current user and the stored conversation set, finding out potential friends of the current user. The memory matrix M is adopted to store the recently-occurring conversation, the algorithm effect and the storage pressure are comprehensively considered in the method, and the number of conversation sequences stored in the memory matrix M is set to 10000. Current session s ═ { v ═ based on current user1,v2,…,v|s|Calculating cosine similarity between the current conversation and the candidate conversation in the memory matrix MFinding out the most similar k sessions and ensuring that the similarity is greater than a threshold simthreAnd then extracting epsilon sessions randomly from the screened k sessions. Finally, the users of the epsilon conversations are determined as the current user's potential friend set B (u), and the extracted conversations represent the interests of the potential friends. The similarity calculation formula is as follows:

wherein s isjIs any session stored in the memory matrix M.Is a binary vector representation of a session s, if an item is present in the session, the corresponding position in s is 1, otherwise it is 0. In the same way, the method for preparing the composite material,is a conversation sjIs represented by a binary vector. l(s) and l(s)j) Respectively representing sessions s and sjLength of (d). For all sessions stored in the memory matrix M, the formula sim (s, s)j) Calculating cosine similarity with the current conversation s, and lowering the similarity to be lower than a threshold simthreFiltering out the sessions, sequencing the sessions from high to low according to the cosine similarity, finding out the first k sessions, and randomly extracting epsilon sessions from the sessions. simthreSetting a decimal value can increase the diversity of recommended items, simthreAnd a large value is set, so that more noises can be filtered. Here, simthreSet to 0.3, k to 100, and ε to 10.

And S300, obtaining interest representations of the current user, the real friends and the potential friends. And extracting the interest of the corresponding user from the current conversation of the current user, the latest conversation of the real friend and the screened conversation of the potential friend, and respectively characterizing the conversation by adopting a gate control recurrent neural network (GRU) to obtain interest characterization. Namely, the current conversation of the current user, the latest conversation of the real friend and the screened conversation of the potential friend are respectively used as the input of a gate control recurrent neural network (GRU), and the output of the gate control recurrent neural network (GRU) is respectively used as the interest of the current user, the interest of the real friend and the interest of the potential friend:

zi=σ(Wxz·xi+Whz·hi-1)

ri=σ(Wxr·xi+Whr·hi-1)

wherein r isiIs a reset gate, ziTo update the gates (update gate), these two gating vectors determine which information can be used as the output of the gated loop unit.Is the current memory content. x is the number ofiIs the node input of the current layer, i.e. the item viIs used for vector characterization. Wxz、Whz、WxrAnd WhrRespectively, control the update gate ziAnd a reset gate riThe parameter (c) of (c). WxhAnd WhhIs to control the pre-memory contentThe parameter (c) of (c). As is the element-level matrix multiplication, σ is the sigmoid function. The output of the last hidden layer of the gated recurrent neural network (GRU) is the session characterization.

S400, combining the real friends and the potential friends of the current user to obtain the social influence of the friends on the user. The real friends and the potential friends are calculated separately, and the effects of the real friends and the potential friends on the current user are calculated by an attention mechanism, wherein the effect of each friend on the current user is different. WhileThe importance of real and potential friends is controlled by a priori parameter λ, which needs to be set by the experimenter. Ultimate social impact pfThe specific calculation method is as follows:

wherein alpha isuiRepresenting real friends uiEffect on the current user, αujRepresenting potential friends ujAs a function of the current user's role,is that the influence of real friends and potential friends on the current user is gathered, pfIs toAdding a nonlinear perceptron layer is also the final social influence; h isu、hiAnd hjRespectively a current user and a real friend uiAnd potential friends ujIs characterized by the vector of (1), attention value alphauiAnd alphaujCalculated using a multiplicative attention mechanism and normalized using the softmax function. The prior parameter lambda belongs to [0,1 ]]The weights of the real friend role and the potential friend role are controlled, and lambda is set to be 0.7 in the experiment. WgIs a transformation matrix parameter and ReLU is a ReLU activation function.

S500, obtaining by combining the interest and social influence of the userAnd (4) user final vector characterization. The interest of the user is jointly determined by the current conversation behavior and social influence, and the user final vector of the user is characterized by guThe two are merged by the full connection layer, such that:

wherein, WphIs a conversion matrix, pfIs a social influence, huIn order to be the current interest of the current user,is a vector stitching operation.

And S600, recommending the article according to the final vector representation of the user and the article vector representation. Article vjVector x ofjMultiplying the representation by the final vector of the user, and then calculating the item v by applying a softmax functionjThe fraction of (c):

wherein, guAn interest vector representing the user is generated by the user,representative article vjThe possibility of becoming the next interactive item; at the same time according toThe log-likelihood function value of (a), calculating a loss function:

wherein, yjRepresents vjThe one-hot code of (a) is,the function is obtained by gradient descent methodAnd (6) optimizing.

The foregoing description of the embodiments is provided to facilitate understanding and application of the invention by those skilled in the art. It will be readily apparent to those skilled in the art that various modifications to the above-described embodiments may be made, and the generic principles defined herein may be applied to other embodiments without the use of inventive faculty. Therefore, the present invention is not limited to the above embodiments, and those skilled in the art should make improvements and modifications to the present invention based on the disclosure of the present invention within the protection scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于时间间隔图的会话推荐方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!