A session recommendation method, device and equipment and computer storage medium
By combining hypergraph neural networks and multilayer self-attention networks with graph attention networks, the problem of low recommendation accuracy in conversational recommendation systems is solved, achieving more efficient recommendation results.
Patent Information
- Application Number
- CN202211374962.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-11-04
AI Technical Summary
Existing conversational recommendation systems suffer from low recommendation accuracy, especially those based on nearest-item methods, Markov chain methods, deep learning methods, and graph neural networks, which are insufficient in recommendation performance.
Hypergraph neural networks and multilayer self-attention networks are used to learn features of the item set. Graph attention networks are combined to obtain interest patterns between different sessions. Recommendation results are optimized by calculating recommendation scores and loss functions.
This improves the accuracy of the recommendation system by fully utilizing the correlation between item features and conversations, thereby enhancing the recommendation effect.
Smart Images

Figure CN115617969B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of conversation recommendation, in particular to a conversation recommendation method, device, equipment and computer storage medium. BACKGROUND
[0002] With the development of the Internet, the recommendation system has become an important method to help users obtain effective information, and is playing an important role in consumption, service and decision making. At present, most of the recommendation systems are based on the browsing information such as the browsing records of users to make recommendations, but many users often use anonymous login when browsing information, which makes the existing recommendation system unable to accurately obtain the information of the users, resulting in a decrease in the accuracy of the recommendations. In order to solve the above problems, a new recommendation system, i.e. a conversation recommendation system, is generated.
[0003] The conversation recommendation system uses the session data generated by the user in the process of browsing information to mine and learn the preferences of the user. Each session contains multiple "user-item interaction behaviors" occurring in a continuous time period, for example, a user purchases a basket of goods in a transaction session (such as from logging into an account of an e-commerce platform to logging out of the account within a period of time). The session-based recommendation system (also referred to as the conversation recommendation system in this paper) takes each session as the most basic input data unit, and can capture the short-term preferences of the user from the recently generated session of the user, thereby making more accurate and real-time recommendations.
[0004] At present, most of the conversation recommendation systems mainly include a conversation recommendation method based on a neighboring item method, a conversation recommendation method based on a Markov chain, a conversation recommendation method based on deep learning, and a conversation recommendation method based on a graph neural network. Among them: (1) the conversation recommendation method based on the neighboring item method calculates the similar sessions to the current session through the co-occurring items, but this method only makes recommendations according to the last item of the session, and the recommendation accuracy is low; (2) the conversation recommendation method based on the Markov chain predicts the next behavior by predicting the last behavior of the user, but such strict time sequence dependence is not good for the recommendation task; (3) the conversation recommendation method based on deep learning ignores the information between items and sessions, resulting in poor effect; (4) the conversation recommendation method based on the graph neural network is difficult to directly learn the interest patterns between different sessions. It can be seen that the existing conversation recommendation methods have the disadvantage of poor recommendation effect. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a conversation recommendation method, device, equipment and computer storage medium, which has the advantage of high recommendation accuracy.
[0006] The technical solution adopted by the present application is as follows:
[0007] A session recommendation method, comprising:
[0008] S1: obtaining an item set and a session set, the session set comprising a plurality of sessions, each of the sessions comprising at least part of the items in the item set;
[0009] S2: obtaining a first feature matrix of the item set, and performing hypergraph convolution processing on the first feature matrix of the item set by using a hypergraph neural network of the item set to obtain a second feature matrix of the item set;
[0010] S3: inputting the second feature matrix of the item set into a multi-layer self-attention network for learning to obtain a first feature matrix of the session set;
[0011] S4: constructing a graph attention network by using the session set, and inputting the first feature matrix of the session set into the graph attention network for learning to obtain a second feature matrix of the session set;
[0012] S5: calculating a recommendation score of each item by using the second feature matrix of the item set and the second feature matrix of the session set, and calculating a loss function by using the recommendation score of each item and a recommendation true value;
[0013] S6: determining whether the loss function meets a loss threshold value, and repeating steps S2-S5 until the loss function meets the loss threshold value, and taking an item with a recommendation score greater than a recommendation threshold value as a recommendation result if the loss function does not meet the loss threshold value.
[0014] Further, step S2 comprises:
[0015] S21: obtaining a first feature matrix of the item set , wherein: is the number of items, denotes the i-th item, denotes the first feature vector of the item .
[0016] S22: constructing a hypergraph neural network by using the item set , wherein: is a set of nodes in the hypergraph neural network, is a set of hyperedges in the hypergraph neural network, is a weight matrix of the hyperedge;
[0017] S23: performing hypergraph convolution processing on the first feature matrix of the item set by using the hypergraph neural network . performing hypergraph convolution processing to obtain a second feature matrix of the item set . .
[0018] Further, the step S23 comprises:
[0019] S231: obtaining an incidence matrix of the hypergraph neural network , and , and when , , wherein: ;
[0020] S232: calculating a degree matrix of nodes and a degree matrix of hyperedges in the hypergraph neural network using the incidence matrix , and , and , wherein: , ;
[0021] S233: calculating a second feature matrix of the item set using the degree matrix of nodes , the degree matrix of hyperedges , the incidence matrix , and a weight matrix of hyperedges , and the calculation formula is: wherein: is a feature of the i-th layer of the hypergraph neural network, is a feature of the j-th layer of the hypergraph neural network, is a weight matrix of the i-th layer of the hypergraph neural network.
[0022] Further, the step S3 comprises:
[0023] S31: obtaining a third feature matrix of the item set using the second feature matrix of the item set , and wherein: denotes a third feature vector of the item , , , , , , is a feature conversion matrix, The latitude, with a value of 100;
[0024] S32: Confirm the session The third feature vector of the last item As the first feature vector of this session The session set is obtained. First characteristic matrix ,in: .
[0025] Further, step S4 includes:
[0026] S41: Utilizing Session Collections Construct a graph attention network, wherein the graph attention network includes multiple nodes, wherein: Indicates the first One session, Indicates the number of sessions;
[0027] S42: Transfer the session set The first characteristic matrix The graph attention network is input to perform graph attention learning, and the session set is obtained. The second characteristic matrix .
[0028] Further, step S42 includes:
[0029] S421: Calculate the similarity between any two nodes in the graph neural network. ,and ,in: Use a random initialization vector; For the graph, note the set of adjacent nodes in the network; , Representing sessions , The first eigenvector; ; For activation functions;
[0030] S422: Utilize the graph to observe the similarity between any two nodes in the network. and the session set The first characteristic matrix Calculate the session set The second characteristic matrix ,and ,in: For activation function, , Representing sessions The first and second eigenvectors; This is the characteristic transformation matrix.
[0031] Further, step S5 includes:
[0032] S51: Utilizing the second feature vector of each session and the second feature vector of each item Calculate the recommended score for each item. ,and ;
[0033] S52: Utilize the recommended score for each item Calculate the recommendation score loss function ,and ,in: For items The true value of is either 0 or 1.
[0034] The present invention also discloses a conversation recommendation device, comprising:
[0035] The first acquisition module is used to acquire an item set and a session set, wherein the session set includes multiple sessions, and each session includes at least a portion of the items in the item set;
[0036] The second acquisition module is used to acquire the first feature matrix of the item set, and to perform hypergraph convolution processing on the first feature matrix of the item set using the hypergraph neural network of the item set to obtain the second feature matrix of the item set.
[0037] The third acquisition module inputs the second feature matrix of the item set into a multi-layer self-attention network for learning and outputs the first feature matrix of the conversation set.
[0038] The fourth acquisition module is used to construct a graph attention network using the session set, and input the first feature matrix of the session set into the graph attention network for learning to obtain the second feature matrix of the session set;
[0039] The calculation module is used to calculate the recommendation score of each item using the second feature matrix of the item set and the second feature matrix of the session set, and to calculate the loss function using the recommendation score and the true recommendation value of each item;
[0040] The determination module is used to determine whether the loss function meets the loss threshold, and when the loss function meets the loss threshold, items with a recommendation score greater than the recommendation threshold are used as recommendation results.
[0041] The present invention also discloses a conversation recommendation device, comprising:
[0042] processor;
[0043] a memory for storing a computer program executed by the processor;
[0044] The processor implements the session recommendation method of the present application when executing the computer program.
[0045] The present application also discloses a computer readable storage medium, characterized in that a computer program is stored thereon, and the computer program is executed to implement the session recommendation method of the present application.
[0046] Compared with the prior art, the present application has the following beneficial effects:
[0047] The session recommendation method disclosed by the present application can learn the feature information in the item set and the importance of each item in each session through the hypergraph neural network and the multi-layer self-attention network, and can obtain the interest mode between different sessions through the graph attention network, so as to fully utilize the features of the items and the correlation between different sessions, thereby improving the recommendation effect.
[0048] In order to better understand and implement the present application, the present application will be described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 The flow chart of the session recommendation method in an embodiment of the present application;
[0050] Figure 2 The flow chart of the session recommendation method in an embodiment of the present application; Figure 1
[0051] Figure 3 The schematic diagram of the hypergraph neural network;
[0052] Figure 4 The schematic diagram of the graph attention network;
[0053] Figure 5 The structural schematic diagram of the session recommendation device in an embodiment of the present application;
[0054] In each figure, the reference signs are as follows:
[0055] 1, first obtaining module; 11, article set obtaining unit; 12, conversation set obtaining unit; 2, second obtaining module; 21, first article feature matrix obtaining unit; 22, hypergraph neural network creating unit; 23, correlation matrix obtaining unit; 24, degree matrix obtaining unit; 25, second article feature matrix obtaining unit; 3, third obtaining module; 4, fourth obtaining module; 41, graph attention network constructing unit; 42, similarity calculation unit; 43, conversation feature matrix obtaining unit; 5, calculation module; 51, recommendation score calculation unit; 52, loss function calculation unit; 6, determination module; 61, judgment unit; 62, determination unit. DETAILED DESCRIPTION
[0056] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0057] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein means and includes any or all possible combinations of one or more associated listed items.
[0058] The following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not necessarily describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0059] In addition, in the description of the present application, "multiple" means two or more, unless otherwise specified. "And / or" describes the association between the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship.
[0060] It should be understood that the embodiments of this application are not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from their scope. The scope of the embodiments of this application is limited only by the appended claims.
[0061] Reference Figure 1 and Figure 2 This embodiment provides a session recommendation method, which includes the following steps:
[0062] S1: Obtain an item set and a session set, wherein the session set includes multiple sessions, and each session includes at least a portion of the items in the item set. In this embodiment, the item set... for: , The quantity of items; the session set for: , The number of sessions.
[0063] S2: Obtain the first feature matrix of the item set, and use the hypergraph neural network of the item set to perform hypergraph convolution on the first feature matrix of the item set to obtain the second feature matrix of the item set.
[0064] In this embodiment, step S2 is implemented through the following steps:
[0065] (1) Obtain the set of items in a random manner. In this embodiment, let the first feature vector be... Represents the set of items The first eigenvector, and , The number of items. Indicates the first One item, Represents items The first eigenvector.
[0066] (2) Reference Figure 3 Using a collection of items Building Hypergraph Neural Networks ,in: It is a collection of nodes in a hypergraph neural network. It is the set of hyperedges in a hypergraph neural network. Let be the weight matrix of the hyperedge.
[0067] (3) Using the hypergraph neural network For the set of items First characteristic matrix Perform hypergraph convolution to obtain the set of items. The second characteristic matrix And the set of items The second characteristic matrix The hypergraph neural network is obtained through the following method: 1) Obtaining the hypergraph neural network. correlation matrix ,and , and when hour, ,in: For nodes in the hypergraph neural network. 1) The hyperedge in the hypergraph neural network; 2) Using the correlation matrix Calculate the hypergraph neural network Degree matrix of middle nodes degree matrix of hyperedge ,and , ,in: , 3) Utilize the degree matrix of the nodes The degree matrix of hyperedges Correlation matrix and the weight matrix of the hyperedge Calculate the set of items The second characteristic matrix And the calculation formula is: ,in: For the hypergraph neural network of the first generation Features of the layer For the hypergraph neural network of the first generation Features of the layer The hypergraph neural network is the first Layer weight matrix.
[0068] S3: Input the second feature matrix of the item set into a multi-layer self-attention network for learning to obtain the first feature matrix of the conversation set.
[0069] In this embodiment, firstly, the item set is used. The second characteristic matrix Obtain the aforementioned item set The third characteristic matrix ,and ,in: Represents items The third eigenvector, , and All are feature transformation matrices. For vectors The latitude, with a value of 100; then, the session... The third feature vector of the last item As the first feature vector of this session The session set is obtained. First characteristic matrix ,in: .
[0070] S4: Construct a graph attention network using the session set, and input the first feature matrix of the session set into the graph attention network for learning to obtain the second feature matrix of the session set.
[0071] In this embodiment, step S4 is implemented through the following steps:
[0072] (1) Reference Figure 4 Using session collections Construct a graph attention network, wherein the graph attention network includes multiple nodes, wherein: Indicates the first One session, Indicates the number of sessions.
[0073] (2) The session set First characteristic matrix The graph attention network is input to perform graph attention learning, and the session set is obtained. The second characteristic matrix And the session set The second characteristic matrix This is obtained by: 1) calculating the similarity between any two nodes in the graph neural network. ,and ,in: Use a random initialization vector; Note the set of adjacent nodes in the network for the graph. , Representing sessions , The first eigenvector; ; 1) Activation function; 2) Utilize the similarity between any two nodes in the graph attention network. and the session set First characteristic matrix Calculate the session set The second characteristic matrix ,and ,in: For activation function, , Representing sessions The first and second eigenvectors; is a feature conversion matrix.
[0074] S5: calculating a recommendation score of each item by using the second feature matrix of the item set and the second feature matrix of the session set, and calculating a loss function by using the recommendation score of each item and a recommendation true value.
[0075] In the embodiment, step S5 comprises the following steps: (1) calculating a recommendation score of each item by using the second feature vector of each session and the second feature vector of each item , and ; (2) calculating a loss function of the recommendation score by using the recommendation score of each item , and , wherein: is a true value of the item , and the value is 0 or 1.
[0076] S6: judging whether the loss function meets a loss threshold value, and repeating steps S2-S5 until the loss function meets the loss threshold value, and taking an item with a recommendation score greater than a recommendation threshold value as a recommendation result.
[0077] In order to verify the recommendation effect of the session recommendation method, the application takes the data of two data sets Yoochoose1 / 4 and Diginetica as examples, and uses the parameters P@20 and MRR@20 to evaluate the recommendation effects of the session recommendation method, POP, Item-KNN, GRU4REC, NARM, STAMP, SR-GNN and other recommendation methods, and the test data is shown in Table 1.
[0078] Table 1
[0079]
[0080] In Table 1, the parameter (Precision) represents the proportion of the correct recommended items in the total number of recommendations in the first 20 recommended items, and the calculation formula is: , wherein: is the correct recommended item in the first 20 recommended items; is the total number of recommendations; (Mean Reciprocal Rank) is the cumulative summation of the reciprocal of the rank of the correct recommended item, and represents the ranking of the first 20 recommended items in the range, and the calculation formula is: , wherein: indicates the number of correct items in the top 20 recommended items; indicates the item ranking in the recommendation list, indicates the total number of items.
[0081] As can be seen from Table 1, the accuracy of the recommendation result of the conversation recommendation method is high, because the conversation recommendation method first learns the information between items by using a hypergraph neural network, then aggregates the information between items by using a self-attention network, and finally learns the information between conversations by using a graph attention network. Through the mutual combination of the hypergraph neural network, the multi-layer self-attention network and the graph attention network, the features of the items, the association between the items and the association between the conversations can be fully utilized to achieve the purpose of improving the recommendation accuracy.
[0082] Based on the conversation recommendation method provided in this embodiment, the embodiment further provides a conversation recommendation device, which comprises:
[0083] A first acquisition module 1 is configured to acquire an item set and a conversation set, wherein the conversation set comprises a plurality of conversations, and each conversation comprises at least part of the items in the item set.
[0084] In this embodiment, the first acquisition module 1 comprises an item set acquisition unit 11 and a conversation set acquisition unit 12. The item set acquisition unit 11 is configured to acquire the item set, and the item set is: , the number of items; and the conversation set acquisition unit 12 is configured to acquire the conversation set, and the conversation set is: , the number of conversations.
[0085] A second acquisition module 2 is configured to acquire a first feature matrix of the item set, and perform hypergraph convolution processing on the first feature matrix of the item set by using a hypergraph neural network of the item set to obtain a second feature matrix of the item set.
[0086] In this embodiment, the second acquisition module 2 comprises a first item feature matrix acquisition unit 21, a hypergraph neural network creation unit 22, an association feature matrix acquisition unit 23, a degree matrix acquisition unit 24 and a second item feature matrix acquisition unit 25. The first item feature matrix acquisition unit 21 obtains the first feature vectors of the item set in a random manner. In this embodiment, let indicate the first feature vectors of the item set , and , The number of items, represents the first item, represents the first feature vector of the item ; (2) the hypergraph neural network creation unit 22 constructs a hypergraph neural network using the item set , wherein: is a set of nodes in the hypergraph neural network, is a set of hyperedges in the hypergraph neural network, is a weight matrix of the hyperedge; (3) the correlation matrix acquisition unit 23 is configured to acquire the correlation matrix of the hypergraph neural network , and , and when , , wherein: is a node in the hypergraph neural network, is a hyperedge in the hypergraph neural network; (4) the degree matrix acquisition unit 24 calculates the degree matrix of the nodes and the degree matrix of the hyperedges in the hypergraph neural network using the correlation matrix , and , , wherein: , ; (5) the second item feature matrix acquisition unit 25 calculates the second feature matrix of the item set using the degree matrix of the nodes , the degree matrix of the hyperedges , the correlation matrix , and the weight matrix of the hyperedge , and the calculation formula is: , wherein: is the feature of the layer of the hypergraph neural network, is the feature of the layer of the hypergraph neural network, is the weight matrix of the layer of the hypergraph neural network;
[0087] The third acquisition module 3 inputs the second feature matrix of the item set into a multi-layer self-attention network for learning, and outputs the first feature matrix of the session set.
[0088] In this embodiment, the third acquisition module 3 inputs the second feature matrix of the item set into a multilayer self-attention network for learning to obtain the first feature matrix of the conversation set. The specific process is as follows: First, using the item set... The second characteristic matrix Obtain the aforementioned item set The third characteristic matrix ,and ,in: Represents items The third eigenvector, , and All are feature transformation matrices. For vectors The latitude, with a value of 100; then, the session... The third feature vector of the last item As the first feature vector of this session The session set is obtained. The first characteristic matrix ,in: .
[0089] The fourth acquisition module 4 is used to construct a graph attention network using the session set, and input the first feature matrix of the session set into the graph attention network for learning to obtain the second feature matrix of the session set.
[0090] In this embodiment, the fourth acquisition module 4 includes a graph attention network construction unit 41, a similarity calculation unit 42, and a session feature matrix acquisition unit 43, wherein: (1) the graph attention network construction unit 41 utilizes a session set Construct a graph attention network, wherein the graph attention network includes multiple nodes, wherein: Indicates the first One session, (2) The similarity calculation unit 42 is used to calculate the similarity between any two nodes in the graph neural network. ,and ,in: Use a random initialization vector; Note the set of adjacent nodes in the network for the graph. , Representing sessions , The first eigenvector; ; The activation function is (3) the session feature matrix acquisition unit 42 uses the similarity between any two nodes in the graph attention network. and the session set The first characteristic matrix Calculate the session set The second characteristic matrix ,and ,in: For activation function, , Representing sessions The first and second eigenvectors; This is the characteristic transformation matrix.
[0091] The calculation module 5 is used to calculate the recommendation score of each item using the second feature matrix of the item set and the second feature matrix of the session set, and to calculate the loss function using the recommendation score and the true recommendation value of each item.
[0092] In this embodiment, the calculation module 5 includes a recommendation score calculation unit 51 and a loss function calculation unit 52, wherein: (1) the recommendation score calculation unit 51 utilizes the second feature vector of each session. and the second feature vector of each item Calculate the recommended score for each item. ,and (2) The loss function calculation unit 52 uses the recommendation score of each item. Calculate the recommendation score loss function ,and ,in: For items The true value of is either 0 or 1.
[0093] The determination module 6 is used to determine whether the loss function meets the loss threshold, and when the loss function meets the loss threshold, items with a recommendation score greater than the recommendation threshold are used as recommendation results.
[0094] In this embodiment, the determining module 6 includes a judging unit 61 and a determining unit 62, wherein: (1) the judging unit 61 is used to judge whether the loss function satisfies the loss threshold; (2) when the judging unit 61 judges that the loss function satisfies the loss threshold, the determining unit 62 takes the item with the recommendation score greater than the recommendation threshold as the recommendation result.
[0095] Based on the session recommendation method provided in this embodiment, this embodiment also provides a session recommendation device. The session recommendation device can be a server, a desktop computing device, or a mobile computing device (e.g., a laptop, a handheld computing device, a tablet computer, a netbook, etc.), etc., and includes:
[0096] processor;
[0097] a memory for storing a computer program executed by the processor;
[0098] The processor implements the session recommendation method according to the embodiments when executing the computer program.
[0099] Based on the session recommendation method provided in the embodiments, the embodiments further provide a computer readable storage medium, which stores a computer program and the computer program is executed to implement the session recommendation method according to the embodiments.
[0100] The present application can adopt the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD ROM, optical storage, etc.) containing program codes. The computer usable storage media includes permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0101] The above embodiments only express the preferred embodiments of the present application, which are described in detail and specifically, but should not be understood as a limitation to the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, and the present application also intends to include these modifications and improvements.
Claims
1. A conversation recommendation method, characterized in that, include: S1: Obtain an item set and a session set, wherein the session set includes multiple sessions, and each session includes at least a portion of the items in the item set; S2: Obtain the first feature matrix of the item set, and use the hypergraph neural network of the item set to perform hypergraph convolution processing on the first feature matrix of the item set to obtain the second feature matrix of the item set; S3: Input the second feature matrix of the item set into a multi-layer self-attention network for learning to obtain the first feature matrix of the conversation set; S4: Construct a graph attention network using the session set, and input the first feature matrix of the session set into the graph attention network for learning to obtain the second feature matrix of the session set; S5: Calculate the recommendation score for each item using the second feature matrix of the item set and the second feature matrix of the session set, and calculate the loss function using the recommendation score and the true recommendation value of each item; S6: Determine whether the loss function meets the loss threshold. If not, repeat steps S2-S5 until the loss function meets the loss threshold, and use items with recommendation scores greater than the recommendation threshold as recommendation results.
2. The conversation recommendation method according to claim 1, characterized in that, Step S2 includes: S21: Obtain Item Collection The first characteristic matrix ,in: The number of items. Indicates the first One item, Represents items The first eigenvector; S22: Utilizing item collections Building Hypergraph Neural Networks ,in: It is a collection of nodes in a hypergraph neural network. It is the set of hyperedges in a hypergraph neural network. Let be the weight matrix of the hyperedge; S23: Utilizing the hypergraph neural network For the set of items The first characteristic matrix Perform hypergraph convolution to obtain the set of items. The second characteristic matrix .
3. The conversation recommendation method according to claim 2, characterized in that, Step S23 includes: S231: Obtain the hypergraph neural network Correlation matrix ,and , and when hour, ,in: For nodes in the hypergraph neural network, The hyperedge in the hypergraph neural network; S232: Using the aforementioned correlation matrix Calculate the hypergraph neural network Degree matrix of middle nodes degree matrix of hyperedge ,and , ,in: , ; S233: Utilizing the degree matrix of nodes The degree matrix of hyperedges Correlation matrix and the weight matrix of the hyperedge Calculate the set of items The second characteristic matrix And the calculation formula is: ,in: For the hypergraph neural network of the first generation Features of the layer For the hypergraph neural network of the first generation Features of the layer The hypergraph neural network is the first Layer weight matrix.
4. The conversation recommendation method according to claim 3, characterized in that, Step S3 includes: S31: Utilize the aforementioned item set The second characteristic matrix Obtain the aforementioned item set The third characteristic matrix ,and ,in: Represents items The third eigenvector, , and All are feature transformation matrices. For vectors The latitude, with a value of 100; S32: Confirm the session The third feature vector of the last item As the first feature vector of this session The session set is obtained. The first characteristic matrix ,in: .
5. The conversation recommendation method according to claim 4, characterized in that, Step S4 includes: S41: Utilizing Session Collections Construct a graph attention network, wherein the graph attention network includes multiple nodes, wherein: Indicates the first One session, Indicates the number of sessions; S42: Transfer the session set The first characteristic matrix The graph attention network is input to perform graph attention learning, and the session set is obtained. The second characteristic matrix .
6. The conversation recommendation method according to claim 5, characterized in that, Step S42 includes: S421: Calculate the similarity between any two nodes in the graph neural network. ,and ,in: Use a random initialization vector; For the graph, note the set of adjacent nodes in the network; , Representing sessions , The first eigenvector; ; For activation functions; S422: Utilize the graph to observe the similarity between any two nodes in the network. and the session set The first characteristic matrix Calculate the session set The second characteristic matrix ,and ,in: For activation function, , Representing sessions The first and second eigenvectors; This is the characteristic transformation matrix.
7. The conversation recommendation method according to claim 6, characterized in that, Step S5 includes: S51: Utilizing the second feature vector of each session and the second feature vector of each item Calculate the recommended score for each item. ,and ; S52: Utilize the recommended score for each item Calculate the recommendation score loss function ,and ,in: For items The true value of is either 0 or 1.
8. A conversation recommendation device, characterized in that, include: The first acquisition module is used to acquire an item set and a session set, wherein the session set includes multiple sessions, and each session includes at least a portion of the items in the item set; The second acquisition module is used to acquire the first feature matrix of the item set, and to perform hypergraph convolution processing on the first feature matrix of the item set using the hypergraph neural network of the item set to obtain the second feature matrix of the item set. The third acquisition module inputs the second feature matrix of the item set into a multi-layer self-attention network and outputs the first feature matrix of the session set. The fourth acquisition module is used to construct a graph attention network using the session set, and input the first feature matrix of the session set into the graph attention network for learning to obtain the second feature matrix of the session set; The calculation module is used to calculate the recommendation score of each item using the second feature matrix of the item set and the second feature matrix of the session set, and to calculate the loss function using the recommendation score and the true recommendation value of each item; The determination module is used to determine whether the loss function meets the loss threshold, and when the loss function meets the loss threshold, items with a recommendation score greater than the recommendation threshold are used as recommendation results.
9. A conversation recommendation device, characterized in that, include: processor; Memory for storing computer programs executed by the processor; Wherein, when the processor executes the computer program, it implements the session recommendation method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed, implements the session recommendation method according to any one of claims 1-7.
Citation Information
Patent Citations
Recommendation method and device based on graph neural network, and computer equipment
CN111667067A
Time and location-based linking of captured medical information with medical records
US20210313051A1