A session recommendation system fusing item transition relations and timing information

By integrating item transformation relationships and temporal information into a conversation recommendation system, this approach addresses the problem of insufficient utilization of conversation sequence information in existing technologies through the use of item embedding layers, transformation relationship encoding layers, self-attention layers, and graph neural network layers. This enables more accurate user interest modeling and recommendation.

CN119003869BActive Publication Date: 2026-07-10INSPUR ZHUOSHU BIG DATA IND DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
Filing Date
2024-08-01
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing session recommendation methods fail to fully utilize item transition relationships and temporal information in session sequences, resulting in an inability to accurately capture global and local dependency information of the session, thus affecting the accuracy of the recommendation model.

Method used

A conversation recommendation system that integrates item transition relationships and temporal information is adopted. Through an item embedding layer, an item transition relationship encoding layer, a self-attention layer, a graph neural network layer, and a prediction layer, global and local dependency information of the conversation is obtained. Combined with the reverse position information, a linear combination is performed to generate a user recommendation list.

Benefits of technology

By acquiring and combining global and local dependency information of a session, the representation of the session sequence is accurately modeled, improving the accuracy of recommendations and capturing user interests and preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003869B_ABST
    Figure CN119003869B_ABST
Patent Text Reader

Abstract

This invention discloses a conversation recommendation system that integrates item transformation relationships and temporal information, relating to the field of conversation recommendation technology. It includes: an item embedding layer for mapping each node of a conversation sequence to a fixed-dimensional vector representation; an item transformation relationship encoding layer for calculating the shortest path sequence between any two items in the conversation sequence and encoding it as the transformation relationship between the corresponding items; a self-attention layer for capturing global dependency information of the conversation from a graph perspective using a self-attention mechanism based on the transformation relationship between items; a graph neural network layer for constructing a conversation graph using the temporal information of the conversation sequence and obtaining local dependency information of the conversation; and a prediction layer for linearly combining global and local dependency information and concatenating inverse positional information to obtain an accurate representation of the conversation, calculating the scores of all candidate items to generate a recommendation list. This invention can accurately model the representation of conversation sequences and generate user interest preferences for items.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of conversation recommendation technology, specifically a conversation recommendation system that integrates item conversion relationships and temporal information. Background Technology

[0002] In the internet age, with the rapid rise and development of various social media, e-commerce websites, and social service websites, recommendation systems play a crucial role on various online platforms. This is because they can effectively alleviate the problem of information overload by recommending useful content to users, and at the same time, they have profound significance for expanding the platform market.

[0003] Traditional recommendation methods (such as collaborative filtering) often rely on the availability of user profiles and long-term historical interactions. In many recent real-world scenarios, when such information is unavailable, traditional recommendation methods may perform poorly in terms of predictive performance.

[0004] Conversation-based recommendation has attracted widespread attention from researchers in recent years due to its high practical value. It models a given sequence of anonymous behaviors in chronological order and predicts the next item that a user may be interested in, leading to the development of many effective recommendation methods.

[0005] Early research on session-based recommendation primarily focused on Markov chains (MC), which assume that the next action is based on previous actions. This independent combination can limit the accuracy of recommendation models. In recent years, many deep learning-based methods have been proposed for recommendation tasks, utilizing pairwise item transition information to model user preferences for a given session, such as GRU4Rec and NARM. Other attempts have focused on applying graph neural networks to session recommendation, such as SR-GNN and GC-SAN. While these graph neural network-based methods have achieved promising results and provided a new and hopeful direction for session-based recommendation, these models only consider item information within the session sequence and do not fully utilize other auxiliary information within the session, such as item transition relationships and session temporal information. This results in an inability to accurately capture global and local dependencies during session modeling. Summary of the Invention

[0006] This invention addresses the needs and shortcomings of current technological development by providing a session recommendation system that integrates item conversion relationships and temporal information. By acquiring and combining global and local dependency information of sessions, it captures user interests more accurately and then accurately models the representation of session sequences to make recommendations to users.

[0007] The present invention provides a conversation recommendation system that integrates item conversion relationships and temporal information. The technical solution adopted to solve the above-mentioned technical problems is as follows:

[0008] A conversational recommendation system that integrates item conversion relationships and temporal information, the structure of which includes:

[0009] Item embedding layer, used to map each node in the session sequence to a fixed-dimensional vector representation;

[0010] The item transformation relationship encoding layer is used to obtain the shortest path sequence between any two items in the session sequence by using the edge information in the graph network structure, and then encodes it into the transformation relationship between the corresponding items through a bidirectional GRU network.

[0011] The self-attention layer based on item transformation relationships is used to capture global dependency information of the session from the perspective of graphs by combining self-attention mechanisms, according to the transformation relationships between items.

[0012] A graph neural network layer based on session temporal information is used to construct a session graph using temporal information in the session sequence, and then obtain the local dependency information of the session through a gated graph neural network.

[0013] The prediction layer linearly combines the obtained global and local dependency information and concatenates it with the inverse position information to obtain an accurate representation of the session. Finally, it calculates the scores of all candidate items to generate a user recommendation list.

[0014] Optionally, the given session sequence s = {v1, v2, ..., v...} can be used. i ,...,v n The input is fed into the item embedding layer, resulting in a vector representation of the conversation sequence s:

[0015] X = [x1, x2, ..., x i ,...,x n ] Formula (1),

[0016] Where, x i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation is given by n, where n represents the length of the session sequence s.

