Session recommendation method based on graph neural network and long and short term memory

By using a combination of graph neural network and long-term memory network in the conversation recommendation system, the problem of long-term and short-term interests is solved, and more accurate and adaptive recommendation results are achieved, improving the user experience.

CN120086325APending Publication Date: 2025-06-03STATE GRID HEBEI ELECTRIC POWER CO LTD +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510044028.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The existing session recommendation system has shortcomings in capturing and distinguishing long and short-term interests of users, resulting in poor accuracy and adaptability of recommendation results.

Method used

The conversation recommendation method based on graph neural network and long and short-term memory is adopted. The long-term interest encoder and short-term interest encoder respectively capture the user's long-term and short-term interest decoupling module and fusion module are used for adaptive fusion to generate more accurate recommendation results.

Benefits of technology

It significantly improves the accuracy and adaptability of the recommendation system, can dynamically capture changes in user preferences, make the recommendation results more in line with the actual needs of users, and enhances user satisfaction and participation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086325A_ABST
    Figure CN120086325A_ABST
Patent Text Reader

Abstract

The invention provides a recommendation method based on a graph neural network and long and short term memory sessions, and relates to the technical field of recommendation systems.The method comprises the steps that historical interaction sessions of a user are obtained; the user historical interaction session is input into a recommendation model, a recommendation result is output, the recommendation model comprises a long-term interest encoder, a short-term interest encoder, a long-term and short-term interest decoupling module, a fusion module and a recommendation result generation module, and the long-term and short-term interest decoupling module combines a self-supervised learning mechanism to generate a recommendation result; long-term interests and short-term interests are decoupled in a comparative learning mode, and a fusion module performs adaptive fusion on decoupled long-term and short-term interests to obtain session representation. By adopting the scheme, the real-time preference of the user can be dynamically captured, and a more accurate recommendation result is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of recommendation systems, and particularly to a method and device for session recommendation based on graph neural networks and long short-term memory. Background Art

[0002] Existing session recommendation systems mainly rely on two major categories of methods: machine learning and deep learning. These technologies have their own characteristics and are widely used in the field of recommendation systems. However, these methods also face many challenges in practical applications, which limit their performance and effectiveness. The following is an analysis of existing technical solutions and a discussion of their existing problems.

[0003] (1) Machine learning methods

[0004] Traditional machine learning methods have a long application history in recommendation systems. Their typical technologies include collaborative filtering, matrix factorization, and content-based recommendation. Collaborative filtering makes recommendations by analyzing the similarity between users or items, and is divided into user-user collaborative filtering and item-item collaborative filtering; matrix factorization extracts latent features by decomposing the user-item interaction matrix, and then realizes personalized recommendation; content-based recommendation relies on the content information of users and items, mines user preferences, and recommends content that users may be interested in.

[0005] Although these methods perform well in static scenarios, they show obvious limitations in dynamic and real-time session recommendation tasks. First, these methods are insufficient in capturing the dynamic changes of user interests, especially in short-term sessions, and it is difficult to accurately reflect users' immediate needs. Second, since session recommendation tasks usually only rely on single-session data, this leads to a more serious data sparsity problem, and it is difficult for the model to learn users' true preferences from limited data. Finally, the generalization ability of these traditional methods is weak, and it is difficult to transfer the knowledge learned from one session to new sessions or new users, resulting in poor adaptability to new scenarios.

[0006] (2) Deep learning methods

[0007] The rise of deep learning has provided more powerful tools for session recommendation systems. The main technologies include recurrent neural networks (RNNs), attention mechanism-based models, and graph neural networks (GNNs). Recurrent neural networks and their variants (such as LSTM and GRU) perform excellently in processing time series data and can model the time dependence of user behavior. Attention mechanism-based models are outstanding in capturing user intentions at a fine-grained level by analyzing the importance of different items in the user session. And graph neural networks provide a novel and effective way to model session data by constructing session graphs and capturing the complex interaction relationships between users and items.

