A method for determining a recommendation model and related device

By constructing a bipartite graph and using random walks to determine positive sample pairs, the method enriches training samples and reduces overfitting, enhancing the accuracy of resource recommendations in scenarios with fewer samples.

CN114647789BActive Publication Date: 2024-12-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210335018.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2024-12-13
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

In scenarios with fewer training samples, recommendation models prone to overfitting, leading to low accuracy in resource recommendations.

Method used

Construct a bipartite graph based on historical interaction behavior, perform random walks with a preset step length, slide a window to determine positive sample pairs, and train a recommendation model using these pairs to enrich training samples and add multi-hop connections.

Benefits of technology

Increases the number of training samples, reducing the probability of overfitting and improving the accuracy of resource recommendations, especially in scenarios with fewer samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647789B_ABST
    Figure CN114647789B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method for determining a recommendation model and a related device, which relates to machine learning in the field of artificial intelligence. In a bipartite graph determined based on the historical interaction behavior generated by an object on a resource, any graph node is used as the starting graph node, and a random walk preset step length is performed according to the association relationship to obtain a walk path. A size greater than 2 and not greater than the preset step length is set to a preset length, and a window of the preset length is slid on the walk path, and any two graph nodes in the same window are determined as positive sample pairs. Not only does it enrich the training samples, but it also effectively increases the co-occurrence of cold start graph nodes and other graph nodes by adding multi-hop connections, such as forming a positive sample pair with two non-adjacent object nodes in the same window, and the objects corresponding to the two object nodes have similarities. Therefore, the recommendation model obtained by training with more positive sample pairs reduces the probability of overfitting of the recommendation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for determining a recommendation model and related devices. Background Art

[0002] With the development of Internet technology, more and more users use Internet platforms to browse resources such as videos, products, and articles that they are interested in. In existing resource-providing platforms, the trained recommendation models are used to recommend resources of interest to users.

[0003] In related technologies, the recommendation model is usually trained by direct learning. The so-called direct learning is to first observe specific training samples and then make predictions for the specific training samples. That is, during the training process, the graph data used needs to contain all the graph nodes to be predicted. In scenarios with abundant training samples, the recommendation model trained by direct learning works better.

[0004] However, in scenarios with fewer training samples, the trained recommendation model is prone to overfitting, resulting in low accuracy in recommending resources to users. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a method for determining a recommendation model and a related device, which are used to improve the accuracy of resource recommendations when recommending resources to users.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a method for determining a recommendation model, characterized in that the method includes:

[0008] Constructing a bipartite graph according to the historical interaction behavior generated by the object on the resource; wherein the bipartite graph includes graph nodes and association relationships, the node types of the graph nodes include object nodes identifying the object and resource nodes identifying the resource, and the association relationship is used to reflect the association between the object and the resource based on the historical interaction behavior;

[0009] In the bipartite graph, according to the association relationship, a random walk with a preset step length is performed from a starting graph node to obtain a walk path; wherein the starting graph node is any graph node in the bipartite graph;

[0010] Slide a window of a preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair; wherein the preset length is an integer greater than 2 and not greater than the preset step length;

[0011] The recommendation model is obtained by training according to the positive sample pairs.

[0012] On the other hand, an embodiment of the present application provides a device for determining a recommendation model, the device comprising: a construction unit, a sampling unit, a determination unit, and a training unit;

[0013] The construction unit is used to construct a bipartite graph according to the historical interaction behavior generated by the object on the resource; wherein the bipartite graph includes graph nodes and association relationships, the node types of the graph nodes include object nodes identifying the object and resource nodes identifying the resource, and the association relationship is used to reflect the association between the object and the resource based on the historical interaction behavior;

[0014] The sampling unit is used to randomly walk a preset step length from a starting graph node in the bipartite graph according to the association relationship to obtain a walking path; wherein the starting graph node is any graph node in the bipartite graph;

[0015] The determination unit is used to slide a window of a preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair; wherein the preset length is an integer greater than 2 and not greater than the preset step length;

[0016] The training unit is used to obtain a recommendation model through training based on the positive sample pairs.

[0017] On the other hand, an embodiment of the present application provides a computer device, the device comprising a processor and a memory:

[0018] The memory is used to store program code and transmit the program code to the processor;

[0019] The processor is used to execute the method described in the above aspects according to the instructions in the program code.

[0020] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.

[0021] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above aspects.

[0022] It can be seen from the above technical solution that in the bipartite graph determined based on the historical interaction behavior generated by the object to the resource, it includes object nodes, resource nodes, and the association relationship between the object and the resource. In the bipartite graph, any graph node is used as the starting graph node, and the preset step length of the random walk is obtained according to the association relationship to obtain the walking path. The size greater than 2 and not greater than the preset step length is set as the preset length, and the window of the preset length is slid on the walking path, and any two graph nodes in the same window are determined as positive sample pairs. Since the graph nodes in the same window have similarities, two graph nodes that do not have an association relationship but are in a window can be added as a positive sample pair. Compared with only two graph nodes with an association relationship as a positive sample pair, it not only enriches the training samples, but also effectively increases the co-occurrence of cold start graph nodes and other graph nodes by adding multi-hop connections. For example, two non-adjacent object nodes in the same window constitute a positive sample pair, and the objects corresponding to the two object nodes have similarities. Therefore, even in a scenario with fewer training samples, the number of positive sample pairs can be increased through the above method. The recommendation model trained with more positive sample pairs has a lower probability of overfitting due to the increased number of training samples. When recommending resources to users through the recommendation model, the accuracy of resource recommendations is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A schematic diagram of an application scenario of a method for determining a recommendation model provided in an embodiment of the present application;

[0025] Figure 2 A flowchart of a method for determining a recommendation model provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of a neighbor node provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a recommended model provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of a relationship perception graph attention module provided in an embodiment of the present application;

[0029] Figure 6A schematic diagram of a device for determining a recommendation model provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0033] If the direct learning method in related technologies is adopted, such as the random walk (DeepWalk method), the co-occurrence frequency of graph nodes is used to measure the similarity of graph node vectors, so that the graph data used in the training process of the recommendation model needs to include all graph nodes to be predicted. In scenarios with fewer training samples, such as when the platform providing resources is in the development stage, there are many cold-start objects (such as newly registered users) and cold-start resources (such as videos newly uploaded by users). These cold-start objects and cold-start resources are prone to overfitting during the training process of the recommendation model due to their less historical interaction behaviors.

[0034] Based on this, an embodiment of the present application provides a method and related device for determining a recommendation model, which reduces the probability of overfitting of the recommendation model by increasing the number of training samples, and improves the accuracy of resource recommendations when recommending resources to users through the recommendation model.

[0035] The method for determining the recommendation model provided in the embodiment of the present application is based on artificial intelligence. Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0036] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, mechatronics and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, smart transportation and other major directions.

[0037] In the embodiments of the present application, the artificial intelligence technologies mainly involved include the above-mentioned machine learning / deep learning and other directions.

[0038] The method for determining the recommendation model provided in this application can be applied to a determination device that has the function of determining the recommendation model for resource recommendation, such as a terminal device and a server. The terminal device can specifically be a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc., but is not limited thereto; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0039] The determining device may also have machine learning capabilities. Machine Learning (ML) is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0040] In the method for determining the recommendation model provided in the embodiment of the present application, the artificial intelligence model adopted mainly involves the application of machine learning. By adding multi-hop connections, not only the number of training samples is increased, but also the co-occurrence of cold start graph nodes and other graph nodes is increased, thereby reducing the probability of overfitting of the recommendation model. When recommending resources to users through the recommendation model, the accuracy of resource recommendations is improved.

[0041] In order to facilitate understanding of the technical solution of the present application, the method for determining the recommendation model provided in the embodiment of the present application is introduced below in combination with actual application scenarios.