[0017] Optionally, the item transformation relationship encoding layer uses the edge information in the graph network structure to obtain the shortest path sequence between any two items in the session sequence. The specific process is as follows:

[0018] Given a session sequence s = {v1, v2, ..., v...} i ,...,v n Model it as a directed graph G = {V} s ,ε s},in, ε represents the set of nodes that represent unique items in a session sequence.s It represents a set of edges, which can be of four types: unidirectional edges, bidirectional edges, self-loop edges, and undirected edges.

[0019] Assume (v) i ,v j If ) are adjacent items in session s, then four different types of directed edges are added between them, specifically: ① from v i to v j Marked as 1, ② from v j to v i Marked as 2, ③ (v) appeared in the session sequence s. j ,v i ), then v i and v j The edge between nodes is labeled 3. ④ Add a self-loop edge to each node in the session sequence s, labeled 4.

[0020] Then, for any two nodes v i and v j The shortest path sequence between them is represented as: R i→j =[e(i,k1),e(k1,k2),...,e(k L [,j)], where e(·,·) represents the category label of the edge between the two nodes, k m Represents node v i and v j The set of intermediate nodes between, m is between 1 and L.

[0021] At this point, a learnable embedding is assigned to each type of edge, thus obtaining the shortest path sequence R. i→j The vector representation involves the following formula:

[0022] R = [r0, r1, ..., r i ,...,r L ] Formula (2),

[0023] in, d represents the embedding information of the m-th edge. r Let L be the embedding dimension of the shortest path sequence, representing node v. i and v j The number of intermediate node sets between them.

[0024] Optionally, the item transformation relationship encoding layer encodes the shortest path sequence between any two items in the session sequence into the transformation relationship between the corresponding items through a bidirectional GRU network. The specific process is as follows:

[0025] First, a bidirectional GRU network is used to encode the shortest path sequence between any two items in the session sequence s into a fixed-length vector, involving the following formula:

[0026]

[0027] in, and These represent the forward encoded hidden layer information and the backward encoded hidden layer information of the (l+1)th edge, respectively. (GRU) f and GRU b These represent the forward GRU encoding and the reverse GRU encoding of the (l+1)th edge, respectively;

[0028] Subsequently, the hidden layer information of the last layer of the forward GRU network and the reverse GRU network are concatenated, then node v i and v j Transformation relation β ij Represented as:

[0029]

[0030] in, This represents the forward GRU encoding of the (L+1)th edge. This represents the reverse GRU encoding of the first edge.

[0031] Optionally, the self-attention layer involved captures global dependency information of the session from a graph perspective, combining the transformation relationships between items with the self-attention mechanism. The specific process is as follows:

[0032] First, node v i and v j Transformation relation β ij Divided into two relations r i→j and r j→i r i→j Indicates from v i to v j The relationship, r j→i Indicates from v j to v i The relationship is shown in formula (6):

[0033] [r i→j ;r j→i ] = W r β ij Formula (6),

[0034] in, For training parameters, d represents the embedding dimension of the item. r The embedding dimension represents the shortest path sequence;

[0035] Subsequently, using formulas (7)-(11), the embedding sequence of the items and the corresponding transformation relationship are added together as the input to the self-attention layer, thereby obtaining the output of the self-attention layer:

[0036] K i =W i K (x j +r j→i ) formula (7),

[0037] Q i =W i Q (x i +r i→j ) formula (8),

[0038]

[0039] F = [f1, f2, ..., f i ,...,f n ] Formula (11),

[0040] Among them, W i Q W i K W i V ∈R d×d For training parameters, x i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where d represents the embedding dimension of the item; K i and Q i Nodes v representing the self-attention layer i The query vector and index vector, K i and Q i They respectively merged from v j to v i Relationship and from v i to v j relation; Represents the compute node v i and v j The attention scores are normalized by using the softmax function to compress all attention scores to a range of 0 to 1, thus obtaining the final score λ. ij The normalized score λ ij Input information x j The weight of node v is obtained. j For node v i The attention value will be calculated from all nodes from 1 to n for v. i The attention values ​​are added together to obtain the node v. i The output of f represents i; n represents the length of the session sequence s. The output representations of all nodes from 1 to n are concatenated in parallel to obtain the output F = [f1, f2, ..., fn] of the self-attention layer. i ,...,f n ];

[0041] Finally, a feedforward neural network layer with ReLU as the activation function and a residual network are applied after the self-attention layer to obtain a global dependency information representation that integrates the item transformation relationship, as shown in Equation (12):

[0042] G = ReLU(FW1+b1)W2+b2+F (Formula 12)

[0043] Where W1, W2 ∈ R d×d For the training parameters, b1, b2 ∈ R d Here, d represents the item embedding dimension, n represents the length of the conversation sequence s, F represents the output of the self-attention layer, and G = [g1, g2, ..., g i ,...,g n ] represents the global dependency information of the session, where i takes values ​​between 1 and n (inclusive of endpoints 1 and n), and F = f in formula (12). i That is, we get g i g i Represents node v i The global dependency information is represented.

[0044] Alternatively, the graph neural network layers involved utilize temporal information from the session sequence to construct the session graph, as follows:

[0045] For a given session sequence s = {v1, v2, ..., v...} i ,...,v n}, will store items v in the session sequence s. i Treated as a node on the session graph, it will start from v i-1 to v i Each click is considered a directed edge between two nodes in the session graph, thus completing the construction of the session graph;