[0008] However, these methods also have certain limitations. Recurrent neural networks are sensitive to the session length and it is difficult to simultaneously adapt to the data characteristics of both long and short sessions, which affects the stability and generalization ability of the model. During the training process, since the recommendation system needs to process a large amount of data, negative sampling is usually required to improve the computational efficiency. However, the quality and efficiency of negative sampling have a significant impact on the learning effect of the model. Although the attention mechanism-based model has advantages in fine-grained analysis, it is insufficient in distinguishing between the long-term and short-term interests of users, thus limiting the accurate prediction of the current user's preferences. Although graph neural networks are powerful in capturing complex relationships, they also face similar problems, that is, it is difficult to clearly distinguish and model the long-term and short-term interests of users, and this ability is crucial for improving the accuracy of recommendations.

[0009] In summary, the existing technologies have deficiencies in capturing and distinguishing the long-term and short-term interests of users. Long-term interests represent the stable preferences of users within a certain time span, while short-term interests reflect the immediate needs and temporary preferences of users. These two types of interests have different characteristics in user behavior modeling. How to accurately capture the long-term and short-term interests of users and effectively distinguish the differences between them is crucial for improving the modeling accuracy of user behavior preferences and the overall performance of the recommendation system. Summary of the Invention

[0010] This application aims to at least solve one of the technical problems in the related technologies to some extent.

[0011] To this end, the first object of this application is to propose a session recommendation method based on graph neural networks and long short-term memory, which can dynamically capture the real-time preferences of users and provide more accurate recommendation results.

[0012] The second object of this application is to propose a computer device.

[0013] The third object of this application is to propose a non-transitory computer-readable storage medium.

[0014] To achieve the above object, the first aspect embodiment of this application proposes a session recommendation method based on graph neural networks and long short-term memory, including:

[0015] Obtain the user's historical interaction sessions;

[0016] Input the user's historical interaction sessions into the recommendation model, and output the recommendation results. The recommendation model includes a long-term interest encoder, a short-term interest encoder, a long and short-term interest decoupling module, a fusion module, and a recommendation result generation module. The long and short-term interest decoupling module combines a self-supervised learning mechanism to decouple the long-term and short-term interests through contrastive learning. The fusion module adaptively fuses the decoupled long-term and short-term interest representations to obtain the session representation.

[0017] Optionally, in an embodiment of the present application, the user's historical interaction session is input into the recommendation model, and the recommendation result is output, including:

[0018] Based on the user's historical interaction session, generate a long-term interest representation and a short-term interest representation through a long-term interest encoder and a short-term interest encoder;

[0019] Based on the session representation generated by the session representation learning module after decoupling by the long-short term interest decoupling module, generate a recommendation result through the recommendation result generation module.

[0020] Optionally, in an embodiment of the present application, the long-term interest encoder is specifically used for:

[0021] For the long-term interest representation, through the Transformer Encoder structure and adding reverse position information, learn the session weights to aggregate the items in the session to form the long-term interest representation of the items;

[0022] The short-term interest encoder is specifically used for:

[0023] For the short-term interest representation, construct a temporal session graph, and capture the migration of item neighborhood information in the time dimension through the temporal module to form the short-term interest representation of the items.

[0024] Optionally, in an embodiment of the present application, the long-short term interest decoupling module is specifically used for:

[0025] Calculate the average value of all neighbor representations of the current item, use it as the long-term interest proxy, and use the last neighbor representation of the item in the current session as the short-term interest proxy;

[0026] Use the long-short term interest proxies as labels to decouple the long-term interest and the short-term interest. The goal during decoupling is to make the long-term and short-term interest representations close to their respective proxies and far from the other's proxy, and obtain the decoupled long-term interest representation and short-term interest representation.

[0027] Optionally, in an embodiment of the present application, the fusion module is specifically used for:

[0028] Fuse the decoupled long-term and short-term interest representations through an adaptive gating aggregator to form the final session representation.

