Recommendation method, device and computer equipment based on graph neural network

Through the recommendation method based on graph neural network, conversation sequences are converted into directed graphs and attention networks to capture user interests, solve the problem of low accuracy of existing recommendation systems, and achieve more accurate and efficient item recommendations.

CN111667067BActive Publication Date: 2024-10-29SHENZHEN PING AN MEDICAL HEALTH TECHNOLOGY SERVICES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010466251.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-28
Publication Date
2024-10-29
Estimated Expiration
2040-05-28

AI Technical Summary

Technical Problem

The accuracy of existing recommendation systems is low and requires a large number of manual labels and complex rule expert systems, making it difficult to guarantee the recommendation effect.

Method used

A recommendation method based on graph neural network is adopted, by converting the conversation sequence into a directed graph, inputting it into the graph neural network to obtain the preference vector, and combining it with the attention network to capture the user's short-term and long-term interests, and calculate the comprehensive preference vector to recommend items.

Benefits of technology

It improves the accuracy of item recommendation, automates the recommendation process, reduces reliance on manual labels and rules, and enhances the efficiency of the recommendation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111667067B_ABST
    Figure CN111667067B_ABST
Patent Text Reader

Abstract

The present invention relates to artificial intelligence, and provides a recommendation method, device and computer equipment based on graph neural network. The method includes: obtaining a conversation sequence to be predicted; converting the conversation sequence to be predicted into a directed graph; inputting the directed graph into a preset target graph neural network; inputting the preference vector corresponding to each node into a preset target attention network; determining the historical preference vector corresponding to the first node according to the historical conversation sequence of the target user; obtaining the general preference vector corresponding to the first node; performing linear transformation on the overall preference vector, the general preference vector, the current preference vector and the historical preference vector to obtain a comprehensive preference vector; determining the probability values ​​corresponding to N items according to the comprehensive preference vector; and selecting the item corresponding to the maximum probability value as the recommended item. In addition, the present invention also relates to blockchain technology, and each preference vector can be stored in a blockchain node. The present invention can improve the accuracy of recommendations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence recommendation technology and also to the field of smart city technology, and in particular to a recommendation method, device and computer equipment based on graph neural network. Background Art

[0002] In order to improve the user experience, the prior art proposes a recommendation system, the purpose of which is to quickly and accurately push the information needed by the user to the user, thereby improving the speed at which the user obtains information. In the prior art recommendation method, on the one hand, it is usually based on similarity calculation, including similarity calculation of items, similarity calculation of users, similarity calculation of content, etc., to recommend items based on similarity. When describing various similarities, it is necessary to manually add a large number of tags to items, users, and content. The more tags there are, the more accurate the description of similarity is, so that the recommended items can be accurate. However, the labeling work is very huge; furthermore, the existing recommendation system often requires manual construction of complex rule expert systems based on the business needs of the product to achieve recommendation, which makes it difficult to guarantee the recommendation effect.

[0003] Therefore, the problem of low recommendation accuracy of recommendation systems in the prior art has become a technical problem that urgently needs to be solved in this field. Summary of the invention

[0004] The purpose of the present invention is to provide a recommendation method, device and computer equipment based on graph neural network to solve the technical problems in the prior art. The present invention can also be applied to the field of smart cities to realize the recommendation of relevant content in smart government affairs / smart urban management / smart communities / smart security / smart logistics / smart medical care / smart education / smart environmental protection / smart transportation scenarios.

[0005] On the one hand, to achieve the above objectives, the present invention provides a recommendation method based on graph neural network.

[0006] The recommendation method based on graph neural network includes: obtaining a conversation sequence to be predicted, wherein the conversation sequence represents N items clicked by a target user in sequence and the order of clicks; converting the conversation sequence to be predicted into a directed graph, wherein the nodes in the directed graph represent the items clicked, and the directed edges in the directed graph represent the order in which two items are clicked; inputting the directed graph into a preset target graph neural network to obtain a preference vector corresponding to each node in the directed graph, wherein the preference vector corresponding to each node includes N component values, and each component value is used to represent the relationship value of two nodes; inputting the preference vector corresponding to each node into a preset target attention network to obtain an overall preference vector corresponding to the conversation sequence to be predicted; determining a historical preference vector corresponding to the first node according to the historical conversation sequence of the target user, wherein the first node is the last node in the directed graph; obtaining a general preference vector corresponding to the first node; performing linear transformation on the overall preference vector, the general preference vector, the current preference vector and the historical preference vector to obtain a comprehensive preference vector, wherein the current preference vector is the preference vector corresponding to the first node in the directed graph; determining probability values ​​corresponding to the N items according to the comprehensive preference vector; and selecting the item corresponding to the maximum probability value as the recommended item.