[0046] Based on the constructed session graph, starting from 1, natural numbers are used to assign values ​​to the corresponding edges according to the order in which items appear in the session sequence s, in order to represent the weight of the edges in the session graph. At this point, a session graph structure containing temporal information can be obtained.

[0047] The tanh activation function is used to normalize the weights of the edges in the session graph, mapping the weights appropriately to the range of 0 to 1. The specific operation is as follows:

[0048] Let A I A O ∈Rn×n These represent the input matrix and output matrix in the session graph, respectively. n represents the length of the session sequence s. Each row in the matrix represents the in-degree and out-degree relationship between the current node and the remaining nodes in the session graph, and its value is equal to the weight of the corresponding edge.

[0049] If a node in the session graph has at least one in-degree or one out-degree, then the average value is taken as the weight of the corresponding edge.

[0050] Optionally, after constructing a session graph using temporal information from the session sequence, the graph neural network layer then obtains local dependency information of the session through a gated graph neural network. The specific process is as follows:

[0051]

[0052] z i =σ(W z a i +U z x i ) formula (14),

[0053] r i =σ(W r a i +U r x i ) formula (15),

[0054]

[0055] in, It is the i-th row in the corresponding input and output matrices; W I W O ∈R d×d These are the learning parameters for the input and output edges, respectively, and b I ,b O ∈R d It is the deviation vector; X = [x1, x2, ..., x i ,...,x n [x] is a list of node vectors in the session sequence s. i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where d represents the embedding dimension of the item, and n represents the length of the session sequence s; W z U z W r U r and W o U o These represent the learning parameters for the reset gate, update gate, and output gate, respectively; σ(·) represents the sigmoid activation function, ⊙ represents the element-wise multiplication operation, and tanh is the activation function;

[0056] The a obtained by formula (13) i Represents node v i The result of interactions between node v and its neighboring nodes via edges is used to reflect the relationship between node v and its neighboring nodes. i The degree to which neighboring nodes influence it;

[0057] z calculated by formula (14) i Represents node v i The reset door;

[0058] The r calculated by formula (15) i Represents node v i The update gate;

[0059] The result calculated by formula (16) Represents node v i Candidate states;

[0060] The result of formula (17) is l i For node v i The local latent vector representation; the function of formula (17) is: for each session graph, the gated graph neural network is used to propagate information between adjacent graph nodes. The functions of the reset gate and the update gate determine which node information to discard and retain, respectively, and thus obtain l i For node v i Local implicit vector representation;

[0061] n represents the length of the session sequence s. The outputs of all nodes from 1 to n are concatenated in parallel using a gated graph neural network to obtain the local dependency information representation L = [l1, l2, ..., ln]. i ,...,l n ].

[0062] Optionally, the prediction layer linearly combines the obtained global and local dependency information and concatenates it with the inverse position information to obtain an accurate representation of the session. The specific process is as follows:

[0063] By linearly combining the global dependency information G and the local dependency information L of a session, the final representation H of the session is obtained:

[0064] G = [g1, g2, ..., g i ,...,g n ],

[0065] L = [l1, l2, ..., l i ,...,l n ],

[0066] H=ωG+(1-ω)L Formula (18),

[0067] Among them, ω, as a weighting factor, controls the ratio of global dependency information to local dependency information in the session representation;

[0068] Define a learnable positional embedding matrix P = [p1, p2, ..., p i ,...,p n ], where p i ∈R d Represents node v i The position vector, where n represents the length of the session sequence s, is used to integrate the session information and the reverse position information by concatenating the concatenation results and performing a nonlinear transformation to obtain the node information representation containing position information:

[0069] θ i =tanh(W3[h i ||p n-i+1 ]+b3) formula (19),

[0070] Where W3∈R d×2d and b3∈R d These are the training parameters, where d represents the embedding dimension of the item, and tanh is the activation function; h i Represents node v i The final session representation is that i takes values ​​between 1 and n (inclusive of endpoints 1 and n);

[0071] Calculate the average of all item embeddings in the session to represent the overall information of the session:

[0072]

[0073] Where n represents the length of the session sequence s, h i Represents node v i The final session representation is that i takes values ​​between 1 and n (inclusive of endpoints 1 and n);

[0074] The weights of the corresponding nodes are learned through a soft attention mechanism:

[0075] μ i =q T σ(W4θ i +W5h s +b4) Formula (21),

[0076] Where W4, W5 ∈ R d×d and q,b4∈R d For training parameters, d represents the embedding dimension of the item; h s Represents overall information about the session, θ i It is a node v that contains location information. iInformation representation, σ(·) represents the sigmoid activation function, q T This indicates that the training parameter matrix q is transposed. Formula (21) means that the score of each node is calculated using a soft attention mechanism, where h s Represents the query vector, θ i The key vector is represented, and the query vector h is calculated using a scaling dot product attention mechanism. s and key vector θ i The similarity between them;

[0077] The session representation S is obtained by linearly combining the nodes and their corresponding weights.

[0078]

[0079] Where n represents the length of the session sequence s, μ i Represents node v i The weight, h i Represents node v i The final session representation, i takes values ​​between 1 and n (inclusive of endpoints 1 and n), is expressed by formula (23): Calculate the node v in the session sequence s i h i and weight μ i The product of these terms, summed together, yields the session representation S;

[0080] Each candidate calculates its final recommendation probability based on its initial embedding and the current session representation S.

[0081]