[0029] Optionally, in an embodiment of the present application, the recommendation module is specifically used for:

[0030] Perform a dot product operation on the session representation and the initial embedding of each candidate item to obtain the score of each candidate item, normalize the scores of all items using softmax, and introduce a temperature coefficient to control the item scores to obtain the recommended probability of the candidate items, and generate a recommendation result based on the recommended probability of the candidate items.

[0031] To achieve the above object, an embodiment of the second aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned session recommendation method based on graph neural network and long short-term memory is implemented.

[0032] To achieve the above object, an embodiment of the third aspect of the present invention provides a non-transitory computer-readable storage medium, which can execute the above-mentioned session recommendation method based on graph neural network and long short-term memory when the instructions in the storage medium are executed by the processor.

[0033] The session recommendation method and device based on graph neural network and long short-term memory in the embodiments of the present application, by integrating the advantages of graph neural network and long short-term memory network, realize an in-depth understanding of the user's behavior patterns in the session and the relationships between items, and significantly improve the accuracy of the recommendation system. This embodiment can dynamically capture the changes in user preferences, make the recommendation results more in line with the actual needs of users, and enhance user satisfaction and participation. By decoupling the long-term and short-term interests of users, the model can adapt to the evolution of user interests, effectively learn without explicit labels, and improve the generalization ability and robustness of the model. The application of this embodiment is not limited to a specific business field, and its flexibility and adaptability enable it to be widely applied to multiple scenarios such as e-commerce and content recommendation, bringing more efficient resource allocation and higher conversion rates to the platform, and providing a more personalized service experience for users.

[0034] Some of the additional aspects and advantages of the present application will be given in the following description, some will become obvious from the following description, or be understood through the practice of the present application. Description of the Drawings

[0035] The above-mentioned and / or additional aspects and advantages of the present application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0036] Figure 1 It is a schematic flowchart of a session recommendation method based on graph neural network and long short-term memory provided by Embodiment 1 of the present application;

[0037] Figure 2 It is a schematic flowchart of a session recommendation system based on graph neural network and long short-term memory of the embodiments of the present application;

[0038] Figure 3 It is a structural diagram of a time-aware graph neural network of the embodiments of the present application;

[0039] Figure 4 It is an example diagram showing the embodiment of the long-term and short-term interests of users of the embodiments of the present application. Detailed Embodiments

[0040] Embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present application, and should not be construed as a limitation to the present application.

[0041] The graph neural network and long short-term memory session recommendation method and device according to the embodiments of the present application will be described below with reference to the accompanying drawings.

[0042] Figure 1 It is a schematic flow chart of a graph neural network and long short-term memory session recommendation method provided by Embodiment 1 of the present application.

[0043] As Figure 1 shown, the graph neural network and long short-term memory session recommendation method includes the following steps:

[0044] Step 101, obtaining the user's historical interaction session;

[0045] Step 102, inputting the user's historical interaction session into the recommendation model, and outputting a recommendation result, where the recommendation model includes a long-term interest encoder, a short-term interest encoder, a long-short-term interest decoupling module, a fusion module, and a recommendation result generation module. The long-short-term interest decoupling module combines a self-supervised learning mechanism to decouple the long-term interest and the short-term interest through contrastive learning. The fusion module adaptively fuses the decoupled long-term and short-term interest representations to obtain a session representation.

[0046] The graph neural network and long short-term memory session recommendation method according to the embodiments of the present application realizes an in-depth understanding of the user's behavior patterns in the session and the relationships between items by integrating the advantages of the graph neural network and the long short-term memory network, and significantly improves the accuracy of the recommendation system. This embodiment can dynamically capture the changes in user preferences, make the recommendation results more in line with the actual needs of users, and enhance the user's satisfaction and participation. By decoupling the user's long-term and short-term interests, the model can adapt to the evolution of user interests, perform effective learning without explicit labels, and improve the generalization ability and robustness of the model. The application of this embodiment is not limited to specific business fields, and its flexibility and adaptability enable it to be widely applied to multiple scenarios such as e-commerce and content recommendation, bringing more efficient resource allocation and higher conversion rates to the platform, and also providing a more personalized service experience for users.