[0007] Furthermore, the step of determining a historical preference vector corresponding to the first node based on the historical conversation sequence of the target user includes: converting the historical conversation sequence of the target user into a directed graph, and inputting it into the target graph neural network to obtain a preference vector table corresponding to the target user, wherein the preference vector table includes N rows, and each row includes a relationship value between a node and N nodes; adding N component values ​​of the current preference vector and the relationship values ​​between the first node and N nodes in the preference vector table respectively, and dividing by 2 to obtain N first means; determining the N first means as the historical preference vector corresponding to the first node.

[0008] Furthermore, the step of obtaining a universal preference vector corresponding to the first node includes: obtaining a preference vector table corresponding to multiple users; adding the relationship values ​​between the first node and N nodes in the preference vector table corresponding to each user respectively and dividing by the number of users to obtain N second means; and determining the N second means as the universal preference vector corresponding to the first node.

[0009] Furthermore, before the step of inputting the directed graph into a preset target graph neural network, the method also includes: determining an initial graph neural network and an initial target attention network; obtaining a training sample set, wherein the training sample set includes multiple training samples, and the training samples include conversation sequences and target items corresponding to the conversation sequences; converting the conversation sequences of the training samples into a directed graph as the input of the initial graph neural network; inputting the output of the initial graph neural network into the initial target attention network; converting the target items of the training samples into a training preference vector as the output of the initial target attention network, training the initial graph neural network and the initial target attention network, and the graph neural network obtained after the training is the target graph neural network, and the attention network obtained after the training is the target attention network, wherein, among the N component values ​​of the training preference vector, the relationship value between the target item and the target item is 1, and the relationship value between the target item and other items among the N items is 0.

[0010] Furthermore, when the session sequence to be predicted is converted into a directed graph, the number of identical click sequences is represented by the visualization features of the directed edges.

[0011] Further, the visualization feature includes the shape of the directed edge and / or the thickness of the directed edge and / or the color of the directed edge.

[0012] Furthermore, the step of determining the probability values ​​corresponding to the N items according to the comprehensive preference vector includes: inputting the comprehensive preference vector into a softmax function, wherein the output value of the softmax function is a probability value.

[0013] On the other hand, to achieve the above-mentioned purpose, the present invention provides a recommendation device based on graph neural network.

[0014] The recommendation device based on graph neural network includes: a first acquisition module, used to acquire a conversation sequence to be predicted, wherein the conversation sequence represents N items clicked by the target user in sequence and the order of the clicks; a first processing module, used to convert the conversation sequence to be predicted into a directed graph, wherein the nodes in the directed graph represent the items clicked, and the directed edges in the directed graph represent the order in which two items are clicked; a first input module, used to input the directed graph into a preset target graph neural network to obtain a preference vector corresponding to each node in the directed graph, wherein the preference vector corresponding to each node includes N component values, and each component value is used to represent the relationship value between two nodes; a second input module, used to input the preference vector corresponding to each node into a preset target attention network; network to obtain the overall preference vector corresponding to the conversation sequence to be predicted; a first determination module, used to determine the historical preference vector corresponding to the first node according to the historical conversation sequence of the target user, wherein the first node is the last node in the directed graph; a second acquisition module, used to obtain the general preference vector corresponding to the first node; a second processing module, used to linearly transform the overall preference vector, the general preference vector, the current preference vector and the historical preference vector to obtain a comprehensive preference vector, wherein the current preference vector is the preference vector corresponding to the first node in the directed graph; a second determination module, used to determine the probability values ​​corresponding to N items according to the comprehensive preference vector; and a third determination module, used to select the item corresponding to the maximum probability value as the recommended item.

[0015] Furthermore, the first determination module includes: a processing unit, used to convert the historical conversation sequence of the target user into a directed graph, and input it into the target graph neural network to obtain a preference vector table corresponding to the target user, wherein the preference vector table includes N rows, and each row includes a relationship value between a node and N nodes; a first calculation unit, used to add the N component values ​​of the current preference vector and the relationship values ​​between the first node and N nodes in the preference vector table, respectively, and then divide by 2 to obtain N first means; a first determination unit, used to determine the N first means as historical preference vectors corresponding to the first node.

[0016] Furthermore, the second acquisition module includes: an acquisition unit, used to obtain a preference vector table corresponding to multiple users; a second calculation unit, used to add the relationship values ​​of the first node and N nodes in the preference vector table corresponding to each user, respectively, and then divide the sum by the number of users to obtain N second means; a second determination unit, used to determine that the N second means are the general preference vectors corresponding to the first node.