[0082] Where, x i ∈R d Let be the embedding representation of the candidate item, d represent the embedding dimension of the item, softmax represent the activation function, and S represent the embedding dimension of the candidate item. T The session represents the transpose of matrix S, where S is the transpose of matrix S. T x i Represents node v i The recommended score, expressed by formula (23), is obtained by using softmax to optimize S. T x i Compress the values ​​to between 0 and 1, perform normalization, and thus obtain the probability that the current candidate item will be clicked by the user in the next click.

[0083] The conversation recommendation system of the present invention, which integrates item conversion relationships and temporal information, has the following advantages compared with the prior art:

[0084] 1. This invention captures more accurate user interests by acquiring and linearly combining global and local dependency information of a session, thereby accurately modeling the representation of the session sequence to generate user interest preferences for items;

[0085] 2. This invention utilizes a graph network structure to obtain the shortest path sequence between any two nodes in a session sequence. This sequence is then encoded into a transformation relationship between corresponding items using a bidirectional GRU. A self-attention mechanism is then combined to capture the global dependency information of the session from a graph perspective. The temporal information of the session is used as the edge weights of the session graph, and a gated graph neural network is combined to obtain the local dependency information of the session. The global dependency information and the local dependency information are linearly combined, and the reverse position information is combined to accurately model the representation of the session sequence for making recommendations to users. Attached Figure Description

[0086] Appendix Figure 1 This is a system implementation framework diagram of Embodiment 1 of the present invention;

[0087] Appendix Figure 2 This is the item conversion relationship coding process of Embodiment 1 of the present invention;

[0088] Appendix Figure 3 yes Figure 2 A schematic diagram representing the shortest path sequence between any two nodes in the diagram;

[0089] Appendix Figure 4 This is a session graph constructed according to Embodiment 1 of the present invention;

[0090] Appendix Figure 5 This is a schematic diagram of the adjacency matrix of the session graph described in Embodiment 1 of the present invention. Detailed Implementation

[0091] To make the technical solution, the technical problem solved, and the technical effect of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments.

[0092] Example 1:

[0093] Combined with appendix Figure 1 This embodiment proposes a conversation recommendation system that integrates item transition relationships and temporal information. Its structure includes an item embedding layer, an item transition relationship encoding layer, a self-attention layer based on item transition relationships, a graph neural network layer based on conversation temporal information, and a prediction layer.

[0094] (a) The item embedding layer is used to map each node in the session sequence to a vector representation with fixed dimensions.

[0095] Given a session sequence s = {v1, v2, ..., v i ,...,v nTaking a conversation sequence s with a length n=5 as an example, the specific conversation sequence s={v1,v2,v2,v3,v3,v2,v4,v5} is input into the item embedding layer to obtain the vector representation of the conversation sequence s:

[0096] X = [x1,x2,x2,x3,x3,x2,x4,x5] Formula (1),

[0097] Where, x i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where i takes values ​​of 1, 2, 3, 4, and 5.

[0098] (II) The item transformation relationship encoding layer uses the edge information in the graph network structure to obtain the shortest path sequence between any two items in the session sequence, and then encodes it into the transformation relationship between the corresponding items through a bidirectional GRU network. The specific process is as follows:

[0099] (2.1) Model the given conversation sequence s = {v1, v2, v2, v3, v3, v2, v4, v5} as a directed graph G = {V s ,ε s},in, ε represents the set of nodes that represent unique items in a session sequence. s It represents a set of edges, which can be of four types: unidirectional edges, bidirectional edges, self-loop edges, and undirected edges.

[0100] Reference Appendix Figure 2 , 3 Assume (v) i ,v j Let ) be adjacent items in session s, and let i and j take values ​​of 1, 2, 3, 4, and 5 respectively. Then, add four different types of directed edges between them, specifically: ① from v i to v j Marked as 1, ② from v j to v i Marked as 2, ③ (v) appeared in the session sequence s. j ,v i ), then v i and v j The edge between nodes is labeled 3. ④ Add a self-loop edge to each node in the session sequence s, labeled 4.