[0047] Embodiment 2 of the present application also provides a session recommendation system based on a graph neural network and long short-term memory. This embodiment mainly consists of three components. The first component models the long-term and short-term term interests of users from two aspects. The second component decouples the long-term and short-term term interests of users by designing a long-term and short-term term interest proxy and adopting a contrastive learning method. The third component combines the long-term and short-term term interests of users for final recommendation. The overall process is shown in Figure 2 。

[0048] As Figure 2 shown, it includes:

[0049] Step 1: Input the user's historical session.

[0050] Step 2: User interest modeling

[0051] Existing methods usually form node representations by capturing the original relationships between adjacent nodes and central nodes, but these methods ignore the global relationships of items and the changes in user intentions over time.

[0052] Existing methods may not be able to fully capture the dynamic migration of item neighborhood information in the session over time.

[0053] The present invention designs two independent encoders: a long-term interest encoder and a short-term interest encoder, which capture the long-term and short-term interests of users respectively.

[0054] The long-term interest encoder provides an overall view of user preferences, summarizing the entire historical interaction, while the short-term interest encoder changes dynamically over time, reflecting the recent interaction. The short-term interest encoder captures the dynamically changing interests of users over time and more accurately reflects the user's immediate preferences. The short-term interest encoder forms the short-term interest representation of items by constructing a temporal session graph and capturing the migration of item neighborhood information in the time dimension through a temporal module. Long-term interest encoder: Determine the long-term interests of users from the entire historical interaction session. Specifically, for the long-term interest representation, through the TransformerEncoder structure and adding reverse position information, learn the session weights to aggregate the items in the session to form the long-term interest representation of items. Short-term interest encoder: Construct a time graph centered on each item in the session to capture the time information of neighbor nodes and aggregate the item representations based on this to determine the short-term interests of users.

[0055] Step 3: Decoupling of long-term and short-term interests

[0056] Existing methods often have difficulty distinguishing the long-term and short-term interests of users, resulting in limited accuracy of recommendation results.

[0057] In this embodiment, the long-term proxy is obtained by calculating the average of all neighbor representations of the current project, while the short-term interest proxy is the last neighbor representation of the project in the current session. With the proxies as labels, this embodiment can use them to decouple long-term and short-term interests. The goal is to ensure that the long-term and short-term interest representations are close to their respective proxies while being far from the other's proxy. This decoupling method helps to accurately model the user's long-term and short-term interests and effectively utilize this information in the recommendation process.

[0058] Step 4: Adaptive Fusion after Decoupling

[0059] The long-term and short-term term session representations are fused through a gated aggregator to form the final session representation.

[0060] Step 5: Generate Recommendation Results

[0061] Existing methods may be insufficient in dealing with the fine-grained analysis of user behavior.

[0062] Based on the obtained session representation, the final recommendation probability is calculated by performing a dot product operation with the initial embedding of each candidate item. The scores of all items are normalized using a softmax layer, and a temperature coefficient is introduced to control the scaling of the data and promote the convergence of the model. Finally, the overall loss function of the model is obtained, and the recommendation of the result is achieved according to this value. This embodiment can comprehensively consider the long-term and short-term interests of users and generate recommendation results that better conform to the user's current preferences.

[0063] Self-Supervised Learning Mechanism

[0064] Existing methods may lack an effective mechanism to dynamically capture changes in user preferences.

[0065] This embodiment combines a self-supervised learning mechanism to decouple long-term and short-term interests through a contrastive learning task. The self-supervised learning mechanism enables the model to learn the dynamic changes in user interests without explicit labels, improving the generalization ability and adaptability of the model.