[0017] Furthermore, the device also includes a pre-training module, wherein the pre-training module is used to perform the following steps: determine an initial graph neural network and an initial target attention network; obtain a training sample set, wherein the training sample set includes multiple training samples, and the training samples include a conversation sequence and a target item corresponding to the conversation sequence; convert the conversation sequence of the training sample into a directed graph as the input of the initial graph neural network; input the output of the initial graph neural network to the initial target attention network; convert the target item of the training sample into a training preference vector as the output of the initial target attention network, train the initial graph neural network and the initial target attention network, and the graph neural network obtained after the training is the target graph neural network, and the attention network obtained after the training is the target attention network, wherein, among the N component values ​​of the training preference vector, the relationship value between the target item and the target item is 1, and the relationship value between the target item and other items among the N items is 0.

[0018] To achieve the above objectives, the present invention also provides a computer device, including 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 above method when executing the computer program.

[0019] To achieve the above objectives, the present invention also provides a computer-readable storage medium, including a data storage area and a program storage area, the data storage area stores data created according to the use of the blockchain node, and the program storage area stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0020] The recommendation method, device and computer device based on graph neural network provided by the present invention predict and recommend the next item that the target user may click on according to the conversation sequence, wherein the conversation sequence to be predicted is converted into a directed graph and input into a preset target graph neural network to obtain the preference vector corresponding to each node in the directed graph, and then each preference vector is input into a preset target attention network to obtain an overall preference vector, and then the overall preference vector, the general preference vector, the current preference vector and the historical preference vector are linearly transformed to obtain a comprehensive preference vector, and finally the probability value corresponding to each item is determined according to the comprehensive preference vector, and the item corresponding to the maximum probability value is used as the recommended item. It can be seen that through the present invention, the conversation sequence is converted into a directed graph, and the directed graph is used as the input of the neural network for deep learning, which is convenient for the system to extract the implicit information between the items, and then the attention network architecture model is used to capture the user's short-term interests to obtain a comprehensive preference vector. More importantly, in addition to the comprehensive preference vector, the general preference vector, the current preference vector and the historical preference vector are also considered, so as to achieve a vector representation that captures the coexistence of long-term interests and short-term interests, making the item recommendation more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a recommendation method based on a graph neural network provided in Example 1 of the present invention;

[0022] Figure 2 A block diagram of a recommendation device based on a graph neural network provided in Embodiment 2 of the present invention;

[0023] Figure 3 This is a hardware structure diagram of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0025] In order to improve the recommendation effect of the recommendation system, the present invention provides a recommendation method, device and computer equipment based on graph neural network. In the recommendation method, the item that the user may click next can be recommended according to the user's current conversation sequence. Specifically, the conversation sequence to be predicted is first obtained, wherein the conversation sequence to be predicted represents N items clicked in sequence by the target user and the order of clicks, and then the conversation sequence to be predicted is converted into a directed graph, wherein the nodes in the directed graph represent the clicked items, and the directed edges in the directed graph represent the order in which two items are clicked, and then the directed graph is input into a preset target graph neural network model, the input of the target graph neural network model is a directed graph, and the output is a preference vector corresponding to each node in the directed graph. After obtaining the preference vectors corresponding to each node through the target graph neural network, each preference vector is input into the preset target attention network. The input of the target attention network is the above-mentioned multiple preference vectors, and the output is the overall preference vector. Therefore, by inputting the preference vectors corresponding to each node into the target attention network, the overall preference vector corresponding to the conversation sequence to be predicted can be obtained, and then the general preference vector and the historical preference vector corresponding to the last node in the directed graph are obtained. The overall preference vector, the general preference vector, the current preference vector (that is, the preference vector corresponding to the last node) and the historical preference vector are linearly transformed to obtain a comprehensive preference vector. The probability values ​​corresponding to N items are determined according to the comprehensive preference vector, and the item corresponding to the maximum probability value is selected as the recommended item. Through the present invention, the relationship between items and the items that are clicked successively is represented by a directed graph, and the directed graph is used as the input of the graph neural network. The relationship between nodes in the directed graph is deeply learned, so that it is convenient for the system to extract implicit information between items and can better mine the rich conversion characteristics of items. After each item is represented by a preference vector, an attention network architecture model is further used to capture the user's short-term interest. Finally, the general preference vector, the historical preference vector and the current preference vector are combined to achieve a vector representation that captures the coexistence of long-term and short-term interests, thereby improving the accuracy of item recommendations.

[0026] The specific implementation of the graph neural network-based recommendation method, apparatus, and computer device provided by the present invention will be described in detail below.

[0027] Embodiment 1

[0028] Embodiment 1 of the present invention provides a recommendation method based on a graph neural network. By this method, a general preference vector, a current preference vector, and a historical preference vector are considered at the same time, so as to achieve a vector representation that captures the coexistence of long-term interests and short-term interests, and can improve the accuracy of item recommendations. Specifically, Figure 1 This is a flowchart of a recommendation method based on a graph neural network provided in Example 1 of the present invention, such as Figure 1As shown, the recommendation method based on graph neural network provided in this embodiment includes the following steps S101 to S109.