[0042] See also Figure 1 , which is a schematic diagram of an application scenario of the method for determining a recommendation model provided in an embodiment of the present application. Figure 1 In the application scenario shown, the aforementioned determination device is the server 100, and a recommendation model is obtained through historical interaction behavior training so as to recommend resources of interest to the object through the recommendation model.

[0043] It should be noted that objects are the subjects that perform interactive behaviors, such as users, devices, accounts, etc. who like and comment on short videos. Resources are the recipients of objects that perform interactive behaviors, such as short videos. Interactive behaviors such as likes and comments are the behaviors that objects generate on resources.

[0044] The historical interaction behavior of the object on the resource through the terminal device 200 is uploaded to the server 100, and the server 100 constructs a bipartite graph based on the historical interaction behavior. The bipartite graph includes graph nodes and association relationships, such as Figure 1 As shown, the node types of the graph nodes include object nodes such as vertex A and resource nodes such as vertex B. The line between vertex A and vertex B is the association relationship between the object and the resource based on the historical interaction behavior.

[0045] In the bipartite graph, the sixth object node u6 in vertex A is taken as the starting graph node, and the preset step size is set to 4. The walking path obtained by random walking according to the association relationship can be u6→i3→u1→i2→u3. A window with a preset length of 3 is slid on the walking path, and the graph nodes on the walking path can be divided into multiple groups through the window, such as u6, i3 and u1 in the same window, i3, u1 and i2 in the same window, etc. Since the graph nodes in the same window have similarities, two graph nodes that have no association relationship but are in the same window can be added as a positive sample pair, such as u6 and u1. Therefore, compared with the association relationship between only adjacent object nodes and resource nodes in the walking path, adding multi-hop connections increases the association relationship between graph nodes that are in the same window but not adjacent, making them positive sample pairs, effectively increasing the co-occurrence of cold start graph nodes and other graph nodes, and enriching training samples.

[0046] Even in scenarios with fewer training samples, since the number of positive sample pairs can be increased through the aforementioned method, the server 100 obtains a recommendation model based on training with more positive sample pairs, thereby reducing the probability of overfitting of the recommendation model. When recommending resources to users through the recommendation model, the accuracy of resource recommendations is improved, and the application scenarios of the recommendation model are expanded to scenarios with fewer samples.

[0047] The method for determining the recommendation model provided in the embodiment of the present application can be executed by the server. However, in other embodiments of the present application, the terminal device can also have similar functions as the server, thereby executing the method for determining the recommendation model provided in the embodiment of the present application, or the terminal device and the server jointly execute the method for determining the recommendation model provided in the embodiment of the present application, which is not limited in the present embodiment.

[0048] In conjunction with the accompanying drawings, a method for determining a recommendation model provided in an embodiment of the present application is introduced by taking the aforementioned determination device as a server as an example.

[0049] See also Figure 2 , which is a flow chart of a method for determining a recommendation model provided in an embodiment of the present application, such as Figure 2 As shown, the method for determining the recognition model includes S201-S204.

[0050] S201: Construct a bipartite graph based on the historical interaction behaviors of the object on the resource.

[0051] A bipartite graph, also known as a bipartite graph, is a special model in graph theory. Let G = (V, E) be an undirected graph. If the vertex V can be divided into two non-intersecting subsets (A, B), and the two vertices i and j associated with each edge (i, j) in the graph belong to these two different vertex sets i∈A, j∈B respectively, then the graph G is called a bipartite graph. In other words, a bipartite graph includes graph nodes and association relationships. In an embodiment of the present application, graph nodes are a general term for object nodes and resource nodes. Object nodes are used to identify objects, and resource nodes are used to identify resources. The connection between object nodes and resource nodes is called the association relationship between objects and resources based on historical interaction behaviors.

[0052] As a possible implementation method, since the subsequent recommendation model has a processing upper limit, all historical interaction behaviors can be segmented according to fixed durations, thereby constructing a bipartite graph based on historical interaction behaviors of fixed durations. It should be noted that since the interests and hobbies of the subject fluctuate, the fixed duration can be set to a shorter duration, such as 1 hour.

[0053] As a possible implementation method, the bipartite graph can also be updated according to the object association relationship between the object and other objects. The association relationship of the updated bipartite graph includes node association relationship and object association relationship, among which the node association relationship is used to reflect the association between the object and the resource, and the object association relationship is used to reflect the association between the object and other objects.

[0054] S202: In the bipartite graph, according to the association relationship, randomly walk from the starting graph node with a preset step length to obtain a walking path.

[0055] Any graph node in the bipartite graph is taken as the starting graph node, and a random walk with a preset step length is performed according to the association relationship to obtain a walking path. The node types of two adjacent graph nodes on the walking path are different, and the two have an association relationship.

[0056] The embodiment of the present application does not specifically limit the size of the preset step length, and those skilled in the art can set it according to actual needs, such as the preset step length is 4.

[0057] As a possible implementation method, in a bipartite graph, according to the association relationship, random walks are performed multiple times from the starting graph node with a preset step length, and each random walk obtains a walk path, thereby obtaining multiple walk paths. This can not only reduce the deviation of the walk path obtained by only one random walk, but also increase the number of training samples, thereby reducing the probability of overfitting of the recommendation model.

[0058] Further, the graph node whose number of connection associations exceeds the quantity threshold is used as the starting graph node. The embodiment of the present application does not specifically limit the size of the quantity threshold, and those skilled in the art can set it according to actual needs. Among them, the graph node that does not exceed the quantity threshold can be called a "low-frequency node". The historical interaction behavior of the low-frequency node is less. If it is used as the starting graph node, more positive sample pairs related to the low-frequency node will be generated through multiple random walks, which is easy to cause the recommendation model to overfit. However, low-frequency nodes account for a large proportion in the bipartite graph. If the low-frequency node is directly removed from the bipartite graph, the scale of the bipartite graph and the value rate of the graph node vector will be greatly reduced. Therefore, by limiting the low-frequency node from being the starting point of the random walk, that is, not using the low-frequency node as the starting graph node, but still being sampled as an intermediate node in the walk path during the random walk, and even being sampled as a neighbor node in the subsequent neighbor sampling process, the recommendation model will learn the characteristics of the low-frequency node and its neighbor node, and the graph node vector output by the recommendation model has a certain representativeness, thereby improving the accuracy of the recommended resource recommended by the recommendation model.

[0059] As a possible implementation method, in the updated bipartite graph, the types of association relationships include node association relationships and object association relationships. According to the node association relationships and object association relationships, a random walk is performed from the starting graph node with a preset step length to obtain a walking path. At this time, the node types of two adjacent graph nodes in the walking path can include not only resource nodes and object nodes, but also object nodes and object nodes. The object association relationship can be a friend relationship in social software. Since it is assumed that the interests and hobbies of two objects with a friend relationship are similar, the data types between the graph nodes included in the updated bipartite graph are richer, so that some cold-start objects can have the characteristics of other objects with similar interests and hobbies.

[0060] Furthermore, the proportion of object nodes in the walking path can be pre-set so that in the process of random walking, the type of association relationship can be determined according to the proportion of object nodes, and random walking can be performed according to the type of association relationship. Although the number of object nodes in the updated bipartite graph increases, the number of object nodes in the walking path obtained by controlling the proportion of object nodes can be controlled to avoid overfitting of the recommendation model caused by more cold start graph nodes.

[0061] S203: Slide a window of preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair.

[0062] The preset length is an integer greater than 2 and not greater than the preset step length, such as 3, 4, 5, etc. When the window slides on the wandering path, the graph nodes on the wandering path that are equal to the preset length will be in the same window. Since the graph nodes in the same window have similarities, for example, if two object nodes are both associated with a resource node, there is a certain similarity between the two object nodes. For another example, if two resource nodes are both associated with an object node, there is a certain similarity between the two resource nodes.