[0066] This embodiment significantly improves the accuracy and adaptability of the session recommendation system by introducing long-term and short-term interest encoders, time-aware graph neural networks, and self-supervised learning mechanisms. Compared with the prior art, it can better capture the dynamic changes in user interests and generate more accurate recommendation results.

[0067] Embodiment 3 of this application provides a time-aware graph neural network TGNN, which can effectively capture the dynamic migration of item neighborhood information in the session over time. Figure 3 is the model structure diagram. Figure 3 In it, TGNN Layer represents the temporal graph neural network layer.

[0068] The problem to be solved in this embodiment can be formally defined as:

[0069] Let V = {v 1 , v 2 , v 3 ,..., v M} be the set of all items, and M be the total number of items. An anonymous session S q is represented as It refers to a series of interactions that a user makes in the current session in chronological order. All anonymous sessions are denoted as S' = {S 1 , S 2 ,..., S N}, where N is the total number of sessions. v i represents the item ID clicked by the user in the i-th interaction, and l is the length of S q . Given a session S q , the goal of session recommendation is to recommend K items (1 ≤ K ≤ M) from V that are most likely to be clicked by the user in the current session.

[0070] In session recommendation, the transition between items reflects the evolution of user interests over time. Therefore, this embodiment constructs a session as a temporal graph to learn node representations. Given a session denoted as G s = (V s , E s ) as the corresponding session graph, where is the set of items clicked by the user in session S q . E s = {e ij |(v i , v j )|v i ∈S q , v j ∈N q (v i )} represents the edge set, where N q (v i ) is the neighbor of item v i in the session. To ensure the chronological order of each neighbor, for each item v i in the session, first add the edge connecting it to its left neighbor to the edge set. Figure 4 Shows an example of the construction of a temporal session graph. Taking a dynamic social network as an example, Figure 4 contains the interaction relationships between users on the 1st, 2nd,..., nth days, denoted as G 1 , G 2 ,…, G n , where G i(1 ≤ i ≤ n) is a static sub - graph, which consists of several nodes and directed edges. Each node represents a user, and a directed edge linking from one node to another represents that the user has actively interacted with another user. In the current session {v 1 →v 2 →v 3 →v 2 →v 4 →v 5 →v 2}, the neighbor set of the central node v 2 is {v 1 , v 3 , v 4 , v 5}, and it has a time order.

[0071] Since the interaction history S q of users reflects long - term and short - term interests, TGNN first learns long - term and short - term interests from S q , and then predicts future interactions based on these two aspects. To better learn long - term and short - term interests, this embodiment proposes a long - short - term interest proxy at the item granularity. Specifically, for the item v q in the session S i , its long - term interest proxy is the neighbor of all v i in S′, while the short - term interest proxy is the last item in N q (v i ).

[0072] As Figure 3 shown, the model includes A: User Interest Modeling; B: Long - short - term Interest Decoupling; C: Session Representation Learning.

[0073] Specifically, User Interest Modeling includes:

[0074] 1) Construct a long - term interest encoder

[0075] Embed each item into a unified embedding space. Let where represents the embedding vector of the item v i , Emb( ) is the item embedding lookup table, and d is the dimension of the vector. This embodiment also uses a learnable position embedding matrix where is the position vector, indicating that the current position i is the length of the current session. Then, combine the original embedding with the position embedding information, as shown in the following formula:

[0076]

[0077] Next, use the L-layer self-attention module to learn the potential relationships between session items:

[0078]

[0079] where is the output dimension of the feed-forward network of the final layer of the self-attention module. Subsequently, this embodiment can calculate the normalized weights from the above attention network

[0080]

[0081] where is a learnable parameter, and ⊙ represents element-wise multiplication. The final long-term interest representation is the weighted aggregation of the entire interaction history, and the weights are calculated by the above attention network, as follows:

[0082] u l = α 1 ⊙ H

[0083] 2) Construct a short-term interest encoder

