A method, device, equipment and storage medium for determining representation information
By acquiring heterogeneous graphs and using multi-class metapath processing, the graph neural network is trained to obtain target representation information, which solves the problem that the existing technology cannot meet the needs of diversified business data, and improves the accuracy and effectiveness of media resource recommendations.
Patent Information
- Application Number
- CN202210116162.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-01-28
AI Technical Summary
The existing graph neural network cannot meet the needs of media resource recommendations when processing diversified business data, and cannot effectively recommend media resources that meet user needs.
By acquiring heterogeneous graphs, using multi-class metapaths to process and fuse the graph neural network, the graph neural network is trained to obtain target representation information, which is used to improve the accuracy of media resource recommendations.
Accurate representation of nodes in heterogeneous graphs is achieved, the accuracy and effect of media resource recommendations are improved, and self-supervised training can be carried out without relying on annotation.
Smart Images

Figure CN116561407B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for determining representation information. Background Art
[0002] With the development of network technology, the amount of media resources presented on the Internet is getting larger and larger. How to recommend media resources that meet users' needs from massive data has gradually become the mainstream direction of current research.
[0003] At present, graph neural networks are usually used to analyze the business data of media resources to determine which media resources to recommend to users. The essence of graph neural networks is a graph data processing method. By processing the graph data used to represent business data, the representation information of the nodes in the graph data is obtained, that is, the relationship between users or between users and media resources is obtained for recommendation. With the diversification of business data, more and more data types are involved, and the current graph neural networks can no longer meet the corresponding needs. Therefore, there is an urgent need for a media resource recommendation model that can recommend media resources based on more diverse types of business data. Summary of the invention
[0004] The embodiment of the present application provides a method, apparatus, device and storage medium for determining representation information. The method can improve the accuracy of the determined representation information, thereby improving the accuracy of media resource recommendation. The technical solution is as follows:
[0005] In one aspect, a method is provided, the method comprising:
[0006] Acquire a heterogeneous graph of a target resource service, wherein the heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource service, and a connection relationship between different nodes is used to represent a relationship between entities, and the entities in the target resource service include media resources and interactive objects, and the interactive objects are objects that have interacted with the media resources;
[0007] Based on a graph neural network, multi-class meta-paths of multiple nodes in the heterogeneous graph are respectively fused to obtain initial representation information of each of the multiple nodes, wherein any one of the multi-class meta-paths is used to represent a connection mode between different types of nodes in the heterogeneous graph;
[0008] Training the graph neural network based on initial representation information of each of the multiple nodes;
[0009] Based on the trained graph neural network, multi-class meta-paths of multiple nodes in the heterogeneous graph are fused respectively to obtain target representation information of each of the multiple nodes, and the target representation information is used to recommend media resources.
[0010] In a possible implementation, the graph neural network based on the training is subjected to graph convolution according to the multi-class meta-path of the node to obtain multiple target reference representation information of the node, including:
[0011] For any class of meta-paths in the multi-class meta-paths, based on the graph neural network, the node features of the reference nodes through which the meta-path passes in the heterogeneous graph are fused with the node features of the node to obtain the target reference representation information of the node under the meta-path.
[0012] In a possible implementation manner, fusing the multiple target reference representation information to obtain the target representation information of the node includes any of the following:
[0013] Performing weighted summation on the multiple target reference representation information to obtain the target representation information of the node;
[0014] The multiple target reference representation information are encoded based on the attention mechanism to obtain the target representation information of the node.
[0015] In one aspect, a device is provided, the device comprising:
[0016] A heterogeneous graph acquisition module is used to acquire a heterogeneous graph of a target resource service, wherein the heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource service, and the connection relationship between different nodes is used to represent the relationship between entities. The entities in the target resource service include media resources and interactive objects, and the interactive objects are objects that have interacted with the media resources;
[0017] A fusion module, for fusing the multi-class meta-paths of the multiple nodes in the heterogeneous graph respectively based on a graph neural network to obtain initial representation information of the multiple nodes, wherein any one of the multi-class meta-paths is used to represent a connection mode between different types of nodes in the heterogeneous graph;
[0018] A training module, used for training the graph neural network based on the initial representation information of each of the multiple nodes;
[0019] The fusion module is also used to fuse the multi-class meta-paths of multiple nodes in the heterogeneous graph based on the trained graph neural network, so as to obtain target representation information of each of the multiple nodes, and the target representation information is used to recommend media resources.
[0020] In a possible implementation, the heterogeneous graph acquisition module is used to acquire multiple entities in the target resource business, the associated data between the multiple entities, and the entity characteristics of the multiple entities; and generate the heterogeneous graph based on the multiple entities, the associated data between the multiple entities, and the entity characteristics of the multiple entities.
[0021] In a possible implementation, the heterogeneous graph acquisition module is used to generate multiple nodes corresponding to the multiple entities respectively, and the node characteristics of the multiple nodes are entity characteristics of the corresponding entities; based on the association data between the multiple entities, connecting lines are added between the multiple entities to obtain the heterogeneous graph.
[0022] In a possible implementation, the entities in the target resource business also include producers and labels of the media resources, the associated data include interaction data between the media resources and interactive objects and subordinate data between the producers and labels and the media resources, and the heterogeneous graph acquisition module is used to generate multiple resource nodes, multiple producer nodes, multiple label nodes and multiple object nodes corresponding to the interactive objects corresponding to the multiple media resources; adding lines between the multiple entities based on the associated data between the multiple entities to obtain the heterogeneous graph includes: adding lines between the multiple resource nodes and the multiple producer nodes based on the interaction data; adding lines between the multiple resource nodes, the multiple producer nodes and the multiple label nodes based on the subordinate data to obtain the heterogeneous graph.
[0023] In a possible implementation, the fusion module is used to perform graph convolution on any one of the multiple nodes according to the multi-class meta-path of the node based on the graph neural network to obtain multiple reference representation information of the node, and the starting point of the multi-class meta-path of the node is the node; and fuse the multiple reference representation information to obtain the initial representation information of the node.
[0024] In one possible implementation, the fusion module is used to fuse the node features of the reference nodes through which the meta-path passes in the heterogeneous graph with the node features of the node for any class of meta-paths in the multi-class meta-paths based on the graph neural network, so as to obtain the reference representation information of the node under the meta-path.
[0025] In a possible implementation, the fusion module is used to perform any of the following:
[0026] Performing weighted summation on the multiple reference representation information to obtain initial representation information of the node;
[0027] The multiple reference representation information are encoded based on the attention mechanism to obtain the initial representation information of the node.
[0028] In a possible implementation, the training module is used to obtain a positive sample set and a negative sample set from the multiple nodes, the positive sample set includes multiple positive sample pairs, and the negative sample set includes multiple negative sample pairs, the positive sample pairs are resource nodes and object nodes connected in the heterogeneous graph, and the negative sample pairs are resource nodes and object nodes that are not connected in the heterogeneous graph, wherein the resource nodes correspond to media resources and the object nodes correspond to interactive objects; based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set, the graph neural network is trained.
[0029] In one possible implementation, the training module is used to determine, for any positive sample pair in the positive sample set, first difference information between initial representation information of a resource node and initial representation information of an object node in the positive sample pair; for any negative sample pair in the negative sample set, determine second difference information between initial representation information of a resource node and initial representation information of an object node in the negative sample pair; and train the graph neural network based on the first difference information and the second difference information.
[0030] In one possible implementation, the initial representation information of each of the multiple nodes is obtained by fusing multiple reference representation information of each of the multiple nodes, and the multiple reference representation information corresponds to a multi-class meta-path of the multiple nodes. The training module is also used to train the graph neural network for a first node among the multiple nodes based on the third difference information between any two reference representation information among the multiple reference representation information of the first node.
[0031] In a possible implementation, the training module is also used to obtain multiple reference representation information of the second node among the multiple nodes; and train the graph neural network based on the third difference information and the fourth difference information, wherein the fourth difference information is the difference information between the multiple reference representation information of the first node and the multiple reference representation information of the second node.
[0032] In a possible implementation, the fusion module is also used to perform graph convolution on any one of the multiple nodes according to the multi-class meta-path of the node based on the trained graph neural network to obtain multiple target reference representation information of the node; and fuse the multiple target reference representation information to obtain the target representation information of the node.
[0033] In a possible implementation, the fusion module is also used to fuse the node features of the reference nodes passed by the meta-path in the heterogeneous graph with the node features of the node for any class of meta-paths in the multi-class meta-paths based on the graph neural network, so as to obtain the target reference representation information of the node under the meta-path.
[0034] In a possible implementation, the fusion module is further configured to perform any of the following:
[0035] Performing weighted summation on the multiple target reference representation information to obtain the target representation information of the node;
[0036] The multiple target reference representation information are encoded based on the attention mechanism to obtain the target representation information of the node.
[0037] In a possible implementation, the device further includes:
[0038] The recommendation module is used to recommend resources based on the target representation information of each of the multiple nodes.
[0039] On the one hand, a computer device is provided, which includes one or more processors and one or more memories, wherein the one or more memories store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors to implement the operations performed by the method for determining the representation information.
[0040] On the one hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the method for determining the representation information.
[0041] In one aspect, a computer program product is provided, the computer program product comprising at least one computer program, the at least one computer program being stored in a computer-readable storage medium. A processor of a computer device reads the at least one computer program from the computer-readable storage medium, and the processor executes the at least one computer program, so that the computer device implements the operation of the method for determining the executed representation information.
[0042] Through the technical solution provided in the embodiment of the present application, a heterogeneous graph including nodes corresponding to media resources and nodes corresponding to interactive objects is obtained, and the heterogeneous graph is processed by a graph neural network using a multi-class meta-path, and the processing results are fused into the initial representation information of multiple nodes in the heterogeneous graph. The multi-class meta-path is equivalent to multiple perspectives, that is, the heterogeneous graph is processed using multiple perspectives to obtain the initial representation information of multiple nodes. The graph neural network is trained based on the initial representation information of multiple nodes to obtain a trained graph neural network. The training process of the neural network is also a self-supervised training that does not rely on annotations. By using the trained graph neural network to process the heterogeneous graph, the target representation information of each of the multiple nodes in the heterogeneous graph can be obtained. The target representation information can accurately represent the nodes in the heterogeneous graph, and the accuracy of media resource recommendation using the target representation information is high and the effect is good. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 creative work.
[0044] Figure 1 It is a schematic diagram of an implementation environment of a method for determining representation information provided in an embodiment of the present application;
[0045] Figure 2 is a flow chart of a method for determining representation information provided by an embodiment of the present application;
[0046] Figure 3 is a flow chart of a method for determining representation information provided by an embodiment of the present application;
[0047] Figure 4 is a schematic diagram of a heterogeneous graph provided in an embodiment of the present application;
[0048] Figure 5 is a schematic diagram of a meta-path provided in an embodiment of the present application;
[0049] Figure 6 is a schematic diagram of a meta-path provided in an embodiment of the present application;
[0050] Figure 7 is a schematic diagram of representation learning provided by an embodiment of the present application;
[0051] Figure 8 It is a framework diagram of a method for determining representation information provided in an embodiment of the present application;
[0052] Fig. 9is a structural schematic diagram of a device for determining representation information provided in an embodiment of the present application;
[0053] Fig.10 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0054] Fig.11 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application clearer, the following will further describe the implementation methods of this application in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0056] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.
[0057] In order to facilitate understanding of the technical process of the embodiments of the present application, some terms involved in the embodiments of the present application are explained below:
[0058] Artificial Intelligence (AI) is the 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 machines have the functions of perception, reasoning and decision-making.
[0059] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0060] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0061] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior 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 teaching learning.
[0062] Graph Neural Networks (GNN) is a deep learning algorithm based on graph structure. In computer science, a graph is a data structure composed of nodes and edges. Graph neural network is a neural network that directly acts on the graph structure. Its essence is a graph data processing method used to obtain graph data feature representation.
[0063] Heterogeneous Graph, also known as heterogeneous graph, is a graph containing multiple types of nodes or edges.
[0064] Meta-path is a specific path pattern used to connect two types of entities in a graph structure.
[0065] Embedding, also known as representation or representation, is a vector representation of an entity in a low-dimensional space. It is an implicit representation that appears as a multi-dimensional vector. For example, a word, a product, a movie, etc. can all be represented by embedding.
[0066] The essence of the attention mechanism is to locate information of interest and suppress useless information. The results are usually displayed in the form of probability maps or probability feature vectors. It is a mechanism often used in deep learning.
[0067] The following is an introduction to the implementation environment of this application. Figure 1is a schematic diagram of an implementation environment of a method for determining representation information provided in an embodiment of the present application, see Figure 1 The implementation environment includes: a terminal 101 and a server 102, and the terminal 101 and the server 102 are connected to each other via a wired or wireless network.
[0068] The terminal 101 has an application installed and running that supports the playback of media resources. Optionally, the application is a social application, a media resource application, and the like.
[0069] The terminal 101 may be a vehicle-mounted terminal, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, etc., which is not limited in the embodiments of the present application.
[0070] The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Optionally, the number of the above terminals or servers may be more or less, and the embodiments of the present application are not limited to this.
[0071] In some embodiments, the terminal 101 and the server 102 can serve as nodes in a blockchain system.
[0072] After introducing the implementation environment of the embodiment of the present application, the application scenario of the embodiment of the present application will be described in combination with the above-mentioned implementation environment. In the following description, the terminal is the terminal 101 in the above-mentioned implementation environment, and the server is the server 102 in the above-mentioned implementation environment.
[0073] The technical solution provided by the embodiments of the present application can be applied in the scenario of recommending various types of media resources, for example, in the scenario of recommending short videos, or in the scenario of recommending film and television works, or in the scenario of recommending music, or in the scenario of recommending articles.
[0074] In the scenario of recommending short videos, the terminal starts an application for watching short videos, and an object account is logged in to the application. When the object is a user, the object account is also the user account. The terminal sends a short video recommendation request to the server, and the short video recommendation request carries the object account. The server obtains the short video recommendation request and obtains the object account from the recommendation request. The server queries the object database based on the object account to obtain the target representation information corresponding to the object account, and the target representation information can reflect the viewing preferences of the object account to a certain extent. The server matches in the short video database based on the target representation information to determine at least one target short video to be recommended, wherein the short video database stores the target representation information of multiple short videos. The server recommends the at least one target short video to the terminal. In the above process, the accuracy of the target representation information corresponding to the object account and the target representation information of the short video will affect the accuracy of the short video recommendation. By adopting the technical solution provided in the embodiment of the present application, the target representation information of multiple nodes in the heterogeneous graph can be determined through the heterogeneous graph and the multi-class meta-path in the heterogeneous graph, and the accuracy of the target representation information is high, wherein the multiple nodes in the heterogeneous graph include the object node corresponding to the object account and the resource node corresponding to the short video. After the target representation information of multiple nodes in the heterogeneous graph is determined by the technical solution provided in the embodiment of the present application, the server can store the target representation information of the object nodes among the multiple nodes in the object database, and store the target representation information of the resource nodes among the multiple nodes in the short video database. Accordingly, the server can establish an association between the target representation information and the object account in the object database, and establish an association between the target representation information and the short video in the short video database, so as to facilitate query in the short video recommendation process.
[0075] It should be noted that in the above description, the server recommends short videos as an example. In the scenarios where the server recommends film and television works, music, and articles, the above description process belongs to the same inventive concept, and the content is not repeated. Of course, in addition to being applicable to the above-mentioned scenarios, the technical solution provided in the embodiment of the present application can also be applied to the scenario of recommending other types of media resources, and the embodiment of the present application does not limit this.
[0076] After introducing the implementation environment and application scenarios of the embodiments of the present application, the technical solutions provided by the embodiments of the present application are introduced below. Figure 2 The technical solution provided in the embodiment of the present application can be executed by a terminal or a server, or can be executed by a terminal and a server together. In the embodiment of the present application, the execution subject is taken as an example to illustrate, and the method includes:
[0077] 201. The server obtains a heterogeneous graph of the target resource business, where the heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource business, and the connection relationship between different nodes is used to represent the relationship between entities. The entities in the target resource business include media resources and interactive objects, and the interactive objects are objects that have interacted with the media resources.
[0078] Among them, the target resource business is a business of recommending media resources, and the target resource business has a corresponding meaning according to the different recommended media resources. A heterogeneous graph refers to a graph including two or more types of nodes. In a heterogeneous graph, when there is a line between two nodes, it means that there is an association relationship between the two nodes; when there is no line between the two nodes, it means that there is no association relationship between the two nodes. An entity refers to a concept that has meaning when performing a target resource business, and the determination of an entity is associated with a target resource business. The media resources corresponding to the target resource business are media resources that can be used for media resource recommendation, and the interactive objects corresponding to the target resource business are objects that can be used for media resource recommendation. In some embodiments, the object is also a user. An interactive object having interacted with a media resource means that the interactive object has watched, shared, liked, commented on, or collected the media resource. In some embodiments, an interactive object is also referred to as an interactive user.
[0079] 202. Based on the graph neural network, the server fuses the multi-class meta-paths of the multiple nodes in the heterogeneous graph respectively to obtain the initial representation information of the multiple nodes. Any class meta-path in the multi-class meta-path is used to represent a connection method between different types of nodes in the heterogeneous graph.
[0080] Among them, the graph neural network is used for graph convolution of heterogeneous graphs to obtain the initial representation information of multiple nodes. The graph neural network is an untrained or incompletely trained graph neural network. Accordingly, the initial representation information here refers to the representation information obtained by using the untrained or incompletely trained graph neural network for graph convolution. Multi-class meta-paths represent different connection modes between different types of nodes in heterogeneous graphs. For a node in a heterogeneous graph, the use of multi-class meta-paths based on neural networks can obtain multiple representation information corresponding to the multi-class meta-paths. After the multiple representation information is fused, the initial representation information of the node is obtained.
[0081] 203. The server trains the graph neural network based on the initial representation information of each of the multiple nodes.
[0082] Among them, since heterogeneous graphs can indicate the relationship between different nodes, training the graph neural network based on the initial representation information of multiple nodes is also a self-supervised training process.
[0083] 204. Based on the trained graph neural network, the server fuses the multi-class meta-paths of the multiple nodes in the heterogeneous graph respectively to obtain the target representation information of the multiple nodes respectively, and the target representation information is used to recommend media resources.
[0084] Through the technical solution provided in the embodiment of the present application, a heterogeneous graph including nodes corresponding to media resources and nodes corresponding to interactive objects is obtained, and the heterogeneous graph is processed by a graph neural network using a multi-class meta-path, and the processing results are fused into the initial representation information of multiple nodes in the heterogeneous graph. The multi-class meta-path is equivalent to multiple perspectives, that is, the heterogeneous graph is processed using multiple perspectives to obtain the initial representation information of multiple nodes. The graph neural network is trained based on the initial representation information of multiple nodes to obtain a trained graph neural network. The training process of the neural network is also a self-supervised training that does not rely on annotations. By using the trained graph neural network to process the heterogeneous graph, the target representation information of each of the multiple nodes in the heterogeneous graph can be obtained. The target representation information can accurately represent the nodes in the heterogeneous graph, and the accuracy of media resource recommendation using the target representation information is high and the effect is good.
[0085] It should be noted that the above steps 201-204 are a brief introduction to the technical solution provided in the embodiment of the present application. The technical solution provided in the embodiment of the present application will be more clearly explained below with reference to some examples. Figure 3 The technical solution provided in the embodiment of the present application can be executed by a terminal or a server, or can be executed by a terminal and a server together. In the embodiment of the present application, the execution subject is taken as an example to illustrate, and the method includes:
[0086] 301. The server obtains multiple entities in a target resource service, association data between the multiple entities, and entity features of the multiple entities. The entities in the target resource service include media resources and interactive objects. The interactive objects are objects that have interacted with the media resources.
[0087] Among them, the multiple entities include multiple media resources and multiple interactive objects, and the associated data between the multiple entities include the interactive data between multiple interactive objects and multiple media resources, the related data between multiple media resources, and the related data between multiple interactive objects. Among them, the interactive data between multiple media resources and multiple interactive objects include data corresponding to interactive behaviors such as watching, sharing, liking, commenting or collecting between interactive objects and media resources. For an interactive object, the interactive data of the interactive object includes the identification of the media resource with which the interactive object has interacted and the type of interactive behavior that has occurred; the related data between multiple media resources is used to indicate the media resources with the same media tags, the media resources with the same publisher, and the media resources of the same type in multiple media resources; the related data between multiple interactive objects is used to indicate the interactive objects with the same object tags, the interactive objects with similar preferences, and the interactive objects with similar object characteristics in multiple interactive objects. In some embodiments, the media resources are any one of short videos, film and television works, music, and articles, and the embodiments of the present application are not limited to this. In some embodiments, multiple entities in the target resource business, the associated data between the multiple entities, and the entity characteristics of the multiple entities are also referred to as heterogeneous information. In some embodiments, multiple entities in the target resource business, associated data between the multiple entities, and entity characteristics of the multiple entities are also collectively referred to as business data of the target resource business.
[0088] In a possible implementation, the server obtains initial service data of the target resource service, the service data including multiple candidate media resources, multiple candidate interaction objects, resource features of the multiple candidate media resources, object features of the multiple candidate interaction objects, and multiple candidate association data, the candidate association data referring to interaction data between the candidate interaction objects and the candidate media resources. The server preprocesses the service data based on the target rule to obtain target service data of the target resource service, the target service data including multiple media resources, multiple interaction objects, resource features of the multiple media resources, object features of the multiple interaction objects, and multiple association data, the association data referring to association data between the interaction objects and the media resources.
[0089] Among them, multiple candidate media resources are media resources stored in the resource database maintained by the server, and multiple candidate interactive objects are interactive objects stored in the object database maintained by the server. The target rule is a data preprocessing rule, which is set by the technical staff according to the actual situation, and the embodiment of the present application does not limit this. In some embodiments, the process of preprocessing the initial business data is also referred to as the process of data cleaning or data filtering the initial business data. In some embodiments, the resource characteristics include at least one of the information such as the type, duration, title and number of interactions of the corresponding media resource, wherein the number of interactions includes at least one of the number of times the media resource has been viewed, shared, liked, commented or collected. In some embodiments, the object characteristics include at least one of the characteristics such as the gender, region, online time and follow list of the corresponding interactive object.
[0090] In this implementation, the server can pre-process the initial business data based on the target rules. The pre-processing process can eliminate some erroneous or abnormal data, which can not only reduce the amount of data but also improve the accuracy of subsequent processing.
[0091] The following describes a method in which the server pre-processes the initial service data based on the target rule in the above implementation mode to obtain the target service data of the target resource service.
[0092] In some embodiments, the target rule includes whether the candidate media resource meets the first target condition, whether the candidate interactive object meets the second target condition, and whether the associated data between the multiple candidate interactive objects and the multiple candidate media resources meets the third target condition. The server deletes the candidate media resources and corresponding resource features that meet the first target condition from the multiple candidate media resources to obtain the multiple media resources and the resource features of the multiple media resources. The server deletes the candidate interactive objects and corresponding object features that meet the second target condition from the multiple candidate interactive objects to obtain the multiple interactive objects and the object features of the multiple interactive objects. The server deletes the candidate associated data that meets the third target condition from the multiple candidate associated data to obtain the multiple associated data. The server deletes the resource features that meet the fourth target condition from the resource features of the multiple candidate media resources to obtain the resource features of the multiple media resources. The server deletes the object features that meet the fifth target condition from the object features of the multiple candidate interactive objects to obtain the object features of the multiple interactive objects.
[0093] In some embodiments, the first target condition refers to at least one of the following:
[0094] The number of times a candidate media resource is played is less than or equal to the number of times a candidate media resource is played. Since the reference value of a candidate media resource with a small number of times a candidate media resource is not great, the server can eliminate the candidate media resource with a small number of times a candidate media resource. In some embodiments, the candidate media resource with a small number of times a candidate media resource is also referred to as a low-frequency media resource. The number of interactions between a candidate media resource and an interactive object is less than or equal to the number of interactions threshold. Since the reference value of a candidate media resource with a small number of interactions is not great, the server can eliminate the candidate media resource with a small number of interactions. In some embodiments, the candidate media resource with a small number of interactions is also referred to as a low-frequency media resource. The duration of a candidate media resource is less than or equal to the resource duration threshold. Since the reference value of a candidate media resource with a shorter duration is not great, the server can eliminate the candidate media resource with a shorter duration. In some embodiments, the candidate media resource with a shorter duration is also referred to as an abnormal media resource. The number of resource features of a candidate media resource is less than or equal to the resource feature number threshold. Since the reference value of a candidate media resource with a small number of resource features is not great, the server can eliminate the candidate media resource with a small number of resource features. Among them, the playback count threshold, interaction count threshold, resource duration threshold and resource feature data threshold are set by technical personnel according to actual conditions, and the embodiments of the present application do not limit this.
[0095] In some embodiments, the second target condition refers to at least one of the following:
[0096] The number of times the candidate interactive object has viewed media resources is less than or equal to the viewing number threshold. Since the candidate interactive object with fewer viewing times has little reference value, the server can remove the candidate interactive object with fewer viewing times. In some embodiments, when the object is a user, the candidate interactive object with fewer viewing times is also called a low-frequency user. The single-day viewing time of the candidate interactive object is greater than or equal to the viewing time threshold. Since the candidate interactive object with a longer single-day viewing time may be an abnormal object and has little reference value, the server can remove the candidate interactive object with a longer single-day viewing time. The number of media resources viewed by the candidate interactive object is less than or equal to the viewing amount threshold. Since the candidate interactive object with a smaller number of viewing media resources has little reference value, the server can remove the candidate interactive object with a smaller number of viewing media resources. In some embodiments, when the object is a user, the candidate interactive object with a smaller number of viewing media resources is also called a low-frequency user. The number of object features of the candidate interactive object is less than or equal to the object feature number threshold. Since the candidate interactive object with a smaller number of object features has little reference value, the server can remove the candidate interactive object with a smaller number of object features. Among them, the viewing number threshold, viewing time threshold, viewing amount threshold and object feature quantity threshold are set by technical personnel according to actual conditions, and the embodiments of the present application do not limit this.
[0097] In some embodiments, the third target condition means that the viewing ratio corresponding to the candidate associated data is less than or equal to the viewing ratio threshold, wherein the viewing ratio refers to the viewing ratio of the media resource when the interactive operation corresponding to the candidate associated data is performed. In some embodiments, the viewing ratio threshold is negatively correlated with the duration of the media resource. For example, for media resources with a shorter duration, it is necessary to watch it in its entirety or even more than once to be considered an effective interaction; for media resources with a longer duration, only a certain proportion needs to be watched to be retained; the longer the media resource, the lower the viewing ratio threshold is set. In some embodiments, candidate associated data that meets the third target condition is also referred to as invalid associated data.
[0098] In some embodiments, the fourth target condition means that the characteristic value of any feature in the resource feature is outside the characteristic value range corresponding to the feature, wherein the characteristic value range corresponding to the feature is determined based on the type of the feature, for example, there is a feature of duration in the resource feature, and the characteristic value range of duration is (0, +∞). If the characteristic value of duration in a resource feature is a negative number, it means that the characteristic value is outside the characteristic value range.
[0099] In some embodiments, the fifth target condition means that the feature value of any feature in the object feature is outside the feature value range corresponding to the feature, wherein the feature value range corresponding to the feature is determined based on the type of the feature, for example, there is a feature of gender in the object feature, and the feature value range of gender is 0, 1 and 2, where 0 represents male, 1 represents female, and 2 represents unfilled. If the feature value of gender in a certain object feature is 3, it means that the feature value is outside the feature value range.
[0100] In some embodiments, after the server preprocesses the resource features and object features in the above manner, it can also encode or normalize the resource features and object features to enhance the consistency of feature representation. When encoding resource features and object features, the encoding method is determined according to the feature type, wherein the correspondence between the feature type and the encoding method is set by the technician according to the actual situation, and the embodiments of the present application do not limit this.
[0101] In a possible implementation, the entities in the target resource business include, in addition to media resources and interactive objects, producers of media resources and resource tags. The producer of media resources is the author or publisher of media resources. Resource tags are used to indicate information such as the type, scene or content of media resources. The resource tags can be used to indicate the classification relationship between media resources and types, that is, the media resource belongs to a certain type of media resource indicated by the resource tag. The resource tag can be used to indicate a subordinate relationship between media resources and content, that is, the media resource belongs to subordinate content of the content indicated by the resource tag. For example, the resource tag indicates a TV series, and the media resource is an episode of the TV series. The server obtains the initial business data of the target resource business, the business data includes multiple candidate media resources, multiple candidate interaction objects, resource features of the multiple candidate media resources, object features of the multiple candidate interaction objects, producers of the multiple candidate media resources, resource tags of the multiple candidate media resources, and multiple candidate association data, the candidate association data includes interaction data between the candidate interaction objects and the candidate media resources, subordinate data of the producers and tags of the multiple candidate media resources, and attention data between the multiple candidate interaction objects and the producers of the multiple candidate media resources, wherein. The subordinate data is used to indicate the subordinate relationship between the producer and the tag and the media resource, wherein the subordinate relationship between the producer and the media resource is also called a production relationship. The server pre-processes the business data based on the target rule to obtain the target business data of the target resource business, the target business data includes multiple media resources, multiple interaction objects, resource features of the multiple media resources, object features of the multiple interaction objects, producers of the multiple media resources, resource tags of the multiple media resources, and multiple association data, the association data includes association data between the interaction objects and the media resources, subordinate data of the producers and tags of the multiple media resources, and attention data between the multiple interaction objects and the producers of the multiple media resources.
[0102] Among them, the method in which the server pre-processes the initial business data based on the target rule to obtain the target business data of the target resource business belongs to the same inventive concept as the above description. The implementation process refers to the previous description and will not be repeated here.
[0103] 302. The server generates the heterogeneous graph based on the multiple entities, the associated data between the multiple entities, and the entity features of the multiple entities. The heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource business, and the connection relationship between different nodes is used to represent the relationship between the entities.
[0104] Wherein, in the case where the multiple entities include media resources and interactive objects, the entity features of the multiple entities include resource features of media resources and object features of interactive objects. The heterogeneous graph includes two types of nodes, one type of node is a resource node corresponding to the media resources, and the other type of node is an object node corresponding to the interactive objects. The number of resource nodes is the same as the number of media resources, and the number of object nodes is the same as the number of interactive objects. Correspondingly, the node features of the resource nodes are the resource features of the corresponding media resources, and the node features of the object nodes are the object features of the corresponding interactive objects. In some embodiments, the entity features of the entity are also referred to as the attributes of the entity, and the node features of the node are also referred to as the attributes of the node. In some embodiments, the object node is also referred to as the user node.
[0105] In the heterogeneous graph, when there is a connection between a resource node and an object node, it means that there is an interactive relationship between the media resource corresponding to the resource node and the interactive object corresponding to the object node. When there is no connection between a resource node and an object node, it means that there is no interactive relationship between the media resource corresponding to the resource node and the interactive object corresponding to the object node. When there is a connection between a resource node and another resource node, it means that the two media resources corresponding to the two resource nodes are media resources of the same type. When there is a connection between an object node and another object node, it means that the two interactive objects corresponding to the two object nodes are interactive objects of the same type.
[0106] In a possible implementation, the server generates a plurality of nodes corresponding to the plurality of entities, wherein the node features of the plurality of nodes are entity features of the corresponding entities. Based on the association data between the plurality of entities, the server adds connections between the plurality of entities to obtain the heterogeneous graph.
[0107] The entity features of an entity are also referred to as representations of the entity. In some embodiments, the entity features of an entity are stored in the form of a feature matrix.
[0108] For example, in the case where the multiple entities include media resources and interactive objects, the server generates multiple resource nodes corresponding to the multiple media resources respectively, the node characteristics of each resource node are the resource characteristic matrix of the corresponding media resources, the node identification of each resource node is the resource identification of the corresponding media resources, such as the name of the media resources, etc., and the corresponding relationship between the resource node and the media resources can be determined by the node identification of the resource node. The server generates multiple object nodes corresponding to the multiple interactive objects respectively, the node characteristics of each object node are the object characteristic matrix of the corresponding interactive object, the node identification of each object node is the object identification of the corresponding interactive object, such as the account of the interactive object, etc., and the corresponding relationship between the object node and the interactive object can be determined by the node identification of the object node. Based on the association data between the multiple entities, the server adds connections between resource nodes and object nodes, between resource nodes and resource nodes, and between object nodes and object nodes to obtain the heterogeneous graph. In the heterogeneous graph determined in this way, there may be connections between nodes of the same type, and there may also be connections between nodes of different types.
[0109] For example, when the association data between the multiple entities indicates that there is an interactive behavior between any media resource and any interactive object, the server adds a connection between the resource node corresponding to the media resource and the object node corresponding to the interactive object; when the association data between the multiple entities indicates that any media resource and another media resource are media resources of the same type, the server adds a connection between the resource nodes corresponding to the two media resources; when the association data between the multiple entities indicates that any media resource and another media resource are media resources of the same type, the server adds a connection between the resource nodes corresponding to the two media resources; when the association data between the multiple entities indicates that any interactive object and another interactive object are interactive objects of the same type, the server adds a connection between the object nodes corresponding to the two interactive objects. By repeatedly executing the above steps of adding connections between nodes based on the association data between the multiple entities, the heterogeneous graph can be obtained.
[0110] The above description is made by taking the example that the entities in the target resource service include media resources and interactive objects. In the following description, the entities in the target resource service also include other types of entities.
[0111] In some embodiments, the entity in the target resource service includes at least one of the producer and resource tag of the media resource in addition to the media resource and the interactive object. In the case where the entity in the target resource service also includes the producer and resource tag of the media resource, the heterogeneous graph includes four types of nodes, the first type of node is the resource node corresponding to the media resource, the second type of node is the object node corresponding to the interactive object, the third type of node is the producer node corresponding to the producer of the media resource, and the fourth type of node is the label node corresponding to the resource tag of the media resource, wherein the number of resource nodes is the same as the number of media resources, the number of object nodes is the same as the number of interactive objects, the number of producer nodes is the same as the number of producers of media resources, and the number of label nodes is the same as the number of resource tags of media resources. Correspondingly, the node characteristics of the resource node are the resource characteristics of the corresponding media resource, the node characteristics of the object node are the object characteristics of the corresponding interactive object, the node characteristics of the producer node are the producer characteristics of the corresponding producer, and the node characteristics of the label node are the content of the corresponding resource tag. In some embodiments, the producer characteristics are similar to the object characteristics, including at least one of the characteristics of the corresponding producer, such as gender, location, online time, and attention list.
[0112] In the heterogeneous graph, when there is a connection between a resource node and an object node, it means that there is an interactive relationship between the media resource corresponding to the resource node and the interactive object corresponding to the object node. When there is no connection between a resource node and an object node, it means that there is no interactive relationship between the media resource corresponding to the resource node and the interactive object corresponding to the object node. When there is a connection between a resource node and a producer node, it means that there is a production relationship between the media resource corresponding to the resource node and the producer corresponding to the producer node, that is, the media resource is created or published by the producer. When there is no connection between a resource node and a producer node, it means that there is no production relationship between the media resource corresponding to the resource node and the producer corresponding to the producer node. When there is a connection between a resource node and a label node, it means that there is a subordinate relationship between the media resource corresponding to the resource node and the resource tag corresponding to the label node, that is, the resource tag is a resource tag of the media resource. When there is no connection between a resource node and a label node, it means that there is no subordinate relationship between the media resource corresponding to the resource node and the resource tag corresponding to the label node. When there is a line between an object node and a producer node, it means that there is a follow relationship between the interactive object corresponding to the object node and the producer corresponding to the producer node, that is, the interactive object follows the producer. When there is no line between an object node and a producer node, it means that there is no follow relationship between the interactive object corresponding to the object node and the producer corresponding to the producer node. For example, Figure 4 A schematic diagram of a heterogeneous graph is provided. Figure 4 , including an object node 401 , a resource node 402 , a producer node 403 and a label node 404 .
[0113] In a possible implementation, the server generates multiple resource nodes corresponding to the multiple media resources, the node characteristics of each resource node are the resource characteristic matrix of the corresponding media resources, and the node identification of each resource node is the resource identification of the corresponding media resources. The server generates multiple object nodes corresponding to the multiple interactive objects, the node characteristics of each object node are the object characteristic matrix of the corresponding interactive object, and the node identification of each object node is the object identification of the corresponding interactive object. The server generates multiple producer nodes corresponding to the producers of the multiple media resources, the node characteristics of each producer node are the producer characteristics of the corresponding producer, and the node identification of each producer node is the producer identification of the corresponding producer, such as the account of the producer, etc. The corresponding relationship between the producer node and the producer can be determined by the node identification of the producer node. The server generates multiple label nodes corresponding to the resource labels of the multiple media resources, the node characteristics of each label node are the content of the corresponding media label, and the node identification of each label node can also be the content of the corresponding media label. Based on the association data between the multiple entities, the server adds connections between the resource node and the object node, between the resource node and the producer node, between the resource node and the label node, and between the object node and the producer node to obtain the heterogeneous graph. In the heterogeneous graph determined in this way, there are connections between nodes of different types, but there are no connections between nodes of the same type.
[0114] For example, when the association data between the multiple entities indicates that there is an interactive behavior between any media resource and any interactive object, the server adds a connection between the resource node corresponding to the media resource and the object node corresponding to the interactive object; when the association data between the multiple entities indicates that there is a subordinate relationship between any producer and any media resource, a connection is added between the producer node corresponding to the producer and the resource node corresponding to the media resource; when the association data between the multiple entities indicates that there is a subordinate relationship between any resource tag and any media resource, a connection is added between the tag node corresponding to the resource tag and the resource node corresponding to the media resource. By repeatedly executing the above steps of adding connections between nodes based on the association data between the multiple entities, the heterogeneous graph can be obtained.
[0115] It should be noted that the above is explained by taking the example that the entities in the target resource business include four types of entities: media resources, interactive objects, producers of media resources, and resource tags. In the case where the entities in the target resource business include three types of entities: media resources, interactive objects, and producers of media resources, or the entities in the target resource business include three types of entities: media resources, interactive objects, and resource tags of media resources, the way the server generates the heterogeneous graph belongs to the same inventive concept as the way the above four types of entities are generated, and the types of nodes and connections created can be reduced accordingly, which will not be repeated here.
[0116] In addition, when the entities in the target resource business include other types of entities in addition to the four types of entities including media resources, interactive objects, media resource producers and resource tags, the server can generate nodes and add connections accordingly, which will not be repeated here.
[0117] 303. Based on the graph neural network, the server fuses the multi-class meta-paths of the multiple nodes in the heterogeneous graph respectively to obtain the initial representation information of the multiple nodes. Any class meta-path in the multi-class meta-path is used to represent a connection method between different types of nodes in the heterogeneous graph.
[0118] Among them, the graph neural network is Graph Sage (Graph Sample and Aggregate) or GAT (Graph Attention Network). Of course, with the development of science and technology, it can also be other types of graph neural networks, and the embodiments of the present application do not limit this. In step 303, the graph neural network is an untrained or uncompleted graph neural network. Accordingly, the initial representation information here refers to the representation information obtained by graph convolution using an untrained or uncompleted graph neural network. Fusion of the multi-class meta-paths of multiple nodes in the heterogeneous graph refers to fusion of the multi-class meta-paths of each node in the heterogeneous graph. The initial representation information of the node is different from the node feature of the node. The node feature is assigned to the node when the heterogeneous graph is generated, and the initial representation information is the representation information obtained after processing by the graph neural network. The initial representation information fuses the node feature of the node and the node feature of the neighboring nodes of the node. Since the initial representation information of the node is obtained by fusing the multi-class meta-path of the node, the initial representation information is actually an aggregated representation information. In some embodiments, since the target resource service is a service of recommending media resources to an object, when determining the initial representation information of each of the multiple nodes, it is only necessary to determine the initial representation information of each of the multiple resource nodes and the multiple object nodes. In some embodiments, the multi-class metapath is also called multi-perspective.
[0119] In a possible implementation, for any of the multiple nodes, the server performs graph convolution on the node according to the multi-class meta-path of the node based on the graph neural network to obtain multiple reference representation information of the node, and the starting point of the multi-class meta-path of the node is the node. The server fuses the multiple reference representation information to obtain the initial representation information of the node. The starting point of the multi-class meta-path of the node is the node, which means that for any meta-path of the node, the meta-path will sequentially pass through multiple nodes in the heterogeneous graph, and the node is the first node passed by the meta-path.
[0120] In order to explain the above implementation more clearly, the above implementation will be explained in three parts below, wherein the first part explains the meta-path, the second part explains the method for the server to obtain the reference representation information of the node, and the third part explains the method for the server to obtain the initial representation information of the node.
[0121] The first part describes the meta-path. In the following description, the server obtains the initial representation information of the resource node and the object node respectively as an example.
[0122] In the case that the multiple nodes include resource nodes and object nodes, for any resource node among the multiple nodes, the server performs graph convolution on the resource node using two types of meta-paths corresponding to the resource node to obtain two reference representation information of the resource node, and the two reference representation information correspond to the two types of meta-paths.
[0123] Among them, for any resource node among the multiple nodes, the first type of meta-path in the two types of meta-paths sequentially passes through the resource node, the object node connected to the resource node in the heterogeneous graph, and another resource node connected to the object node in the heterogeneous graph. The first type of meta-path sequentially passes through resource node→object node→resource node. If the resource node is abbreviated as V and the object node is abbreviated as U, then the first type of meta-path is V→U→V. The second type of meta-path in the two types of meta-paths sequentially passes through the resource node, the object node connected to the resource node in the heterogeneous graph, and another object node connected to the object node in the heterogeneous graph. The second type of meta-path sequentially passes through resource node→object node→object node. If the resource node is abbreviated as V and the object node is abbreviated as U, then the second type of meta-path is V→U→U.
[0124] In the case that the multiple nodes include resource nodes and object nodes, for any object node among the multiple nodes, the server performs graph convolution on the object node using two types of meta-paths corresponding to the object node to obtain two reference representation information of the object node, and the two reference representation information correspond to the two types of meta-paths.
[0125] Among them, for any object node among the multiple nodes, the first type of meta-path in the two types of meta-paths sequentially passes through the object node, the resource node connected to the object node in the heterogeneous graph, and another object node connected to the resource node in the heterogeneous graph. The first type of meta-path sequentially passes through object node→resource node→object node. If the resource node is abbreviated as V and the object node is abbreviated as U, then the first type of meta-path is U→V→U. The second type of meta-path in the two types of meta-paths sequentially passes through the object node, the resource node connected to the object node in the heterogeneous graph, and another resource node connected to the resource node in the heterogeneous graph. The second type of meta-path sequentially passes through object node→resource node→resource node. If the resource node is abbreviated as V and the object node is abbreviated as U, then the second type of meta-path is U→V→V.
[0126] It should be noted that, in the above description, the case where the multiple nodes include resource nodes and object nodes, and each type of meta-path connects three nodes is used as an example. In other possible implementations, each type of meta-path can also connect more nodes. For example, for a meta-path U→V→V, one U can connect to 10 Vs, and the second V can connect to 5 Vs.
[0127] In the case where the multiple nodes include resource nodes, object nodes, producer nodes and label nodes, for any resource node among the multiple nodes, the server performs graph convolution on the resource node using three types of meta-paths corresponding to the resource node to obtain three reference representation information of the resource node, and the three reference representation information corresponds to the three types of meta-paths.
[0128] Among them, for any resource node among the multiple nodes, the first type of meta-path in the three types of meta-paths sequentially passes through the resource node, the object node connected to the resource node in the heterogeneous graph, and another resource node connected to the object node in the heterogeneous graph. The first type of meta-path sequentially passes through resource node→object node→resource node. If the resource node is abbreviated as V and the object node is abbreviated as U, then the first type of meta-path is V→U→V. The second type of meta-path in the three types of meta-paths sequentially passes through the resource node, the producer node connected to the resource node in the heterogeneous graph, and another resource node connected to the producer node in the heterogeneous graph. The second type of meta-path sequentially passes through resource node→producer node→resource node. If the resource node is abbreviated as V and the producer node is abbreviated as A, then the second type of meta-path is V→A→V. The third type of meta-path in the three types of meta-paths passes through the resource node, the label node connected to the resource node in the heterogeneous graph, and another resource node connected to the label node in the heterogeneous graph. The third type of meta-path passes through resource node→label node→resource node in sequence. If the resource node is abbreviated as V and the label node is abbreviated as T, then the third type of meta-path is V→T→V. For example, see Figure 5 , provides a schematic diagram of three types of meta-paths of resource nodes, Figure 5 It includes a first type of meta-path 501 , a second type of meta-path 502 and a third type of meta-path 503 .
[0129] In the case where the multiple nodes include resource nodes, object nodes, producer nodes and label nodes, for any object node among the multiple nodes, the server performs graph convolution on the object node using the three types of meta-paths corresponding to the object node to obtain three reference representation information of the object node, and the three reference representation information corresponds to the three types of meta-paths.
[0130] Among them, for any object node among the multiple nodes, the first type of meta-path in the three types of meta-paths sequentially passes through the object node, the resource node connected to the object node in the heterogeneous graph, and another object node connected to the resource node in the heterogeneous graph. The first type of meta-path sequentially passes through object node→resource node→object node. If the resource node is abbreviated as V and the object node is abbreviated as U, then the first type of meta-path is U→V→U. The second type of meta-path in the three types of meta-paths sequentially passes through the object node, the resource node connected to the object node in the heterogeneous graph, and the producer node connected to the resource node in the heterogeneous graph. The second type of meta-path sequentially passes through object node→resource node→producer node. If the object node is abbreviated as U, the resource node is abbreviated as V, and the producer node is abbreviated as A, then the second type of meta-path is U→V→A. The third type of meta-path in the three types of meta-paths passes through the object node, the resource node connected to the object node in the heterogeneous graph, and the label node connected to the resource node in the heterogeneous graph. The third type of meta-path passes through the object node → resource node → label node in sequence. If the object node is abbreviated as U, the resource node is abbreviated as V, and the label node is abbreviated as T, then the third type of meta-path is also U→V→T. For example, see Figure 6 , provides a schematic diagram of the three types of meta-paths of object nodes, Figure 6 It includes a first type of meta-path 601 , a second type of meta-path 602 and a third type of meta-path 603 .
[0131] It should be noted that, in the above description, the case where the multiple nodes include resource nodes, object nodes, producer nodes and label nodes, and each type of meta-path connects three nodes is used as an example. In other possible implementations, each type of meta-path can also connect more nodes. For example, for a meta-path U→V→T, one U can connect to 10 Vs, and one V can connect to 5 Ts.
[0132] After explaining the meta path, the method for the server to obtain reference representation information is explained below.
[0133] Part 2: For any node among the multiple nodes, the server performs graph convolution on the node according to the multi-class meta-path of the node based on the graph neural network to obtain multiple reference representation information of the node.
[0134] In one possible implementation, for any class of meta-paths in the multi-class meta-paths, the server fuses the node features of the reference nodes that the meta-path passes through in the heterogeneous graph with the node features of the node based on the graph neural network to obtain the reference representation information of the node under the meta-path.
[0135] Among them, the reference node is the neighbor node of the node, and the neighbor node includes a first-order neighbor node, a second-order neighbor node...N-order neighbor node, where N is a positive integer. If the reference node is the first-order neighbor node of the node, then it means that the reference node is directly connected to the node, that is, there is a line between the reference node and the node. If the reference node is the second-order neighbor node of the node, then it means that the reference node and the node are indirectly connected through another node, that is, there is another node between the reference node and the node, and there is a line between the reference node and the node and the other node. In the case where the meta-path connects three nodes, it is the first-order neighbor node and the second-order neighbor node of the starting node of the meta-path that are connected.
[0136] In addition, for other class meta-paths of the node, the processing method of the server based on the graph neural network and the processing method of the class meta-path belong to the same inventive concept, and the implementation process will not be repeated here.
[0137] For example, take the example that the class meta-path passes through the node, the first reference node and the second reference node, where the node is the starting point of the class meta-path; the first reference node is the first-order neighbor node of the node, and the first reference node is the midpoint of the class meta-path; the second reference node is the second-order neighbor node of the node, and the second reference node is also the end point of the class meta-path. Based on the graph neural network, the server fuses the node features of the second reference node with the node features of the first reference node to obtain first fused representation information. Based on the graph neural network, the server fuses the first fused representation information with the node features of the node to obtain the reference representation information of the node under the meta-path.
[0138] It should be noted that the above is explained with the example that the number of the first reference node and the number of the second reference node are both one. In other possible implementations, the number of the first reference node and the second reference node can be multiple. In this case, the server can fuse the node features of multiple first reference nodes into a first fused node feature, and fuse the node features of the multiple second reference nodes into a second fused node feature. Based on the graph neural network, the server fuses the first fused node feature with the second fused node feature to obtain first fused representation information. Based on the graph neural network, the server fuses the first fused representation information with the node feature of the node to obtain the reference representation information of the node under the meta-path.
[0139] In the case where the multiple nodes include resource nodes and object nodes, for any resource node among the multiple nodes, the server uses the first-class meta-path V→U→V corresponding to the resource node to perform graph convolution on the resource node to obtain the reference representation information of the resource node under the first-class meta-path, where the first resource node V is also the above-mentioned node, the object node U is also the above-mentioned first reference node, and the second resource node V is also the above-mentioned second reference node. Based on the graph neural network, the server fuses the node features of the second resource node V with the node features of the object node U to obtain the first fused representation information. Based on the graph neural network, the server fuses the first fused representation information with the node features of the first resource node V to obtain the reference representation information of the first resource node V under the first-class meta-path.
[0140] It should be noted that the above is explained by taking the example that the server performs graph convolution on the resource node based on the first type of meta-path V→U→V to obtain the reference representation information of the resource node under the first type of meta-path. The method in which the server performs processing based on the second type of meta-path V→U→U belongs to the same inventive concept as the above method, and the implementation process will not be repeated here.
[0141] In the case where the multiple nodes include resource nodes and object nodes, for any object node among the multiple nodes, the server uses the first class meta-path U→V→U corresponding to the object node to perform graph convolution on the object node to obtain the reference representation information of the object node under the first class meta-path, where the first object node U is also the above-mentioned node, the resource node V is also the above-mentioned first reference node, and the second object node U is also the above-mentioned second reference node. Based on the graph neural network, the server fuses the node features of the second object node U with the node features of the resource node V to obtain the first fused representation information. Based on the graph neural network, the server fuses the first fused representation information with the node features of the first object node U to obtain the reference representation information of the first object node U under the first class meta-path.
[0142] It should be noted that the above is explained by taking the example that the server performs graph convolution on the object node based on the first type of meta-path U→V→U to obtain the reference representation information of the object node under the first type of meta-path. The method in which the server performs processing based on the second type of meta-path U→V→V belongs to the same inventive concept as the above method, and the implementation process will not be repeated here.
[0143] In a possible implementation, when the multiple nodes include resource nodes, object nodes, producer nodes, and label nodes, for any resource node among the multiple nodes, taking the resource node corresponding to three types of meta-paths as an example, the server can perform the following steps:
[0144] For any resource node among the multiple resource nodes, the server performs graph convolution on the resource node according to the first class meta-path of the resource node to obtain first reference representation information of the resource node under the first class meta-path. The server performs graph convolution on the resource node according to the second class meta-path of the resource node to obtain second reference representation information of the resource node under the second class meta-path. The server performs graph convolution on the resource node according to the third class meta-path of the resource node to obtain third reference representation information of the resource node under the third class meta-path.
[0145] Among them, the first type of meta-path V→U→V passes through resource node→object node→resource node in sequence, the second type of meta-path V→A→V passes through resource node→producer node→resource node in sequence, and the third type of meta-path V→T→V passes through resource node→label node→resource node in sequence.
[0146] For any object node among the multiple nodes, taking the object node corresponding to the three-type meta-path as an example, the server can perform the following steps:
[0147] For any object node among the multiple object nodes, the server performs graph convolution on the object node according to the first class meta-path of the object node to obtain first reference representation information of the object node under the first class meta-path. The server performs graph convolution on the object node according to the second class meta-path of the object node to obtain second reference representation information of the object node under the second class meta-path. The server performs graph convolution on the object node according to the third class meta-path of the object node to obtain third reference representation information of the object node under the third class meta-path.
[0148] Among them, the first type of meta-path U→V→U passes through object node→resource node→object node in sequence, the second type of meta-path U→V→A passes through object node→resource node→producer node in sequence, and the third type of meta-path U→V→T passes through object node→resource node→label node in sequence.
[0149] After explaining the method for the server to obtain reference representation information, the following explains a method for the server to obtain initial representation information of a node based on multiple reference representation information of the node.
[0150] In the third part, the server merges the multiple reference representation information to obtain the initial representation information of the node.
[0151] In some embodiments, the initial representation information of the node is an initial embedding vector of the node.
[0152] In a possible implementation, the server performs weighted summation on the multiple reference representation information to obtain initial representation information of the node.
[0153] Among them, the weights of the weighted summation are set by technical personnel according to actual conditions, and the embodiments of the present application do not limit this.
[0154] In a possible implementation, the server encodes the multiple reference representation information based on an attention mechanism to obtain initial representation information of the node.
[0155] For example, the server obtains multiple attention weights between the multiple reference representation information, and fuses the multiple reference representation information based on the multiple attention weights to obtain the initial representation information of the node.
[0156] For example, taking the reference representation information as two reference representation information, the server uses three linear transformation matrices to perform linear transformation on the first reference representation information to obtain the first query matrix, the first key matrix and the first value matrix of the first reference representation information, wherein the three linear transformation matrices are matrices obtained during the model training process. The server uses the three linear transformation matrices to perform linear transformation on the second reference representation information to obtain the second query matrix, the second key matrix and the second value matrix of the second reference representation information. The server obtains the first attention weight of the first reference representation information to the second reference representation information based on the query matrix of the first reference representation information and the key matrix of the second reference representation information. The server obtains the second attention weight of the second reference representation information to the first reference representation information based on the query matrix of the second reference representation information and the key matrix of the first reference representation information. The server uses the first attention weight and the second attention weight to perform weighted summation on the first value matrix and the second value matrix to obtain the initial representation information of the node. Among them, when the server obtains the attention weight based on the query matrix and the key matrix, it can be implemented by multiplying the query matrix with the key matrix.
[0157] It should be noted that the above description is based on the example of two reference representation information. When the number of reference representation information is greater, the implementation process belongs to the same inventive concept as the above description and will not be repeated here.
[0158] In some embodiments, when the server fuses the multiple reference representation information to obtain the initial representation information of the node, the server can multiply the multiple reference representation information with the mask matrix respectively to obtain multiple first candidate representation information. The server fuses the multiple first candidate representation information to obtain the initial representation information of the node.
[0159] Among them, the mask matrix is a matrix containing 0 and 1, and the positions of 0 and 1 in the mask matrix are randomly generated by the server. After the reference representation information is multiplied by the mask matrix, part of the information in the reference representation information can be randomly hidden, which can improve the robustness of the model.
[0160] In some embodiments, since the styles of the reference representation information may be different, the reference representation information of each node may be made consistent through normalization processing. Accordingly, the server normalizes multiple reference representation information to obtain multiple second candidate representation information. The server merges the multiple second candidate representation information to obtain the initial representation information of the node.
[0161] Among them, the normalization method can adopt any one of SoftMax (soft maximization), Relu (linear rectification) or Sigmoid (S-shaped growth curve), which is not limited in the embodiment of the present application.
[0162] 304. The server trains the graph neural network based on the initial representation information of each of the multiple nodes.
[0163] In a possible implementation, the server obtains a positive sample set and a negative sample set from the multiple nodes, the positive sample set includes multiple positive sample pairs, the negative sample set includes multiple negative sample pairs, the positive sample pairs are resource nodes and object nodes connected in the heterogeneous graph, and the negative sample pairs are resource nodes and object nodes that are not connected in the heterogeneous graph, wherein the resource nodes correspond to media resources and the object nodes correspond to interactive objects. The server trains the graph neural network based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set. In some embodiments, the server can generate negative sample pairs directly based on the acquired positive sample pairs, that is, the server replaces the resource nodes in the acquired positive sample pairs with any resource nodes in the heterogeneous graph, or replaces the object nodes in the acquired positive sample pairs with any object nodes in the heterogeneous graph. It should be noted that the number of negative sample pairs can be greater than the number of positive sample pairs.
[0164] The following describes a method for the server to train the graph neural network based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set.
[0165] For any positive sample pair in the positive sample set, the server determines first difference information between initial representation information of the resource node in the positive sample pair and initial representation information of the object node. For any negative sample pair in the negative sample set, the server determines second difference information between initial representation information of the resource node in the negative sample pair and initial representation information of the object node. The server trains the graph neural network based on the first difference information and the second difference information.
[0166] Among them, the purpose of training the graph neural network based on the first difference information and the second difference information is to make the first difference information as small as possible and the second difference information as large as possible. This training method is also called representation learning.
[0167] For example, the server trains the graph neural network based on the first difference information and the second difference information using the following formula (1).
[0168]
[0169]
[0170]
[0171] in, is the first difference information, u 正 is the initial representation information of the object node in the positive sample pair, v 正 is the initial representation information of the resource node in the positive sample pair, is the second difference information, u 负 is the initial representation information of the object node in the negative sample pair, υ 负 is the initial representation information of the resource node in the negative sample pair, σ is the normalization function, is the first loss function for training the graph neural network, that is, the loss function corresponding to the characterization learning. In some embodiments, Also known as the Bayesian Personalized Ranking (BPR), during the training process, the server can use the gradient descent method to continuously optimize the first loss function until the first loss function converges or the number of iterations reaches an iteration threshold.
[0172] In addition to training the graph neural network through the above-mentioned representation learning method, the embodiment of the present application also provides another method for training the graph neural network:
[0173] In one possible implementation, the initial representation information of each of the multiple nodes is obtained by fusing multiple reference representation information of each of the multiple nodes, and the multiple reference representation information corresponds to the multi-class meta-path of the multiple nodes. For the first node among the multiple nodes, the server trains the graph neural network based on the third difference information between any two reference representation information among the multiple reference representation information of the first node.
[0174] Among them, the first node is a resource node or an object node, and the following description takes the first node as an object node as an example. Since the multiple reference representation information of the first node is obtained by the graph neural network through graph convolution based on a multi-class element path, the multiple reference representation information of the first node are all used to represent the entity corresponding to the first node. Then the purpose of training the graph neural network based on the third difference information is to make the third difference information as small as possible, that is, the multiple reference representation information obtained through graph convolution through a multi-class element path is as similar as possible.
[0175] Based on the above implementation, the server can also obtain multiple reference representation information of the second node among the multiple nodes. The server trains the graph neural network based on the third difference information and the fourth difference information, wherein the fourth difference information is the difference information between the multiple reference representation information of the first node and the multiple reference representation information of the second node.
[0176] Among them, the second node and the first node are different nodes of the same type, and under the premise that the first node is an object node, the second node is also an object node. Since the second node and the first node are different nodes, the entities corresponding to the second node and the first node are also different. The fourth difference information refers to the difference information between the reference representation information of the first node and the reference representation information of the second node. The purpose of training the graph neural network based on the fourth difference information is to make the fourth difference information as large as possible, that is, the similarity between the reference representation information of the first node and the reference representation information of the second node is as low as possible. In some embodiments, this training method is also called contrastive learning.
[0177] For example, the server trains the graph neural network based on the third difference information and the fourth difference information using the following formula (2).
[0178]
[0179]
[0180]
[0181] Among them, z ni,njis the third difference information, i represents the i-th type meta-path, j represents the j-th type meta-path, n represents the first node, n′ represents the second node, and h ni represents the reference representation information of the first node under the i-th type meta-path, h nj represents the reference representation information of the first node under the j-th class meta-path, z ni,n′j is the fourth difference information, h n′j represents the reference information of the second node under the j-th class element path, N is the number of nodes, τ is the temperature coefficient which is an adjustable constant, l cl The second loss function for training the graph neural network, that is, the loss function corresponding to contrastive learning, during the training process, the server can use the gradient descent method to continuously optimize the second loss function until the second loss function converges or the number of iterations reaches the iteration threshold.
[0182] for example, Figure 7 A schematic diagram of contrastive learning is provided. Figure 7 The comparative learning process between the first node U and the second node W is shown in FIG. When both the first node and the second node are object nodes, the first node U is also referred to as the object node U, and the second node W is also referred to as the object node W. represents the reference representation information of the first node U under the first type of meta-path, represents the reference representation information of the first node U under the third type of meta-path, represents the reference representation information of the second node W under the first type of meta-path, Represents the reference representation information of the second node W under the third type meta-path.
[0183] It should be noted that the above is explained using the example that the server trains the graph neural network based on the first loss function and the second loss function respectively. In other possible implementations, the server can also train the graph neural network based on the first loss function and the second loss function at the same time, that is, optimizing the joint loss function composed of the first loss function and the second loss function based on the gradient descent method until the joint loss function converges or the number of iterations reaches an iteration threshold.
[0184] 305. Based on the trained graph neural network, the server fuses the multi-class meta-paths of the multiple nodes in the heterogeneous graph respectively to obtain the target representation information of the multiple nodes respectively, and the target representation information is used to recommend media resources.
[0185] In a possible implementation, for any node among the multiple nodes, the server performs graph convolution on the node according to the multi-class meta-path of the node based on the trained graph neural network to obtain multiple target reference representation information of the node. The server fuses the multiple target reference representation information to obtain the target representation information of the node.
[0186] In a possible implementation, the server performs graph convolution on the node according to the multi-class meta-path of the node based on the trained graph neural network, and obtains multiple target reference representation information of the node including:
[0187] For any class of meta-paths in the multi-class meta-paths, the server fuses the node features of the reference nodes that the meta-path passes through in the heterogeneous graph with the node features of the node based on the graph neural network to obtain the target reference representation information of the node under the meta-path.
[0188] In a possible implementation manner, the server merges the multiple target reference representation information to obtain the target representation information of the node including any of the following:
[0189] The server performs weighted summation on the multiple target reference representation information to obtain the target representation information of the node.
[0190] The server encodes the multiple target reference representation information based on the attention mechanism to obtain the target representation information of the node.
[0191] Among them, the server fuses the multi-class meta-paths of multiple nodes in the heterogeneous graph based on the trained graph neural network to obtain the target representation information of each of the multiple nodes. This method belongs to the same inventive concept as the method for obtaining the initial representation information of each of the multiple nodes in the above step 303. The implementation process refers to the relevant description in step 303 and will not be repeated here.
[0192] 306. The server stores the target representation information of each of the multiple nodes.
[0193] In a possible implementation, the server stores the target representation information of the resource nodes among the multiple nodes in a resource database, and stores the target representation information of the object nodes among the multiple nodes in an object database. When the object is a user, the object database is also referred to as a user database. Wherein. When the server stores the target representation information of the resource node in the resource database, the target representation information of the resource node is bound and stored with the media resource corresponding to the resource node, for example, the target representation information of the resource node is bound and stored with the name or link of the media resource corresponding to the resource node. When the server stores the target representation information of the object node in the object database, the target representation information of the object node is bound and stored with the interactive object corresponding to the object node, for example, the target representation information of the object node is bound and stored with the object identifier of the interactive object corresponding to the object node, and the object identifier can be an object account. In some embodiments, the types of the resource database and the object database are both remote dictionary services (RemoteDictionary Server, Redis).
[0194] 307. The server recommends resources based on the target representation information of each of the multiple nodes.
[0195] In a possible implementation, the server determines multiple reference media resources to be recommended from multiple media resources corresponding to the target resource service, and the server recommends resources based on target representation information of media nodes corresponding to the multiple reference media resources.
[0196] Among them, multiple reference media resources are media resources that meet preset conditions among multiple media resources. Meeting the preset conditions means that the completion rate of the media resources is greater than or equal to the completion rate threshold, the playback volume of the media resources is greater than or equal to the playback volume threshold, the like volume of the media resources is greater than or equal to the like volume threshold, the comment volume of the media resources is greater than or equal to the comment volume threshold, and the quality of the media resources is greater than or equal to at least one of the quality threshold.
[0197] The following describes a method in which the server recommends resources based on the target representation information of the media nodes corresponding to the multiple reference media resources.
[0198] In a possible implementation, in response to a resource recommendation request, the server queries the object database based on the object identifier carried in the resource recommendation request to obtain the target representation information corresponding to the object identifier. The server determines at least one target media resource from the multiple reference media resources based on the similarity between the target representation information of the multiple reference media resources and the target representation information corresponding to the object identifier. The server recommends the at least one target media resource to the object corresponding to the object identifier. When determining the target media resource based on the similarity, the server can determine the K reference media resources with the highest similarity as the target media resources, that is, determine the Top K target media resources, and the Top K target media resources are used as the recalled videos recommended to the object, where K is a positive integer.
[0199] In some embodiments, the similarity is cosine similarity, or inner product, or Hamming distance, etc., which is not limited in the embodiments of the present application. When determining the similarity, the server can use two vector search engines, Approximate Nearest Neighbors Oh Yeah, Annoy and Facebook AI Similarity Search, Faiss. In some embodiments, the above steps 307-307 can be encapsulated as a media resource recommendation model.
[0200] Figure 8 A framework diagram of a method for determining representation information provided in an embodiment of the present application is provided, see Figure 8 , the framework diagram includes heterogeneous information 801, which includes two major categories: nodes and relationships. Nodes include interactive objects, media resources, producers, and resource tags. Relationships include completion, likes, comments, attention, sharing, publishing, and belonging. The framework diagram also includes data preprocessing 802, which includes data cleaning, feature processing, and generating heterogeneous graphs. The framework diagram also includes graph representation learning 803, which includes graph framework, graph algorithm, loss function, and output, wherein the graph framework includes Deep Graph Library (DGL), etc.; graph algorithm includes GraphSage, etc.; loss function includes loss function of representation learning and loss function of contrastive learning; output includes target representation information of nodes.
[0201] Through the technical solution provided in the embodiment of the present application, a heterogeneous graph including nodes corresponding to media resources and nodes corresponding to interactive objects is obtained, and the heterogeneous graph is processed by a graph neural network using a multi-class meta-path, and the processing results are fused into the initial representation information of multiple nodes in the heterogeneous graph. The multi-class meta-path is equivalent to multiple perspectives, that is, the heterogeneous graph is processed using multiple perspectives to obtain the initial representation information of multiple nodes. The graph neural network is trained based on the initial representation information of multiple nodes to obtain a trained graph neural network. The training process of the neural network is also a self-supervised training that does not rely on annotations. By using the trained graph neural network to process the heterogeneous graph, the target representation information of each of the multiple nodes in the heterogeneous graph can be obtained. The target representation information can accurately represent the nodes in the heterogeneous graph, and the accuracy of media resource recommendation using the target representation information is high and the effect is good.
[0202] In the scenario of recommending short videos, the object is the user and the media resource is the short video. There are often many invalid interactions between users and short videos, such as watching a short video that they are not interested in, giving a thumbs up due to an operation error, etc. The embodiment of the present application uses multi-view contrast learning on a heterogeneous graph, which can effectively counteract the interference caused by such local noise and enhance the robustness of the model. In this way, more accurate user representation (target representation information of the interactive object) and short video representation (target representation information of the media resource) can be learned to recommend more interesting short videos to users.
[0203] Fig. 9 is a schematic diagram of a structure of a device for determining representation information provided in an embodiment of the present application, see Fig. 9 The device includes: a heterogeneous graph acquisition module 901, a fusion module 902 and a training module 903.
[0204] The heterogeneous graph acquisition module 901 is used to obtain a heterogeneous graph of a target resource business, wherein the heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource business, and the connection relationship between different nodes is used to represent the relationship between entities. The entities in the target resource business include media resources and interactive objects, and the interactive objects are objects that have interacted with the media resources.
[0205] The fusion module 902 is used to fuse the multi-class meta-paths of multiple nodes in the heterogeneous graph based on the graph neural network to obtain the initial representation information of each of the multiple nodes. Any class meta-path in the multi-class meta-path is used to represent a connection method between different types of nodes in the heterogeneous graph.
[0206] The training module 903 is used to train the graph neural network based on the initial representation information of each of the multiple nodes.
[0207] The fusion module 902 is also used to fuse the multi-class meta-paths of multiple nodes in the heterogeneous graph based on the trained graph neural network, so as to obtain target representation information of each of the multiple nodes, and the target representation information is used to recommend media resources.
[0208] In a possible implementation, the heterogeneous graph acquisition module 901 is used to acquire multiple entities in the target resource business, the associated data between the multiple entities, and the entity features of the multiple entities. Based on the multiple entities, the associated data between the multiple entities, and the entity features of the multiple entities, the heterogeneous graph is generated.
[0209] In a possible implementation, the heterogeneous graph acquisition module 901 is used to generate multiple nodes corresponding to the multiple entities, the node features of the multiple nodes are entity features of the corresponding entities, and based on the association data between the multiple entities, add lines between the multiple entities to obtain the heterogeneous graph.
[0210] In a possible implementation, the entities in the target resource business also include the producer and label of the media resource, the associated data include the interaction data between the media resource and the interactive object and the subordinate data between the producer and the label and the media resource, and the heterogeneous graph acquisition module 901 is used to generate multiple resource nodes corresponding to the media resource, multiple producer nodes, multiple label nodes, and multiple object nodes corresponding to the interactive object. Based on the associated data between the multiple entities, adding lines between the multiple entities to obtain the heterogeneous graph includes: based on the interaction data, adding lines between the multiple resource nodes and the multiple producer nodes. Based on the subordinate data, adding lines between the multiple resource nodes, the multiple producer nodes, and the multiple label nodes to obtain the heterogeneous graph.
[0211] In a possible implementation, the fusion module 902 is used to perform graph convolution on any node among the multiple nodes according to the multi-class meta-path of the node based on the graph neural network to obtain multiple reference representation information of the node, where the starting point of the multi-class meta-path of the node is the node. The multiple reference representation information is fused to obtain the initial representation information of the node.
[0212] In one possible implementation, the fusion module 902 is used to fuse the node features of the reference nodes passed by the meta-path in the heterogeneous graph with the node features of the node for any class of meta-paths in the multi-class meta-paths based on the graph neural network, so as to obtain the reference representation information of the node under the meta-path.
[0213] In a possible implementation, the fusion module 902 is configured to perform any of the following:
[0214] The multiple reference representation information are weightedly summed to obtain the initial representation information of the node.
[0215] The multiple reference representation information is encoded based on the attention mechanism to obtain the initial representation information of the node.
[0216] In a possible implementation, the training module 903 is used to obtain a positive sample set and a negative sample set from the multiple nodes, the positive sample set includes multiple positive sample pairs, the negative sample set includes multiple negative sample pairs, the positive sample pairs are resource nodes and object nodes connected in the heterogeneous graph, and the negative sample pairs are resource nodes and object nodes that are not connected in the heterogeneous graph, wherein the resource nodes correspond to media resources and the object nodes correspond to interactive objects. Based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set, the graph neural network is trained.
[0217] In a possible implementation, the training module 903 is used to determine, for any positive sample pair in the positive sample set, first difference information between initial representation information of a resource node in the positive sample pair and initial representation information of an object node. For any negative sample pair in the negative sample set, second difference information between initial representation information of a resource node in the negative sample pair and initial representation information of an object node is determined. The graph neural network is trained based on the first difference information and the second difference information.
[0218] In one possible implementation, the initial representation information of each of the multiple nodes is obtained by fusing multiple reference representation information of each of the multiple nodes, and the multiple reference representation information corresponds to the multi-class meta-path of the multiple nodes. The training module 903 is also used to train the graph neural network for a first node among the multiple nodes based on the third difference information between any two reference representation information among the multiple reference representation information of the first node.
[0219] In a possible implementation, the training module 903 is further used to obtain multiple reference representation information of the second node among the multiple nodes. The graph neural network is trained based on the third difference information and the fourth difference information, where the fourth difference information is the difference information between the multiple reference representation information of the first node and the multiple reference representation information of the second node.
[0220] In a possible implementation, the fusion module 902 is further configured to perform graph convolution on any node among the multiple nodes according to the multi-class meta-path of the node based on the trained graph neural network to obtain multiple target reference representation information of the node. The multiple target reference representation information is fused to obtain the target representation information of the node.
[0221] In a possible implementation, the fusion module 902 is also used to fuse the node features of the reference nodes passed by the meta-path in the heterogeneous graph with the node features of the node for any class of meta-paths in the multi-class meta-paths based on the graph neural network, so as to obtain the target reference representation information of the node under the meta-path.
[0222] In a possible implementation, the fusion module 902 is further configured to perform any of the following:
[0223] The multiple target reference representation information are weightedly summed to obtain the target representation information of the node.
[0224] Based on the attention mechanism, the multiple target reference representation information is encoded to obtain the target representation information of the node.
[0225] In a possible implementation, the device further includes:
[0226] The recommendation module is used to recommend resources based on the target representation information of each of the multiple nodes.
[0227] It should be noted that: the apparatus for determining the representation information provided in the above embodiment only uses the division of the above functional modules as an example when determining the representation information. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for determining the representation information provided in the above embodiment and the method for determining the representation information belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0228] Through the technical solution provided in the embodiment of the present application, a heterogeneous graph including nodes corresponding to media resources and nodes corresponding to interactive objects is obtained, and the heterogeneous graph is processed by a graph neural network using a multi-class meta-path, and the processing results are fused into the initial representation information of multiple nodes in the heterogeneous graph. The multi-class meta-path is equivalent to multiple perspectives, that is, the heterogeneous graph is processed using multiple perspectives to obtain the initial representation information of multiple nodes. The graph neural network is trained based on the initial representation information of multiple nodes to obtain a trained graph neural network. The training process of the neural network is also a self-supervised training that does not rely on annotations. By using the trained graph neural network to process the heterogeneous graph, the target representation information of each of the multiple nodes in the heterogeneous graph can be obtained. The target representation information can accurately represent the nodes in the heterogeneous graph, and the accuracy of media resource recommendation using the target representation information is high and the effect is good.
[0229] The embodiment of the present application provides a computer device for executing the above method. The computer device can be implemented as a terminal or a server. The structure of the terminal is first introduced below:
[0230] Fig.10 The terminal 1000 includes one or more processors 1001 and one or more memories 1002.
[0231] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0232] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one computer program, which is used to be executed by the processor 1001 to implement the method for determining the representation information provided in the method embodiment of the present application.
[0233] In some embodiments, the computer device is provided as a server, Fig.11It is a structural diagram of a server provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one or more memories 1102, wherein the one or more memories 1102 store at least one program code, and the at least one program code is loaded and executed by the one or more processors 1101 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server 1100 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 1100 may also include other components for implementing device functions, which will not be described in detail here.
[0234] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including at least one program code, and the at least one program code can be executed by a processor to complete the method for determining the representation information in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0235] In an exemplary embodiment, a computer program product is also provided, the computer program product includes at least one computer program, the at least one computer program is stored in a computer-readable storage medium. A processor of a computer device reads the at least one computer program from the computer-readable storage medium, and the processor executes the at least one computer program, so that the computer device performs the operations performed by the above-mentioned method for determining the representation information.
[0236] In some embodiments, the computer program involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain system.
[0237] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0238] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for determining representation information, characterized in that: The method comprises: Acquire a heterogeneous graph of a target resource service, wherein the heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource service, and a connection relationship between different nodes is used to represent a relationship between entities, and the entities in the target resource service include media resources and interactive objects, and the interactive objects are objects that have interacted with the media resources; Based on a graph neural network, multi-class meta-paths of multiple nodes in the heterogeneous graph are respectively fused to obtain initial representation information of each of the multiple nodes, wherein any one of the multi-class meta-paths is used to represent a connection mode between different types of nodes in the heterogeneous graph; Acquire a positive sample set and a negative sample set from the multiple nodes, the positive sample set includes multiple positive sample pairs, the negative sample set includes multiple negative sample pairs, the positive sample pairs are resource nodes and object nodes connected in the heterogeneous graph, and the negative sample pairs are resource nodes and object nodes that are not connected in the heterogeneous graph, wherein the resource nodes correspond to media resources and the object nodes correspond to interactive objects; train the graph neural network based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set; or, The initial representation information of each of the multiple nodes is obtained by fusing multiple reference representation information of each of the multiple nodes, and the multiple reference representation information corresponds to the multi-class meta-path of the multiple nodes; for a first node among the multiple nodes, the graph neural network is trained based on third difference information between any two reference representation information among the multiple reference representation information of the first node; For any node among the multiple nodes in the heterogeneous graph, based on the trained graph neural network, graph convolution is performed on the node according to the multi-class meta-path of the node to obtain multiple target reference representation information of the node; the multiple target reference representation information are fused to obtain the target representation information of the node, and the target representation information is used to recommend media resources.
2. The method according to claim 1, characterized in that The heterogeneous graph for acquiring the target resource business includes: Acquire multiple entities in the target resource business, association data between the multiple entities, and entity characteristics of the multiple entities; The heterogeneous graph is generated based on the multiple entities, the association data between the multiple entities, and the entity features of the multiple entities.
3. The method according to claim 2, characterized in that The generating the heterogeneous graph based on the multiple entities, the association data between the multiple entities, and the entity features of the multiple entities includes: Generate a plurality of nodes corresponding to the plurality of entities respectively, wherein the node features of the plurality of nodes are entity features of the corresponding entities; Based on the association data between the multiple entities, connections are added between the multiple entities to obtain the heterogeneous graph.
4. The method according to claim 3, characterized in that The entities in the target resource service also include the producer and label of the media resource, the associated data include the interaction data between the media resource and the interaction object and the subordinate data between the producer and the label and the media resource, and the generating of the multiple nodes corresponding to the multiple entities includes: Generate a plurality of resource nodes, a plurality of producer nodes, a plurality of label nodes corresponding to the plurality of media resources, and a plurality of object nodes corresponding to the plurality of interactive objects; The adding of lines between the multiple entities based on the association data between the multiple entities to obtain the heterogeneous graph comprises: Based on the interaction data, adding connections between the plurality of resource nodes and the plurality of producer nodes; Based on the subordinate data, connections are added between the multiple resource nodes, the multiple producer nodes, and the multiple label nodes to obtain the heterogeneous graph.
5. The method according to claim 1, characterized in that Based on the graph neural network, the multi-class meta-paths of the multiple nodes in the heterogeneous graph are respectively fused to obtain the initial representation information of the multiple nodes respectively, including: For any node among the multiple nodes, based on the graph neural network, graph convolution is performed on the node according to the multi-class meta-path of the node to obtain multiple reference representation information of the node, and the starting point of the multi-class meta-path of the node is the node; The multiple reference representation information are fused to obtain initial representation information of the node.
6. The method according to claim 5, characterized in that The step of performing graph convolution on the node according to the multi-class meta-path of the node based on the graph neural network to obtain multiple reference representation information of the node includes: For any class of meta-paths in the multi-class meta-paths, based on the graph neural network, the node features of the reference nodes through which the meta-path passes in the heterogeneous graph are fused with the node features of the node to obtain the reference representation information of the node under the meta-path.
7. The method according to claim 5, characterized in that The fusing of the multiple reference representation information to obtain the initial representation information of the node includes any of the following: Performing weighted summation on the multiple reference representation information to obtain initial representation information of the node; The multiple reference representation information are encoded based on the attention mechanism to obtain the initial representation information of the node.
8. The method according to claim 1, characterized in that The training of the graph neural network based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set includes: For any positive sample pair in the positive sample set, determining first difference information between initial representation information of a resource node and initial representation information of an object node in the positive sample pair; For any negative sample pair in the negative sample set, determining second difference information between initial representation information of a resource node and initial representation information of an object node in the negative sample pair; The graph neural network is trained based on the first difference information and the second difference information.
9. The method according to claim 1, characterized in that: The method further comprises: Acquire multiple reference representation information of a second node among the multiple nodes; The graph neural network is trained based on the third difference information and the fourth difference information, wherein the fourth difference information is the difference information between the multiple reference representation information of the first node and the multiple reference representation information of the second node.
10. The method according to claim 1, characterized in that The method further comprises: Resource recommendations are made based on the target representation information of each of the plurality of nodes.
11. The method according to claim 1, characterized in that: The graph neural network based on the training is subjected to graph convolution on the node according to the multi-class meta-path of the node to obtain multiple target reference representation information of the node, including: For any class of meta-paths in the multi-class meta-paths, based on the graph neural network, the node features of the reference nodes through which the meta-path passes in the heterogeneous graph are fused with the node features of the node to obtain the target reference representation information of the node under the meta-path.
12. The method according to claim 1, characterized in that The fusing of the plurality of target reference representation information to obtain the target representation information of the node includes any one of the following: Performing weighted summation on the multiple target reference representation information to obtain the target representation information of the node; The multiple target reference representation information are encoded based on the attention mechanism to obtain the target representation information of the node.
13. A device for determining representation information, characterized in that: The device comprises: A heterogeneous graph acquisition module is used to acquire a heterogeneous graph of a target resource service, wherein the heterogeneous graph includes multiple types of nodes, each type of node includes at least one node, each type of node is used to represent a type of entity in the target resource service, and the connection relationship between different nodes is used to represent the relationship between entities. The entities in the target resource service include media resources and interactive objects, and the interactive objects are objects that have interacted with the media resources; A fusion module, for fusing the multi-class meta-paths of the multiple nodes in the heterogeneous graph respectively based on a graph neural network to obtain initial representation information of the multiple nodes, wherein any one of the multi-class meta-paths is used to represent a connection mode between different types of nodes in the heterogeneous graph; A training module, used to obtain a positive sample set and a negative sample set from the multiple nodes, the positive sample set includes multiple positive sample pairs, the negative sample set includes multiple negative sample pairs, the positive sample pairs are resource nodes and object nodes connected in the heterogeneous graph, and the negative sample pairs are resource nodes and object nodes that are not connected in the heterogeneous graph, wherein the resource nodes correspond to media resources and the object nodes correspond to interactive objects; based on the initial representation information of the nodes in the positive sample set and the initial representation information of the nodes in the negative sample set, the graph neural network is trained; or, the initial representation information of each of the multiple nodes is obtained by fusing multiple reference representation information of each of the multiple nodes, and the multiple reference representation information corresponds to the multi-class meta-paths of the multiple nodes; for a first node among the multiple nodes, the graph neural network is trained based on the third difference information between any two reference representation information among the multiple reference representation information of the first node; The fusion module is also used to perform graph convolution on any one of the multiple nodes in the heterogeneous graph according to the multi-class meta-path of the node based on the trained graph neural network to obtain multiple target reference representation information of the node; fuse the multiple target reference representation information to obtain target representation information of the node, and the target representation information is used to recommend media resources.
14. The device according to claim 13, characterized in that The heterogeneous graph acquisition module is used to: Acquire multiple entities in the target resource business, association data between the multiple entities, and entity characteristics of the multiple entities; The heterogeneous graph is generated based on the multiple entities, the association data between the multiple entities, and the entity features of the multiple entities.
15. The device according to claim 14, characterized in that The heterogeneous graph acquisition module is used to: Generate a plurality of nodes corresponding to the plurality of entities respectively, wherein the node features of the plurality of nodes are entity features of the corresponding entities; Based on the association data between the multiple entities, connections are added between the multiple entities to obtain the heterogeneous graph.
16. The device according to claim 15, characterized in that The entities in the target resource service also include the producer and label of the media resource, the associated data includes the interaction data between the media resource and the interaction object and the subordinate data between the producer and label and the media resource, and the heterogeneous graph acquisition module is used to: Generate a plurality of resource nodes, a plurality of producer nodes, a plurality of label nodes corresponding to the plurality of media resources, and a plurality of object nodes corresponding to the plurality of interactive objects; The adding of lines between the multiple entities based on the association data between the multiple entities to obtain the heterogeneous graph comprises: Based on the interaction data, adding connections between the plurality of resource nodes and the plurality of producer nodes; Based on the subordinate data, connections are added between the multiple resource nodes, the multiple producer nodes, and the multiple label nodes to obtain the heterogeneous graph.
17. The device according to claim 13, characterized in that The fusion module is used to: For any node among the multiple nodes, based on the graph neural network, graph convolution is performed on the node according to the multi-class meta-path of the node to obtain multiple reference representation information of the node, and the starting point of the multi-class meta-path of the node is the node; The multiple reference representation information are fused to obtain initial representation information of the node.
18. The device according to claim 17, characterized in that The fusion module is used to: For any class of meta-paths in the multi-class meta-paths, based on the graph neural network, the node features of the reference nodes through which the meta-path passes in the heterogeneous graph are fused with the node features of the node to obtain the reference representation information of the node under the meta-path.
19. The device according to claim 17, characterized in that The fusion module is used to perform any of the following: Performing weighted summation on the multiple reference representation information to obtain initial representation information of the node; The multiple reference representation information are encoded based on the attention mechanism to obtain the initial representation information of the node.
20. The device according to claim 13, characterized in that The training module is used to: For any positive sample pair in the positive sample set, determining first difference information between initial representation information of a resource node and initial representation information of an object node in the positive sample pair; For any negative sample pair in the negative sample set, determining second difference information between initial representation information of a resource node and initial representation information of an object node in the negative sample pair; The graph neural network is trained based on the first difference information and the second difference information.
21. The device according to claim 13, characterized in that The training module is also used to: Acquire multiple reference representation information of a second node among the multiple nodes; The graph neural network is trained based on the third difference information and the fourth difference information, wherein the fourth difference information is the difference information between the multiple reference representation information of the first node and the multiple reference representation information of the second node.
22. The device according to claim 13, characterized in that The device also includes: The recommendation module is used to recommend resources based on the target representation information of each of the multiple nodes.
23. The device according to claim 13, characterized in that The fusion module is further used for: For any class of meta-paths in the multi-class meta-paths, based on the graph neural network, the node features of the reference nodes through which the meta-path passes in the heterogeneous graph are fused with the node features of the node to obtain the target reference representation information of the node under the meta-path.
24. The device according to claim 13, characterized in that The fusion module is further configured to perform any of the following: Performing weighted summation on the multiple target reference representation information to obtain the target representation information of the node; The multiple target reference representation information are encoded based on the attention mechanism to obtain the target representation information of the node.
25. A computer device, characterized in that: The computer device includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the at least one computer program is loaded and executed by the one or more processors to implement the operations performed by the method for determining the representation information as described in any one of claims 1 to claim 12.
26. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to implement the operations performed by the method for determining representation information according to any one of claims 1 to 12.
27. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for determining the representation information according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Heterogeneous graph neural network generation method and device, electronic device and storage medium
CN110046698A
User classification method and device and electronic device
CN110097066A