[0029] Step S101: Obtain a conversation sequence to be predicted.

[0030] The session sequence to be predicted represents the N items clicked by the target user in sequence and the order in which they are clicked.

[0031] For example, the conversation sequence to be predicted involves seven items, namely V1, V2, V3, V4, V5, V6 and V7, displayed in the application, where V1 to V7 respectively identify different items, and the seven items are clicked by the target user in the order of V3, V4, V1, V5, V6, V7, V2, V4, V6, V5 and V4.

[0032] Step S102: converting the conversation sequence to be predicted into a directed graph.

[0033] The nodes in the directed graph represent the items that are clicked, and the directed edges in the directed graph represent the order in which two items are clicked. When the conversation sequence involves N items, the directed graph correspondingly includes N nodes, and the order in which the items are clicked included in the conversation sequence is converted into directed edges between the N nodes in the directed graph.

[0034] For example, after converting the above conversation sequence into a directed graph, the directed graph includes 7 nodes and 10 directed edges, among which the first directed edge is the edge from the node corresponding to V3 to the node corresponding to V4, the second directed edge is the edge from the node corresponding to V4 to the node corresponding to V1, and similarly, the tenth directed edge is the edge from the node corresponding to V5 to the node corresponding to V4.

[0035] Optionally, when converting the conversation sequence into a directed graph, the number of identical click sequences can be represented by the visual features of the directed edges. For example, if there are two or more clicks on V4 followed by a click on V1 in a conversation sequence, the visual features of the directed edge from the node corresponding to V4 to the node corresponding to V1 are represented by 2. The visual features can be the shape of the directed edge (e.g., dotted line, straight line, or wavy line), the thickness of the directed edge, or the color of the directed edge, so that the directed graph can more comprehensively reflect the characteristics of the conversation sequence.

[0036] Step S103: Input the directed graph into a preset target graph neural network model to obtain a preference vector corresponding to each node in the directed graph.

[0037] The preference vector includes N component values, each of which is used to represent the relationship value between two nodes. Specifically, when the directed graph includes N nodes, N preference vectors can be obtained through step S103, each of which includes N component values. For example, for any node Vx among the N nodes, each component value in the corresponding preference vector is used to represent the relationship value between the node Vx and itself and between the node Vx and other nodes among the N nodes.

[0038] The preset target graph neural network model is a preset graph neural network for recommendation. After the directed graph is input into the target graph neural network model, the preference vector corresponding to each node in the directed graph is obtained. Among them, the graph neural network model (GNN) is a method model for processing graph domain information based on deep learning. Specifically, any network structure in the prior art can be used, which will not be repeated here.

[0039] For example, after the directed graph is input into the target graph neural network model, preference vectors corresponding to 7 nodes are obtained, each of which includes 7 component values. For example, the preference vector corresponding to the node V1 includes 7 component values, which are the relationship values ​​between item V1 and items V1 to V7. The relationship value is the relationship representation obtained after the graph neural network performs deep learning on the directed graph, that is, it represents the implicit relationship and connection between items. Therefore, the preference vector corresponding to each node can reflect the degree of closeness of the implicit relationship and connection between the item represented by the node and the items represented by other nodes. For example, the relationship value of node Vx with itself is 1, and the relationship value with other nodes is less than 1, and the larger the relationship value, the greater the degree of closeness of the implicit relationship and connection between the items represented by the two nodes.

[0040] Step S104: Input the preference vector corresponding to each node into a preset target attention network to obtain an overall preference vector corresponding to the conversation sequence to be predicted.

[0041] The attention network is used to adjust the weights of each preference vector so that the conversation sequence generates an overall preference vector using the attention mechanism. The attention network can specifically adopt any network structure in the prior art, which will not be described in detail here.

[0042] Step S105: Determine a historical preference vector corresponding to the first node according to the historical conversation sequence of the target user.

[0043] Among them, the first node is the last node in the directed graph, that is, the node corresponding to the last item in the conversation sequence to be predicted (hereinafter referred to as the first item, for example, the last item in the above conversation sequence is item V4). According to the historical conversation sequence of the target user, the relationship value between the first item and the items corresponding to each node in the directed graph (for example, items V1 to V7 in the above conversation sequence) is determined, that is, the historical preference vector. Through the historical preference vector, the historical behavior of the target user can be used as a recommendation calculation factor in the recommendation process.

[0044] Step S106: Obtain the general preference vector corresponding to the first node.