[0084] As Figure 3 shown, create a temporal session graph for each session. For v i (v i ∈ S q ) and its neighbor nodes v j (v j ∈ N q (v i ))), this embodiment forms a neighbor node time series H′ = [h′ 1 ; h′ 2 ;...; h′ o , where

[0085]

[0086] represents the embedding of the neighbor nodes, and o is the number of neighbor nodes. This embodiment designs a time-aware module to capture the changes in the neighbor sequence in the time dimension, as follows:

[0087]

[0088] where is a learnable parameter, ⊙ represents element-wise multiplication, and ∥ represents the concatenation operation. To emphasize the importance of the central node, this embodiment adds the embedding h i of the central node to the input neighbor sequence at each time step. Finally, this embodiment obtains the representation

[0089] Different from directly calculating the similarity between the central node representation and the initial neighbor representation, this embodiment considers the temporal migration characteristics of neighbor information from the project granularity. By calculating the similarity between the output of the time-aware module and the central node representation, this embodiment distinguishes the importance of different neighbors in the time dimension. This embodiment uses item-aware attention to aggregate the representations of different neighbor nodes. The calculation formulas for the attention weights of the central node and neighbor nodes are as follows: j and the central node representation This embodiment selects LeakyReLU as the activation function.

[0090]

[0091] is the weight of the edge (v , v i , v j ) in the time session graph, and and are learnable parameters.

[0092] This method makes the information propagation depend on the affinity between h i and n j in the time dimension, that is, the neighbors that are more in line with the central node's preference in the time dimension will be preferentially selected. Then, this embodiment normalizes the coefficients of all neighbor nodes through the softmax function:

[0093]

[0094] As a result, the final attention scores can suggest which neighbor nodes should be given more attention. This embodiment aggregates the information of neighbor nodes through the calculated attention scores:

[0095]

[0096] The last step is to aggregate the item representation and its neighbor representation as follows:

[0097]

[0098] The item representation in the time session graph is aggregated based on the characteristics of the item itself and its relationship with neighbors in the current session. Through the attention mechanism, the influence of noise on item representation learning is reduced. This embodiment uses a temporal graph neural network to obtain the short-term interest u s .

[0099] 3) Session Representation Learning

[0100] For long-term representation, this embodiment uses the weights α learned by the Transformer 1 to aggregate the items in the session, thereby forming a session-level representation, as follows:

[0101]

[0102] For short-term representation, the most recently clicked items are more representative of the user's preferences. Therefore, this embodiment uses concatenation and linear layers to combine the information of the reverse positions with the item representations learned from the temporal graph neural network layer:

[0103]

[0104] where and are learnable parameters, represents the item representation after the temporal graph neural network. This embodiment represents the session information by the average value of the session item representations, formalized as s′:

[0105]

[0106] Next, the soft attention mechanism is used to obtain the weight β of each item i :

[0107]

[0108] where is a learnable parameter. Then, this embodiment obtains the short-term session representation by linearly combining the item representations:

[0109]

[0110] Finally, the long-term and short-term term session representations are fused through a gated aggregator to form the final session representation:

[0111] α 3 = σ(W 6 [U l ∥U s )

[0112] where is a learnable parameter used to control the information weight of the long-term and short-term term session representations. Then this embodiment aggregates the long-term and short-term term session representations through α 3 to form the final session representation S:

[0113] S = α 3 * U s + (1 - α 3 ) * U l

[0114] 4) Generate recommendation results

[0115] Based on the obtained session representation S, the final recommendation probability is calculated by taking the dot product of it with the initial embedding of each candidate item. This process typically obtains the click probability of all items through a dot product operation:

[0116]

[0117] Next, a softmax layer is used to normalize the scores of all items, and a scaling coefficient τ is introduced to control the scaling of the data and promote the convergence of the model. The final scores are expressed as:

[0118]

[0119] where represents the probability that item v i is clicked as the next item in the current session.

[0120] To train the main task, this embodiment uses cross-entropy as the optimization objective to learn the parameters:

[0121]