[0063] Therefore, by adding two graph nodes that are not associated but are in a window as a positive sample pair, the training samples are enriched compared to only using two graph nodes that are associated as positive sample pairs. Even in scenarios with fewer training samples, by increasing the number of training samples, the recommendation model trained based on more training samples reduces the probability of overfitting of the recommendation model. In addition, by adding multi-hop connections (i.e., adding connections between two graph nodes that are not associated), the co-occurrence of cold-start graph nodes and other graph nodes is effectively increased, making the features of cold-start graph nodes richer and improving the accuracy of the recommendation model.

[0064] S204: Obtain a recommendation model based on training of positive sample pairs.

[0065] Since more positive sample pairs are generated in the aforementioned manner, the number of training samples is increased, so that the trained recommendation model can have a higher accuracy even in a scenario with fewer training samples.

[0066] In addition, due to the addition of positive sample pairs consisting of two object nodes, or positive sample pairs consisting of two resource nodes, the trained recommendation model is more suitable for actual recommendation business. That is, during the training process, the recommendation model does not distinguish the roles of the graph nodes in the object-resource bipartite graph, and will not cause the trained recommendation model to only realize U2I (find similar resources and recommend them to users) recall, but can also realize I2I (find similar objects for objects, and then recommend resources to users) recall, as well as U2U (find similar objects, and then recommend resources that similar objects like) recall.

[0067] It can be seen from the above technical solution that in the bipartite graph determined based on the historical interaction behavior generated by the object to the resource, it includes object nodes, resource nodes, and the association relationship between the object and the resource. In the bipartite graph, any graph node is used as the starting graph node, and the preset step length of the random walk is obtained according to the association relationship to obtain the walking path. The size greater than 2 and not greater than the preset step length is set as the preset length, and the window of the preset length is slid on the walking path, and any two graph nodes in the same window are determined as positive sample pairs. Since the graph nodes in the same window have similarities, two graph nodes that do not have an association relationship but are in a window can be added as a positive sample pair. Compared with only two graph nodes with an association relationship as a positive sample pair, it not only enriches the training samples, but also effectively increases the co-occurrence of cold start graph nodes and other graph nodes by adding multi-hop connections. For example, two non-adjacent object nodes in the same window constitute a positive sample pair, and the objects corresponding to the two object nodes have similarities. Therefore, even in a scenario with fewer training samples, the number of positive sample pairs can be increased through the above method. The recommendation model trained with more positive sample pairs has a lower probability of overfitting due to the increased number of training samples. When recommending resources to users through the recommendation model, the accuracy of resource recommendations is improved.

[0068] The following describes the training process of the recommendation model through several embodiments.

[0069] As a possible implementation method, in the process of training the recommendation model, the model should be trained not only based on positive sample pairs, but also based on negative sample pairs, wherein the negative sample pairs are composed of graph nodes that are not specifically related in the bipartite graph. Therefore, by training the recommendation model with positive sample pairs and negative sample pairs, the classification effect learned by the recommendation model can be better, so as to avoid recommending resources that the object does not like to the object. Furthermore, the number of negative sample pairs can be appropriately increased to further avoid the recommendation model recommending resources that the object hates to the object.

[0070] As a possible implementation, the recommendation model includes a first encoder and a second encoder, and the two encoders are used to encode the two graph nodes included in the positive sample pair, respectively.

[0071] If the two graph nodes included in the positive sample pair are the first graph node and the second graph node, the first graph node is input into the initial first encoder to obtain the first graph node vector, and the second graph node is input into the initial second encoder to obtain the second graph node vector. Thus, the graph node vector corresponding to the graph node included in the positive sample pair is obtained according to the initial first encoder and the initial second encoder.

[0072] Two graph nodes from different positive sample pairs constitute a negative sample pair, so after obtaining the graph node vector corresponding to the graph node included in the positive sample, the graph node vector corresponding to the graph node included in the negative sample pair can be obtained. For example, for the target graph node, the graph node vectors corresponding to the graph nodes included in a preset number of target positive sample pairs are obtained; wherein the target positive sample pair includes the target graph node and other graph nodes, and the graph node vectors corresponding to any two other graph nodes are determined as the graph node vectors corresponding to the graph nodes included in the negative sample pair. Therefore, the negative sample pairs are not obtained by sampling like the positive sample pairs, but by randomly arranging the graph node vectors of a batch of positive sample pairs, so as to sample the graph node vectors corresponding to the negative sample nodes for each graph node (such as sampling 6-10 negative sample nodes for each graph node), thereby reducing the complexity of data processing. Not only does it improve the data processing speed, but it also makes it easier and more convenient to adjust the negative sample pairs.

[0073] After obtaining the graph node vectors included in the positive sample pair and the negative sample pair, based on the training direction of maximizing the similarity between the graph node vectors corresponding to the two graph nodes in the positive sample pair and minimizing the similarity between the graph node vectors corresponding to the two graph nodes in the negative sample pair, the initial first encoder and the initial second encoder are trained to obtain the first encoder and the second encoder respectively. Then, the recommendation model is determined based on the first encoder and the second encoder.

[0074] For example, the above training direction can be expressed as formula (1):

[0075]

[0076] Among them, h v is the graph node vector corresponding to a graph node in a positive sample pair, h u is the graph node vector corresponding to the other graph node in the positive sample pair, is with h u The graph node vector set corresponding to the graph nodes that constitute the negative sample pair, σ represents the sigmoid function. Formula (1) allows h u As close as possible to h v , and let Try to stay away from h u , thereby improving the accuracy of the recommendation model.

[0077] To ensure the uniformity of the graph node vectors, the model parameters of the first encoder and the second encoder are shared.

[0078] In the related art, the recommendation model generally uses a traditional graph convolutional neural network, which needs to be operated on the entire graph. This method cannot handle real recommendation scenarios with large object scales. Based on this, the embodiment of the present application samples neighbor nodes first and then performs vector aggregation. The computational complexity of this method will not increase with the increase of graph data, so that it can better adapt to large-scale recommendation scenarios. The sampling of neighbor nodes is explained below.

[0079] According to the first graph node, the neighbor nodes of the first graph node, and the association relationship between the first graph node and the neighbor nodes of the first graph node included in the positive sample pair, the first graph node vector is obtained through an initial first encoder; wherein the neighbor nodes of the first graph node are graph nodes determined according to the association relationship, that is, the neighbor nodes of the first graph node are graph nodes having an association relationship with the first graph node.

[0080] Similarly, based on the second graph node, the neighbor nodes of the second graph node, and the association relationship between the second graph node and the neighbor nodes of the second graph node included in the positive sample pair, the second graph node vector is obtained through the initial second encoder; wherein the neighbor nodes of the second graph node are graph nodes determined according to the association relationship, that is, the neighbor nodes of the second graph node are graph nodes that have an association relationship with the second graph node.

[0081] In order to further improve the generalization, neighbor nodes can be obtained through multi-order sampling. As the number of orders increases, the amount of calculation will become larger and larger. As a possible implementation method, neighbor nodes can be obtained through second-order sampling, which can improve the generalization effect of the model while ensuring that the amount of calculation is not too large.

[0082] See also Figure 3 , which is a schematic diagram of a neighbor node provided by an embodiment of the present application. Taking the neighbor nodes of the acquisition object node u1 as an example, four resource nodes i1, i2, i3 and i4 with associated relationships can be uniformly randomly sampled from its historical interaction behavior, and then eight object nodes with associated relationships are sampled respectively with each of the four resource nodes as the center, and the second-order 32 object nodes ( Figure 3 Only some object nodes are shown in the figure), four first-order resource nodes, and one object node of the zero-order constitute a convolution block.