[0101] Then, for any two nodes v i and v j The shortest path sequence between them is represented as: R i→j =[e(i,k1),e(k1,k2),...,e(k L[,j)], where e(·,·) represents the category label of the edge between the two nodes, k m Represents node v i and v j The set of intermediate nodes between them, where m is between 1 and L, is detailed in the appendix. Figure 3 ,

[0102] At this point, a learnable embedding is assigned to each type of edge, thus obtaining the shortest path sequence R. i→j The vector representation involves the following formulas:

[0103] R = [r0, r1, ..., r i ,...,r L ] Formula (2),

[0104] in, Let d represent the embedding information of the m-th edge. r Let L be the embedding dimension of the shortest path sequence, representing node v. i and v j The number of intermediate node sets between them;

[0105] (2.2) The shortest path sequence between any two items in the session sequence s is encoded into a fixed-length vector using a bidirectional GRU network, and the relevant formula is as follows:

[0106]

[0107] in, and These represent the forward encoded hidden layer information and the backward encoded hidden layer information of the (l+1)th edge, respectively. (GRU) f and GRU b These represent the forward GRU encoding and the reverse GRU encoding of the (l+1)th edge, respectively;

[0108] By concatenating the hidden layer information of the last layer of the forward GRU network and the reverse GRU network, node v i and v j Transformation relation β ij Represented as:

[0109]

[0110] in, This represents the forward GRU encoding of the (L+1)th edge. This represents the reverse GRU encoding of the first edge.

[0111] (III) Self-Attention Layer Based on Item Transformation Relationships: Based on the transformation relationships between items, the layer captures global dependency information of the session from a graph perspective using a self-attention mechanism. The specific process is as follows:

[0112] (3.1) Move node v i and v j Transformation relation β ij Divided into two relations r i→j and r j→i r i→j Indicates from v i to v j The relationship, r j→i Indicates from v j to v i The relationship is shown in formula (6):

[0113] [r i→j ;r j→i ] = W r β ij Formula (6),

[0114] in, For training parameters, d represents the embedding dimension of the item. r The embedding dimension represents the shortest path sequence;

[0115] (3.2) Using formulas (7)-(11), the embedding sequence of the items and the corresponding transformation relationship are added together as the input of the self-attention layer, thereby obtaining the output of the self-attention layer:

[0116] K i =W i K (x j +r j→i ) formula (7),

[0117] Q i =W i Q (x i +r i→j ) formula (8),

[0118]

[0119] F = [f1, f2, ..., f i ,...,f n ] Formula (11),

[0120] Among them, W i Q W i K W i V ∈R d×d For training parameters, x i ∈R d It is node v in the session sequence si The d-dimensional embedding representation, where i takes values ​​of 1, 2, 3, 4, and 5, and d represents the embedding dimension of the item; K i and Q i Nodes v representing the self-attention layer i The query vector and index vector, K i and Q i They respectively merged from v j to v i Relationship and from v i to v j relation; Represents the compute node v i and v j The attention scores are normalized by using the softmax function to compress all attention scores to a range of 0 to 1, thus obtaining the final score λ. ij The normalized score λ ij Input information x j The weight of node v is obtained. j For node v i Attention value; the length of the session sequence s is n=5, and all nodes from 1 to n are paired with v. i The attention values ​​are added together to obtain the node v. i The output of f represents i The output representations of all nodes from 1 to n are concatenated in parallel to obtain the output F = [f1, f2, f3, f4, f5] of the self-attention layer;

[0121] (3.3) After the self-attention layer, a feedforward neural network layer with ReLU as the activation function and a residual network are applied to obtain a global dependency information representation that integrates the item transformation relationship, as shown in Equation (12):

[0122] G = ReLU(FW1+b1)W2+b2+F (Formula 12)

[0123] Where W1, W2 ∈ R d×d For the training parameters, b1, b2 ∈ R d Here, d represents the embedding dimension of the item, the length of the conversation sequence s is n = 5, F represents the output of the self-attention layer, G = [g1, g2, g3, g4, g5] is the global dependency information representation of the conversation, and i takes values ​​of 1, 2, 3, 4, 5. In formula (12), F = f i That is, we get g i g i Represents node v i The global dependency information is represented.

[0124] (iv) A graph neural network layer based on session temporal information is used to construct a session graph using the temporal information in the session sequence, and then obtain the local dependency information of the session through a gated graph neural network.

[0125] (4.1) Construct a conversation graph, combined with the appendix Figure 4 The specific process is as follows:

[0126] Given a conversation sequence s = {v1, v2, v2, v3, v3, v2, v4, v5}, select items v from the conversation sequence s. i (i takes values ​​of 1, 2, 3, 4, 5) are considered nodes on the session graph, and will be moved from v i-1 to v i Each click is considered a directed edge between two nodes in the session graph, thus completing the construction of the session graph;

[0127] Based on the constructed session graph, starting from 1, natural numbers are used to assign values ​​to the corresponding edges according to the order in which items appear in the session sequence s, in order to represent the weight of the edges in the session graph. At this point, a session graph structure containing temporal information can be obtained.

[0128] The tanh activation function is used to normalize the weights of the edges in the session graph, mapping the weights appropriately to the range of 0 to 1. The specific operation is as follows:

[0129] Let A I A O ∈R n×n These represent the input matrix and output matrix in the conversation graph, respectively. The length of the conversation sequence s is n = 8. Each row in the matrix represents the in-degree and out-degree relationship between the current node and the remaining nodes in the conversation graph, and its value is equal to the weight of the corresponding edge.

[0130] If a node in the session graph has at least one in-degree or one out-degree, then the average value is taken as the weight of the corresponding edge. In this case, when the session sequence is s = {v1, v2, v2, v3, v3, v2, v4, v5}, its corresponding adjacency matrix is ​​as follows: Figure 5 As shown.

[0131] (4.2) The local dependency information of the session is obtained by the following formula, as follows:

[0132]

[0133] z i =σ(W z a i +U z x i ) formula (14),

[0134] r i =σ(W r ai +U r x i ) formula (15),

[0135]

[0136] in, It is the i-th row in the corresponding input and output matrices; W I W O ∈R d×d These are the learning parameters for the input and output edges, respectively, and b I ,b O ∈R d It is the deviation vector; X = [x1,x2,x2,x3,x3,x2,x4,x5] is the list of node vectors in the session sequence s, x i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where i takes values ​​of 1, 2, 3, 4, and 5, d represents the embedding dimension of the item, and the length of the conversation sequence s is n = 5; W z U z W r U r and W o U o These represent the learning parameters for the reset gate, update gate, and output gate, respectively; σ(·) represents the sigmoid activation function, ⊙ represents the element-wise multiplication operation, and tanh is the activation function;

[0137] The a obtained by formula (13) i Represents node v i The result of interactions between node v and its neighboring nodes via edges is used to reflect the relationship between node v and its neighboring nodes. i The degree to which neighboring nodes influence it;

[0138] z calculated by formula (14) i Represents node v i The reset door;

[0139] The r calculated by formula (15) i Represents node v i The update gate;

[0140] The result calculated by formula (16) Represents node v i Candidate states;

[0141] The result of formula (17) is l i For node v iThe local latent vector representation; the function of formula (17) is: for each session graph, the gated graph neural network is used to propagate information between adjacent graph nodes. The functions of the reset gate and the update gate determine which node information to discard and retain, respectively, and thus obtain l i For node v i Local implicit vector representation;

[0142] The length of the conversation sequence s is n=8. The outputs of all nodes from 1 to n are concatenated in parallel through a gated graph neural network to obtain the local dependency information representation L=[l1,l2,l3,l4,l5] of the conversation sequence s.

[0143] (v) The prediction layer is used to linearly combine the obtained global and local dependency information, concatenate the inverse position information to obtain an accurate representation of the session, and finally calculate the scores of all candidate items to generate a user recommendation list. The specific process is as follows:

[0144] (5.1) By linearly combining the global dependency information G and the local dependency information L of the session, the final representation H of the session is obtained:

[0145] G = [g1, g2, g3, g4, g5],

[0146] L = [l1, l2, l3, l4, l5]

[0147] H=ωG+(1-ω)L Formula (18),

[0148] Among them, ω, as a weighting factor, controls the ratio of global dependency information to local dependency information in the session representation;

[0149] (5.2) Define a learnable position embedding matrix P = [p1, p2, p3, p4, p5], where p i ∈R d Represents node v i The position vector, i taking values ​​1, 2, 3, 4, 5, and the length of the conversation sequence s, n = 5, is used to integrate the conversation information and reverse position information by concatenating them and performing a nonlinear transformation on the concatenation result, thus obtaining a node information representation containing position information:

[0150] θ i =tanh(W3[h i p n-i+1 ]+b3) formula (19),

[0151] Where W3∈R d×2d and b3∈R d These are the training parameters, where d represents the embedding dimension of the item, and tanh is the activation function; h i Represents node v iThe final session representation of i is 1, 2, 3, 4, or 5;

[0152] (5.3) Calculate the average of all item embeddings in the session to represent the overall information of the session:

[0153]

[0154] Where the length of the conversation sequence s is n = 5, h i Represents node v i The final session representation of i is 1, 2, 3, 4, or 5;

[0155] (5.4) Learn the weights of the corresponding nodes through a soft attention mechanism:

[0156] μ i =q T σ(W4θ i +W5h s +b4) Formula (21),

[0157] Where W4, W5∈R d×d and q,b4∈R d For training parameters, d represents the embedding dimension of the item, the length of the conversation sequence s is n=5, and i takes values ​​of 1, 2, 3, 4, 5; h s Represents overall information about the session, θ i It is a node v that contains location information. i Information representation, σ(·) represents the sigmoid activation function, q T This indicates that the training parameter matrix q is transposed. Formula (21) means that the score of each node is calculated using a soft attention mechanism, where h s Represents the query vector, θ i The key vector is represented, and the query vector h is calculated using a scaling dot product attention mechanism. s and key vector θ i The similarity between them;

[0158] (5.5) Obtain the session representation S by linearly combining nodes and their corresponding weights:

[0159]

[0160] Where the length of the session sequence s is n = 5, μ i Represents node v i The weights, i taking values ​​of 1, 2, 3, 4, 5, h i Represents node v i The final session representation, as expressed by formula (23), is: calculating node v in the session sequence s. i h i and weight μi The product of these terms, summed together, yields the session representation S;

[0161] (5.6) The final recommendation probability is calculated for each candidate based on its initial embedding and the current session representation S.

[0162]

[0163] Where, x i ∈R d Let be the embedding representation of the candidate item, d represent the embedding dimension of the item, the length of the session sequence s is n = 5, i takes values ​​1, 2, 3, 4, 5, softmax represents the activation function, and S T The transpose of the session representation matrix S is expressed by formula (23): S is transposed by softmax. T x i Compress the values ​​to between 0 and 1, perform normalization, and thus obtain the probability that the current candidate item will be clicked by the user in the next click. S T x i Represents node v i Recommended score.

[0164] In summary, the conversation recommendation system of the present invention, which integrates item conversion relationships and temporal information, captures more accurate user interests by acquiring global and local dependency information of the conversation and linearly combining the acquired information, thereby accurately modeling the representation of the conversation sequence to make recommendations to users.

[0165] The above specific examples illustrate the principles and implementation methods of the present invention in detail. These embodiments are merely for the purpose of helping to understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made to the present invention by those skilled in the art without departing from the principles of the present invention should fall within the patent protection scope of the present invention.

Claims

1. A conversation recommendation system that integrates item conversion relationships and temporal information, characterized in that, Its structure includes: An item embedding layer is used to map each node in the session sequence to a fixed-dimensional vector representation; the session sequence s = {v1, v2, ..., v...} i , ..., v n }, the vector representation is X = [x1, x2, ..., x]. i , ..., x n Formula (1), where x i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where n represents the length of the session sequence s; The item transformation relationship encoding layer is used to obtain the shortest path sequence between any two items in the session sequence by using the edge information in the graph network structure, and then encodes it into the transformation relationship between the corresponding items through a bidirectional GRU network. The self-attention layer based on item transformation relationships is used to capture global dependency information of the session from the perspective of graphs by combining self-attention mechanisms, according to the transformation relationships between items. A graph neural network layer based on session temporal information is used to construct a session graph using temporal information in the session sequence, and then obtain the local dependency information of the session through a gated graph neural network. The prediction layer is used to linearly combine the obtained global and local dependency information and concatenate the inverse position information to obtain an accurate representation of the session. Finally, the scores of all candidate items are calculated to generate a user recommendation list. The self-attention layer, based on the transformation relationships between items, captures global dependency information of the session from a graph perspective using a self-attention mechanism. The specific process is as follows: First, assume (v i v j ) is the neighboring item in session s, which will connect node v i and v j Transformation relation β ij Divided into two relationships and , Indicates from v i to v j Relationship, Indicates from v j to v i The relationship is shown in formula (6): Official (6), In the formula, For training parameters, d represents the embedding dimension of the item. r The embedding dimension represents the shortest path sequence; Subsequently, using formulas (7)-(11), the embedding sequence of the items and the corresponding transformation relationship are added together as the input to the self-attention layer, thereby obtaining the output of the self-attention layer: Official (7), Official (8), Official (9), Official (10), F = [f1, f2, ..., f i , ..., f n ] Formula (11), In the formula, For training parameters, x i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where d represents the embedding dimension of the item; K i and Q i These represent nodes v in the self-attention layer. j The query vector and index vector, K i and Q i They respectively merged from v j to v i Relationship and from v i to v j relation; Represents the compute node v i and v j The attention scores are normalized by using the softmax function to compress all attention scores to a range of 0 to 1, thus obtaining the final score λ. ij The normalized score λ ij Input information x j The weight of node v is obtained. j For node v i The attention value will be calculated from all nodes from 1 to n for v. i The attention values ​​are added together to obtain the node v. i The output of f represents i ; n represents the length of the session sequence s. The output representations of all nodes from 1 to n are concatenated in parallel to obtain the output F=[f1, f2, ..., fn] of the self-attention layer. i , ..., f n ]; Finally, a feedforward neural network layer with ReLU as the activation function and a residual network are applied after the self-attention layer to obtain a global dependency information representation that integrates the item transformation relationship, as shown in Equation (12): G=ReLU(FW1+b1)W2+b2+F Formula (12). Where W1, W2∈R d*d For the training parameters, b1, b2 ∈ R d Here, d represents the item embedding dimension, the length of the conversation sequence s is n=5, F represents the output of the self-attention layer, and G=[g1, g2, ..., g...]. i , ..., g n ] represents the global dependency information of the session, where i takes values ​​between 1 and n, and F = f in formula (12). i That is, we get g i g i Represents node v i The global dependency information is represented.

