Session recommendation method fusing historical information and related device
By integrating the feature vectors of the current session and the historical session, and generating the user feature vector, the problem of the inability to use historical sessions for personalized recommendations in the existing technology is solved, and more accurate and personalized recommendation results are achieved.
Patent Information
- Application Number
- CN202411771784.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
AI Technical Summary
Existing session recommendation methods fail to utilize historical sessions to learn users' long-term preferences, resulting in non-personalized recommendations.
By collecting interactive records, dividing them into the current session and historical session, obtaining the session feature vector and the historical session feature vector, fusing to obtain the user feature vector, and recommending it based on the user feature vector.
Personalized recommendations are realized, which can capture users' short-term and long-term preferences and improve the accuracy and user experience of recommendations.
Smart Images

Figure CN119691161A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data mining and recommendation, and relates to a conversation recommendation method integrating historical information and a related device. Background Art
[0002] In recent years, with the rapid development of Internet technology, online platforms such as e-commerce, social media and streaming media have generated massive amounts of data, which has led to information overload and seriously affected people's efficiency in obtaining useful information. Recommendation systems can help users discover novel and interesting items in a personalized way, which is one of the effective ways to alleviate the problem of information overload. They have been deployed in multiple online platforms and mobile applications to improve user experience.
[0003] In many early applications, due to technical limitations and other reasons, the user information of the interaction list is unknown. At this time, the ordered interaction list of a user in a short period of time can be regarded as an anonymous session. For example, the record of a user clicking on news on a news website within 5 minutes is a session. The anonymous session recommendation system forms a session representation by mining the dependencies between items in the current session, with the aim of predicting the items that the user may be interested in at the next moment. Recurrent neural networks (RNNs) are the mainstream method for modeling sequence data. However, RNN-based models assume that any adjacent interactions in a session must be dependent, which may lead to the generation of false dependencies and can only capture point-to-point dependencies, ignoring long-distance complex dependencies between items.
[0004] With the maturity and development of technology, many applications (such as large e-commerce and video sharing websites) can track user identities and generate sufficient session data for each user. However, for a long time, most conversational recommendation studies have assumed that sessions are anonymous, ignoring this personalized conversational recommendation scenario. In this scenario, if two users have the same current session but different historical sessions, the anonymous conversational recommendation method will generate the same recommendation list for their next moment, which will lead to non-personalized recommendations because this method ignores the useful information in the historical session and cannot generate a personalized recommendation list for the user based on their long-term preferences. Summary of the invention
[0005] The purpose of the present invention is to provide a conversation recommendation method and related devices that integrate historical information, aiming to solve the problem that existing conversation recommendation methods can only make recommendations based on the user's current conversation and cannot use historical conversations to learn the user's long-term preferences, thereby leading to non-personalized recommendations.
[0006] To achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a conversation recommendation method integrating historical information, comprising: Collect interaction records and divide them into current session and historical session sets; Get the session feature vector of each session in the current session; get the historical session feature vector of each session in the historical session set; The user feature vector is obtained by fusing the session feature vector and the historical session feature vector; The next interaction probability is obtained based on the user feature vector to complete the recommendation.
[0007] Furthermore, the interaction records are collected and divided into current session and historical session sets, including: The website backend server collects all users, items, and each user's item interaction records. For each user's interaction record, it is divided into M sessions according to the preset time interval. The items contained in each session are arranged in order according to the interaction time. The session with the latest interaction time is regarded as the current session. , the remaining sessions constitute the historical session set .
[0008] Furthermore, the session feature vector of each session of the current session is obtained, including: Any session is represented by , where l is the sequence length, Represents a session The i-th item in the session Convert to session graph , get the session graph After the neighboring matrix is obtained, a gated graph neural network is used to model it, learn the session feature vector of the node and the feature vector of the entire session, and first aggregate the messages propagated by the neighboring nodes for each node, and then fuse them with the feature vector of the previous step of the node. The feature update process of step t is as shown in formulas (3) to (7): (3) (4) (5) (6) (7) In the formula, ,in is the total number of items in the current session, and Represent adjacent order matrices and Midpoint The corresponding line, and is the parameter vector that needs to be updated during the model training process, , , , , , , , is the parameter matrix that needs to be updated during the model training process. and represent the update gate and reset gate respectively, Represents a merge operation. Representation Node The vector representation at step t; All nodes in the session are updated simultaneously, and after T steps of iterative updates, the session feature vector of each item in the session can be obtained. ; After obtaining the session feature vectors of all items in the session, they are input into the position-aware attention mechanism to obtain the feature vector of the entire session. The session feature vector It is fused with the vector representation of the location, as shown in formula (8): (8) In the formula, represents the inverse position matrix, is the vector representation of position l+1-j. Items close to the last position are more important for the session representation. is a trainable vector, and are the parameter matrices and vectors that need to be updated during the model training process; the attention mechanism shown in formula (9) is used to calculate the item The weight factor of the feature when generating the entire session feature: (9) In the formula, , and are the parameter matrices and vectors that need to be updated during the model training process. is a sigmoid function. After finding the weight factors of all items, the softmax function shown in formula (10) is used for normalization: (10) Get Items The normalized weight factor ; After obtaining the conversation feature vectors of all items and the corresponding normalized weight factors, the conversation feature vectors are fused using formula (11) to obtain the entire conversation feature vector The eigenvector of: (11).
[0009] Further, we get ,if and adjacent, and the user first Interact with Interaction, then There is an edge in arrive for Relationship and arrive for Relationship, expressed as and , using the neighboring matrix and The relationships are stored separately as and The weights between adjacent nodes are: (1) (2) in, and Respectively shown in Figure China-Israel Node As the starting point, the relationship is and The set of neighbor nodes of and Respectively represent the edge and In the figure The number of times it appears in and Respectively and The i-th node in To the jth node The weight of .
[0010] Furthermore, the historical session feature vector of each session in the historical session set is obtained, including: For each user's historical session collection With the current session First, use formula (12) to calculate the historical session With the current session The cosine similarity between: (12) In the formula, It is a historical session The characteristic vector of Is the current session Then the similarity is normalized using the softmax function described in formula (13): (13) In the formula, Indicates that when calculating the entire historical session features Finally, we use formula (14) to perform a weighted sum on the feature vectors of all historical sessions to obtain the feature vector of the entire historical session: (15).
[0011] Furthermore, the user feature vector is obtained based on the fusion of the session feature vector and the historical session feature vector, including: The current session feature vector and the historical session feature vector reflect the user's short-term and long-term preferences respectively, and the last interacted item in the current session can best reflect his current intention. The user's short-term preference, long-term preference and current intention are fused using formula (16) to obtain the user's final feature vector: (16) In the formula, is the feature vector of the user’s current session, is the feature vector of its historical session, is the feature vector of the last interaction item in the current session.
[0012] Furthermore, the next interaction probability is obtained based on the user feature vector to complete the recommendation, including: After obtaining the user's feature vector, calculate the rating of all items according to formula (17): (17) In the formula, Represents the feature matrix of all items, which is the initial feature representation of items in the internal session encoding module. is the feature vector of the i-th item, and then the softmax function is used to normalize the score to obtain the probability of the user interacting with the i-th item at the next moment: (18) Get the probability vector of interacting with all items Finally, the top K items with the highest probability are recommended to the user.
[0013] In a second aspect, the present invention provides a conversation recommendation system integrating historical information, comprising: The data collection module is used to collect interaction records and divide the interaction records into current sessions and historical session sets; A feature vector acquisition module is used to acquire a session feature vector of each session of the current session; acquire a historical session feature vector of each session in a historical session set; and obtain a user feature vector based on the fusion of the session feature vector and the historical session feature vector; The calculation and recommendation module is used to obtain the next interaction probability based on the user feature vector and complete the recommendation.
[0014] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the conversation recommendation method integrating historical information when executing the computer program.
[0015] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the conversation recommendation method integrating historical information are implemented.
[0016] Compared with the prior art, the present invention has the following technical effects: The present invention uses a location-aware gated graph neural network to deeply learn and extract conversation features. Compared with traditional recurrent neural networks, this neural network model is particularly good at capturing and retaining the intricate, deep patterns and dependencies contained in graph data. In this way, the present invention can mine user preference information more comprehensively and accurately, laying a solid foundation for subsequent recommendation work.
[0017] Furthermore, the present invention not only focuses on feature learning of a single session, but also introduces historical sessions. Based on the similarity between historical sessions and current sessions, key features in historical sessions are effectively learned and extracted. The design of this dual encoding mechanism enables the present invention to have a more comprehensive perspective when understanding user behavior. It can capture the user's short-term preferences in the current session, and through the analysis of historical sessions, gain insight into the user's long-term preferences and potential current intentions.
[0018] Based on the careful design of the internal conversation encoding module and the historical conversation encoding module, the present invention proposes a new personalized conversation recommendation method. This method organically integrates multiple features such as the user's short-term preferences, long-term preferences, and current intentions to form a comprehensive and in-depth understanding of the user's preferences. Therefore, it can capture the user's real needs with higher accuracy, and then generate a personalized recommendation list for the user that not only meets his current interests but also takes into account his historical preferences. Such recommendations are not only more targeted, but also better meet the user's personalized needs, improving user satisfaction and loyalty. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of a personalized conversation recommendation method integrating historical information provided by an embodiment of the present invention; Figure 2 A schematic diagram of converting a conversation sequence into a conversation graph provided by an embodiment of the present invention; Figure 2 (a) in the figure is the conversation sequence. Figure 2 (b) in the figure is the conversation graph. Figure 2 (c) in the figure is the neighbor matrix that stores the node weights in the session graph.
[0020] Figure 3 It is a schematic diagram of the structure of the internal session encoding module provided by an embodiment of the present invention.
[0021] Figure 4 It is a structural diagram of a personalized conversation recommendation method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The present invention is further described below in conjunction with the accompanying drawings: Embodiment 1, the present invention provides a conversation recommendation method integrating historical information, comprising: Collect interaction records and divide them into current session and historical session sets; Get the session feature vector of each session in the current session; get the historical session feature vector of each session in the historical session set; The user feature vector is obtained by fusing the session feature vector and the historical session feature vector; The next interaction probability is obtained based on the user feature vector to complete the recommendation.
[0023] The present invention uses a location-aware gated graph neural network in the internal session encoding module to learn session features. Compared with traditional recurrent neural networks, it can effectively capture and retain complex patterns and dependencies in graph data and fully tap user preferences. The internal session encoding module is used to learn session features from a single session, and the historical session encoding module is used to learn historical session features based on the similarity between historical sessions and current sessions. The personalized session recommendation method designed based on this incorporates multiple features of users' short-term preferences, long-term preferences, and current intentions, which can more effectively capture users' preferences and generate personalized recommendation lists for users.
[0024] Example 2, please refer to Figure 1 The present invention provides a conversation recommendation method integrating historical information, which specifically includes: S1: Data acquisition and data preprocessing: The website backend server collects all users, items, and each user's item interaction records. For each user's interaction record, it is divided into M sessions according to the preset time interval. The items contained in each session are arranged in order according to the interaction time. The session with the latest interaction time is regarded as the current session. , the remaining sessions constitute the historical session set .
[0025] S2: Obtain a single session feature vector through the internal session encoding module: Assume that any session is represented as , where l is the sequence length, Represents a session The i-th item in the session according to Figure 2 The method shown is converted into a conversation graph. Figure 2 (a) shows the session, first we get ,if and adjacent, and the user first Interact with Interaction, then There is an edge in arrive for Relationship and arrive for Relationship, expressed as and , using the neighboring matrix and The relationships are stored separately as and The weights between adjacent nodes.
[0026] (1) (2) in, and Respectively shown in Figure China-Israel Node As the starting point, the relationship is and The set of neighbor nodes of and Respectively represent the edge and In the figure The number of times it appears in and Respectively and The i-th node in To the jth node The weight of .
[0027] Get the session graph After the neighboring matrix is obtained, a gated graph neural network is used to model it, learn the session feature vector of the node and the feature vector of the entire session, and first aggregate the messages propagated by the neighboring nodes for each node, and then fuse them with the feature vector of the previous step of the node. The feature update process of step t is as shown in formulas (3) to (7): (3) (4) (5) (6) (7) In the formula, (in is the total number of items in the current session), and Represent adjacent order matrices and Midpoint The corresponding line, and is the parameter vector that needs to be updated during the model training process, , , , , , , , is the parameter matrix that needs to be updated during the model training process. and represent the update gate and reset gate respectively, Represents a merge operation. Representation Node The vector representation at step t. All nodes in the session are updated simultaneously, and after T steps of iterative updates, the session feature vector of each item in the session can be obtained. .
[0028] After obtaining the session feature vectors of all items in the session, they are input into the position-aware attention mechanism to obtain the feature vector of the entire session. The session feature vector It is fused with the vector representation of the location, as shown in formula (8): (8) In the formula, represents the inverse position matrix, is the vector representation of position l+1-j. Items close to the last position are more important for the session representation. is a trainable vector, and are the parameter matrices and vectors that need to be updated during the model training process. Since the last item interacted with in the user session is more important for the next moment’s choice, the attention mechanism shown in formula (9) is used to calculate the item The weight factor of the feature when generating the entire session feature: (9) In the formula, , and are the parameter matrices and vectors that need to be updated during the model training process. is a sigmoid function. After finding the weight factors of all items, the softmax function shown in formula (10) is used for normalization: (10) Get Items The normalized weight factor .
[0029] After obtaining the conversation feature vectors of all items and the corresponding normalized weight factors, the conversation feature vectors are fused using formula (11) to obtain the entire conversation feature vector The eigenvector of: (11) S3: Obtain the historical conversation feature vector through the historical conversation encoding module: For each user's historical session collection With the current session After obtaining the feature vector of each session in step S2, the historical session is first calculated using formula (12) With the current session The cosine similarity between: (12) In the formula, It is a historical session The characteristic vector of Is the current session Then the similarity is normalized using the softmax function described in formula (13): (13) In the formula, Indicates that when calculating the entire historical session features Finally, we use formula (14) to perform a weighted sum on the feature vectors of all historical sessions to obtain the feature vector of the entire historical session: (15) S4: Calculate the user feature vector through the feature fusion module: The current session feature vector and the historical session feature vector reflect the user's short-term and long-term preferences respectively, and the last interacted item in the current session can best reflect his current intention. The user's short-term preference, long-term preference and current intention are fused using formula (16) to obtain the user's final feature vector: (16) In the formula, is the feature vector of the user’s current session, is the feature vector of its historical session, is the feature vector of the last interaction item in the current session.
[0030] S5: Recommendation through scoring module: After obtaining the user's feature vector, calculate the rating of all items according to formula (17): (17) In the formula, The feature matrix representing all items is the initial feature representation of items in the internal session encoding module. is the feature vector of the i-th item, and then the softmax function is used to normalize the score to obtain the probability of the user interacting with the i-th item at the next moment: (18) Get the probability vector of interacting with all items Finally, the top K items with the highest probability are recommended to the user.
[0031] The website backend server comprehensively collects user, item and interaction records, providing a solid foundation for subsequent analysis. The session is subdivided into M ordered sessions according to the preset time interval, which not only retains the time series characteristics, but also facilitates subsequent feature extraction.
[0032] The latest session is considered the current session, and the rest are historical sessions. This division helps distinguish users' immediate interests from long-term preferences, and provides a time dimension basis for personalized recommendations.
[0033] The gated graph neural network is used to model the conversation graph, and the complex relationship between items is captured through the neighboring matrix, effectively learning the conversation features of nodes (items). The position-aware attention mechanism further strengthens the influence of key items in the conversation, making the conversation feature vector more accurate.
[0034] By iteratively updating node features and combining gating mechanisms (update gate, reset gate), effective information transmission and fusion are achieved, improving the efficiency and accuracy of feature learning.
[0035] The cosine similarity is used to measure the relevance between the historical session and the current session, and the weights are normalized through the softmax function to achieve weighted fusion of historical session features. This method not only considers the overall impact of historical sessions, but also highlights the historical information most relevant to the current session.
[0036] The short-term preference (current session feature), long-term preference (historical session feature) and current intention (the feature of the last interactive item in the current session) are combined to form a comprehensive user feature vector. This fusion strategy fully considers the diversity and timeliness of user behavior and improves the personalization of recommendations.
[0037] Based on the similarity calculation between the user feature vector and the feature matrix of all items, the probability distribution of the user's interaction with each item is obtained through the softmax function. The top K items with the highest probability are selected as the recommendation results to ensure the accuracy and diversity of the recommendation.
[0038] Since both session features and historical session features are dynamically generated based on the user's most recent interaction behaviors, the recommendation results can promptly reflect changes in user preferences, improving the real-time and relevance of recommendations.
[0039] In summary, this technical solution achieves in-depth mining of user preferences and personalized recommendations through sophisticated data preprocessing, efficient conversation feature learning, comprehensive historical conversation analysis, multi-dimensional user feature fusion, and precise recommendation generation, significantly improving the accuracy of recommendations and user experience.
[0040] In yet another embodiment of the present invention, a conversation recommendation system integrating historical information is provided, which can be used to implement the above-mentioned conversation recommendation method integrating historical information. Specifically, the system includes: The data collection module is used to collect interaction records and divide the interaction records into current sessions and historical session sets; A feature vector acquisition module is used to acquire a session feature vector of each session of the current session; acquire a historical session feature vector of each session in a historical session set; and obtain a user feature vector based on the fusion of the session feature vector and the historical session feature vector; The calculation and recommendation module is used to obtain the next interaction probability based on the user feature vector and complete the recommendation.
[0041] The division of modules in the embodiments of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present invention may be integrated into one processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0042] In another embodiment of the present invention, a computer device is provided, the computer device including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in a computer storage medium to implement a corresponding method flow or a corresponding function; the processor described in the embodiment of the present invention can be used for the operation of a conversation recommendation method that integrates historical information.
[0043] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of a conversation recommendation method for integrating historical information in the above embodiment.
[0044] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0045] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0046] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0047] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0048] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A conversation recommendation method integrating historical information, characterized in that: include: Collect interaction records and divide them into current session and historical session sets; Get the session feature vector of each session in the current session; get the historical session feature vector of each session in the historical session set; The user feature vector is obtained by fusing the session feature vector and the historical session feature vector; The next interaction probability is obtained based on the user feature vector to complete the recommendation.
2. The conversation recommendation method integrating historical information according to claim 1, characterized in that: Collect interaction records and divide them into current session and historical session sets, including: The website backend server collects all users, items, and each user's item interaction records. For each user's interaction record, it is divided into M sessions according to the preset time interval. The items contained in each session are arranged in order according to the interaction time. The session with the latest interaction time is regarded as the current session. , the remaining sessions constitute the historical session set .
3. The conversation recommendation method integrating historical information according to claim 1, characterized in that: Get the session feature vector of each session of the current session, including: Any session is represented by , where l is the sequence length, Represents a session The i-th item in the session Convert to session graph , get the session graph After the neighboring matrix is obtained, a gated graph neural network is used to model it, learn the session feature vector of the node and the feature vector of the entire session, and first aggregate the messages propagated by the neighboring nodes for each node, and then fuse them with the feature vector of the previous step of the node. The feature update process of step t is as shown in formulas (3) to (7): (3) (4) (5) (6) (7) In the formula, ,in is the total number of items in the current session, and Represent adjacent order matrices and Midpoint The corresponding line, and is the parameter vector that needs to be updated during the model training process, , , , , , , , is the parameter matrix that needs to be updated during the model training process. and represent the update gate and reset gate respectively, Represents a merge operation. Representation Node The vector representation at step t; All nodes in the session are updated simultaneously, and after T steps of iterative updates, the session feature vector of each item in the session can be obtained. ; After obtaining the session feature vectors of all items in the session, they are input into the position-aware attention mechanism to obtain the feature vector of the entire session. The session feature vector It is fused with the vector representation of the location, as shown in formula (8): (8) In the formula, represents the inverse position matrix, is the vector representation of position l+1-j. Items close to the last position are more important for the session representation. is a trainable vector, and are the parameter matrices and vectors that need to be updated during the model training process; the attention mechanism shown in formula (9) is used to calculate the item The weight factor of the feature when generating the entire session feature: (9) In the formula, , and are the parameter matrices and vectors that need to be updated during the model training process. is a sigmoid function. After finding the weight factors of all items, the softmax function shown in formula (10) is used for normalization: (10) Get Items The normalized weight factor ; After obtaining the conversation feature vectors of all items and the corresponding normalized weight factors, the conversation feature vectors are fused using formula (11) to obtain the entire conversation feature vector The eigenvector of: (11)。 4. The conversation recommendation method integrating historical information according to claim 3, characterized in that: Get the graph ,if and adjacent, and the user first Interact with Interaction, then There is an edge in arrive for Relationship and arrive for Relationship, expressed as and , using the neighboring matrix and The relationships are stored separately as and The weights between adjacent nodes are: (1) (2) in, and Respectively shown in Figure China-Israel Node As the starting point, the relationship is and The set of neighbor nodes of and Respectively represent the edge and In the figure The number of times it appears in and Respectively and The i-th node in To the jth node The weight of .
5. The conversation recommendation method integrating historical information according to claim 3, characterized in that: Get the historical session feature vector of each session in the historical session set, including: For each user's historical session collection With the current session First, use formula (12) to calculate the historical session With the current session The cosine similarity between: (12) In the formula, It is a historical session The characteristic vector of Is the current session Then the similarity is normalized using the softmax function described in formula (13): (13) In the formula, Indicates that when calculating the entire historical session features Finally, we use formula (14) to perform a weighted sum on the feature vectors of all historical sessions to obtain the feature vector of the entire historical session: (15)。 6. The conversation recommendation method integrating historical information according to claim 1, characterized in that: The user feature vector is obtained by fusing the session feature vector and the historical session feature vector, including: The current session feature vector and the historical session feature vector reflect the user's short-term and long-term preferences respectively, and the last interacted item in the current session can best reflect his current intention. The user's short-term preference, long-term preference and current intention are fused using formula (16) to obtain the user's final feature vector: (16) In the formula, is the feature vector of the user’s current session, is the feature vector of its historical session, is the feature vector of the last interaction item in the current session.
7. The method for recommending conversations by integrating historical information according to claim 6, characterized in that: The next interaction probability is obtained based on the user feature vector to complete the recommendation, including: After obtaining the user's feature vector, calculate the rating of all items according to formula (17): (17) In the formula, The feature matrix representing all items is the initial feature representation of items in the internal session encoding module. is the feature vector of the i-th item, and then the softmax function is used to normalize the score to obtain the probability of the user interacting with the i-th item at the next moment: (18) Get the probability vector of interacting with all items Finally, the top K items with the highest probability are recommended to the user.
8. A conversation recommendation system integrating historical information, characterized in that: include: The data collection module is used to collect interaction records and divide the interaction records into current sessions and historical session sets; A feature vector acquisition module is used to acquire a session feature vector of each session of the current session; acquire a historical session feature vector of each session in a historical session set; and obtain a user feature vector based on the fusion of the session feature vector and the historical session feature vector; The calculation and recommendation module is used to obtain the next interaction probability based on the user feature vector and complete the recommendation.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the conversation recommendation method integrating historical information as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a conversation recommendation method integrating historical information as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Session recommendation method and system, electronic equipment and storage medium
CN120372096A
Conversation recommendation method, system, electronic device and storage medium
CN120372096B