[0083] The vector aggregation is described below. Each encoder includes multiple encoding layers, and encodes the node multiple times. The following takes two encoding layers as an example for description.

[0084] The feature vector of the first graph node included in the positive sample pair is obtained through vector mapping; the feature vector of the neighbor nodes of the first graph node is obtained through vector mapping; and the feature vector of the association relationship between the first graph node and the neighbor nodes of the first graph node is obtained through vector mapping.

[0085] As a possible implementation manner, a graph node may be mapped via vector to obtain a feature vector representing the node, such as mapping a first graph node via vector to obtain a vector feature of the first graph node.

[0086] According to the feature vector of the first graph node, the feature vector of the neighboring nodes of the first graph node, and the feature vector of the association relationship between the first graph node and the neighboring nodes of the first graph node, the first vector for the first graph node is obtained through the first encoding layer of the initial first encoder. According to the first vector of the first graph node and the feature vector of the neighboring nodes of the first graph node, the second vector for the second graph node is obtained through the second encoding layer of the initial first encoder. The feature vector of the first graph node, the first vector of the first graph node, and the second vector of the first graph node are concatenated to obtain the first graph node vector.

[0087] Similarly, the feature vector of the second graph node included in the positive sample pair is obtained by vector mapping; the feature vector of the neighbor nodes of the second graph node is obtained by vector mapping; the feature vector of the association relationship between the second graph node and the neighbor nodes of the second graph node is obtained by vector mapping. According to the feature vector of the second graph node, the feature vector of the neighbor nodes of the second graph node, and the feature vector of the association relationship between the second graph node and the neighbor nodes of the second graph node, the first vector for the second graph node is obtained by the second encoding layer of the initial second encoder. According to the first vector of the second graph node and the feature vector of the neighbor nodes of the second graph node, the second vector for the second graph node is obtained by the second encoding layer of the initial second encoder. The feature vector of the second graph node, the first vector of the second graph node, and the second vector of the second graph node are concatenated to obtain the second graph node vector.

[0088] Therefore, the recommendation model is no longer trained only based on the graph nodes in the present application, but also trained based on the neighbor nodes of the graph nodes and the association relationship with the neighbor nodes, which increases the number of training samples, reduces the probability of overfitting of the recommendation model, and improves the accuracy of resource recommendations.

[0089] As a possible implementation method, not only can the graph nodes themselves be mapped to obtain feature vectors, but more generalized features can also be added to the graph nodes, such as dimensional features such as gender, age, and region. It should be noted that in the specific implementation of this application, when it comes to user-related data such as gender, age, and region, when the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of relevant data must comply with relevant laws, regulations, and standards of relevant countries and regions.

[0090] During the aggregation process, the recommendation model will learn the characteristics of neighbor nodes, which will bring noise information and fail to extract truly useful collaborative information. Based on this, the embodiment of the present application proposes a dynamic attention mechanism based on relationship perception for aggregation, and configures different weights for different neighbor nodes according to the association relationship, so as to explicitly consider the type of interactive behavior when aggregating neighbor nodes, thereby filtering the noise interference caused by sampling and the data itself. The following is a detailed description.

[0091] See also Figure 4 , which is a schematic diagram of a recommendation model provided by an embodiment of the present application. u1 and i3 are a pair of positive samples, which are input into the initial first encoder and the initial second encoder respectively. The initial first encoder is used as an example for description below.