[0045] Similar to the above historical preference vector, the general preference vector is also the relationship value between the above first item and the items corresponding to each node in the directed graph. Different from the above historical preference vector, the general preference vector is not targeted at the target user or a specific user, but represents the general preference of unspecified users.

[0046] Step S107: linearly transform the overall preference vector, the general preference vector, the current preference vector and the historical preference vector to obtain a comprehensive preference vector.

[0047] The current preference vector is the preference vector corresponding to the first node in the directed graph.

[0048] Optionally, the overall preference vector, the general preference vector, the current preference vector and the historical preference vector can be input into a linear transformation function to obtain a comprehensive preference vector, wherein the overall preference vector can reflect the predicted preference of the target user's to-be-predicted conversation sequence, the general preference vector can reflect the general preference corresponding to the first item, the current preference vector can reflect the preference of the first item reflected by the target user's to-be-predicted conversation sequence, and the historical preference vector can reflect the preference of the first item reflected by the target user's historical conversation sequence. Therefore, the comprehensive preference vector obtained by linear change can simultaneously reflect the above four aspects.

[0049] Step S108: Determine the probability values ​​corresponding to the N items according to the comprehensive preference vector.

[0050] Optionally, the comprehensive preference vector is input into the softmax function to obtain the probability values ​​corresponding to N items, that is, the probability value of the item that the target user may click next, and each probability value is between 0 and 1.

[0051] Step S109: Select the item corresponding to the maximum probability value as the recommended item.

[0052] Among the probability values ​​corresponding to N items, the item corresponding to the maximum probability value is the item that the target user is most likely to click next, so it is used as the recommended item.

[0053] In the recommendation method based on graph neural network provided in this embodiment, the next item that the target user may click is predicted and recommended according to the conversation sequence, wherein the conversation sequence to be predicted is converted into a directed graph and input into the preset target graph neural network to obtain the preference vector corresponding to each node in the directed graph, and then each preference vector is input into the preset target attention network to obtain the overall preference vector, and then the overall preference vector, the general preference vector, the current preference vector and the historical preference vector are linearly transformed to obtain the comprehensive preference vector, and finally the probability value corresponding to each item is determined according to the comprehensive preference vector, and the item corresponding to the maximum probability value is used as the recommended item. It can be seen that the recommendation method based on graph neural network provided in this embodiment is used to convert the conversation sequence into a directed graph, and the directed graph is used as the input of the neural network for deep learning, which is convenient for the system to extract implicit information between items, and then the attention network architecture model is used to capture the user's short-term interests to obtain the comprehensive preference vector. More importantly, in addition to the comprehensive preference vector, the general preference vector, the current preference vector and the historical preference vector are also considered, so as to achieve the vector representation that captures the coexistence of long-term interests and short-term interests, making the item recommendation more accurate.

[0054] Optionally, in one embodiment, the step of determining a historical preference vector corresponding to a first node based on a historical conversation sequence of a target user includes: converting the historical conversation sequence of the target user into a directed graph, and inputting it into a target graph neural network to obtain a preference vector table corresponding to the target user, wherein the preference vector table includes N rows, and each row includes a relationship value between a node and N nodes; respectively adding N component values ​​of a current preference vector and the relationship values ​​between a first node and N nodes in the preference vector table, and dividing by 2 to obtain N first means; and determining the N first means as the historical preference vector corresponding to the first node.

[0055] Specifically, the historical conversation sequence of the target user can be converted into a directed graph in the same manner as step S102 above, and then the directed graph formed by the historical conversation sequence can be input into the target neural network in the same manner as step S103 above, so as to obtain N preference vectors corresponding to the historical conversation sequence. A preference vector table can be formed by using the preference vectors corresponding to multiple historical conversation sequences. Optionally, the relationship values ​​between the same items in multiple historical conversation sequences can be added and divided by the number of historical conversation sequences to obtain the relationship values ​​between the corresponding items in the preference vector table.

[0056] As shown in Table 1 below, the preference vector table corresponding to the target user is shown, wherein 0000001 is the identifier of the target user, the value in the first row and the first column represents the relationship value between item V1 and item V1, the value in the first row and the second column represents the relationship value between item V1 and item V2, and the value in the second row and the first column represents the relationship value between item V2 and item V1, wherein x is used to replace the size of the specific relationship value, and x in each position can be the same value or different values.

[0057] Table 1

[0058]

[0059]

[0060] Still taking the above-mentioned conversation sequence to be predicted {V3, V4, V1, V5, V6, V7, V2, V4, V6, V5, V4} as an example, after obtaining the historical preference vector table, the 7 component values ​​of the current preference vector (that is, the 7 component values ​​of item V4) and the relationship values ​​between the first node (that is, the first item V4) and the 7 nodes (that is, other items V1 to V7) in the preference vector table are added respectively and divided by 2 to obtain 7 first means, and the 7 first means are used as the historical preference vector corresponding to the first node (that is, the first item V4).