[0122] where y represents the one-hot encoded vector of the true label. One-hot encoding is a technique for converting categorical variables into binary vectors. Its main purpose is to convert non-numerical data (such as categorical labels) into a numerical form that can be input into a machine learning model. Each categorical label is represented as a binary vector of length N, where N is the number of all possible categorical labels. Only one position in each vector has a value of 1, and the values of the remaining positions are 0. This position corresponds to the index of the label.

[0123] Finally, the overall loss function L of the model is obtained:

[0124] L = L main + λL c

[0125] where λ is a hyperparameter used to control the scale of self-supervised decoupled long-term and short-term interests.

[0126] To implement the above embodiments, the present invention also proposes a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in the above embodiments is implemented.

[0127] To implement the above embodiments, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the methods of the above embodiments are implemented.

[0128] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without conflict, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0129] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present application, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically and clearly defined.

[0130] Any process or method description in a flowchart or described in other ways herein may be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process. The scope of the preferred embodiments of the present application includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0131] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.

[0132] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0133] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0134] In addition, each functional unit in various embodiments of the present application may be integrated into a processing module, may exist separately as individual physical units, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0135] The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disc, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present application.

Claims

1. A conversation recommendation method based on graph neural network and long short-term memory, characterized in that: include: Get the user's historical interaction session; The user historical interaction conversation is input into a recommendation model, and a recommendation result is output, wherein the recommendation model includes a long-term interest encoder, a short-term interest encoder, a long-term and short-term interest decoupling module, a fusion module and a recommendation result generation module. The long-term and short-term interest decoupling module is combined with a self-supervised learning mechanism to decouple long-term interests and short-term interests by contrastive learning. The fusion module adaptively fuses the decoupled long-term and short-term interest representations to obtain a conversation representation.

2. The method according to claim 1, characterized in that The step of inputting the user historical interactive session into a recommendation model and outputting a recommendation result includes: Based on the user historical interaction session, generating a long-term interest representation and a short-term interest representation through the long-term interest encoder and the short-term interest encoder; Based on the session representation generated by the session representation learning module after decoupling by the long-term and short-term interest decoupling module, the recommendation result is generated by the recommendation result generation module.

3. The method according to claim 2, characterized in that The long-term interest encoder is specifically used for: For long-term interest representation, the Transformer Encoder structure is used with reverse position information to learn session weights to aggregate items in the session and form a long-term interest representation of the items.

4. The method according to claim 3, characterized in that The short-term interest encoder is specifically used for: For short-term interest representation, a temporal session graph is constructed, and the migration of project neighborhood information in the time dimension is captured through the temporal module to form a short-term interest representation of the project.

5. The method according to claim 4, characterized in that The long-term interest decoupling module is specifically used for: Calculate the average of all neighbor representations of the current item and use it as a proxy for long-term interest; The long-term interest proxy is used as a label to decouple the long-term interest. The goal of decoupling is to make the long-term interest representation close to the long-term interest proxy and away from the short-term proxy, so as to obtain the decoupled long-term interest representation.

6. The method according to claim 5, characterized in that The short-term interest decoupling module is specifically used for: Use the last neighbor representation of the item in the current session as a short-term interest proxy; The short-term interest proxy is used as a label to decouple the short-term interest. The goal of decoupling is to make the short-term interest representation close to the short-term interest proxy and away from the long-term interest proxy, so as to obtain the decoupled short-term interest representation.

7. The method according to claim 6, characterized in that The fusion module is specifically used for: The decoupled long-term and short-term interest representations are fused through an adaptive gated aggregator to form the final session representation.

8. The method according to claim 7, characterized in that The recommendation module is specifically used for: A dot product operation is performed on the session representation and the initial embedding of each candidate item to obtain the score of each candidate item. The scores of all items are normalized using softmax, and a temperature coefficient is introduced to control the item scores to obtain the candidate item recommendation probability, and a recommendation result is generated based on the candidate item recommendation probability.

9. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Education course session recommendation method and related device

    CN120894201A