[0092] The positive sample pair includes the first graph node u1, the neighbor nodes i1, i2 and i4 of the first graph node (since u1 and i3 are predicted with an unknown relationship, i3 is not considered as the neighbor node of u1), and the association relationship r between the first graph node and its neighbor nodes 11 、r 12 and r 14 Input to the relation-aware graph attention module in the initial first encoder, and output the weight α corresponding to each neighbor node through the relation-aware graph attention module i1 , α i2 and α i4 . The weights α corresponding to the neighbor nodes i1, i2 and i4 of the first graph node and the neighbor nodes of the first graph node are i1 , α i2 and α i4 Perform weighted summation and transform the dimension ( Figure 4 The FC Layer shown in the figure is then combined with the node features of the first graph node and normalized ( Figure 4 Normalization as shown in Figure 1 is used as the output of the first encoding layer of the initial first encoder. After passing through multiple encoding layers, the central node vectors of each layer will be spliced ​​together through the splicing module as the graph node vector corresponding to the first graph node.

[0093] Similarly, the graph node vector corresponding to the second graph node is obtained through the initial second encoder, thereby calculating the similarity between the first graph node u1 and the second graph node i3, adjusting the initial first encoder according to the similarity to obtain the first encoder, and adjusting the initial second encoder to obtain the second encoder. Then, the recommendation model is obtained according to the first encoder and the second encoder.

[0094] See also Figure 5 , which is a schematic diagram of a relationship perception graph attention module provided in an embodiment of the present application. The relationship perception graph attention module works based on the dynamic attention mechanism of relationship perception, h i and h j is the graph node vector corresponding to two graph nodes, r ij is the vector corresponding to the association between two graph nodes, Θ is the shared parameter matrix, and α is the weight used to filter noise information. As a possible implementation method, m can also be added to filter out the impact of all-zero vectors. Because sampling is performed according to a fixed number, if the number of neighbor nodes of a graph node is insufficient, it will be filled with all-zero vectors.

[0095] As a possible implementation method, after obtaining the recommendation model, the object node corresponding to the target object and the arbitrary resource node corresponding to any resource are obtained, and the target object node and the arbitrary resource node are input into the recommendation model. The target similarity between the target object node and the arbitrary resource node is obtained through the recommendation model, such as inputting a bipartite graph composed of the target object node and the arbitrary resource node into at least the recommendation model, and obtaining the target similarity through the recommendation model. The target similarity is used to identify the degree of interest of the target object in any resource, thereby recommending the resources corresponding to the arbitrary resource node to the target object based on the target similarity, such as recommending the resources corresponding to the target similarity exceeding the similarity threshold to the target object.

[0096] Therefore, through the recommendation model, the similarity between any object and any resource can be determined, so as to recommend resources that the object may be interested in based on the similarity. Not only can the corresponding resources be recommended for the cold start object, but the accuracy of the resource recommendation is also high, which improves the object's experience. Cold start resources can also be recommended for the object, expanding the range of resources that the object can view, and improving the object's experience.

[0097] Next, we will combine Figure 4 , taking the scenario of users watching videos as an example, when users are watching videos, they may like, comment, share and other interactive behaviors on their favorite videos.

[0098] S1: Filter out invalid interactive behaviors, such as interactive behaviors caused by users clicking on videos due to operational errors, and segment historical interactive behaviors. The duration of each historical interactive behavior is 1 hour.

[0099] S2: Construct a bipartite graph based on 1 hour of historical interaction behavior.

[0100] S3: Take the non-low-frequency node as the starting node, and in the bipartite graph, randomly walk from the starting graph node for multiple times with a preset step length according to the association relationship to obtain the walking path.

[0101] S4: Slide a window of preset length on the walking path to determine any two graph nodes in the same window as positive sample pairs.

[0102] Each graph node will first sample several neighboring nodes, and then the recommendation model will calculate the dynamic weights based on the relationship between the central node (sampled graph node) and the neighboring nodes, and between the central node and the neighboring nodes, and perform weighted summation on the sampled neighboring nodes. The following is an illustration of the positive sample pair consisting of the first graph node u1 and the second graph node i3.

[0103] S5: Obtain the feature vector x of the first graph node u1 through vector mapping v ; Obtain the feature vector x of the neighbor node of the first graph node through vector mapping u ; Obtain the characteristic vector x of the association relationship between the first graph node and its neighbor nodes through vector mapping uv .

[0104] As a possible implementation method, the neighbor node sampling phase can selectively sample according to the type and time of interaction behavior. The type of interaction behavior (such as liking an item, liking an item) can significantly improve certain online indicators, and the interaction time can capture the changes in user interests, making the recommendation model more timely.

[0105] S6: x v 、x u and x uv Input to Figure 4 In the initial first encoder shown, the multiple encoding layers included in the initial first encoder configure corresponding weights for each neighbor node, thereby filtering out noise information brought by the neighbor node. For details, see formula (2):

[0106]

[0107] in, represents the kth vector of the first graph node output by the kth encoding layer, σ is the sigmoid function, W k and B k are two mapping matrices, which are the model parameters to be learned by the first encoder. Represents the neighbor node set of the graph node v (such as the first graph node u1), u is a neighbor node in the neighbor node set, αuv is the weight corresponding to the graph node v and the neighbor node u, is the neighbor node output by the k-1th encoding layer, is the k-1th vector of the first graph node output by the k-1th encoding layer.

[0108] Among them, the 0th vector can be expressed as formula (3):

[0109]

[0110] Considering that each neighbor is not equally weighted during the aggregation process, the recommendation model should learn to filter out the noise information brought by the neighbors. Therefore, the present invention adopts the idea of ​​dynamic attention mechanism when aggregating neighbor node vectors. The calculation idea of ​​the attention mechanism in the model is shown in the following formula:

[0111]

[0112] Among them, || represents the splicing operation, α vu Indicates the weight when graph node k is aggregated to graph node v. This weight is calculated by the softmax function. In the Softmax function, a T is a filter vector, which can be seen as filtering the concatenated vector h v ,h k , r kv ,h v ,h u , r uv Unimportant ingredients. kv is the type of the association between graph node k and graph node v, and is also mapped to a vector. uv is the type of association between graph node u and graph node v, which is also mapped to a vector. Θ is a model parameter, which can be a mapping matrix. LeakyReLU is a nonlinear activation function. Represents the set of neighbors of graph node v.

[0113] S7: Through the splicing module in the initial first encoder (such as Figure 4 Layer Combination (shown in Figure 4) concatenates all vectors of each layer to obtain the first graph node vector. For details, please refer to formula (4):

[0114]

[0115] in, A vector representing the output of the last encoding layer.

[0116] S8: The second graph node vector is obtained by using the initial second encoder. Please refer to S5-S7, which will not be described in detail here.

[0117] S9: Obtain graph node vectors corresponding to other graph nodes in the positive sample pair including the first graph node, and determine the graph node vectors corresponding to two other graph nodes as the graph node vectors corresponding to the graph node included in the negative sample pair.

[0118] S10: Train the initial first encoder and the initial second encoder according to the aforementioned formula (1) to obtain the first encoder and the second encoder respectively.

[0119] S11: Determine a recommendation model according to the first encoder and the second encoder.

[0120] S12: Input the target object node and any resource node into the recommendation model, and obtain the similarity between the target object node and any resource node through the recommendation model.

[0121] The user for whom resources are to be recommended is taken as the target object node, and any resource is taken as the arbitrary resource node. The target similarity between the target object node and the arbitrary resource node is obtained through the recommendation model.

[0122] S13: Recommend resources corresponding to any resource node to the target object according to the target similarity.

[0123] The target similarity is used to describe the interest of the user corresponding to the target object node in the resource corresponding to any resource node. If the target similarity exceeds the similarity threshold, the resource can be recommended to the user.

[0124] In the scenario where a resource platform in the development stage needs large-scale recommendations, a large-scale graph vector generation solution based on random walks and neighbor aggregation is implemented to solve the problems of insufficient training samples and excessive data noise caused by a large number of cold-start users and cold-start resources. In the online A / B experiment, the average user stay time (minutes) increased by 1.85% and the average number of feed views (Video View, VV) increased by 1.11%.

[0125] In view of the method for determining a recognition model provided in the above-mentioned embodiment, an embodiment of the present application also provides a device for determining a recognition model.

[0126] See also Figure 6 , which is a schematic diagram of a determination device for a recommendation model provided in an embodiment of the present application. Figure 6 As shown, the determination device 600 of the recommendation model includes: a construction unit 601, a sampling unit 602, a determination unit 603 and a training unit 604;

[0127] The construction unit 601 is used to construct a bipartite graph according to the historical interaction behavior generated by the object on the resource; wherein the bipartite graph includes graph nodes and association relationships, the node types of the graph nodes include object nodes identifying the object and resource nodes identifying the resource, and the association relationship is used to reflect the association between the object and the resource based on the historical interaction behavior;

[0128] The sampling unit 602 is used to randomly walk a preset step length from a starting graph node in the bipartite graph according to the association relationship to obtain a walking path; wherein the starting graph node is any graph node in the bipartite graph;

[0129] The determining unit 603 is used to slide a window of a preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair; wherein the preset length is an integer greater than 2 and not greater than the preset step length;

[0130] The training unit 604 is used to obtain a recommendation model through training according to the positive sample pairs.

[0131] As a possible implementation manner, the sampling unit 602 is configured to:

[0132] In the bipartite graph, according to the association relationship, a preset step length is randomly walked from the starting graph node multiple times, and multiple walking paths are correspondingly obtained.

[0133] As a possible implementation, the recommendation model determination device 600 further includes a starting graph node determination unit, which is used to determine a graph node whose number of connection associations exceeds a quantity threshold as a starting graph node.

[0134] As a possible implementation manner, the training unit 604 is used to:

[0135] According to the first graph node included in the positive sample pair, a first graph node vector is obtained by an initial first encoder; according to the second graph node included in the positive sample pair, a second graph node vector is obtained by an initial second encoder;

[0136] According to the graph node vector corresponding to the graph node included in the positive sample pair, the graph node vector of the graph node included in the negative sample pair is obtained; wherein the negative sample pair is composed of two graph nodes from different positive sample pairs;

[0137] Based on the training direction of maximizing the similarity between the graph node vectors corresponding to the two graph nodes in the positive sample pair and minimizing the similarity between the graph node vectors corresponding to the two graph nodes in the negative sample pair, training the initial first encoder and the initial second encoder to obtain the first encoder and the second encoder respectively;

[0138] A recommendation model is determined according to the first encoder and the second encoder.

[0139] As a possible implementation manner, the training unit 604 is used to:

[0140] For a target graph node, obtaining graph node vectors corresponding to graph nodes included in a preset number of target positive sample pairs; wherein the target positive sample pairs include the target graph node and other graph nodes;

[0141] The graph node vectors corresponding to any two other graph nodes are determined as the graph node vectors corresponding to the graph nodes included in the negative sample pair.

[0142] As a possible implementation manner, the training unit 604 is used to:

[0143] According to the first graph node, the neighboring nodes of the first graph node, and the association relationship between the first graph node and the neighboring nodes of the first graph node included in the positive sample pair, a first graph node vector is obtained through an initial first encoder; wherein the neighboring nodes of the first graph node are graph nodes determined according to the association relationship;

[0144] The step of obtaining a second graph node vector by an initial second encoder according to the second graph node included in the positive sample pair includes:

[0145] According to the second graph node included in the positive sample pair, the neighbor nodes of the second graph node, and the association relationship between the second graph node and the neighbor nodes of the second graph node, a second graph node vector is obtained through an initial second encoder; wherein the neighbor nodes of the second graph node are graph nodes determined according to the association relationship.

[0146] As a possible implementation manner, the initial first encoder includes two encoding layers, the initial second encoder includes two encoding layers, and the training unit 604 is used to:

[0147] Obtaining a feature vector of a first graph node included in the positive sample pair through vector mapping; obtaining a feature vector of a neighbor node of the first graph node through vector mapping; obtaining a feature vector of an association relationship between the first graph node and the neighbor nodes of the first graph node through vector mapping;

[0148] Obtaining a first vector for the first graph node through a first encoding layer of the initial first encoder according to a feature vector of the first graph node, a feature vector of a neighboring node of the first graph node, and a feature vector of an association relationship between the first graph node and the neighboring nodes of the first graph node;

[0149] Obtaining, according to the first vector of the first graph node and the feature vector of the neighboring node of the first graph node, a second vector for the second graph node through the second encoding layer of the initial first encoder;

[0150] Concatenate the feature vector of the first graph node, the first vector of the first graph node, and the second vector of the first graph node to obtain the first graph node vector;

[0151] Obtain a feature vector of a second graph node included in the positive sample pair by vector mapping; obtain a feature vector of a neighbor node of the second graph node by vector mapping; obtain a feature vector of an association relationship between the second graph node and the neighbor nodes of the second graph node by vector mapping;

[0152] Obtaining a first vector for the second graph node through a second encoding layer of the initial second encoder according to a feature vector of the second graph node, a feature vector of a neighboring node of the second graph node, and a feature vector of an association relationship between the second graph node and the neighboring nodes of the second graph node;

[0153] Obtaining a second vector for the second graph node through a second encoding layer of the initial second encoder according to the first vector of the second graph node and a feature vector of a neighboring node of the second graph node;

[0154] The feature vector of the second graph node, the first vector of the second graph node, and the second vector of the second graph node are concatenated to obtain the second graph node vector.

[0155] As a possible implementation manner, the training unit 604 is used to:

[0156] According to the first graph node, the neighbor nodes of the first graph node, and the association relationship between the first graph node and the neighbor nodes of the first graph node included in the positive sample pair, corresponding weights are set for the neighbor nodes of the first graph node one by one through the relationship-aware graph attention module in the initial first encoder;

[0157] Obtaining a first graph node vector through a concatenation module in the initial first encoder according to neighbor nodes of the first graph node, weights respectively corresponding to the neighbor nodes of the first graph node, and the first graph node;

[0158] According to the second graph node, the neighboring nodes of the second graph node, and the association relationship between the second graph node and the neighboring nodes of the second graph node, a second graph node vector is obtained through an initial second encoder, including:

[0159] According to the second graph node included in the positive sample pair, the neighbor node of the second graph node, and the association relationship between the second graph node and the neighbor node of the second graph node, the relationship-aware graph attention module in the initial second encoder sets corresponding weights for the neighbor nodes of the second graph node one by one;

[0160] A second graph node vector is obtained through a concatenation module in the initial second encoder according to the neighbor nodes of the second graph node, the weights respectively corresponding to the neighbor nodes of the second graph node, and the second graph node.

[0161] As a possible implementation, the recommendation model determination device 600 further includes an updating unit, which is used to update the bipartite graph according to the object association relationship between the object and other objects, and the relationship type of the association relationship of the updated bipartite graph includes a node association relationship and an object association relationship, the node association relationship is used to reflect the association between the object and the resource, and the object association relationship is used to reflect the association between the object and the other objects;

[0162] The sampling unit 602 is used to randomly walk a preset step length from a starting graph node in the updated bipartite graph according to the node association relationship and the object association relationship to obtain a walking path.

[0163] As a possible implementation, the recommendation model determination device 600 further includes a preset unit, which is used to:

[0164] Presetting the ratio of object nodes in the walking path;

[0165] During the random walk, the type of the association relationship is determined according to the object node ratio, and the random walk is performed according to the type of the association relationship.

[0166] As a possible implementation, the recommendation model determination device 600 further includes an application unit, which is used to:

[0167] Inputting a target object node and an arbitrary resource node into the recommendation model, and obtaining a target similarity between the target object node and the arbitrary resource node through the recommendation model;

[0168] The resource corresponding to the arbitrary resource node is recommended to the target object according to the target similarity.

[0169] It can be seen from the above technical solution that in the bipartite graph determined based on the historical interaction behavior generated by the object to the resource, it includes object nodes, resource nodes, and the association relationship between the object and the resource. In the bipartite graph, any graph node is used as the starting graph node, and the preset step length of the random walk is obtained according to the association relationship to obtain the walking path. The size greater than 2 and not greater than the preset step length is set as the preset length, and the window of the preset length is slid on the walking path, and any two graph nodes in the same window are determined as positive sample pairs. Since the graph nodes in the same window have similarities, two graph nodes that do not have an association relationship but are in a window can be added as a positive sample pair. Compared with only two graph nodes with an association relationship as a positive sample pair, it not only enriches the training samples, but also effectively increases the co-occurrence of cold start graph nodes and other graph nodes by adding multi-hop connections. For example, two non-adjacent object nodes in the same window constitute a positive sample pair, and the objects corresponding to the two object nodes have similarities. Therefore, even in a scenario with fewer training samples, the number of positive sample pairs can be increased through the above method. The recommendation model trained with more positive sample pairs has a lower probability of overfitting due to the increased number of training samples. When recommending resources to users through the recommendation model, the accuracy of resource recommendations is improved.

[0170] The present application also provides a computer device, which is the computer device described above. The computer device can be a server or a terminal device. The aforementioned determination device of the recommendation model can be built into the server or the terminal device. The computer device provided by the present application will be introduced from the perspective of hardware entity. Figure 7 The following is a schematic diagram of the server structure. Figure 8 Shown is a schematic diagram of the structure of the terminal equipment.

[0171] See also Figure 7 , which is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1422 and memory 1432, one or more application programs 1442 or storage media 1430 (such as one or more massive storage devices) for data 1444. Among them, the memory 1432 and the storage medium 1430 may be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the CPU 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.

[0172] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0173] The steps performed by the server in the above embodiment can be based on the Figure 7 The server structure shown.

[0174] The CPU 1422 is used to perform the following steps:

[0175] Constructing a bipartite graph according to the historical interaction behavior generated by the object on the resource; wherein the bipartite graph includes graph nodes and association relationships, the node types of the graph nodes include object nodes identifying the object and resource nodes identifying the resource, and the association relationship is used to reflect the association between the object and the resource based on the historical interaction behavior;

[0176] In the bipartite graph, according to the association relationship, a random walk with a preset step length is performed from a starting graph node to obtain a walk path; wherein the starting graph node is any graph node in the bipartite graph;

[0177] Slide a window of a preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair; wherein the preset length is an integer greater than 2 and not greater than the preset step length;

[0178] The recommendation model is obtained by training the positive sample pairs

[0179] Optionally, the CPU 1422 may also execute the method steps of any specific implementation of the method for determining the recommendation model in the embodiments of the present application.

[0180] See also Figure 8 , which is a structural diagram of a terminal device provided for an embodiment of the present application. Figure 8The block diagram shows a partial structure of a smart phone related to a terminal device provided in an embodiment of the present application, and the smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art can understand that Figure 8 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0181] Combine the following Figure 8 A detailed introduction to the various components of a smartphone:

[0182] The RF circuit 1510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station.

[0183] The memory 1520 may be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 1520 .

[0184] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect user touch operations on or near it and drive the corresponding connection device according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0185] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 1540 may include a display panel 1541, and the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0186] The smartphone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that may be configured in the smartphone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.