[0061] By using the graph neural network-based recommendation method provided in this embodiment, the historical preference vector is formed by the historical conversation sequence and the conversation sequence to be predicted, which can fully reflect the historical preference situation before the next item that may be clicked.

[0062] Optionally, in one embodiment, the step of obtaining a general preference vector corresponding to the first node includes: obtaining a preference vector table corresponding to multiple users; adding the relationship values ​​between the first node and N nodes in the preference vector table corresponding to each user, respectively, and dividing the sum by the number of users to obtain N second means; and determining the N second means as the general preference vector corresponding to the first node.

[0063] Specifically, preference vector tables of multiple users can be obtained (such as the preference vector table of one user shown in Table 1 above, in this embodiment, preference vector tables of multiple users are obtained), and the relationship values ​​between the first node and each node in each preference vector table are found and added to obtain the average value, so as to obtain the general preference vector corresponding to the first node.

[0064] Still taking the above-mentioned conversation sequence to be predicted {V3, V4, V1, V5, V6, V7, V2, V4, V6, V5, V4} as an example, after obtaining multiple preference vector tables, the relationship value between the first item V4 and each item (that is, items V1 to V7) is searched in each preference vector table, and then the corresponding values ​​are added and averaged, that is, the relationship value between the first item V4 and item V1 in each preference vector table is added and averaged, the relationship value between the first item V4 and item V2 in each preference vector table is added and averaged, and so on. The 7 average values ​​obtained form a universal preference vector.

[0065] By adopting the recommendation method based on graph neural network provided by this embodiment, a universal preference vector is determined through preference vector tables of multiple real users, which can reflect the preferences that are not targeted at specific users and has high accuracy.

[0066] Optionally, in one embodiment, before the step of inputting the directed graph into a preset target graph neural network, the recommendation method based on the graph neural network also includes: determining an initial graph neural network and an initial target attention network; obtaining a training sample set, wherein the training sample set includes multiple training samples, and the training samples include conversation sequences and target items corresponding to the conversation sequences; converting the conversation sequences of the training samples into a directed graph as the input of the initial graph neural network; inputting the output of the initial graph neural network into the initial target attention network; converting the target items of the training samples into a training preference vector as the output of the initial target attention network, training the initial graph neural network and the initial target attention network, and the graph neural network obtained after the training is the target graph neural network, and the attention network obtained after the training is the target attention network, wherein, among the N component values ​​of the training preference vector, the relationship value between the target item and the target item is 1, and the relationship values ​​between the target item and other items among the N items are all 0.

[0067] Among them, the initial graph neural network and the initial target attention network are both untrained initial neural networks. The initial graph neural network and the initial target attention network are trained through training samples to obtain the target graph neural network and the target attention network.

[0068] Embodiment 2

[0069] Corresponding to the above-mentioned embodiment 1, embodiment 2 of the present invention provides a recommendation device based on a graph neural network. The relevant technical features and corresponding technical effects can be referred to the above-mentioned embodiment 1, which will not be repeated here. Figure 2 A block diagram of a recommendation device based on a graph neural network provided in Embodiment 2 of the present invention, such as Figure 2As shown, the device includes: a first acquisition module 201, a first processing module 202, a first input module 203, a second input module 204, a first determination module 205, a second acquisition module 206, a second processing module 207, a second determination module 208 and a third determination module 209.

[0070] Among them, the first acquisition module 201 is used to obtain the conversation sequence to be predicted, wherein the conversation sequence represents the N items clicked by the target user in sequence and the order of clicks; the first processing module 202 is used to convert the conversation sequence to be predicted into a directed graph, wherein the nodes in the directed graph represent the items clicked, and the directed edges in the directed graph represent the order in which two items are clicked; the first input module 203 is used to input the directed graph into a preset target graph neural network to obtain the preference vector corresponding to each node in the directed graph, wherein the preference vector corresponding to each node includes N component values, and each component value is used to represent the relationship value of two nodes; the second input module 204 is used to input the preference vector corresponding to each node into the preset target attention network to obtain the conversation sequence to be predicted. The first determining module 205 is used to determine the historical preference vector corresponding to the first node according to the historical conversation sequence of the target user, wherein the first node is the last node in the directed graph; the second obtaining module 206 is used to obtain the general preference vector corresponding to the first node; the second processing module 207 is used to linearly transform the overall preference vector, the general preference vector, the current preference vector and the historical preference vector to obtain a comprehensive preference vector, wherein the current preference vector is the preference vector corresponding to the first node in the directed graph; the second determining module 208 is used to determine the probability values ​​corresponding to N items according to the comprehensive preference vector; and the third determining module 209 is used to select the item corresponding to the maximum probability value as the recommended item.

