CN113704438A - Conversation recommendation method of abnormal picture based on layered attention mechanism - Google Patents
Conversation recommendation method of abnormal picture based on layered attention mechanism Download PDFInfo
- Publication number
- CN113704438A CN113704438A CN202111035918.6A CN202111035918A CN113704438A CN 113704438 A CN113704438 A CN 113704438A CN 202111035918 A CN202111035918 A CN 202111035918A CN 113704438 A CN113704438 A CN 113704438A
- Authority
- CN
- China
- Prior art keywords
- node
- session
- vector
- current
- user
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/338—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Probability & Statistics with Applications (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a conversation recommendation method of an abnormal picture based on a layered attention mechanism. The method models the interests of the user according to the current conversation of the anonymous user to recommend the most likely interested items of the user in the next step. Mainly comprises four parts: the first part is to calculate the similarity between the current session and the sessions in the session set, recall the similar neighbor session set, and then construct an abnormal graph based on the current session and the neighbor session set; the second part is to adopt a layered attention machine to transmit the information of the nodes in the abnormal graph, so as to obtain the vector representation of the articles in the conversation; the third part is to characterize the item sequence in the current conversation to obtain the interest characterization of the current user; and the fourth part is used for predicting the most likely interested items of the user in the next step according to the user interest characterization.
Description
Technical Field
The invention belongs to the technical field of internet service, and particularly relates to a session recommendation method of an abnormal picture based on a layered attention mechanism.
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. In an actual scenario, some users log in anonymously, and historical interaction behavior data and user detailed information of the users cannot be acquired. Thus, the user can only be recommended items of interest based on the anonymous user's current session. The traditional conversation recommendation method is an Item-based collaborative filtering (Item-KNN) recommendation method, which recommends the most similar items to the user by calculating the similarity between the items in the candidate set and the items in the current conversation. A Session-based collaborative filtering method (Session-KNN) has appeared in recent years, which recommends sessions as a whole by calculating similarities between sessions. The collaborative filtering algorithm ignores the item transfer relationship in the conversation, so more recent conversation recommendation methods use a Recurrent Neural Network (RNN) or a variant of the RNN to learn the item sequence information in the conversation. And the method based on the recurrent neural network can only learn the transfer relationship from the immediately adjacent previous item to the next item in the conversation, but neglects the context relationship of the items in the same conversation. The scholars of the Chinese academy propose to establish the current session as a Graph (Graph) in 2019 to capture the richer item transfer relationships in the more current session, and the method is named as session recommendation by using a Graph neural network (SR-GNN). However, the method is only established based on the current session, and the number of items in a session and the number of times the same item appears repeatedly limit the effectiveness of the method.
Therefore, the method provides a conversation recommendation method based on the layered attention mechanism for the heteromorphic graph. The method extracts a more similar neighbor session set from the most recent session sequence based on the current session. Then, an anomaly graph is constructed based on the current session and the set of neighbor sessions. At this time, there are two sides of the heterogeneous graph, one side represents the item transfer relationship in the current session, that is, represents the interest transfer of the current user. Another type of edge is a transfer relationship in a neighbor session, which represents a general transfer law for an item. And then, based on a hierarchical attention mechanism, carrying out vector updating on the article nodes on the heterogeneous graph to obtain an article vector representation fused with the article transfer relationship. And finally, characterizing the current session by using a recurrent neural network to obtain the interest characterization of the user, and recommending articles. The method sufficiently digs the transfer relationship between the articles by constructing the heteromorphic graph.
Disclosure of Invention
The technical problem to be solved by the invention is to model the interests of the user given the current session of the user to recommend the items which are most likely to be interested by the user in the next step. In an actual recommendation scenario, anonymous users often encounter the behavior of logging in and browsing. At this time, the personal information of the user and the history browsing record of the user are both missing, and the recommendation method can only recommend based on the current session. Thus, the training data is extremely sparse. In order to alleviate the problem of data sparsity in the session recommendation process, the method recalls neighbor sessions similar to the current session in the system through session similarity calculation. And capturing the item transfer relationship between the neighbor session and the current session to improve the performance of the recommendation method. Therefore, the invention adopts the following technical scheme:
a conversation recommendation method of an abnormal picture based on a layered attention mechanism comprises the following steps:
and recalling the neighbor session set according to the item sequence in the current session of the user. The method uses a memory matrix M to store recently occurring sessions. Based on the current session s ═ { v ═ v1,v2,…,v|s|Finding out the most similar k sessions from the memory matrix M as the neighbor session set N of the current session ss. The method screens out a neighbor conversation set N by calculating cosine similarity between a current conversation and a candidate conversation in a memory matrix MsThe similarity calculation formula is as follows:
wherein s isjIs any session stored in the memory matrix M.Is a binary vector representation of the conversation s, if an item is present in the conversationThe corresponding position in s is 1, otherwise 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, and then, according to the cosine similarity, sequencing from high to low, finding out the top k sessions as a neighbor session set N of the current session ss。
And constructing an abnormal graph according to the current session and the neighbor session set of the user. The nodes in the abnormal graph G are a current session s and a neighbor session set NsA union of the set of items present in (a). The edges in the anomaly graph G are directed edges, and there are two semantic edges: one type of edge is derived from the item transfer relationship in the current session, representing the transfer of interest of the current user. Another kind of edge is derived from the item transfer relationship in the neighbor session, and represents the general transfer rule of the item. That is, the data sources of the two edges are different, and thus the semantics of the representations are also different. Session s ═ { v ═ v1,v2,…,v|s|(v) in (v)j-1,vj) Is a directed edge of the abnormal graph G and represents the clicked item vj-1Then click on item vj. Similarly, neighbor session set NsAnother directed edge of the heteromorphic graph G can also be constructed in the session in (1). At this time, the heterogeneous graph G has two source edges, and in the representation of the heterogeneous graph, the edges are distinguished by using a flag Φ ∈ { ses, nei }, and represent that the sources are a current session (session) set and a neighbor session (neighbor session) set, respectively, and the represented semantics are current user interest transfer and general item transfer rules, respectively.
And based on the abnormal graph, a layered attention mechanism is adopted to obtain the object vector representation in the current conversation. And carrying out vector updating on the article nodes in the abnormal composition, and carrying out vector updating on only the articles in the current session in the abnormal composition. The node information transfer of the abnormal graph adopts a layered attention mechanism, which comprises two layers of attention mechanisms: the first layer is a node-based attention mechanism and the second layer is a semantic-based attention mechanism. The heterogeneous graph in the method can be divided into two semantic subgraphs according to different edge semantics, a node-based attention mechanism is firstly used for carrying out node information transfer in the two subgraphs respectively, the two subgraphs respectively obtain updated node vector representations, and at the moment, one article node has two semantic vector representations; and then, performing semantic selection on two semantic vector representations of one article node by adopting a semantic-based attention mechanism, assigning different importance to the two semantic vector representations, performing information fusion of the article nodes, and finally obtaining the final vector representation of the article. The calculation process of updating the ith node in the abnormal graph by adopting a node attention mechanism method is as follows:
wherein, all superscripts phi take values of phi E { ses, nei }, and the represented semantics are respectively the current user interest transfer rule and the general item transfer rule. Note that in this step, the two subgraphs of the different semantics of the heterogeneous graph are computed independently. h isiIs the original vector characterization of the ith node in the heteromorphic graph and is initialized to an article viVector characterization v ofi,viThe learning needs to be updated continuously during model training. Note that v hereiBelonging to items present in the current session, i.e. vi∈s。The vector characterization is carried out after the ith node in the abnormal graph is converted.Is a transformation matrix.Representing the importance degree of the jth neighbor node to the ith nodeAtt mechanism using node-based attentionnodeTo calculate the time of the calculation of the time of the calculation,and representing the neighbor node set of the ith node under the phi semantic subgraph. attnodeIs specifically shown as The | | represents a vector join operation,andrespectively, a transformation vector and a transformation matrix, and tanh is a tanh activation function. Obtaining the importance degree of the jth neighbor node to the ith nodeAfterwards, the softmax function pair is adoptedNormalization is carried out, the coefficient after normalization isFinally, all the neighbor nodes of the ith nodeIs transmitted to the ith node to obtainThe vector representation of the ith node after the node attention mechanism is updated. At this time, two semantic vector representations may exist in one item node in the heterogeneous graph, for example, the two semantic vector representations of the ith node are respectivelyAndthen, performing semantic selection on two semantic vector representations of an article node by adopting a semantic-based attention mechanism, allocating different importance to the two semantic vector representations, performing information fusion of the article node, and finally obtaining a final vector representation of the article:
wherein the content of the first and second substances,andis a transformation matrix, bfIs a bias vector, qfIs the translation vector, tanh is the tanh activation function, and σ is the sigmoid activation function. Coefficient beta representsThe coefficient 1-beta representsThe degree of importance of. The final vector characterization of the ith item node is xi。
And obtaining the interest representation of the user according to the item sequence in the current session of the user. After obtaining the vector characterization of all the items, a gate control recurrent neural network (GRU) is adopted to carry out s ═ v ═ on the current session of the user1,v2,…,v|s|Characterizing to obtain a session characterization, namely, characterizing the current interest of the user:
zi=σ(Wxz·xi+Whz·hi-1)
ri=σ(Wxr·xi+Whr·hi-1)
wherein r isiIs a reset gate (resetgate), 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 for the current layer. 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. Door control cycleOutput h of last hidden layer of a recurrent neural network (GRU)|s|It is the session representation, i.e. the user's current interest representation p.
Recommending the item according to the user interest characterization. Article vjVector v ofjMultiplying the user interest vector p and then applying a softmax function to calculate an item vjThe fraction of (c):
where p represents the user's interest vector,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 invention constructs the heteromorphic graph based on the current conversation and the neighbor conversation set. The method captures the rich transfer relation between the articles and improves the performance of the recommendation method.
(2) The method adopts a layered attention mechanism to update the object vector representation based on the constructed abnormal graph. Not only the current user interest transfer rule is considered, but also the common article transfer rule in the system is considered, and the model learns the importance of the two types of transfer by itself.
Drawings
FIG. 1 is a schematic flow chart of a session recommendation method for an abnormal graph based on a hierarchical attention mechanism according to the present invention;
FIG. 2 is a model framework diagram of a session recommendation method based on an abnormal graph of a hierarchical attention mechanism according to the present invention.
Detailed Description
For further understanding of the present invention, the following describes a conversation recommendation method based on an abnormal graph of a layered attention mechanism with reference to specific embodiments, but the present invention is not limited thereto, and those skilled in the art can make insubstantial modifications and adjustments under the core teaching 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, session being a set of items in a time period s ═ v { (v)1,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.Ns: a set of neighbor sessions for session s.
Definition 5. G: based on user current conversation s and neighbor conversation set NsAnd constructing the abnormal picture.
Definition 6.The neighbor node of the ith node in the heterograph G under the phi semantic meaning phi e { ses, nei }.
Definition 7.hi: and (5) differentiating vector representation of the ith node of the graph.
Definition 9. p: the vector representation of the current session also represents the user interest vector representation.
In conjunction with the above variable definitions, the final problem is defined as: given the user's current session s, the session recommendation method models the user's interests to recommend the items that the user is most likely to be interested in the next step, the items being a subset of the set V.
Therefore, the invention provides a conversation recommendation method based on an abnormal graph of a layered attention mechanism. The model is shown in fig. 2, and the model mainly comprises four modules. The first module is to construct an abnormal picture, firstly calculate the similarity between the current session and the sessions in the session set, recall the similar neighbor session set, and then construct the abnormal picture based on the current session and the neighbor session set. Graph nodes in an anomaly graph are items that appear in the current session and neighbor session sets, and edges are of two types: one type of edge represents an item transfer relationship in the current session, that is, represents a transfer of interest of the current user. Another type of edge is a transfer relationship in a neighbor session, which represents a general transfer law for an item. That is, the data sources of the two edges are different, and thus the semantics of the representations are also different. And the second module is used for carrying out information transmission of nodes in the abnormal graph so as to obtain the object representation. The node information transfer of the abnormal graph adopts a layered attention mechanism, which comprises two layers of attention mechanisms: the first layer is a node-based attention mechanism and the second layer is a semantic-based attention mechanism. The heterogeneous graph in the method can be divided into two subgraphs according to edge semantics, node information transmission is carried out on the two subgraphs respectively by using a node attention-based mechanism, the two subgraphs respectively obtain updated node vector representations, and at the moment, two semantic vector representations exist in one article node; and then, performing semantic selection on two semantic vector representations of one article node by adopting a semantic-based attention mechanism, assigning different importance to the two semantic vector representations, performing information fusion of the article nodes, and finally obtaining the final vector representation of the article. And the third module is an interest extraction module, and after the object vector representation is obtained, the method adopts the recurrent neural network to represent the object sequence in the current conversation to obtain the vector representation of the conversation, namely the interest representation of the current user. The last module is to recommend items according to the obtained user interest representation. The method is characterized in that a first module constructs a heterogeneous graph network for a current session and a neighbor session set, and a second module updates the object vector representation by adopting a layered attention mechanism in a heterogeneous graph.
As shown in fig. 1, one embodiment of the present invention comprises the steps of:
s100, recalling the neighbor session set according to the item sequence in the current session of the user. According to research, the value of the recently-occurring session information is the highest, such as clothes, fruits and the like in the e-market scenes are closely related to the time. The method adopts a memory matrix M to store the recently-occurring conversation, and comprehensively considers the algorithm effect and the storage pressure in the method, and sets the conversation sequence number stored in the memory matrix M to be 10000. Based on the current session s ═ { v ═ v1,v2,…,v|s|Finding out the most similar k sessions from the memory matrix M as the neighbor session set N of the current session ss. Wherein k has a value of 256. The method screens out a neighbor conversation set N by calculating cosine similarity between a current conversation and a candidate conversation in a memory matrix MsThe 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, and then, according to the cosine similarity, sequencing from high to low, finding out the top k sessions as a neighbor session set N of the current session ss. Here, simthreSet to 0.5 and k to 256.
S200, constructing an abnormal graph according to the current session and the neighbor session set of the user. From the previous step, a neighbor session set N of the current session s of the user has been obtaineds. The nodes in the abnormal graph G are a current session s and a neighbor session set NsA union of the set of items present in (a). The edges in the anomaly graph G are directed edges, and there are two semantic edges: one type of edge is derived from the item transfer relationship in the current session, representing the transfer of interest of the current user. Another kind of edge is derived from the item transfer relationship in the neighbor session, and represents the general transfer rule of the item. The data sources of these two edges are different and therefore the semantics of the representations are also different. Session s ═ { v ═ v1,v2,…,v|s|(v) in (v)j-1,vj) Is a directed edge of the abnormal graph G and represents the clicked item vj-1Then click on item vj. Similarly, neighbor session set NsAnother directed edge of the heteromorphic graph G can also be constructed in the session in (1). At this time, the heterogeneous graph G has two source edges, and in the representation of the heterogeneous graph, the edges are distinguished by using a flag Φ ∈ { ses, nei }, and represent that the sources are a current session (session) set and a neighbor session (neighbor session) set, respectively, and the represented semantics are current user interest transfer and general item transfer rules, respectively.
And S300, based on the abnormal picture, obtaining the object vector representation in the current conversation by adopting a layered attention mechanism. And carrying out vector updating on the article nodes in the abnormal composition, and carrying out vector updating on only the articles in the current session in the abnormal composition. The node information transfer of the abnormal graph adopts a layered attention mechanism, which comprises two layers of attention mechanisms: the first layer is a node-based attention mechanism and the second layer is a semantic-based attention mechanism. The heterogeneous graph in the method can be divided into two subgraphs according to different edge semantics, node-based attention is firstly used for conducting information transfer of nodes in the two subgraphs respectively, the two subgraphs respectively obtain updated node vector representations, and at the moment, two semantic vector representations exist in one article node; and then, performing semantic selection on two semantic vector representations of one article node by adopting a semantic-based attention mechanism, assigning different importance to the two semantic vector representations, performing information fusion of the article nodes, and finally obtaining the final vector representation of the article. The calculation process of updating the ith node in the abnormal graph by adopting a node attention mechanism method is as follows:
wherein, all superscripts phi take values of phi E { ses, nei }, and the represented semantics are respectively the current user interest transfer rule and the general item transfer rule. Note that in this step, the two subgraphs of the different semantics of the heterogeneous graph are computed independently. h isiIs the original vector characterization of the ith node in the heteromorphic graph and is initialized to an article viVector characterization v ofi,viNeed to continually update learning as models are trained, and viIs set to 100. Note that v hereiBelonging to items present in the current session, i.e. vi∈s。The vector characterization is carried out after the ith node in the abnormal graph is converted.Is a transformation matrix.Representing the importance degree of the jth neighbor node to the ith nodeAtt mechanism using node-based attentionnodeTo calculate the time of the calculation of the time of the calculation,and representing the neighbor node set of the ith node under the phi semantic subgraph. attnodeIs specifically shown asThe | | represents a vector join operation,andrespectively, a transformation vector and a transformation matrix, and tanh is a tanh activation function. Obtaining the importance degree of the jth neighbor node to the ith nodeAfterwards, the softmax function pair is adoptedNormalization is carried out, the coefficient after normalization isFinally, all the neighbor nodes of the ith nodeIs transmitted to the ith node to obtainThe vector representation of the ith node after the node attention mechanism is updated. At this time, two semantic vector representations may exist in one item node in the heterogeneous graph, for example, the two semantic vector representations of the ith node are respectivelyAndthen, performing semantic selection on two semantic vector representations of an article node by adopting a semantic-based attention mechanism, allocating different importance to the two semantic vector representations, performing information fusion of the article node, and finally obtaining a final vector representation of the article:
wherein the content of the first and second substances,andis a transformation matrix, bfIs a bias vector, qfIs the translation vector, tanh is the tanh activation function, and σ is the sigmoid activation function. Coefficient beta representsThe coefficient 1-beta representsThe degree of importance of. The final vector characterization of the ith item node is xi。
S400, obtaining the user interest representation according to the item sequence in the current session of the user. After obtaining the vector characterization of all the items, a gate control recurrent neural network (GRU) is adopted to carry out s ═ v ═ on the current session of the user1,v2,…,v|s|Characterizing to obtain a session characterization, namely, characterizing the current interest of the user:
zi=σ(Wxz·xi+Whz·hi-1)
ri=σ(Wxr·xi+Whr·hi-1)
wherein r isiIs a reset gate (resetgate), 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 for the current layer. 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. Controlling the output h of the last hidden layer of a recurrent neural network (GRU)|s|It is the session representation, i.e. the user's current interest representation p.
And S500, recommending the item according to the user interest representation. Article vjVector v ofjMultiplying by a user interest vector p, and then calculating the item v by applying a soffmax functionjThe fraction of (c):
where p represents the user's interest vector,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 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.
Claims (3)
1. A conversation recommendation method of an abnormal picture based on a layered attention mechanism is characterized in that:
recalling the neighbor session set according to the item sequence in the current session of the user; storing the most recently occurring sessions by using a memory matrix M; based on the current session s ═ { v ═ v1,v2,…,v|s|Calculating cosine similarity between the current conversation and the candidate conversation in the memory matrix M, and lowering the cosine similarity to be lower than a threshold simthreThe sessions are filtered, and then are sorted from high to low according to cosine similarity, and the first k sessions are the neighbor session set N of the current session ss;
Constructing a heteromorphic graph according to a current session and a neighbor session set of a user; the nodes in the abnormal graph G are a current session s and a neighbor session set NsA union of the set of items present in (a); the edges in the anomaly graph G are directed edges, and there are two semantic edges: one edge is derived from the item transfer relationship in the current session and represents the interest transfer of the current user; the other edge is derived from the article transfer relationship in the neighbor conversation and represents the general transfer rule of the article; the data sources of the two edges are different, so that the represented semantics are also different, and the edges of the two semantics are distinguished by using a mark phi epsilon { ses, nei }; current session s ═ v1,v2,…,v|s|(v) in (v)j-1,vj) Is a directed edge of the abnormal graph G and represents the clicked item vj-1Then click on item vj(ii) a Similarly, neighbor session set NsAnother directed edge of the abnormal graph G can be constructed in the conversation in (1);
based on the abnormal picture, a layered attention mechanism is adopted to obtain the object vector representation in the current conversation; carrying out vector updating on the article nodes in the abnormal composition, and only carrying out vector updating on the articles in the current conversation s in the abnormal composition; the node information transfer of the abnormal graph adopts a layered attention mechanism, which comprises two layers of attention mechanisms: the first layer is a node-based attention mechanism, and the second layer is a semantic-based attention mechanism; the heterogeneous graph can be divided into two semantic subgraphs according to different edge semantics, node information transmission is carried out on the two subgraphs respectively by using a node-based attention mechanism, the two subgraphs respectively obtain updated node vector representations, and at the moment, two semantic vector representations exist in one article node; then, selecting two semantic vector representations of an article node by adopting a semantic-based attention mechanism, assigning different importance to the two semantic vector representations, performing information fusion of the article node, and finally obtaining a final vector representation of the article; the calculation process of updating the ith node in the abnormal graph by adopting a node attention mechanism method is as follows:
wherein, all superscript phi values are phi belongs to { ses, nei }, and the represented semantics are respectively the current user interest transfer rule and the general item transfer rule; note that in this step, two subgraphs of the different semantics of the heterogeneous graph are computed independently; h isiIs the original vector characterization of the ith node in the heteromorphic graph and is initialized to an article viVector characterization v ofi,viThe learning needs to be updated continuously during model training; v hereiniBelonging to items present in the current session, i.e. vi∈s;Is the vector representation of the ith node in the abnormal graph after conversion,is a transformation matrix;representing the importance degree of the jth neighbor node to the ith nodeAtt mechanism using node-based attentionnodeTo calculate the time of the calculation of the time of the calculation,representing the neighbor node set of the ith node under the phi semantic subgraph; attnodeIs specifically shown as The | | represents a vector join operation,andrespectively, a transformation vector and a transformation matrix, and tanh is a tanh activation function; obtaining the importance degree of the jth neighbor node to the ith nodeThen, the s0ftmax function pair is adoptedNormalization is carried out, the coefficient after normalization isFinally, all the neighbor nodes of the ith nodeIs transmitted to the ith node to obtainThe vector representation of the ith node is updated through a node attention mechanism; at this time, two semantic vector representations may exist in one item node in the heterogeneous graph, for example, the two semantic vector representations of the ith node are respectivelyAndthen, selecting two semantic vector representations of an article node by adopting a semantic-based attention mechanism, assigning different importance to the two semantic vector representations, performing information fusion of the article node, and finally obtaining a final vector representation of the article:
wherein the content of the first and second substances,andis a transformation matrix, bfIs a bias vector, qfIs a translation vector, tanh is a tanh activation function, σ is a sigmoid activation function; coefficient beta representsThe coefficient 1-beta representsThe degree of importance of; the final vector characterization of the ith item node is xi;
Obtaining a user interest representation according to an article sequence in a current session of a user; after obtaining the vector characterization of all the items, a gate control recurrent neural network (GRU) is adopted to carry out s ═ v ═ on the current session of the user1,v2,…,v|s|Characterizing to obtain a session characterization, namely a current interest characterization p of a user;
recommending the item according to the user interest representation; article vjVector v ofjMultiplying the user interest vector p and then applying a softmax function to calculate an item vjThe fraction of (c):
where p represents the user's interest vector,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:
2. The conversation recommendation method based on the layered attention mechanism abnormal picture according to claim 1, characterized in that: the cosine 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 appears in the session, the corresponding position in s is 1, otherwise 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).
3. The conversation recommendation method based on the layered attention mechanism abnormal picture according to claim 1, characterized in that: 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, ziTo update the gate, these two gating vectors determine which information can be used as inputs to the gated loop unitDischarging;is the current memory content; x is the number ofiIs the node input of the current layer; 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; controlling the output h of the last hidden layer of a recurrent neural network (GRU)|s|It is the session representation, i.e. the user's current interest representation p.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111035918.6A CN113704438B (en) | 2021-09-06 | 2021-09-06 | Conversation recommendation method of abnormal picture based on layered attention mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111035918.6A CN113704438B (en) | 2021-09-06 | 2021-09-06 | Conversation recommendation method of abnormal picture based on layered attention mechanism |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113704438A true CN113704438A (en) | 2021-11-26 |
CN113704438B CN113704438B (en) | 2022-02-22 |
Family
ID=78660092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111035918.6A Active CN113704438B (en) | 2021-09-06 | 2021-09-06 | Conversation recommendation method of abnormal picture based on layered attention mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113704438B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114036400A (en) * | 2021-12-07 | 2022-02-11 | 中国计量大学 | Hypergraph-based collaborative session recommendation method |
CN115659063A (en) * | 2022-11-08 | 2023-01-31 | 黑龙江大学 | Relevance information enhanced recommendation method for user interest drift, computer device, storage medium, and program product |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160099854A1 (en) * | 2014-10-01 | 2016-04-07 | Adobe Systems Incorporated | Digital content consumption analysis |
US9772979B1 (en) * | 2012-08-08 | 2017-09-26 | Amazon Technologies, Inc. | Reproducing user browsing sessions |
CN109299373A (en) * | 2018-10-20 | 2019-02-01 | 上海交通大学 | Recommender system based on figure convolution technique |
US20190222560A1 (en) * | 2015-08-05 | 2019-07-18 | Intralinks, Inc. | Systems and methods of secure data exchange |
US20190386969A1 (en) * | 2015-01-26 | 2019-12-19 | Listat Ltd. | Decentralized Cybersecure Privacy Network For Cloud Communication, Computing And Global e-Commerce |
CN110795618A (en) * | 2019-09-12 | 2020-02-14 | 腾讯科技(深圳)有限公司 | Content recommendation method, device, equipment and computer readable storage medium |
CN111125537A (en) * | 2019-12-31 | 2020-05-08 | 中国计量大学 | Session recommendation method based on graph representation |
CN111222054A (en) * | 2020-01-03 | 2020-06-02 | 中国计量大学 | Session social contact recommendation method based on context neighbor relation modeling |
CN111460331A (en) * | 2020-04-07 | 2020-07-28 | 中国计量大学 | Conversation recommendation method based on space-time diagram |
CN111538906A (en) * | 2020-05-29 | 2020-08-14 | 支付宝(杭州)信息技术有限公司 | Information pushing method and device based on privacy protection |
CN111881269A (en) * | 2020-06-24 | 2020-11-03 | 北京三快在线科技有限公司 | Recommendation object determination method and device, electronic equipment and storage medium |
CN112035746A (en) * | 2020-09-01 | 2020-12-04 | 湖南大学 | Session recommendation method based on space-time sequence diagram convolutional network |
CN112528165A (en) * | 2020-12-16 | 2021-03-19 | 中国计量大学 | Session social recommendation method based on dynamic routing graph network |
-
2021
- 2021-09-06 CN CN202111035918.6A patent/CN113704438B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9772979B1 (en) * | 2012-08-08 | 2017-09-26 | Amazon Technologies, Inc. | Reproducing user browsing sessions |
US20160099854A1 (en) * | 2014-10-01 | 2016-04-07 | Adobe Systems Incorporated | Digital content consumption analysis |
US20190386969A1 (en) * | 2015-01-26 | 2019-12-19 | Listat Ltd. | Decentralized Cybersecure Privacy Network For Cloud Communication, Computing And Global e-Commerce |
US20190222560A1 (en) * | 2015-08-05 | 2019-07-18 | Intralinks, Inc. | Systems and methods of secure data exchange |
CN109299373A (en) * | 2018-10-20 | 2019-02-01 | 上海交通大学 | Recommender system based on figure convolution technique |
CN110795618A (en) * | 2019-09-12 | 2020-02-14 | 腾讯科技(深圳)有限公司 | Content recommendation method, device, equipment and computer readable storage medium |
CN111125537A (en) * | 2019-12-31 | 2020-05-08 | 中国计量大学 | Session recommendation method based on graph representation |
CN111222054A (en) * | 2020-01-03 | 2020-06-02 | 中国计量大学 | Session social contact recommendation method based on context neighbor relation modeling |
CN111460331A (en) * | 2020-04-07 | 2020-07-28 | 中国计量大学 | Conversation recommendation method based on space-time diagram |
CN111538906A (en) * | 2020-05-29 | 2020-08-14 | 支付宝(杭州)信息技术有限公司 | Information pushing method and device based on privacy protection |
CN111881269A (en) * | 2020-06-24 | 2020-11-03 | 北京三快在线科技有限公司 | Recommendation object determination method and device, electronic equipment and storage medium |
CN112035746A (en) * | 2020-09-01 | 2020-12-04 | 湖南大学 | Session recommendation method based on space-time sequence diagram convolutional network |
CN112528165A (en) * | 2020-12-16 | 2021-03-19 | 中国计量大学 | Session social recommendation method based on dynamic routing graph network |
Non-Patent Citations (5)
Title |
---|
DIETMAR JANNACH等: "When Recurrent Neural Networks meet the Neighborhood for Session-Based Recommendation", 《RECSYS "17: PROCEEDINGS OF THE ELEVENTH ACM CONFERENCE ON RECOMMENDER SYSTEMS》 * |
SHU WU等: "Session-Based Recommendation with Graph Neural Networks", 《PROCEEDINGS OF THE AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE》 * |
XIAO WANG等: "Heterogeneous Graph Attention Network", 《WWW "19: THE WORLD WIDE WEB CONFERENCE》 * |
孙鑫等: "基于图神经网络和时间注意力的会话序列推荐", 《计算机工程与设计》 * |
杨康: "基于神经网络的行为推荐模型研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114036400A (en) * | 2021-12-07 | 2022-02-11 | 中国计量大学 | Hypergraph-based collaborative session recommendation method |
CN114036400B (en) * | 2021-12-07 | 2022-04-08 | 中国计量大学 | Hypergraph-based collaborative session recommendation method |
CN115659063A (en) * | 2022-11-08 | 2023-01-31 | 黑龙江大学 | Relevance information enhanced recommendation method for user interest drift, computer device, storage medium, and program product |
CN115659063B (en) * | 2022-11-08 | 2023-07-25 | 黑龙江大学 | Relevance information enhancement recommendation method for user interest drift, computer device, storage medium and program product |
Also Published As
Publication number | Publication date |
---|---|
CN113704438B (en) | 2022-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111523047B (en) | Multi-relation collaborative filtering algorithm based on graph neural network | |
CN111310063B (en) | Neural network-based article recommendation method for memory perception gated factorization machine | |
CN111881350B (en) | Recommendation method and system based on mixed graph structured modeling | |
CN111460331B (en) | Conversation recommendation method based on space-time diagram | |
CN111881342A (en) | Recommendation method based on graph twin network | |
CN109657156A (en) | A kind of personalized recommendation method generating confrontation network based on circulation | |
CN113704438B (en) | Conversation recommendation method of abnormal picture based on layered attention mechanism | |
CN111949885B (en) | Personalized recommendation method for scenic spots | |
CN113918834B (en) | Graph convolution collaborative filtering recommendation method fusing social relations | |
CN112819575B (en) | Session recommendation method considering repeated purchasing behavior | |
CN112765461A (en) | Session recommendation method based on multi-interest capsule network | |
CN113918833A (en) | Product recommendation method realized through graph convolution collaborative filtering of social network relationship | |
CN113918832A (en) | Graph convolution collaborative filtering recommendation system based on social relationship | |
CN114595383A (en) | Marine environment data recommendation method and system based on session sequence | |
CN115618128A (en) | Collaborative filtering recommendation system and method based on graph attention neural network | |
CN113590965B (en) | Video recommendation method integrating knowledge graph and emotion analysis | |
CN117216281A (en) | Knowledge graph-based user interest diffusion recommendation method and system | |
CN113361928B (en) | Crowd-sourced task recommendation method based on heterogram attention network | |
CN110442802A (en) | A kind of more Behavior preference prediction techniques of social activity user | |
CN113704439B (en) | Conversation recommendation method based on multi-source information heteromorphic graph | |
Zhang et al. | Knowledge graph driven recommendation model of graph neural network | |
CN112818256A (en) | Recommendation method based on neural collaborative filtering | |
CN116304336A (en) | Course recommendation method integrating knowledge graph and graph neural network | |
CN116257691A (en) | Recommendation method based on potential graph structure mining and user long-short-term interest fusion | |
Zhang et al. | Probabilistic matrix factorization recommendation of self-attention mechanism convolutional neural networks with item auxiliary information |
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 |