[0187] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the smartphone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another smartphone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.

[0188] The processor 1580 is the control center of the smartphone, and uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 1520, and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.

[0189] The smart phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.

[0190] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0191] In the embodiment of the present application, the memory 1520 included in the smart phone can store program codes and transmit the program codes to the processor.

[0192] The processor 1580 included in the smart phone can execute the method for determining the recommendation model provided in the above embodiment according to the instructions in the program code.

[0193] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute the method for determining the recommendation model provided in the above embodiment.

[0194] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for determining the recommendation model provided in various optional implementations of the above aspects.

[0195] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-Only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0196] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0197] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining a recommendation model, It is characterized in that The method comprises: A bipartite graph is constructed according to the historical interaction behaviors of the object on the resource; wherein the bipartite graph includes graph nodes and association relationships, the node types of the graph nodes include object nodes identifying the object and resource nodes identifying the resource, the association relationships are used to reflect the association between the object and the resource based on the historical interaction behaviors, the object is a user, device or account, the resource is a video, product or article, and the interaction behaviors are likes, comments or shares; In the bipartite graph, according to the association relationship, a random walk with a preset step length is performed from a starting graph node to obtain a walk path; wherein the starting graph node is any graph node in the bipartite graph; Slide a window of a preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair; wherein the preset length is an integer greater than 2 and not greater than the preset step length; A recommendation model is obtained by training the positive sample pairs; The step of obtaining a recommendation model based on the training of the positive sample pairs includes: According to the first graph node included in the positive sample pair, a first graph node vector is obtained through an initial first encoder, which includes: according to the first graph node included in the positive sample pair, a neighbor node of the first graph node, and an association relationship between the first graph node and the neighbor node of the first graph node, the first graph node vector is obtained through an initial first encoder; wherein the neighbor node of the first graph node is a graph node determined according to the association relationship; According to the second graph node included in the positive sample pair, a second graph node vector is obtained through an initial second encoder, which includes: according to the second graph node included in the positive sample pair, a neighbor node of the second graph node, and an association relationship between the second graph node and the neighbor node of the second graph node, a second graph node vector is obtained through an initial second encoder; wherein the neighbor node of the second graph node is a graph node determined according to the association relationship; According to the graph node vector corresponding to the graph node included in the positive sample pair, the graph node vector of the graph node included in the negative sample pair is obtained; wherein the negative sample pair is composed of two graph nodes from different positive sample pairs; Based on the training direction of maximizing the similarity between the graph node vectors corresponding to the two graph nodes in the positive sample pair and minimizing the similarity between the graph node vectors corresponding to the two graph nodes in the negative sample pair, training the initial first encoder and the initial second encoder to obtain the first encoder and the second encoder respectively; Determining a recommendation model according to the first encoder and the second encoder; The step of obtaining the first graph node vector by an initial first encoder according to the first graph node, the neighboring nodes of the first graph node, and the association relationship between the first graph node and the neighboring nodes of the first graph node included in the positive sample pair includes: According to the first graph node, the neighbor nodes of the first graph node, and the association relationship between the first graph node and the neighbor nodes of the first graph node included in the positive sample pair, corresponding weights are set for the neighbor nodes of the first graph node one by one through the relationship-aware graph attention module in the initial first encoder; Obtaining a first graph node vector through a concatenation module in the initial first encoder according to neighbor nodes of the first graph node, weights respectively corresponding to the neighbor nodes of the first graph node, and the first graph node; According to the second graph node, the neighboring nodes of the second graph node, and the association relationship between the second graph node and the neighboring nodes of the second graph node, a second graph node vector is obtained through an initial second encoder, including: According to the second graph node included in the positive sample pair, the neighbor node of the second graph node, and the association relationship between the second graph node and the neighbor node of the second graph node, the relationship-aware graph attention module in the initial second encoder sets corresponding weights for the neighbor nodes of the second graph node one by one; A second graph node vector is obtained through a concatenation module in the initial second encoder according to the neighbor nodes of the second graph node, the weights respectively corresponding to the neighbor nodes of the second graph node, and the second graph node.

