Sequence recommendation method for user multi-operation behavior
By combining gated graph neural networks and Transformer models to learn the embeddings of user travel products and operation sequences, long-term and recent interests are captured, solving the problem of neglecting user operation behavior in existing methods and achieving more accurate travel product recommendations.
Patent Information
- Application Number
- CN202310920265.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-07-25
AI Technical Summary
Existing sequential recommendation methods neglect the diversity of user behavior when recommending travel products, resulting in inaccurate recommendations that fail to meet the needs of users with dynamically changing interests.
The algorithm employs a gated graph neural network and a Transformer model to learn the embeddings of tourism product sequences and operation sequences, respectively. By combining these with the user's historical browsing sequence, it captures long-term and recent interests. The two types of interests are then fused through a gating fusion module to generate a user interest representation, and finally, the algorithm recommends the next possible tourism product.
By considering multiple user actions, the accuracy and dynamism of the recommendation system are improved, enabling a better understanding of user needs and preferences and providing recommendations that are more tailored to individual interests.
Smart Images

Figure CN117112891B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of recommendation methods, and particularly relates to a sequence recommendation method for user multiple operation behaviors. BACKGROUND
[0002] The continuous development of Internet technology has led to the rise of the online tourism industry, and people can view tourism information, select tourism products and plan trips in advance through various online tourism platforms. However, with the continuous expansion of the online tourism industry, the explosive growth of various tourism information has limited users to browsing and screening a large amount of tourism information, making it difficult for users to quickly, accurately and efficiently find information of their interest, thereby greatly reducing the user's satisfaction with the online tourism platform. At the same time, in real-life scenarios, users do not know their true intentions, and their tourism needs are usually vague. At this time, users face a large amount of tourism information and feel confused and tired, which gradually weakens the stickiness between users and the online tourism platform. In view of the problems of information overload and unclear user needs, a recommendation system is considered an effective method to solve the problem, which can actively recommend tourism information that may meet the user's purpose and interest in the case of vague user needs.
[0003] Traditional recommendation systems mainly model user-tourism product interactions to obtain the long-term static preferences of users. However, for a series of user interactions with tourism products, it is not an independent set of tourism products, and the user interactions with tourism products are often sequentially related. At the same time, the user's preferences will change over time. Therefore, a sequence recommendation system emerges as the times require, which explores the sequential relationship between tourism products by regarding the user and tourism product interactions as dynamic sequences, captures the user's dynamic interest and recommends tourism products of interest to the user.
[0004] In order to achieve accurate recommendation, various sequence recommendation methods have been proposed. The method based on Markov chain uses a Markov chain model to simulate the transition from the previous item to the next item in the user-item interaction sequence, thereby predicting the next interaction. Recently, deep learning-based methods have been applied to sequence recommendation, and their recommendation performance is superior to traditional methods. Although existing sequence recommendation methods have been proven to be more accurate, there are still the following problems: ignoring the user's operation on the tourism products in the sequence. If only the sequence of tourism products is considered, all tourism products in the sequence are equally important, but in fact the user's specific operation on the tourism products also reflects the user's different interests. SUMMARY
[0005] The purpose of the present application is to provide a sequence recommendation method for user multiple operation behaviors, which can better understand the user's needs and preferences and provide the user with a recommendation result that better fits their personal interests.
[0006] The technical scheme adopted by the present application is a sequence recommendation method for user multiple operation behaviors, comprising the following steps:
[0007] Step 1, learning a tourism product sequence and an operation sequence embedding through a sequence learning model to obtain a user historical browsing sequence embedding in series;
[0008] Step 2, capturing user interest from the perspectives of long-term interest and recent interest based on the user historical browsing sequence embedding, and fusing the two interests to obtain a user interest representation;
[0009] Step 3, predicting a tourism product that the user will interact with next according to the user interest representation and a candidate tourism product.
[0010] The present application is also characterized in that,
[0011] Step 1 specifically comprises the following steps:
[0012] Step 1.1, learning a sequence representation according to the characteristics of a tourism product sequence using a gated graph neural network to obtain a tourism product sequence embedding X;
[0013] Step 1.2, learning a sequence representation according to the characteristics of an operation sequence using a Transformer model to obtain an operation sequence embedding O;
[0014] Step 1.3, concatenating the two sequence embeddings X and O learned in steps 1.1 and 1.2 to obtain a user historical browsing sequence embedding P.
[0015] Step 1.1 specifically comprises:
[0016] First, define a tourism product sequence as wherein represents the kth tourism product browsed by the user in the tourism product sequence, i k is the type number of the tourism product, and K represents the length of the tourism product sequence;
[0017] Then model the tourism product sequence as a directed graph G=(V X ,E O ), wherein each node in the directed graph G represents a tourism product in the tourism product sequence, and each edge represents that the user has operated on the tourism product after operating on the tourism product Each edge is assigned a normalized weight, and the calculation of the weight is the number of occurrences of each edge divided by the out-degree of the starting node of the edge; the update function of the embedding vector v k of each node in the directed graph G is:
[0018]
[0019] Adjacency matrix defined as the outgoing adjacency matrix and the incoming adjacency matrix Each entry in the adjacency matrix A is the weight of the corresponding edge in the directed graph G, representing the degree of communication between nodes in the directed graph G; are two columns in the adjacency matrix A corresponding to node k, is the weight matrix, b is the bias term, is the embedding vector of all nodes at time t-1 (1≤t≤T), represents the result of the interaction between the node and the adjacent node through the edge; and represent the update gate and the reset gate, σ is the sigmoid function, and all W are d-dimensional matrices; is the newly generated information, decides which past information to generate new information from; represents the selection of which past information to forget, represents the memory of which newly generated information;
[0020] After updating, the embedding of all tourism products in the directed graph G is obtained
[0021] Step 1.2 is specifically:
[0022] First, define the operation sequence as where represents the operation of the user on the kth tourism product in the operation sequence, i k is the type number of the operation, and K represents the length of the operation sequence;
[0023] For the user operation sequence set the input embedding of the operation sequence as Add position encoding to the input embedding of the operation sequence The position encoding borrows the method in the Transformer model, using sine and cosine functions of different frequencies; The input embedding of the operation sequence is represented as:
[0024]
[0025] The operation sequence is modeled using an encoder module in the Transformer, which is composed of multiple layers of encoders, each of which includes two sub-layers of a self-attention layer and a feed-forward network layer; wherein the self-attention layer adopts a multi-head self-attention mechanism, and the attention scores of each head are calculated in parallel, and then the output values of each head are spliced and linearly converted:
[0026] S=MultHead(Q,K,V)=Concat(head1,…,head h )W O (3)
[0027] Wherein h is the number of heads, and the attention mechanisms of the h heads are independent of each other;
[0028] The attention score calculation uses a scaled dot product:
[0029]
[0030] After normalization, the weight coefficient w K of K is obtained:
[0031]
[0032] After adding the weight coefficient w K , V is weighted to obtain the Attention vector:
[0033]
[0034] Therefore, the Attention of each head is defined as:
[0035] Attention(Q,K,V)=Attention(EW Q ,EW K ,EW V ) (7)
[0036] The feed-forward network layer is composed of two fully connected layers:
[0037] F=FFN(S)=ReLU(SW1+b1)W2+b2 (8)
[0038] Wherein W1, W2, b1, b2 are learnable parameters;
[0039] Residual network and normalization modules are added at the end of the two sub-layers, i.e. the final output of each layer is SubLayer_output=LayerNorm(x+SubLayer(x)), wherein SubLayer(x) is the processing function of the sub-layer itself, and x is the input of the sub-layer:
[0040] S = LayerNorm(E + MultHead(E))
[0041] F = LayerNorm(S + FFN(S)) (9)
[0042] The b-th layer encoder in the multi-layer encoder is defined as:
[0043] S b = MultHead(F (b-1) )
[0044]
[0045] The operation sequence embedding learned by the Transformer layer is represented as
[0046] Step 2 specifically comprises the following steps:
[0047] Step 2.1, input the historical browsing sequence embedding obtained in step 1 into the attention mechanism to obtain the long-term interest and the recent interest
[0048] Step 2.2, control the contribution degree of the two interests to the user interest through a gating fusion module to obtain the user interest representation s u .
[0049] Step 2.1 specifically: input the user historical browsing sequence embedding P = [p1, p2, …, p K ] as input to obtain the long-term interest of user u
[0050] The attention score between objects in the historical browsing sequence is calculated as follows:
[0051] Score(p k ) = φ(W l ·p k +b l ) (11)
[0052] W l and b l are model parameters, and φ is a ReLU activation function; after normalization, the weight coefficients between objects are:
[0053]
[0054] Aggregate each object in the historical browsing sequence embedding with its corresponding weight coefficient to obtain the long-term interest of user u
[0055]
[0056] Select the user's recent seven-day history browsing sequence embedding p r = [p m ,…,p K ]∈p, 1≤m≤K as input, and use attention mechanism to capture the user's recent interest
[0057] Score(p k )=φ(W r ·p k +b r )
[0058]
[0059]
[0060] Step 2.2 specifically uses a gating unit G u to control the contribution of the user's long-term interest and recent interest to the user's interest, and the specific formula is as follows:
[0061]
[0062]
[0063] Where e u represents the embedding representation of the user, and represent the long-term interest and recent interest of the user respectively, W is the weight matrix, b is the bias term, ⊙ represents the dot product operation of elements, and s u is the interest vector representation of the user u.
[0064] Step 3 specifically includes the following steps:
[0065] Step 3.1, match the user interest representation w u and the candidate tourism product e j obtained in step 2, and calculate the matching score T sj :
[0066]
[0067] Step 3.2, select the tourism product with the highest score as the next most likely to interact with the user, and recommend it to the user.
[0068] The beneficial effects of the present application are: the sequence recommendation method for multiple operation behaviors of users in the present application considers the user travel product sequence and adds user operation, compared with the traditional recommendation system, more attention is paid to the diversity of user interaction behavior, and the user intention is captured in more detail, thereby improving the performance of the recommendation system. Compared with capturing user static interest, capturing from the angles of stable long-term interest and changing recent interest, more attention is paid to the dynamics of user interest, thereby improving the accuracy of capturing user interest to a certain extent. By fusing the operation behavior of the user, the demand and preference of the user can be better understood, and the recommendation result more suitable for the personal interest of the user is provided. BRIEF DESCRIPTION OF DRAWINGS
[0069] Figure 1 is a flowchart of the sequence recommendation method for multiple operation behaviors of users in the present application. DETAILED DESCRIPTION
[0070] The present application will be described in detail below in combination with the drawings and specific embodiments.
[0071] Embodiment 1
[0072] The present application provides a sequence recommendation method for multiple operation behaviors of users, as shown in Figure 1 , comprising the following steps:
[0073] Step 1, learning the travel product sequence and operation sequence embedding through a sequence learning model to obtain the user historical browsing sequence embedding in series; specifically comprising the following steps:
[0074] Step 1.1, according to the characteristics of the travel product sequence S x , a gated graph neural network is used to learn the sequence representation, and the travel product sequence embedding X is obtained;
[0075] Step 1.2, according to the characteristics of the operation sequence S o , a Transformer model is used to learn the representation of the sequence, and the operation sequence embedding O is obtained;
[0076] Step 1.3, the two sequence embeddings X and O learned in steps 1.1 and 1.2 are concatenated to obtain the user historical browsing sequence embedding P.
[0077] Step 2, capturing user interest from the angles of long-term interest and recent interest based on the user historical browsing sequence embedding, and fusing the two interests to obtain the user interest representation; specifically comprising the following steps:
[0078] Step 2.1, inputting the historical browsing sequence embedding P obtained in step 1 into an attention mechanism to obtain the user long-term interest and recent interest
[0079] Step 2.2, controlling the contribution degree of two interests to the user interest representation s by a gating fusion module u .
[0080] Step 3, predicting the tourism product of the next interaction of the user according to the user interest representation and the candidate tourism product; specifically comprising the following steps:
[0081] Step 3.1, matching the user interest representation s obtained in step 2 u and the candidate tourism product e j , and calculating the matching score Y sj :
[0082] Step 3.2, selecting the tourism product with the highest score as the tourism product that the user is most likely to interact with next, and recommending it to the user.
[0083] Embodiment 2
[0084] The principle of the sequence recommendation method for multiple operation behaviors of the user of the application is:
[0085] S1 learns sequence embedding
[0086] The user historical browsing sequence is composed of a tourism product sequence and an operation sequence. The tourism product sequence is defined as The operation sequence is defined as Wherein represents the kth tourism product browsed by the user in the tourism product sequence, represents the operation of the user on the kth tourism product in the tourism product sequence, i k is the type number of the tourism product / operation, K represents the length of the tourism product / operation sequence, and the two sequences are one-to-one corresponding by order. The application adopts a separate learning method to learn the sequence embedding, that is, the tourism product sequence and the operation sequence are learned respectively, and then the tourism product sequence embedding and the operation sequence embedding are connected as the historical browsing sequence embedding.
[0087] S1.1 Tourism product sequence embedding
[0088] In this sequence, the relationship between the tourism products is not only a single order relationship arranged in ascending order of time, but also a bidirectional relationship, the forward tourism product will affect the backward tourism product, and the backward tourism product will also affect the forward tourism product, and they are interdependent. Based on the above sequence characteristics, the application adopts GGNN to learn the tourism product sequence embedding.
[0089] The tourism product sequence is modeled as a directed graph G=(V X ,E OIn a directed graph G, each node... Represents a tourism product in a tourism product sequence, each edge This indicates that the user is operating a travel product. After that, I operated the tourism products. Each edge is assigned a normalized weight, calculated by dividing the number of times each edge appears by the out-degree of the node from which the edge originates. The embedding vector v of each node in the directed graph G is... k Update function:
[0090]
[0091] Adjacency matrix Defined as outgoing adjacency matrix and the input adjacency matrix The adjacency matrix A is a series of elements, where each element is the weight of the corresponding edge in the directed graph G, representing the degree of communication between nodes in the directed graph G. These are the two columns in the adjacency matrix A corresponding to node k. This is a weight matrix, where b is the bias term. It is the embedding vector of all nodes at time t-1 (1≤t≤T). This represents the result of the interaction between a node and its adjacent nodes through edges. and Let W represent the update gate and reset gate, σ be the sigmoid function, and W be a d-dimensional matrix. It is newly generated information. Decide from which past information to generate new information. This indicates which past information you choose to forget. This indicates which newly generated information is remembered. After the update, the embeddings of all tourism products in the directed graph G are obtained.
[0092] S1.2 Operation Sequence Embedding
[0093] User actions are diverse, and different actions taken by users towards tourism products reflect their level of interest in those products. Furthermore, user actions towards tourism products also exhibit a certain sequence; this invention uses a Transformer model to learn the embeddings of these action sequences.
[0094] For user operation sequence Set the input embedding of the operation sequence to When processing objects in a sequence, the Transformer model is unaware of the objects' order within the sequence. However, the operation sequence in this invention requires utilizing the sequential nature of the sequence; therefore, positional encoding is incorporated into the input embedding of the operation sequence. Position encoding borrows the method in Transformer model, using sine and cosine functions with different frequencies. The input embedding of operation sequence can be represented as:
[0095]
[0096] The present application uses the encoder module in the Transformer to model the operation sequence, which is composed of multiple layers of encoders, each of which mainly includes two sub-layers, namely self-attention layer and feedforward network layer.
[0097] Self-attention layer
[0098] Multi-head self-attention mechanism is used, and the attention score of each head is calculated in parallel, and then the output value of each head is spliced and linearly converted
[0099] S=MultHead(Q,K,V)=Concat(head1,…,head h )W O (3)
[0100] h is the number of heads, and the attention mechanism of the h heads is independent of each other.
[0101] The attention score calculation uses scaled dot product, and the scaling is to prevent the value from being too large, which will allocate almost all the probability to the item with too large value when normalized.
[0102]
[0103] After normalization, the weight coefficient w K
[0104]
[0105] After adding the weight coefficient w K , V is weighted to obtain the Attention vector
[0106]
[0107] Therefore, the Attention of each head is defined as
[0108] Attention(Q,K,V)=Attention(EW Q ,EW K ,EW V ) (7)
[0109] Feedforward network layer
[0110] The above operations are all linearly changing processes, in order to increase the nonlinearity of the model, the present application adds a feedforward network layer, the feedforward network layer is composed of two full connection layers.
[0111] F = FFN (S) = ReLU (SW1 + b1) W2 + b2 (8)
[0112] Wherein W1, W2, b1, b2 are learnable parameters.
[0113] Residual network and normalization module are added at the end of the two sublayers. That is, the final output of each layer is SubLayer_output = LayerNorm (x + SubLayer (x)), wherein SubLayer (x) is the processing function of the sublayer itself, and x is the input of the sublayer.
[0114] S = LayerNorm (E + MultHead (E))
[0115] F = LayerNorm (S + FFN (S)) (9)
[0116] Stacked encoder
[0117] The multi-layer encoder can learn more complex relationships, and the b-th layer encoder is defined as:
[0118] S b = MultHead (F (b-1) )
[0119]
[0120] The operation sequence embedding learned by the Transformer layer is represented as Connect the learned X and O as the user's historical browsing sequence representation, that is, Wherein Represents the series operation. Through this embedding learning method, the sequences of different operations on the same tourism product have different embedding representations, which more accurately capture the user's interest.
[0121] S2 User interest capture
[0122] The user's interest is determined by both stable long-term interest and changing recent interest, which affects the user's selection of tourism products.
[0123] S2.1 Long-term / recent interest capture
[0124] Embed all the user's historical browsing sequences P = [p1, p2, …, p K ] as input, and obtain the long-term interest of the user u
[0125] The attention score between objects in the history browsing sequence is calculated as follows:
[0126] Score(p k )=φ(W l ·p k +b l (11)
[0127] W l and b l Here are the model parameters, and φ is the ReLU activation function. After normalization, the weight coefficients between objects are:
[0128]
[0129] By aggregating the objects embedded in the historical browsing sequence with their corresponding weight coefficients, the long-term interests of user u can be obtained.
[0130]
[0131] Select the user's browsing history sequence over the past seven days and embed it into P r =[p m ,…,p K Using P (1≤m≤K) as input, similar to capturing long-term interests, an attention mechanism is employed to capture the recent interests of user u.
[0132] Score(p k )=φ(W r ·p k +b r )
[0133]
[0134]
[0135] S2.2 User Interest Fusion
[0136] To better integrate user interests, this invention employs a gating mechanism, similar to a gated loop unit (GRU). The gated unit G... u To control the contribution of a user's long-term and recent interests to their overall user interest, the specific formula is as follows:
[0137]
[0138]
[0139] e u This represents the user's embedded representation. and Let W represent the user's long-term interests and recent interests, respectively. W is the weight matrix, b is the bias term, ⊙ represents the dot product operation, and s... u Let be the interest vector representation for user u.
[0140] S3 generates recommendations
[0141] In obtaining the final representation of user interests u Then, embed it with candidate tourism products in e j Inputting data into a multilayer perceptron layer and then performing a softmax operation yields a score Y for a tourism product that may be the user's next interaction. sj .
[0142]
[0143] This invention uses the cross-entropy loss function as the loss function of the model, that is...
[0144] Loss=-∑ s∈S ∑ j∈I [y sj logY sj +(1-y sj log(1-Y) sj (17)
[0145] y sj ∈{0,1} indicates whether the user will interact with candidate tourism product j, S represents the set of sequences, and I represents the set of candidate tourism products.
[0146] Example 3
[0147] S1 Data Preprocessing
[0148] S1.1 Acquires multiple user action data, such as browsing tourist attractions, saving restaurants, and booking hotels. This data usually comes from the website's user logs or database.
[0149] S1.2 Filter information related to tourism products from the user's multiple operational behavior data, such as deleting tourism product details, merchant addresses, postal codes, etc. Sort the filtered information according to user interaction time, and treat all user interaction information as a sequence to form sequence data. Based on the sequence content, sequence information related to tourism products is marked as tourism product sequence, and sequence information related to user operations is marked as operation sequence.
[0150] S2 learned sequence embedding
[0151] S2.1 Based on the sequence constructed in S1.2, the tourism product sequence is obtained. and operation sequence The tourism product sequence is a set of vectors containing multiple tourism products, and each vector represents a tourism product feature, including tourism product ID, sequence ID, tourism product type, etc. The operation sequence is a set of vectors containing multiple user operations, and each vector represents a user operation, including operation type, operation time, etc.
[0152] S2.2 The GGNN can capture the bidirectional relationship between tourism products in the tourism product sequence. In the application scenario, the tourism product sequence is modeled as a directed graph, where each node represents a tourism product in the tourism product sequence, and each edge is regarded as a user operation. This process captures the correlation between tourism products through GGNN, representing each tourism product as an embedding vector where k represents the kth product in the tourism product sequence.
[0153] S2.3 The Transformer model is used to learn the tourism product sequence, which can consider the context information of different operations in the sequence. Each user operation is represented as an embedding vector where k represents the kth operation in the operation sequence.
[0154] S2.4 The learned tourism product sequence embedding vector and operation sequence embedding forms the user historical browsing sequence representation
[0155] S3 User interest capture
[0156] S3.1 The user historical browsing sequence representation obtained in S2 is input into the attention mechanism to obtain the user long-term interest and recent interest The long-term interest reflects the user's stable interest within a certain period of time, while the recent interest pays more attention to the user's interest changes in the recent period.
[0157] S3.2 The gating fusion module is used to learn the weight parameter to control the contribution of long-term and recent interest to user interest. The influence of long-term interest and recent interest on user interest can be flexibly adjusted in different situations to obtain the final representation s of user interest u .
[0158] S4 Generation of recommendations
[0159] S4.1 The user interest representation s obtained in S3.2 u is matched with the candidate tourism product embedding e j , and the matching score Y is calculatedsj where the candidate tourism product is embedded e j is the feature vector of the candidate tourism product, and the matching process adopts a combination of MLP and Softmax function.
[0160] S4.2 The candidate tourism product with the highest matching score is the next possible tourism product that the user will interact with.
[0161] S5 Model training and optimization: the model is trained and optimized using the cross-entropy loss function.
Claims
1. A sequence recommendation method for user multi-operation behavior, characterized in that, The method comprises the following steps: Step 1, learning a tourism product sequence and an operation sequence embedding through a sequence learning model to obtain a user historical browsing sequence embedding in series; specifically comprising the following steps: Step 1.
1. According to the sequence characteristics of the tourism product, a gated graph neural network is used to learn the sequence representation, and the tourism product sequence embedding is obtained ; Specifically: First, the tourism product sequence is defined as wherein represents the i-th tourism product in the tourism product sequence browsed by the user tourism product, is the type number of the tourism product, represents the length of the tourism product sequence; Then the tourism product series Model as a directed graph In a directed graph In, each node Represents a tourism product in a tourism product sequence, each edge This indicates that the user is operating a travel product. After that, I operated the tourism products. Each edge is assigned a normalized weight, calculated by dividing the number of times each edge appears by the out-degree of the starting node of that edge; Directed graph Embedding vector of each node The update function is: (1) adjacency matrix defined as the outgoing adjacency matrix and the incoming adjacency matrix in series, the adjacency matrix each entry is the weight of the corresponding edge in the directed graph representing the degree of communication between the nodes in the directed graph ; is the adjacency matrix two columns in the adjacency matrix corresponding to the nodes is the weight matrix, is the bias term, is the embedding vectors of all nodes at time , representing the result of the interaction between the node and its neighboring nodes through edges; and represent the update gate and the reset gate, is the sigmoid function, all are d-dimensional matrices; is the newly generated information, decides which past information to generate new information from; represents the choice of forgetting which past information, represents remembering which newly generated information; After the update, the directed graph is obtained Embedding of all tourism products in the middle ; Step 1.
2. Learning representations of the operation sequences using a Transformer model according to the sequence of operations, resulting in operation sequence embeddings ; in particular: First, the operation sequence is defined as wherein represents the operation of the user on the th tourist product in the tourist product sequence, is the type number of the operation, represents the length of the operation sequence; For a user operation sequence The input embedding of the operation sequence is set as ; the position encoding is added in the input embedding of the operation sequence The position encoding adopts sine and cosine functions with different frequencies by borrowing the method in the Transformer model; the input embedding of the operation sequence is expressed as: (2) An encoder module in the Transformer is used to model the operation sequence, and the encoder module is composed of multiple layers of encoders, each layer of encoder comprising two sub-layers of a self-attention layer and a feedforward network layer; wherein the self-attention layer adopts a multi-head self-attention mechanism, and the attention scores of each head are calculated in parallel, and then the output values of each head are spliced for linear conversion: (3) wherein h is the number of heads, h The attention mechanisms of the heads are independent of each other; The attention score calculation uses a scaled dot product: (4) After normalization, we obtain K the weight coefficient : (5) Adding a weight coefficient After that, the Attention vector is obtained by weighting: V (6) Thus, per head is defined as: (7) The feedforward network layer is composed of two fully connected layers: (8) wherein , , , are learnable parameters; At the end of both sub-layers, a residual network and a normalization module are added, i.e. the final output of each layer is wherein is the processing function of the sub-layer itself, x is the input of the sub-layer: (9) Intra-layer prediction b Layer encoder is defined as: (10) The operation sequence embedding learned through the Transformer layer is represented as ; Step 1.
3. Concatenate the two sequence embeddings learned from step 1.1 and step 1.2 and to obtain the user historical browsing sequence embedding ; Step 2, capturing user interest from the perspectives of long-term interest and recent interest based on the user historical browsing sequence embedding, and fusing the two interests to obtain a user interest representation; specifically comprising the following steps: Step 2.1: Embed the historical browsing sequence obtained in Step 1 into the attention mechanism to obtain the user's long-term interests. and recent interests Specifically, this involves embedding the user's browsing history sequence. As input, obtain user u long-term interest : The attention score calculation between the historical browsing sequence objects is as follows: (11) and are model parameters, is a ReLU activation function; after normalization, the weight coefficients between objects are: (12) The objects in which the historical browsing sequence is embedded are aggregated with their corresponding weight coefficients to obtain the long-term interest of the user u : (13) selecting a user's recent seven-day history browsing sequence embedding , as input, an attention mechanism is employed to capture the user's u recent interests : (14) Step 2.2, controlling the contribution degree of two interests to the user interest representation by a gating fusion module ; specifically, a gating unit is used to control the contribution degree of the long-term interest and the recent interest of the user to the user interest, and the specific formula is as follows: (15) wherein, represents an embedding representation of a user, and represent a long-term interest and a recent interest of a user, respectively, is a weight matrix, is a bias term, represents a dot product operation of elements, is a user u interest vector representation; Step 3, predicting a tourism product that the user will next interact with according to the user interest representation and a candidate tourism product.
2. The user-oriented multiple operation behavior sequence recommendation method of claim 1, wherein, The step 3 specifically comprises the following steps: Step 3.
1. Representing the user interest and the candidate travel product are matched and a matching score is computed : (16) Step 3.2, selecting the tourism product with the highest score as the tourism product that the user is most likely to next interact with, and recommending the user.
Citation Information
Patent Citations
Session recommendation method based on graph neural network and interest attention network
CN115658864A