[0071] Optionally, in one embodiment, the first determination module 205 includes: a processing unit, used to convert the target user's historical conversation sequence into a directed graph, and input it into the target graph neural network to obtain a preference vector table corresponding to the target user, wherein the preference vector table includes N rows, and each row includes a relationship value between a node and N nodes; a first calculation unit, used to add the N component values ​​of the current preference vector and the relationship values ​​between the first node and the N nodes in the preference vector table, respectively, and then divide by 2 to obtain N first means; a first determination unit, used to determine the N first means as the historical preference vectors corresponding to the first node.

[0072] Furthermore, the second acquisition module 206 includes: an acquisition unit, used to obtain a preference vector table corresponding to multiple users; a second calculation unit, used to add the relationship values ​​of the first node and N nodes in the preference vector table corresponding to each user, respectively, and then divide the sum by the number of users to obtain N second means; a second determination unit, used to determine that the N second means are the general preference vectors corresponding to the first node.

[0073] Furthermore, the device also includes a pre-training module, wherein the pre-training module is used to perform the following steps: determine an initial graph neural network and an initial target attention network; obtain a training sample set, wherein the training sample set includes multiple training samples, and the training samples include a conversation sequence and a target item corresponding to the conversation sequence; convert the conversation sequence of the training sample into a directed graph as the input of the initial graph neural network; input the output of the initial graph neural network to the initial target attention network; convert the target item of the training sample into a training preference vector as the output of the initial target attention network, train the initial graph neural network and the initial target attention network, and the graph neural network obtained after the training is the target graph neural network, and the attention network obtained after the training is the target attention network, wherein, among the N component values ​​of the training preference vector, the relationship value between the target item and the target item is 1, and the relationship value between the target item and other items among the N items is 0.

[0074] Embodiment 3

[0075] This third embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. Figure 3 As shown, the computer device 01 of this embodiment includes at least but is not limited to: a memory 011 and a processor 012 which can be interconnected through a system bus. Figure 3 It should be pointed out that Figure 3 Only a computer device 01 having components memory 011 and processor 012 is shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0076] In this embodiment, the memory 011 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 011 may be an internal storage unit of the computer device 01, such as a hard disk or memory of the computer device 01. In other embodiments, the memory 011 may also be an external storage device of the computer device 01, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 01. Of course, the memory 011 may also include both the internal storage unit of the computer device 01 and its external storage device. In this embodiment, the memory 011 is generally used to store the operating system and various application software installed on the computer device 01, such as the program code of the recommendation device based on the graph neural network in the second embodiment. In addition, the memory 011 can also be used to temporarily store various types of data that have been output or are to be output.

[0077] In some embodiments, the processor 012 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 012 is generally used to control the overall operation of the computer device 01. In this embodiment, the processor 012 is used to run the program code stored in the memory 011 or process data, such as a recommendation method based on a graph neural network.

[0078] Embodiment 4

[0079] This fourth embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., on which a computer program is stored, and the program realizes the corresponding function when executed by the processor. The computer-readable storage medium of this embodiment is used to store the recommendation device based on the graph neural network, and the computer-readable storage medium realizes the recommendation method based on the graph neural network of the first embodiment when executed by the processor.

[0080] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0081] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0082] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0083] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0084] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0086] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A recommendation method based on graph neural network, characterized in that: include: Obtaining a conversation sequence to be predicted, wherein the conversation sequence represents N items clicked by the target user in sequence and the order in which they are clicked; Converting the to-be-predicted conversation sequence into a directed graph, wherein the nodes in the directed graph represent the items that are clicked, and the directed edges in the directed graph represent the order in which two items are clicked; Inputting the directed graph into a preset target graph neural network to obtain a preference vector corresponding to each of the nodes in the directed graph, wherein the preference vector corresponding to each of the nodes includes N component values, and each of the component values ​​is used to represent a relationship value between two nodes; Inputting the preference vectors corresponding to the nodes into a preset target attention network to obtain an overall preference vector corresponding to the conversation sequence to be predicted; Determining a historical preference vector corresponding to a first node according to a historical conversation sequence of the target user, wherein the first node is the last node in the directed graph; Obtaining a general preference vector corresponding to the first node; Performing a linear transformation on the overall preference vector, the general preference vector, the current preference vector and the historical preference vector to obtain a comprehensive preference vector, wherein the current preference vector is a preference vector corresponding to the first node in the directed graph; Determining probability values ​​corresponding to the N items according to the comprehensive preference vector; and Select the item with the maximum probability value as the recommended item. The method further includes: converting the conversation sequence of the target user's history into the directed graph, and inputting the converted graph into the target graph neural network to obtain a preference vector table corresponding to the target user, wherein the preference vector table includes N rows, each row including a relationship value between a node and the N nodes; The step of obtaining a universal preference vector corresponding to a first node includes: obtaining the preference vector table corresponding to multiple users; respectively adding the relationship values ​​between the first node and the N nodes in the preference vector table corresponding to each user and dividing the sum by the number of users to obtain N second means; and determining the N second means as the universal preference vector corresponding to the first node.