2. The conversation recommendation system that integrates item conversion relationships and temporal information according to claim 1, characterized in that, The item transformation relationship encoding layer uses the edge information in the graph network structure to obtain the shortest path sequence between any two items in the session sequence. The specific process is as follows: Given a session sequence s={v1, v2, ..., v... i , ..., v n Model it as a directed graph G={V} s , ε s },in, ε represents the set of nodes that represent unique items in a session sequence. s It represents a set of edges, which can be of four types: unidirectional edges, bidirectional edges, self-loop edges, and undirected edges. Assume (v) i v j If ) are adjacent items in session s, then four different types of directed edges are added between them, specifically: ① from v i to v j Marked as 1, ② from v j to v i Marked as 2, ③ (v) appeared in the session sequence s. j v i ,), then v i and v j The edge between nodes is labeled 3. ④ Add a self-loop edge to each node in the session sequence s, labeled 4. Then, for any two nodes v i and v j The shortest path sequence between them is represented as: Where e(·,·) represents the category label of the edge between the two nodes, and k m Represents node v i and v j The set of intermediate nodes between, m is between 1 and L. At this point, a learnable embedding is assigned to each type of edge, thus obtaining the shortest path sequence. The vector representation involves the following formula: R = [r0, r1, ..., r i , ..., r L ]Formula (2), Where, r i ∈R d d represents the embedding information of the (i+1)th edge. r Let L be the embedding dimension of the shortest path sequence, representing node v. i and v j The number of intermediate node sets between them.