2. The method according to claim 1, It is characterized in that In the bipartite graph, according to the association relationship, randomly walking a preset step length from a starting graph node to obtain a walking path includes: In the bipartite graph, according to the association relationship, a preset step length is randomly walked from the starting graph node multiple times, and multiple walking paths are correspondingly obtained.

3. The method according to claim 2, It is characterized in that The method further comprises: A graph node whose number of connection associations exceeds a quantity threshold is determined as a starting graph node.

4. The method according to claim 1, It is characterized in that The obtaining, according to the graph node vector corresponding to the graph node included in the positive sample pair, the graph node vector of the graph node included in the negative sample pair comprises: For a target graph node, obtaining graph node vectors corresponding to graph nodes included in a preset number of target positive sample pairs; wherein the target positive sample pairs include the target graph node and other graph nodes; The graph node vectors corresponding to any two other graph nodes are determined as the graph node vectors corresponding to the graph nodes included in the negative sample pair.

5. The method according to claim 1, It is characterized in that The initial first encoder includes two encoding layers. According to the first graph node, the neighboring node of the first graph node, and the association relationship between the first graph node and the neighboring node of the first graph node included in the positive sample pair, the first graph node vector is obtained by the initial first encoder and replaced with: Obtaining a feature vector of a first graph node included in the positive sample pair through vector mapping; obtaining a feature vector of a neighbor node of the first graph node through vector mapping; obtaining a feature vector of an association relationship between the first graph node and the neighbor nodes of the first graph node through vector mapping; Obtaining a first vector for the first graph node through a first encoding layer of the initial first encoder according to a feature vector of the first graph node, a feature vector of a neighboring node of the first graph node, and a feature vector of an association relationship between the first graph node and the neighboring nodes of the first graph node; Obtaining, according to the first vector of the first graph node and the feature vector of the neighboring node of the first graph node, a second vector for the second graph node through the second encoding layer of the initial first encoder; Concatenate the feature vector of the first graph node, the first vector of the first graph node, and the second vector of the first graph node to obtain the first graph node vector; The initial second encoder includes two encoding layers. According to the second graph node included in the positive sample pair, the neighboring node of the second graph node, and the association relationship between the second graph node and the neighboring node of the second graph node, the second graph node vector is obtained by the initial second encoder and replaced with: Obtain a feature vector of a second graph node included in the positive sample pair by vector mapping; obtain a feature vector of a neighbor node of the second graph node by vector mapping; obtain a feature vector of an association relationship between the second graph node and the neighbor nodes of the second graph node by vector mapping; Obtaining a first vector for the second graph node through a second encoding layer of the initial second encoder according to a feature vector of the second graph node, a feature vector of a neighboring node of the second graph node, and a feature vector of an association relationship between the second graph node and the neighboring nodes of the second graph node; Obtaining a second vector for the second graph node through a second encoding layer of the initial second encoder according to the first vector of the second graph node and a feature vector of a neighboring node of the second graph node; The feature vector of the second graph node, the first vector of the second graph node, and the second vector of the second graph node are concatenated to obtain the second graph node vector.

6. The method according to claim 1, It is characterized in that The method further comprises: Update the bipartite graph according to the object association relationship between the object and other objects, the relationship type of the association relationship of the updated bipartite graph includes a node association relationship and an object association relationship, the node association relationship is used to reflect the association between the object and the resource, and the object association relationship is used to reflect the association between the object and the other objects; In the bipartite graph, according to the association relationship, randomly walking a preset step length from a starting graph node to obtain a walking path includes: In the updated bipartite graph, according to the node association relationship and the object association relationship, a random walk with a preset step length is performed from a starting graph node to obtain a walk path.

7. The method according to claim 6, It is characterized in that The method further comprises: Presetting the ratio of object nodes in the walking path; During the random walk, the type of the association relationship is determined according to the object node ratio, and the random walk is performed according to the type of the association relationship.

8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: Inputting a target object node and an arbitrary resource node into the recommendation model, and obtaining a target similarity between the target object node and the arbitrary resource node through the recommendation model; The resource corresponding to the arbitrary resource node is recommended to the target object according to the target similarity.