2. The recommendation method based on graph neural network according to claim 1, characterized in that: The step of determining the historical preference vector corresponding to the first node according to the historical conversation sequence of the target user comprises: Add the N component values ​​of the current preference vector and the relationship values ​​between the first node and the N nodes in the preference vector table respectively, and then divide by 2 to obtain N first means; Determine the N first means as the historical preference vectors corresponding to the first node.

3. The recommendation method based on graph neural network according to claim 1, characterized in that: Before the step of inputting the directed graph into a preset target graph neural network, the method further includes: Determine the initial graph neural network and initial target attention network; Acquire a training sample set, wherein the training sample set includes a plurality of training samples, and the training samples include a conversation sequence and a target object corresponding to the conversation sequence; Converting the conversation sequence of the training sample into the directed graph as the input of the initial graph neural network; Inputting the output of the initial graph neural network into the initial target attention network; The target item of the training sample is converted into a training preference vector as the output of the initial target attention network, and the initial graph neural network and the initial target attention network are trained. The graph neural network obtained after the training is the target graph neural network, and the attention network obtained after the training is the target attention network, wherein, among the N component values ​​of the training preference vector, the relationship value between the target item and the target item is 1, and the relationship values ​​between the target item and other items among the N items are all 0.

4. The recommendation method based on graph neural network according to claim 1, characterized in that: When the to-be-predicted session sequence is converted into a directed graph, the number of identical click sequences is represented by visualization features of the directed edges.

5. The recommendation method based on graph neural network according to claim 4, characterized in that: The visual feature includes the shape of the directed edge and / or the thickness of the directed edge and / or the color of the directed edge.

6. The recommendation method based on graph neural network according to claim 1, characterized in that: The step of determining the probability values ​​corresponding to the N items according to the comprehensive preference vector includes: inputting the comprehensive preference vector into a softmax function, wherein an output value of the softmax function is the probability value.

7. A recommendation device based on graph neural network, characterized in that: include: A first acquisition module is used to acquire a conversation sequence to be predicted, wherein the conversation sequence represents N items clicked by the target user in sequence and the order of the clicks; A first processing module, configured to convert the to-be-predicted conversation sequence into a directed graph, wherein the nodes in the directed graph represent the items that are clicked, and the directed edges in the directed graph represent the order in which two items are clicked; A first input module is used to input the directed graph into a preset target graph neural network to obtain a preference vector corresponding to each of the nodes in the directed graph, wherein the preference vector corresponding to each of the nodes includes N component values, and each of the component values ​​is used to represent a relationship value between two nodes; A second input module is used to input the preference vectors corresponding to the nodes into a preset target attention network to obtain an overall preference vector corresponding to the conversation sequence to be predicted; A first determination module, configured to determine a historical preference vector corresponding to a first node according to a historical conversation sequence of the target user, wherein the first node is the last node in the directed graph; A second acquisition module, used to acquire a general preference vector corresponding to the first node; a second processing module, configured to perform a linear transformation on the overall preference vector, the general preference vector, the current preference vector, and the historical preference vector to obtain a comprehensive preference vector, wherein the current preference vector is a preference vector corresponding to the first node in the directed graph; A second determination module is used to determine the probability values ​​corresponding to the N items according to the comprehensive preference vector; and The third determination module is used to select the item corresponding to the maximum probability value as the recommended item. The first determination module includes: a processing unit, configured to convert the conversation sequence of the target user history into the directed graph, and input the converted sequence into the target graph neural network to obtain a preference vector table corresponding to the target user, wherein the preference vector table includes N rows, each row including a relationship value between a node and the N nodes; The second acquisition module includes: an acquisition unit, used to obtain the preference vector table corresponding to multiple users; a second calculation unit, used to add the relationship values ​​between the first node and the N nodes in the preference vector table corresponding to each user, respectively, and then divide the sum by the number of users to obtain N second means; a second determination unit, used to determine that the N second means are the general preference vectors corresponding to the first node.

8. 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 method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, comprising a data storage area and a program storage area, wherein the data storage area stores data created according to the use of a blockchain node, and the program storage area stores a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • A session sequence recommendation method and system based on a graph convolutional neural network

    CN109816101A

  • Session-based project recommendation method, device and apparatus and storage medium

    CN110119467A