3. The conversation recommendation system that integrates item conversion relationships and temporal information according to claim 2, characterized in that, The item transformation relationship encoding layer encodes the shortest path sequence between any two items in the session sequence into the transformation relationship between the corresponding items through a bidirectional GRU network. The specific process is as follows: First, a bidirectional GRU network is used to encode the shortest path sequence between any two items in the session sequence s into a fixed-length vector, involving the following formula: Official (3), Official (3), in, and These represent the forward encoded hidden layer information and the backward encoded hidden layer information of the (l+1)th edge, respectively. (GRU) f and GRU b These represent the forward GRU encoding and the reverse GRU encoding of the (l+1)th edge, respectively; Subsequently, the hidden layer information of the last layer of the forward GRU network and the reverse GRU network are concatenated, then node v i and v j Transformation relation β ij Represented as: Official (5), in, This represents the forward GRU encoding of the (L+1)th edge. This represents the reverse GRU encoding of the first edge.

4. A conversation recommendation system that integrates item conversion relationships and temporal information according to claim 3, characterized in that, The graph neural network layer utilizes temporal information from the session sequence to construct the session graph, and the specific process is as follows: For a given session sequence s={v1, v2, ..., v i , ..., v n }, will store items v in the session sequence s. i Treated as a node on the session graph, it will start from v i-1 to v i Each click is considered a directed edge between two nodes in the session graph, thus completing the construction of the session graph; Based on the constructed session graph, starting from 1, natural numbers are used to assign values ​​to the corresponding edges according to the order in which items appear in the session sequence s, in order to represent the weight of the edges in the session graph. At this point, a session graph structure containing temporal information can be obtained. The tanh activation function is used to normalize the weights of the edges in the session graph, mapping the weights appropriately between 0 and 1.