9. A device for determining a recommendation model, It is characterized in that The device comprises: a construction unit, a sampling unit, a determination unit and a training unit; The construction unit is used to construct a bipartite graph according to the historical interaction behavior generated by the object on the resource; wherein the bipartite graph includes graph nodes and association relationships, the node types of the graph nodes include object nodes identifying the object and resource nodes identifying the resource, the association relationship is used to reflect the association between the object and the resource based on the historical interaction behavior, the object is a user, device or account, the resource is a video, product or article, and the interaction behavior is a like, comment or share behavior; The sampling unit is used to randomly walk a preset step length from a starting graph node in the bipartite graph according to the association relationship to obtain a walking path; wherein the starting graph node is any graph node in the bipartite graph; The determination unit is used to slide a window of a preset length on the walking path to determine any two graph nodes in the same window as a positive sample pair; wherein the preset length is an integer greater than 2 and not greater than the preset step length; The training unit is used to obtain a recommendation model through training according to the positive sample pairs; Wherein, the training unit is used for: According to the first graph node included in the positive sample pair, a first graph node vector is obtained through an initial first encoder, which includes: according to the first graph node included in the positive sample pair, a neighbor node of the first graph node, and an association relationship between the first graph node and the neighbor node of the first graph node, the first graph node vector is obtained through an initial first encoder; wherein the neighbor node of the first graph node is a graph node determined according to the association relationship; According to the second graph node included in the positive sample pair, a second graph node vector is obtained through an initial second encoder, which includes: according to the second graph node included in the positive sample pair, a neighbor node of the second graph node, and an association relationship between the second graph node and the neighbor node of the second graph node, a second graph node vector is obtained through an initial second encoder; wherein the neighbor node of the second graph node is a graph node determined according to the association relationship; According to the graph node vector corresponding to the graph node included in the positive sample pair, the graph node vector of the graph node included in the negative sample pair is obtained; wherein the negative sample pair is composed of two graph nodes from different positive sample pairs; Based on the training direction of maximizing the similarity between the graph node vectors corresponding to the two graph nodes in the positive sample pair and minimizing the similarity between the graph node vectors corresponding to the two graph nodes in the negative sample pair, training the initial first encoder and the initial second encoder to obtain the first encoder and the second encoder respectively; Determining a recommendation model according to the first encoder and the second encoder; The training unit is used to obtain a first graph node vector through an initial first encoder according to the first graph node, the neighboring node of the first graph node, and the association relationship between the first graph node and the neighboring node of the first graph node included in the positive sample pair, including: According to the first graph node, the neighbor nodes of the first graph node, and the association relationship between the first graph node and the neighbor nodes of the first graph node included in the positive sample pair, setting corresponding weights for the neighbor nodes of the first graph node one by one through the relationship-aware graph attention module in the initial first encoder; Obtaining a first graph node vector through a concatenation module in the initial first encoder according to neighbor nodes of the first graph node, weights respectively corresponding to the neighbor nodes of the first graph node, and the first graph node; The training unit is used to obtain a second graph node vector through an initial second encoder according to the second graph node, the neighboring nodes of the second graph node, and the association relationship between the second graph node and the neighboring nodes of the second graph node, including: According to the second graph node included in the positive sample pair, the neighbor node of the second graph node, and the association relationship between the second graph node and the neighbor node of the second graph node, setting corresponding weights for the neighbor nodes of the second graph node one by one through the relationship-aware graph attention module in the initial second encoder; A second graph node vector is obtained through a concatenation module in the initial second encoder according to the neighbor nodes of the second graph node, the weights respectively corresponding to the neighbor nodes of the second graph node, and the second graph node.

10. The device according to claim 9, It is characterized in that The sampling unit is used for: In the bipartite graph, according to the association relationship, a preset step length is randomly walked from the starting graph node multiple times, and multiple walking paths are correspondingly obtained.

11. The device according to claim 10, It is characterized in that The device also includes: The starting graph node determination unit is used to determine a graph node whose number of connection association relationships exceeds a quantity threshold as a starting graph node.

12. The device according to claim 9, It is characterized in that The training unit is used to: For a target graph node, obtaining graph node vectors corresponding to graph nodes included in a preset number of target positive sample pairs; wherein the target positive sample pairs include the target graph node and other graph nodes; The graph node vectors corresponding to any two other graph nodes are determined as the graph node vectors corresponding to the graph nodes included in the negative sample pair.

13. The device according to claim 9, It is characterized in that The initial first encoder includes two encoding layers, and the training unit is used to obtain a first graph node vector through the initial first encoder according to the first graph node, the neighboring node of the first graph node, and the association relationship between the first graph node and the neighboring node of the first graph node included in the positive sample pair, and replace it with: Obtaining a feature vector of a first graph node included in the positive sample pair through vector mapping; obtaining a feature vector of a neighbor node of the first graph node through vector mapping; obtaining a feature vector of an association relationship between the first graph node and the neighbor nodes of the first graph node through vector mapping; Obtaining a first vector for the first graph node through a first encoding layer of the initial first encoder according to a feature vector of the first graph node, a feature vector of a neighboring node of the first graph node, and a feature vector of an association relationship between the first graph node and the neighboring nodes of the first graph node; Obtaining, according to the first vector of the first graph node and the feature vector of the neighboring node of the first graph node, a second vector for the second graph node through the second encoding layer of the initial first encoder; Concatenate the feature vector of the first graph node, the first vector of the first graph node, and the second vector of the first graph node to obtain the first graph node vector; The initial second encoder includes two encoding layers, and the training unit is used to obtain a second graph node vector through the initial second encoder according to the second graph node, the neighboring node of the second graph node, and the association relationship between the second graph node and the neighboring node of the second graph node included in the positive sample pair, and replace it with: Obtain a feature vector of a second graph node included in the positive sample pair by vector mapping; obtain a feature vector of a neighbor node of the second graph node by vector mapping; obtain a feature vector of an association relationship between the second graph node and the neighbor nodes of the second graph node by vector mapping; Obtaining a first vector for the second graph node through a second encoding layer of the initial second encoder according to a feature vector of the second graph node, a feature vector of a neighboring node of the second graph node, and a feature vector of an association relationship between the second graph node and the neighboring nodes of the second graph node; Obtaining a second vector for the second graph node through a second encoding layer of the initial second encoder according to the first vector of the second graph node and a feature vector of a neighboring node of the second graph node; The feature vector of the second graph node, the first vector of the second graph node, and the second vector of the second graph node are concatenated to obtain the second graph node vector.

14. The device according to claim 9, It is characterized in that The device also includes an updating unit; The updating unit is used to update the bipartite graph according to the object association relationship between the object and other objects, the relationship type of the association relationship of the updated bipartite graph includes a node association relationship and an object association relationship, the node association relationship is used to reflect the association between the object and the resource, and the object association relationship is used to reflect the association between the object and the other objects; The sampling unit is used to randomly walk a preset step length from a starting graph node in the updated bipartite graph according to the node association relationship and the object association relationship to obtain a walking path.

15. The device according to claim 14, It is characterized in that The device further comprises a preset unit, which is used for: Presetting the ratio of object nodes in the walking path; During the random walk, the type of the association relationship is determined according to the object node ratio, and the random walk is performed according to the type of the association relationship.

16. The device according to any one of claims 9 to 15, It is characterized in that The device further comprises an application unit, wherein the application unit is configured to: Inputting a target object node and an arbitrary resource node into the recommendation model, and obtaining a target similarity between the target object node and the arbitrary resource node through the recommendation model; The resource corresponding to the arbitrary resource node is recommended to the target object according to the target similarity.

17. A computer device, It is characterized in that The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the method according to any one of claims 1 to 8 according to the instructions in the program code.

18. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 8.

19. A computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and device for outputting information

    CN111104599A

  • Multimedia resource recommendation method and device, electronic equipment and storage medium

    CN111708964A

  • Graph neural network link prediction recommendation method based on social relations

    CN112115377A

  • Method and device for training feature extraction model and detecting similar images

    CN113971751A

  • Training method and training device for image description model

    CN114090815A