5. A conversation recommendation system that integrates item conversion relationships and temporal information according to claim 4, characterized in that, The tanh activation function is used to normalize the weights of the edges in the session graph, mapping the weights appropriately to the range of 0 to 1. The specific operation is as follows: Let A I A O ∈R n*n These represent the input matrix and output matrix in the session graph, respectively. n represents the length of the session sequence s. Each row in the matrix represents the in-degree and out-degree relationship between the current node and the remaining nodes in the session graph, and its value is equal to the weight of the corresponding edge. If a node in the session graph has at least one in-degree or one out-degree, then the average value is taken as the weight of the corresponding edge.

6. A conversation recommendation system that integrates item conversion relationships and temporal information according to claim 4, characterized in that, After constructing a session graph using temporal information from the session sequence, the graph neural network layer then obtains local dependency information of the session through a gated graph neural network. The specific process is as follows: Official (13), Official (14), Official (15), Official (16), Official (17), In the formula, A I A O ∈R n*n It is the i-th row in the corresponding input and output matrices; W I W O ∈R d*d These are the learning parameters for the input and output edges, respectively, and b I b O ∈R d It is the deviation vector; X = [x1, x2, ..., x...] i , ..., x n [x] is a list of node vectors in the session sequence s. i ∈R d It is node v in the session sequence s i The d-dimensional embedding representation, where d represents the embedding dimension of the item, and n represents the length of the session sequence s; W z U z W r U r and W o U o These represent the learning parameters for the reset gate, update gate, and output gate, respectively; σ(·) represents the sigmoid activation function, ⊙ represents the element-wise multiplication operation, and tanh is the activation function; The a obtained by formula (13) i Represents node v i The result of interactions between node v and its neighboring nodes via edges is used to reflect the relationship between node v and its neighboring nodes. i The degree to which neighboring nodes influence it; z calculated by formula (14) i Represents node v i The reset door; The r calculated by formula (15) i Represents node v i The update gate; The result calculated by formula (16) Represents node v i Candidate states; The result of formula (17) is l i For node v i The local latent vector representation; the function of formula (17) is: for each session graph, information is propagated between adjacent graph nodes using a gated graph neural network, and the functions of the reset gate and update gate determine which node information to discard and retain respectively, thereby obtaining l i For node v i Local implicit vector representation; n represents the length of the session sequence s. The outputs of all nodes from 1 to n are concatenated in parallel using a gated graph neural network to obtain the local dependency information representation L=[l1, l2, ..., ln]. i , ..., l n ].

7. A conversation recommendation system integrating item conversion relationships and temporal information according to claim 6, characterized in that, The prediction layer linearly combines the obtained global and local dependency information and concatenates it with the inverse position information to obtain an accurate representation of the session. The specific process is as follows: By linearly combining the global dependency information G and the local dependency information L of a session, the final representation H of the session is obtained: G=[g1,g2,…,g i ,…,g n ], L=[l1,l2,…,l i ,…,l n ], H=ωG+(1-ω)L Formula (18) Among them, ω, as a weighting factor, controls the ratio of global dependency information to local dependency information in the session representation; Define a learnable position embedding matrix P = [p1, p2, ..., p i , ..., p n ], where p i ∈R d Represents node v i The position vector, where n represents the length of the session sequence s, is used to integrate the session information and the reverse position information by concatenating the concatenation results and performing a nonlinear transformation to obtain the node information representation containing position information: Official (19), Where W1∈R d*2d and b3∈R d These are the training parameters, where d represents the embedding dimension of the item, and tanh is the activation function; h i Represents node v i The final session representation indicates that i takes a value between 1 and n; Calculate the average of all item embeddings in the session to represent the overall information of the session: Official (20), Where n represents the length of the session sequence s, h i Represents node v i The final session representation indicates that i takes a value between 1 and n; The weights of the corresponding nodes are learned through a soft attention mechanism: Official (21), In the formula, W4 and W5 ∈ R d*d and q, b4∈R d* For training parameters, d represents the embedding dimension of the item; h s Represents overall information about the session, θ i It is a node v that contains location information. i Information representation, σ(·) represents the sigmoid activation function, q T This indicates that the training parameter matrix q is transposed. Formula (21) means that the score of each node is calculated using a soft attention mechanism, where h s Represents the query vector, θ i The key vector is represented, and the query vector h is calculated using a scaling dot product attention mechanism. s and key vector θ i The similarity between them; The session representation S is obtained by linearly combining the nodes and their corresponding weights. Official (22), In the formula, n represents the length of the session sequence s, and μ i Represents node v i The weight, h i Represents node v i The final session representation, as expressed by formula (23), is: calculating node v in the session sequence s. i h i and weight μ i The product of these terms, summed together, yields the session representation S; Each candidate calculates its final recommendation probability based on its initial embedding and the current session representation S. : Official (23), Where, x i ∈R d Let be the embedding representation of the candidate item, d represent the embedding dimension of the item, softmax represent the activation function, and S represent the embedding dimension of the candidate item. T The session represents the transpose of matrix S, S T x i Represents node v i The recommended score, expressed by formula (23), is obtained by using softmax to optimize S. T x i Compress the values ​​to between 0 and 1, perform normalization, and thus obtain the probability that the current candidate item will be clicked by the user in the next click. .