Model training method and apparatus, electronic device, storage medium and computer program product
By extracting and merging the features of objects, interactive objects and attribute nodes in heterogeneous data structures in the recommendation system, generating sample node features and training recommendation meta-models, the problem of low recommendation accuracy caused by insufficient interactive data in the existing technology is solved. Efficient recommendations for new items and new users are achieved.
Patent Information
- Application Number
- PCT/CN2023/129601
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-06
- Filing Date
- 2023-11-03
- Publication Date
- 2024-09-12
AI Technical Summary
Existing recommendation systems rely on a large amount of interaction data in the collaborative filtering algorithm. If there is less interaction data, it is difficult to recommend new items or new users, resulting in low recommendation accuracy.
By obtaining objects, interactive objects and attribute nodes in heterogeneous data structures, features are extracted and fused respectively to generate sample node features, which are used to train recommendation meta-models and improve recommendation accuracy.
Even when there is less interaction data, new items or new users can be recommended quickly and accurately, improving the accuracy of the recommendation system and solving the cold start problem of new items or new users.
Smart Images

Figure CN2023129601_12092024_PF_FP_ABST
Abstract
Description
Model training method, device, electronic device, storage medium and computer program product
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the Chinese patent application with application number 2023101276183 and application date of February 6, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field
[0003] The present application relates to the field of data processing technology, and in particular to a model training method, device, electronic device, storage medium and computer program product. Background Art
[0004] With the development of science and technology, more and more data are available on the Internet. In order to make it easier for users to find the data they like, recommendation systems have emerged. Recommendation systems can recommend data to users based on the existing interaction data between users and items.
[0005] Recommendation systems in related technologies primarily use collaborative filtering algorithms to recommend items to users based on interaction data. However, collaborative filtering algorithms rely on a large amount of existing interaction data. If there is insufficient existing interaction data, new items may not be recommended to users, or items may not be recommended to new users, resulting in low recommendation accuracy.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a model training method, device, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of recommendations based on the recommendation meta-model obtained through training.
[0008] The present invention provides a model training method, including:
[0009] Acquire a heterogeneous data structure including a plurality of nodes, wherein data corresponding to each of the nodes includes an object and attributes of the object;
[0010] Obtaining, from the heterogeneous data structure, an object node corresponding to the target object, an interaction node corresponding to an interaction object that interacts with the target object, and an attribute node corresponding to an attribute of the target object;
[0011] Performing feature extraction on the object nodes, interaction nodes, and attribute nodes to obtain object features of the object nodes, interaction features of the interaction nodes, and attribute features of the attribute nodes;
[0012] The object features, interaction features and attribute features are integrated to obtain the sample node features of the target object;
[0013] According to the characteristics of the sample nodes, the candidate recommendation meta-model is trained to obtain the trained recommendation meta-model.
[0014] Accordingly, an embodiment of the present application provides a model training device, comprising:
[0015] an acquisition module configured to acquire a heterogeneous data structure comprising a plurality of nodes, wherein data corresponding to each of the nodes comprises an object and attributes of the object;
[0016] a screening module configured to obtain, from the heterogeneous data structure, an object node corresponding to a target object, an interaction node corresponding to an interaction object interacting with the target object, and an attribute node corresponding to an attribute of the target object;
[0017] An extraction module is configured to perform feature extraction on the object node, the interaction node, and the attribute node, respectively, to obtain object features corresponding to the object node, interaction features corresponding to the interaction node, and attribute features corresponding to the attribute node;
[0018] a fusion module configured to fuse the object features, the interaction features, and the attribute features to obtain sample node features of the target object;
[0019] The training module is configured to train the candidate recommendation meta-model according to the above sample node characteristics to obtain a trained recommendation meta-model.
[0020] In addition, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the model training method or object recommendation method provided in the embodiment of the present application.
[0021] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for loading by a processor to execute any model training method or object recommendation method provided in the embodiment of the present application.
[0022] In addition, an embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the model training method or object recommendation method provided in the embodiment of the present application.
[0023] In an embodiment of the present application, a heterogeneous data structure including multiple nodes is obtained, and the data corresponding to each node includes an object and the attributes of the object; from the heterogeneous data structure, an object node corresponding to the target object, an interaction node corresponding to the interactive object that interacts with the target object, and an attribute node corresponding to the attribute of the target object are obtained; feature extraction is performed on the object nodes, interaction nodes, and attribute nodes respectively to obtain object features corresponding to the object nodes, interaction features corresponding to the interaction nodes, and attribute features corresponding to the attribute nodes; the object features, interaction features, and attribute features are fused to obtain sample node features of the target object; based on the sample node features, a candidate recommendation metamodel is trained to obtain a trained recommendation metamodel.
[0024] Since the metamodel can learn quickly and accurately from a small amount of data, even if there are fewer interaction nodes corresponding to the object nodes in the heterogeneous data structure, that is, there is less interaction data during the model training process, when the trained recommendation metamodel obtained by training the candidate recommendation metamodel based on the heterogeneous data structure makes recommendations, it can also recommend new items to users or recommend items to new users, thereby improving the accuracy of recommendations. Moreover, because the sample node features of the target object include the attribute features of the target object, the sample node features not only integrate the object features and interaction features, but also integrate the attribute features. Therefore, using the sample node features to train the candidate recommendation metamodel can make objects with similar attribute features have similar interaction parameters, so that when the trained recommendation metamodel is used for recommendation, the items can be recommended to users more accurately. Compared with the method of using the recommendation model trained by related technologies for recommendation, the recommendation accuracy is improved by using the trained recommendation metamodel trained by the embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1 is a schematic diagram of a scenario of a model training process provided in an embodiment of the present application;
[0026] FIG2 is a flow chart of a model training method according to an embodiment of the present application;
[0027] FIG3 is a schematic diagram of a heterogeneous data structure provided by an embodiment of the present application;
[0028] FIG4 is a schematic diagram of neighbor nodes provided in an embodiment of the present application;
[0029] FIG5 is a schematic diagram of a sub-heterogeneous data structure provided in an embodiment of the present application;
[0030] FIG6 is a schematic diagram of meta-learning provided in an embodiment of the present application;
[0031] FIG7 is a process diagram of a model training method provided in an embodiment of the present application;
[0032] FIG8 is a schematic diagram of an object recommendation method provided in an embodiment of the present application;
[0033] FIG9 is a schematic diagram of a recommendation system provided in an embodiment of the present application;
[0034] FIG10 is a flow chart of another model training method provided in an embodiment of the present application;
[0035] FIG11 is a flow chart of a model application method according to an embodiment of the present application;
[0036] FIG12 is a schematic diagram of the structure of a model training device provided in an embodiment of the present application;
[0037] FIG13 is a schematic diagram of the structure of an object recommendation device provided in an embodiment of the present application;
[0038] FIG14 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0040] The embodiments of the present application provide a model training method, device, electronic device, computer-readable storage medium, and computer program product. The model training device can be integrated into an electronic device, which can be a server, a terminal, or other device.
[0041] Among them, the server can be an independent physical server, 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, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0042] Furthermore, multiple servers can form a blockchain, and the servers are nodes on the blockchain.
[0043] The terminal may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal and the server may be connected directly or indirectly via wired or wireless communication, which is not limited in the present embodiment.
[0044] For example, as shown in Figure 1, a server can generate a heterogeneous data structure based on data in a recommendation system and send it to the terminal. The terminal then filters the heterogeneous data structure to identify the object node corresponding to the target object and its neighbor nodes. The neighbor nodes include interaction nodes corresponding to objects that interact with the target object and attribute nodes corresponding to the target object's attributes. Feature extraction is performed on the object nodes and neighbor nodes to obtain object features corresponding to the object nodes, interaction features corresponding to the interaction nodes, and attribute features corresponding to the attribute nodes. The object features, interaction features, and attribute features are then fused to obtain sample node features of the target object. Based on the sample node features, a candidate recommendation metamodel is trained to obtain a trained recommendation metamodel. The terminal then sends the trained recommendation metamodel to the server.
[0045] In addition, the term "a plurality of" in the embodiments of the present application refers to two or more than two. The terms "first" and "second" in the embodiments of the present application are used to distinguish descriptions and should not be understood to imply relative importance.
[0046] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0047] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0048] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning through demonstration.
[0049] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0050] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0051] In this embodiment, the description will be made from the perspective of the model training device. In order to facilitate the description of the model training method of this application, the following detailed description will be given with the model training device integrated in the terminal, that is, the terminal will be used as the execution subject.
[0052] Please refer to Figure 2, which is a flow chart of the model training method provided in an embodiment of the present application. In practical applications, the model training method can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. The embodiment of the present application takes the server alone as an example. The model training method may include:
[0053] S201: Acquire a heterogeneous data structure including multiple nodes, wherein data corresponding to each node includes an object and attributes of the object.
[0054] Here, heterogeneous data structures can be generated based on data in a recommendation system, which includes data on recommended objects (such as recommended items, which can be actual items such as apples, or virtual items such as videos) (such as the identification of the recommended objects, the number of recommendations, object attributes, etc.) and data on recommended objects (such as user objects) (such as the identification of the user objects, the number of recommendations, preference information of the user objects, etc.).
[0055] In practical applications, a heterogeneous data structure can be periodically generated based on the data in the recommendation system to obtain a heterogeneous data structure; alternatively, a heterogeneous data structure can be periodically generated based on the data in the recommendation system and then stored, and then when a model training instruction for instructing model training is obtained, the heterogeneous data structure can be directly obtained from the storage space; alternatively, a heterogeneous data structure can be generated based on the data in the recommendation system when a model training instruction is obtained.
[0056] The heterogeneous data structure includes multiple nodes, each node corresponds to an object, and the object can be a recommended object or a recommended object. The data or object data corresponding to each node includes the object (object identifier) and the attributes of the object.
[0057] A heterogeneous data structure refers to a network structure that includes nodes corresponding to multiple node types. In some embodiments, node types can include items and users. For example, network structure g1 can be as shown in Figure 3. Network structure g1 includes nodes n1, n2, and n3. Node n1 represents shoe a1, node n2 represents user u1, and node n3 represents sneaker t1 (the category of shoe a1). Shoe a1 has an item node type, user u1 has a user node type, and node n3 has a sneaker t1 node type (i.e., an attribute of shoe a1). Therefore, network structure g1 is a heterogeneous data structure.
[0058] An object refers to an entity that can exist independently in a recommendation system, which may include at least one of an item (i.e., a recommended object) or a user (i.e., a recommended object). Items may include multiple types, and the type of item may be selected according to actual conditions. For example, items may include commodities or products, etc. Products may be video accounts, live broadcast rooms, or articles, etc. This embodiment of the present application does not limit this.
[0059] The attributes of an object refer to information that indicates the nature of the object. For example, when the object refers to an item, the attributes of the object may include the category of the item or the publisher of the item, etc. For another example, when the object refers to a user, the attributes of the object may include the user's age, gender, etc.
[0060] S202: Acquire, from the heterogeneous data structure, an object node corresponding to the target object, an interaction node corresponding to an interaction object that interacts with the target object, and an attribute node corresponding to an attribute of the target object.
[0061] Interaction refers to the behavior initiated by one object and affecting another object. The type of interaction can be selected based on the actual situation. For example, if a user clicks an icon of an item, the interaction refers to a click, which is initiated by the user and affects the item. Another example is that if a user watches a video, the user triggers a play command for the video, such as clicking a play control. In this case, the interaction refers to the user triggering a play command for the video, and watching is initiated by the user and affects the video. This embodiment of the application does not limit this.
[0062] In a recommendation system, recommendations can be made based on users (i.e., recommending items to new users) or items (i.e., recommending new items to users). When recommending new items to users, the target object can be the item, in which case the recommendation is based on the item. When recommending items to new users, the target object can be the user, in which case the recommendation is based on the user. When the target object is an item, the interactive object that interacts with the target object can be the user, and the attributes of the target object can refer to the attributes of the item. In this case, the heterogeneous data structure may include or exclude the user's attributes. When the target object is a user, the interactive object that interacts with the target object can be the item, and the attributes of the target object can refer to the attributes of the user. In this case, the heterogeneous data structure may include or exclude the user's attributes.
[0063] The server can first determine the node type corresponding to the target object, then filter the target object node from the heterogeneous data structure based on the node type, and then filter the neighbor nodes corresponding to the object node from the heterogeneous data structure. In practical applications, the above-mentioned interaction nodes and attribute nodes can be classified as neighbor nodes of the object node.
[0064] Alternatively, the server may also filter out the object node corresponding to the target object and the neighbor nodes of the object node from the heterogeneous data structure according to the preset meta-path. In this case, the process of obtaining the object node corresponding to the target object, the interaction node corresponding to the interaction object interacting with the target object, and the attribute node corresponding to the attribute of the target object from the heterogeneous data structure may be:
[0065] Get multiple preset meta paths, which include different node types;
[0066] According to different node types, object nodes corresponding to the target object in the object, interaction nodes corresponding to the interaction object interacting with the target object, and attribute nodes corresponding to the attributes of the target object are filtered out from the heterogeneous data structure.
[0067] A preset meta-path refers to a path connecting multiple nodes. The nodes in the path may include at least two node types. The path may describe the association relationship between multiple nodes. Different preset meta-paths generally represent different semantic information. The node types in the preset meta-path may be set according to actual conditions, and the embodiments of the present application do not limit this. For example, the preset meta-path p1 is item→user→item. The semantic information represented by the preset meta-path p1 is that two items liked by the same user may be similar. The preset meta-path p2 is item→attribute→item. The semantic information represented by the preset meta-path p2 is that two items with the same attribute may be similar.
[0068] It should be understood that different attribute nodes can be stored in different or the same preset meta-paths. Attribute nodes and interaction nodes can be stored in different or the same preset meta-paths.
[0069] For example, when different attribute nodes are stored in different preset meta-paths, the preset meta-path may be item→category→item and item→publisher→item; when different attribute nodes are stored in the same preset meta-path, the preset meta-path may be item→category→item→publisher→item.
[0070] When attribute nodes and interaction nodes are stored in different preset meta-paths, the preset meta-path including attribute nodes can be item→attribute→item, and the preset meta-path including interaction nodes can be item→user→item. When attribute nodes and interaction nodes are stored in the same preset meta-path, the preset meta-path can be item→attribute→item→user→item.
[0071] In some embodiments, after obtaining the preset meta-path, a node sequence corresponding to different types of nodes in the preset meta-path can be filtered out from the heterogeneous data structure, and then the object node corresponding to the target object and the neighbor nodes of the object node can be filtered out from the node sequence.
[0072] For example, the preset meta-path may be item→attribute, and the node sequence corresponding to different node types in the preset meta-path may be shoe a1→sneakers, and then shoe a1 is filtered out from shoe a1→sneakers as the object node and sneakers as the neighbor node.
[0073] Alternatively, since the preset meta-path includes a direction, after obtaining the preset meta-path, the terminal can also determine the starting node type and adjacent node types of different node types in the preset meta-path according to the direction in the preset meta-path, and then filter out the nodes corresponding to the starting node type from the heterogeneous data structure to obtain the object node corresponding to the target object, and then obtain the initial neighbor node corresponding to the object node, and filter out the initial neighbor node corresponding to the adjacent node type from the initial neighbor node to obtain the neighbor node of the object node.
[0074] For example, the preset meta-path can be item→attribute, then the starting node type is item, the adjacent node type is attribute, the node corresponding to the item is used as the object node of the target object, and the initial neighbor node corresponding to the attribute among the initial neighbor nodes of the object node is used as the neighbor node of the object.
[0075] It should be noted that adjacent node types can include at least one. For example, when the preset meta-path is item → attribute, the adjacent node type is attribute. In this case, the adjacent node type includes one. For another example, when the preset meta-path is item → attribute → item, the adjacent node types are attribute and item. In this case, the adjacent node type includes two.
[0076] That is, the process of filtering out the initial neighbor nodes corresponding to the adjacent node type from the initial neighbor nodes and obtaining the neighbor nodes of the object node can be:
[0077] Filter the next node type corresponding to the starting node type from the adjacent node types to obtain the intermediate node type;
[0078] Filter out the initial neighbor nodes corresponding to the intermediate node type from the initial neighbor nodes to obtain the candidate neighbor nodes of the object node;
[0079] If there are unfiltered node types in the preset meta-path, the initial neighbor node of the candidate neighbor node is used as the initial neighbor node, the intermediate node type is used as the starting node type, and the step of filtering the next node type corresponding to the starting node type from the adjacent node types to obtain the intermediate node type is returned;
[0080] If there is no unfiltered node type in the preset meta-path, the candidate neighbor node of the object node is used as the neighbor node of the object node.
[0081] For example, as shown in Figure 4, the preset meta-path is item→category→item. At this time, there are two types of adjacent nodes. The node corresponding to the starting node type is shoe a1. The initial neighbor nodes of shoe a1 are user u1, sneakers t1, publisher i1, and price s1. The next node type of the starting node type is category. The initial neighbor nodes corresponding to the category are filtered out from the initial neighbor nodes to obtain the candidate neighbor node "sports shoes t1" of shoe a1. The initial neighbor nodes of the candidate neighbor node include shoes a3 and shoes a4.
[0082] At this time, since there is an unfiltered node type "item" in the adjacent node type, shoes a3 and shoes a4 are taken as the initial neighbor nodes, the category is taken as the starting node type, and the next node type of the category in the adjacent node type is item. The initial neighbor nodes of the item are filtered out from shoes a3 and shoes a4, and the candidate neighbor nodes "shoes a3" and "shoes a4" of the object node are obtained.
[0083] At this time, since there are no unfiltered node types among the adjacent node types, the candidate neighbor node "sneakers t1", the candidate neighbor node "shoes a3" and the candidate neighbor node "shoes a4" of the object node are taken as the neighbor nodes of the object node. That is, at this time, the neighbor nodes of the object node include the first-order neighbor nodes and the second-order neighbor nodes of the object node.
[0084] It should be noted that a node can be a first-order neighbor node or a second-order neighbor node. For example, as shown in Figure 4, the node "shoes a4" is a first-order neighbor node of the node "sports shoes t1" and a second-order neighbor node of the node "shoes a1".
[0085] In some embodiments, the object node and the neighbor nodes obtained through each preset meta-path can be respectively formed into a sub-heterogeneous data structure. For example, the heterogeneous data structure can be shown as 501 in Figure 5. The preset meta-paths include item→category→item, item→user→item, and item→publisher→item. The sub-heterogeneous data structure obtained through item→user→item can be shown as 502 in Figure 5, the sub-heterogeneous data structure obtained through item→category→item can be shown as 503 in Figure 5, and the sub-heterogeneous data structure obtained through item→publisher→item can be shown as 504 in Figure 5.
[0086] It should be understood that the edges in the sub-heterogeneous data structure can be undirected edges, or, in order to facilitate subsequent feature fusion processing, the edges in the sub-heterogeneous data structure can be directed edges, and the direction of the directed edges can be the opposite direction of the preset meta-path.
[0087] For example, as shown in 502 in FIG5 , through item→user→item, we can get shoe a1→user u2→shoe a11, which is represented as shoe a11→user u2→shoe a1 in the sub-heterogeneous data structure corresponding to item→user→item.
[0088] S203 , performing feature extraction on the object nodes, interaction nodes, and attribute nodes respectively, to obtain object features corresponding to the object nodes, interaction features corresponding to the interaction nodes, and attribute features corresponding to the attribute nodes.
[0089] After obtaining the object node and neighbor nodes (including the above-mentioned interaction nodes and attribute nodes), feature extraction is performed on the object node and neighbor nodes respectively to obtain object features corresponding to the object node, interaction features corresponding to the interaction node, and attribute features corresponding to the attribute node.
[0090] In actual applications, the server can extract features from the object node and the neighboring nodes separately at the same time, or it can first extract features from the neighboring nodes and then extract features from the object nodes, or it can first extract features from the object nodes and then extract features from the neighboring nodes. This embodiment of the present application does not limit this.
[0091] S204: Fusing the object features, interaction features, and attribute features to obtain sample node features of the target object.
[0092] The server can directly add the object features, interaction features and attribute features to achieve the fusion of the object features, interaction features and attribute features; or the server can obtain the weight of the object features, the weight of the interaction features and the weight of the attribute features, and then perform weighted summation of the object features, interaction features and attribute features based on their respective weights; or, the object features and interaction features can be fused to obtain a first fusion result, the object features and attribute features can be fused to obtain a second fusion result, and then the first fusion result and the second fusion result can be added to obtain the sample node features of the target object.
[0093] For example, the process of fusing object features, interaction features, and attribute features to obtain sample node features of the target object can be:
[0094] The object features and interaction features are fused to obtain the first sample node features of the target object;
[0095] The object features and attribute features are fused to obtain the second sample node features of the target object;
[0096] The sample node feature of the target object is determined according to the first sample node feature and the second sample node feature.
[0097] If there are multiple attribute nodes, each attribute feature is fused with the object feature to obtain multiple second sample node features.
[0098] In an embodiment of the present application, the object features and the interaction features are fused to obtain the first node sample features, the object features and the attribute features are fused to obtain the second sample node features of the target object, and finally, the sample node features of the target object are determined based on the first sample node features and the second sample node features, thereby improving the accuracy of determining the sample node features of the target object.
[0099] The process of determining the sample node feature of the target object according to the first sample node feature and the second sample node feature may be:
[0100] The first sample node feature and the second sample node feature are added together to obtain the sample node feature of the target object.
[0101] Alternatively, the process of determining the sample node feature of the target object according to the first sample node feature and the second sample node feature may also be:
[0102] Obtain a first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature;
[0103] Adjusting the first sample node feature according to the first weight to obtain an adjusted first sample node feature;
[0104] Adjusting the second sample node feature according to the second weight to obtain an adjusted second sample node feature;
[0105] The sample node features of the target object are determined according to the adjusted first sample node features and the adjusted second sample node features.
[0106] In an embodiment of the present application, since the importance of interaction features and attribute features to the target object may be different, the first weight of the first sample node feature and the second weight of the second sample node feature can be determined according to the importance, and then the first sample node feature is adjusted according to the first weight of the first sample node feature to obtain the adjusted first sample node feature, and the second sample node feature is adjusted according to the second weight of the second sample node feature to obtain the adjusted second sample node feature. Finally, the adjusted first sample node feature and the adjusted second sample node feature are added to obtain the sample node feature of the target object, thereby improving the accuracy of the sample node feature.
[0107] In practical applications, the importance of interaction features and attribute features to the target object can be set according to actual conditions, and the importance and weight of sample node features can be positively correlated. For example, if the importance of interaction features to the target object is the first importance, and the importance of attribute features to the target object is the second importance, then the first weight of the first sample node feature and the second weight of the second sample node feature can be determined based on the ratio of the first importance to the second importance, and the sum of the first weight and the second weight is 1.
[0108] It should be understood that if there are multiple second sample node features, the second weight corresponding to each second sample node feature may be the same or different. When a neighboring node is obtained through a preset meta-path, it can also be understood that each preset meta-path corresponds to a weight, that is, it can be understood that each sub-heterogeneous data structure corresponds to a weight. For example, when the first sample node feature x1 is obtained through the preset meta-path p1, the second sample node feature x2 is obtained through the preset meta-path p2, and the second sample node feature x3 is obtained through the preset meta-path p3, the first weight corresponding to the first sample node feature x1, the second weight corresponding to the second sample node feature x2, and the second weight corresponding to the second sample node feature x3 are different.
[0109] At this time, the first sample node feature, the first weight, the second weight, and the second sample node feature can be substituted into the following formula (1) to obtain the sample node feature of the target object:
[0110] Among them, h represents the sample node feature, β q represents the first weight or the second weight, h q represents the first sample node feature or the second sample node feature, and q represents the total number of types of interaction nodes and attribute nodes.
[0111] In some embodiments, obtaining a first weight corresponding to a first sample node feature and a second weight corresponding to a second sample node feature includes:
[0112] Performing a first fusion on the first sample node feature and the second sample node feature to obtain a fused node feature;
[0113] Performing a first mapping on the fused node features to obtain first mapped node features;
[0114] The first weight corresponding to the first sample node feature and the second weight corresponding to the second sample node feature are filtered out from the first mapped node feature.
[0115] In an embodiment of the present application, the first weight of the first sample node feature can be determined in real time based on the first sample node feature, and the second weight of the second sample node feature can be determined in real time based on the second sample node feature, so as to improve the accuracy of the first weight and the second weight, thereby improving the accuracy of the sample node feature obtained according to the first weight and the second weight.
[0116] The first fusion can be a splicing fusion or an additive fusion. When the first fusion is a splicing fusion process, the first sample node feature and the second sample node feature can be substituted into the following formula (2) for the first fusion and the first mapping to obtain the node feature after the first mapping:
[0117] Among them, h q represents the first sample node feature or the second sample node feature, represents the splicing and fusion processing, W represents the first mapping function, and β represents the node feature after the first mapping.
[0118] In practical applications, after obtaining the first mapped node feature, the first mapped node feature can be normalized to obtain the normalized node feature. That is, the first mapped node feature is substituted into the following formula (3) for normalization to obtain the normalized node feature: β'=softmax(β) (3)
[0119] Among them, β' represents the normalized node feature and softmax represents the normalization function.
[0120] In practical applications, after obtaining the normalized node features, the first weight corresponding to the first sample node feature and the second weight corresponding to the second sample node feature are filtered out from the normalized node features. For example, the server can determine the order of weights corresponding to the first sample node feature and the order of weights corresponding to the second sample node feature based on the order in which the first sample node feature and the second sample node feature are fused in the first fusion, and then filter out the first weight corresponding to the first sample node feature and the second weight corresponding to the second sample node feature from the normalized node features based on the order of weights.
[0121] For example, q is 3, h1 represents the first sample node feature, h2 and h3 represent the second sample node feature. If the fusion order of formula (2) is followed, the weight order of h1 is the first dimension, the weight order of h2 is the second dimension, and the weight order of h3 is the third dimension. The sub-features of the first dimension in the normalized node feature are used as the first weight, the sub-features of the second dimension in the normalized node feature are used as the second weight of h2, and the sub-features of the second dimension in the normalized node feature are used as the second weight of h3.
[0122] In some embodiments, in order to extract high-order features corresponding to the object node, the neighbor nodes of the object node may include multi-order neighbor nodes. That is, the neighbor nodes include not only interaction nodes and attribute nodes, but also other object nodes corresponding to other objects in the object. Other objects are objects other than the target object and interaction objects in the object. In this case, the object features, interaction features, and attribute features are fused to obtain sample node features of the target object, including:
[0123] Filtering out the last-order neighbor node of the object node from the multi-order neighbor nodes, and filtering out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes;
[0124] The node features of the last-order neighbor node and the node features of the previous-order neighbor node are fused to obtain the sample node features of the previous-order neighbor node;
[0125] If the previous-order neighbor node is not a first-order neighbor node, then the sample node feature of the previous-order neighbor node is used as the node feature of the previous-order neighbor node, and the previous-order neighbor node is used as the last-order neighbor node, and the process returns to the step of filtering out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes.
[0126] If the previous-order neighbor node is a first-order neighbor node, the sample node features of the previous-order neighbor node are used as interaction features or attribute features;
[0127] The object features, interaction features and attribute features are fused to obtain the sample node features of the target object.
[0128] For example, as shown in 502 in Figure 5 , the object node "shoe a1" includes first-order neighbor nodes and second-order neighbor nodes. The first-order neighbor nodes include user u1 and user u2, and the second-order neighbor nodes include shoe a2, shoe a6, and shoe a11. The second-order neighbor nodes are the object node's trailing neighbor nodes, i.e., shoe a2, shoe a6, and shoe a11 are the trailing neighbor nodes. The previous-order neighbor node of the second-order neighbor node is the first-order neighbor node, i.e., the previous-order neighbor node of the trailing neighbor nodes "shoe a2" and "shoe a6" is user u1, and the previous-order neighbor node of the trailing neighbor node "shoe a11" is user u2.
[0129] The node features of the last-order neighbor node and the node features of the previous-order neighbor node are fused to obtain the sample node features of the previous-order neighbor node, that is, the node features of shoe a2, the node features of shoe a6 and the node features of user u1 are fused to obtain the sample node features of the previous-order neighbor node "user u1", and the node features of shoe a11 and the node features of user u2 are fused to obtain the sample node features of the previous-order neighbor node "user u2".
[0130] Since the previous-order neighbor nodes "user u1" and "user u2" are first-order neighbor nodes, the sample node features of the previous-order neighbor node "user u1" are used as the interaction features of user u1, and the sample node features of the previous-order neighbor node "user u2" are used as the interaction features of user u2.
[0131] Then, the object features of the shoe a1, the interaction features of the user u1, and the interaction features of the user u2 are added together to achieve the fusion of the object features of the shoe a1, the interaction features of the user u1, and the interaction features of the user u2, and obtain the first sample node features of the object node.
[0132] At this time, after feature extraction of the interaction nodes and attribute nodes, node features of the interaction nodes and node features of the attribute nodes are obtained. Then, after fusing the node features, the interaction features of the interaction nodes and attribute features of the attribute nodes are obtained.
[0133] In practical applications, the terminal may filter out the last-order neighbor node of the object node from the multi-order neighbor nodes by traversing the neighbor nodes of the object node, and filter out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes.
[0134] Alternatively, when the neighbor nodes of the object node are obtained through a preset meta-path, the preset meta-path can be used to filter out the last-order neighbor node of the object node from the multi-order neighbor nodes, and to filter out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes. In this case, the process of filtering out the last-order neighbor node of the object node from the multi-order neighbor nodes and filtering out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes can be:
[0135] Obtaining a preset meta-path, where the preset meta-path includes adjacent node types;
[0136] According to the type of the adjacent nodes, the last-order neighbor node of the object node is filtered out from the multi-order neighbor nodes, and the previous-order neighbor node of the last-order neighbor node is filtered out from the multi-order neighbor nodes.
[0137] Since the preset meta-path includes a direction, the end node type can be filtered out from the adjacent node types according to the direction, and then the node corresponding to the end node type in the multi-order neighbor nodes is used as the last-order neighbor node of the object node, and the node corresponding to the previous node type of the end node type in the preset meta-path is used as the previous-order neighbor node of the last-order neighbor node.
[0138] For example, the preset meta-path is item→user→item (the arrow indicates the direction), and the direction is from left to right. The object node and neighbor node obtained are shoe a1→user u1→shoe a2, then the adjacent node types are user and item. Since the direction is from left to right, the end node type in the adjacent node type is item, then the last-order neighbor node is shoe a2 corresponding to the end node type "item", and the previous node type of the end node type "item" in the preset meta-path is user, then the node corresponding to the previous node type is user u1, that is, the previous-order neighbor node of the last-order neighbor node is user u1.
[0139] It should be noted that when a sub-heterogeneous data structure is generated and the edges in the sub-heterogeneous data structure include directions, the last-order neighbor nodes of the object node can be filtered out from the multi-order neighbor nodes according to the sub-heterogeneous data structure, and the previous-order neighbor nodes of the last-order neighbor nodes can be filtered out from the multi-order neighbor nodes.
[0140] For example, as shown in 502 in Figure 5, the direction of the edge in the sub-heterogeneous data structure is from the second-order neighbor node "shoes a2" and the second-order neighbor node "shoes a6" to the first-order neighbor node "user u1", then the second-order neighbor node "shoes a2" and the second-order neighbor node "shoes a6" can be filtered out from the multi-order neighbor nodes as the last-order neighbor nodes of the object node "shoes a1", and the first-order neighbor node "user u1" can be used as the previous-order neighbor node of the last-order neighbor node.
[0141] In some embodiments, by presetting a meta-path, the tail-order neighbor node of the object node is filtered out from the multi-order neighbor nodes, and the previous-order neighbor node of the tail-order neighbor node is filtered out from the multi-order neighbor nodes, so that there is no need to traverse the multi-order neighbor nodes, thereby improving the speed of obtaining the tail-order neighbor node and the previous-order neighbor node.
[0142] After obtaining the last-order neighbor node and the previous-order neighbor node, the server can directly fuse the node features of the last-order neighbor node with the node features of the previous-order neighbor node to obtain the sample node features of the previous-order neighbor node. Alternatively, the terminal can also fuse the node features of the last-order neighbor node with the node features of the previous-order neighbor node based on the importance between the last-order neighbor node and the previous-order neighbor node to obtain the sample node features of the previous-order neighbor node. In this case, the node features of the last-order neighbor node and the node features of the previous-order neighbor node are fused to obtain the sample node features of the previous-order neighbor node, including:
[0143] The weight between the last-order neighbor node and the previous-order neighbor node is obtained, where the weight represents the importance of the last-order neighbor node to the previous-order neighbor node. The node features of the last-order neighbor node are adjusted according to the weight to obtain the adjusted node features of the last-order neighbor node. The adjusted node features are fused with the node features of the previous-order neighbor node to obtain the sample node features of the previous-order neighbor node.
[0144] In an embodiment of the present application, the node features of the tail-order neighbor node are adjusted according to the weight between the tail-order neighbor node and the previous-order neighbor node to obtain the adjusted node features of the tail-order neighbor node, and then the adjusted node features and the node features of the previous-order neighbor node are fused to obtain the sample node features of the previous-order neighbor node, so that the sample node features include the importance of the tail-order neighbor node to the previous-order neighbor node, so that when the trained recommendation meta-model obtained by training according to the sample node features is used for recommendation, the recommendation results can be more accurate.
[0145] At this time, the node features of the last-order neighbor node and the node features of the previous-order neighbor node can be substituted into the following formula (4) for fusion to obtain the sample node features of the previous-order neighbor node:
[0146] h' k represents the sample node feature of the previous order neighbor node k, σ() represents the activation mapping function, N k represents the set of tail-order neighbor nodes of the previous-order neighbor node k, α kj represents the weight between the last-order neighbor node j and the previous-order neighbor node k, h j represents the node characteristics of the last-order neighbor node j, h k Represents the node features of the previous-order neighbor node k.
[0147] It should be noted that in the process of fusing object features, interaction features and attribute features to obtain sample node features of the target object, the weights between the object features and the interaction features can be determined based on the importance between the object node and each interaction node, and then the weights between the object features and the interaction features can be adjusted. After that, the adjusted interaction features and object features can be fused. According to the importance between the object node and each attribute node, the weights between the object features and the attribute features can be determined. After that, the weights between the object features and the attribute features can be adjusted. After that, the adjusted attribute features and object features can be fused.
[0148] That is, the object features and interaction features and the object features and attribute features can also be fused through formula (4). At this time, the object node can be understood as the previous order neighbor node, and the interaction node and attribute node can be understood as the last order neighbor node.
[0149] In some other embodiments, obtaining the weight between the last-order neighbor node and the previous-order neighbor node includes:
[0150] The similarity between the previous-order neighbor node and the last-order neighbor node is determined based on the node features of the last-order neighbor node and the node features of the previous-order neighbor node; and the weight between the last-order neighbor node and the previous-order neighbor node is determined based on the similarity.
[0151] The server can map the node features of the last-order neighbor node and the node features of the previous-order neighbor node to the same feature space, and then splice and fuse the mapped last-order node features and the mapped previous-order node features to obtain the spliced node features, and then map the spliced node features to a real number so that the real number can be used to represent the similarity between the previous-order neighbor node and the last-order neighbor node, and finally use the similarity as the weight between the last-order neighbor node and the previous-order neighbor node.
[0152] In practical applications, after obtaining the similarity, the terminal can also normalize the similarity and then use the normalized similarity as the weight between the last-order neighbor node and the previous-order neighbor node. At this time, the node features of the last-order neighbor node and the node features of the previous-order neighbor node can be substituted into the following formula (5) for calculation to obtain the weight between the last-order neighbor node and the previous-order neighbor node:
[0153] Among them, α kj represents the weight between the last-order neighbor node j and the previous-order neighbor node k, exp() represents the exponential operation, LeakyReLU() represents the activation function, and a T Indicates the operation of mapping the spliced node features to a real number, [||] indicates the splicing fusion process, W1 indicates mapping the node features to the same feature space, N k Represents the set of last-order neighbor nodes of the previous-order neighbor node k.
[0154] In an embodiment of the present application, the node characteristics of the last-order neighbor node and the node characteristics of the previous-order neighbor node can be used to determine the similarity between the last-order neighbor node and the previous-order neighbor node in real time, so that the importance of the last-order neighbor node to the previous-order neighbor node determined in real time based on the similarity is more accurate, thereby making the weight between the last-order neighbor node and the previous-order neighbor node more accurate.
[0155] In some embodiments, after object features, interaction features, and attribute features are fused to obtain sample node features of the target object, the interaction parameters in the recommendation meta-model to be trained can be corrected based on the sample node features to obtain a candidate recommendation meta-model.
[0156] The interaction parameter can also be called the preference parameter of the interacting object to the target object, or the prior parameter.
[0157] Meta-learning is a technology that enables a model to learn to adjust parameters. A model that has the ability to learn to adjust parameters can be called a meta-model. The recommendation meta-model in the embodiment of the present application is also a recommendation model that has the ability to learn to adjust parameters. The principle of meta-learning can be shown in Figure 6. The meta-model is trained through multiple tasks. A task can include a type of training samples. Each task is divided into a support set (Support Set) and a query set (Query Set). First, the sample of the support set in task m (task m) is used to train the model parameter φ in the meta-model. 0 Perform local update (local update can also be understood as correction) to obtain Then according to Use the samples of the query set in task m to calculate the loss value of task m, and use the loss value to calculate the loss value of task m. The gradient of the model parameter φ 0 Perform global update to obtain model parameters φ 1 Then, we continue to use task n to adjust the model parameter φ in the meta-model. 1 Perform local and global updates to obtain the model parameters φ 2 , until the training is completed, the model parameters in the meta-model are first corrected so that a small number of samples can be used to train the meta-model later.
[0158] Therefore, in an embodiment of the present application, a metamodel is applied to a recommendation system, that is, sample node features are used to train a recommendation metamodel to be trained, and a trained recommendation metamodel is obtained. Even if there is less interaction data for new items or new users, recommendations can be made through the trained recommendation metamodel, thereby solving the cold start problem of items or users.
[0159] However, in the process of training the recommendation metamodel to be trained, if all objects in the recommendation system share the same interaction parameters, it will result in a low recommendation accuracy and poor recommendation results when the trained recommendation metamodel is used for recommendation. For objects, they usually have some inherent attributes. Therefore, in an embodiment of the present application, the object features, interaction features and attribute features are fused to obtain the sample node features of the target object, so that the sample node features include attribute features, and then the interaction parameters in the recommendation metamodel to be trained are corrected according to the sample node features to obtain a candidate recommendation metamodel, so that the interaction parameters in the recommendation metamodel to be trained are corrected according to the attributes of the object, so that objects with similar attribute features have similar interaction parameters, and feature adaptation is achieved, so that when the trained recommendation metamodel obtained by training the candidate recommendation metamodel according to the sample node features is used for recommendation, items can be recommended to users more accurately, thereby improving the accuracy of recommendations.
[0160] In practical applications, the terminal can directly perform a second fusion of the sample node features and the interaction parameters to correct the interaction parameters in the recommendation metamodel to be trained and obtain a candidate recommendation metamodel. Alternatively, the terminal can perform a second mapping of the sample node features to obtain the second mapped node features corresponding to the target object, and then perform a second fusion of the interaction parameters and the second mapped node features to correct the interaction parameters in the recommendation metamodel to be trained and obtain a candidate recommendation metamodel.
[0161] The node features after the second mapping can be understood as the prior knowledge corresponding to the target object, and the interaction parameters are corrected based on the prior knowledge of the target object.
[0162] In practical applications, the terminal can map the sample node features to the second mapped node features through the fully connected layer in the recommendation meta-model to be trained. That is, the sample node features can be substituted into the following formula (6) for the second mapping to obtain the second mapped node features: z =δ(W g h z '+b g ) (6)
[0163] x z represents the node feature after the second mapping of the target object z, δ() represents the second mapping, W g Represents the matrix parameters of the fully connected layer, h' z Represents the sample node features of the target object z, b g Represents the bias parameters of the fully connected layer.
[0164] After obtaining the second mapped node feature, the terminal multiplies the second mapped node feature and the interaction parameter to achieve the second fusion and obtain the candidate interaction parameter. The recommendation meta-model to be trained containing the candidate interaction parameter is called the candidate recommendation meta-model. That is, the second mapped node feature and the interaction parameter can be substituted into the following formula (7) to obtain the candidate interaction parameter:
[0165] Among them, Φ z represents the candidate interaction parameter, Φ represents the interaction parameter, Represents element-wise multiplication.
[0166] S205: Train the candidate recommendation meta-model according to the sample node characteristics to obtain a trained recommendation meta-model.
[0167] After obtaining the candidate recommendation metamodel, the server predicts the interaction score based on the interaction features and sample node features to obtain the predicted interaction score of the interacting object for the target object, and then obtains the actual interaction score between the interacting object and the target object. Based on the predicted interaction score and the actual interaction score, the server determines the target loss value of the candidate recommendation metamodel. Based on the target loss value, the candidate recommendation metamodel is trained to obtain the trained recommendation metamodel.
[0168] The operation of interaction score prediction may include fusion operation and mapping operation. The interaction features and sample node features may be substituted into the following formula (8) for fusion mapping:
[0169] Among them, r′ uz Represents the predicted interaction score of the interaction object u for the target object z, sigmoid() represents the activation function, which is used for mapping. represents concatenation and fusion, and f() represents a multi-layer perceptron.
[0170] In practical applications, the candidate recommendation meta-model is trained according to the target loss value, and the process of obtaining the trained recommendation meta-model can be as follows:
[0171] According to the target loss value, the interaction parameters in the candidate recommendation metamodel are updated to obtain an updated recommendation metamodel; the sample node features in the query set are obtained, and the first target loss value of the updated recommendation metamodel is determined based on the sample node features in the query set; if the first target loss value meets the preset loss condition, the updated recommendation metamodel is used as the trained recommendation metamodel;
[0172] If the first target loss value does not meet the preset loss condition, the model parameters in the recommendation meta-model to be trained are globally updated according to the first target loss value, and the process returns to execute the steps of extracting features of the object nodes, interaction nodes and attribute nodes respectively.
[0173] After obtaining the object node and its neighbor nodes, the neighbor nodes of the object node can be divided to obtain the support set and query set corresponding to the object node, and then feature extraction is performed on the nodes in the support set and query set to obtain sample node features corresponding to the support set and sample node features corresponding to the query set.
[0174] According to the target loss value, the interaction parameters in the candidate recommendation metamodel are updated. The process of obtaining the updated recommendation metamodel can be as follows: solving the gradient of the target loss value for the interaction parameter, updating the interaction parameter according to the gradient of the interaction parameter, and obtaining the updated recommendation metamodel. That is, at this time, using the gradient Perform gradient descent update and set Φ z Update to Φ′ z , W2 is not updated, W2∪Φ z represents all model parameters, W2 represents the parameters for feature extraction and fusion processing of object nodes and neighbor nodes, S z represents the support set of the target object z.
[0175] Based on the sample node features in the query set, the process of determining the first target loss value of the updated recommendation metamodel can be as follows: fusing and mapping the interaction features in the query set and the sample node features in the query set to obtain a target predicted interaction score; obtaining the target true interaction score between the interaction object and the target object in the query set; and determining the first target loss value based on the target predicted interaction score and the target true interaction score. The method for determining the first target loss value based on the target predicted interaction score and the target true interaction score can be selected based on actual conditions. For example, the first target loss value can be calculated by minimizing the square error function or the cross entropy loss function, which is not limited in this embodiment of the present application.
[0176] When the first target loss value is calculated by minimizing the square error function, the first target loss value can be calculated by the following formula (9):
[0177] Among them, L' represents the first target loss value, R represents the interaction matrix between the target object z and the interaction object u, r uz represents the target true interaction score between the target object z and the interaction object u, r″ uz represents the target predicted interaction score between the target object z and the interaction object u.
[0178] When the first target loss value does not meet the preset loss condition, the model parameters in the recommendation meta-model to be trained are globally updated according to the first target loss value. It can be understood that all model parameters in the recommendation meta-model to be trained are updated. All model parameters include not only interaction parameters, but also parameters for feature extraction and fusion of object nodes and neighboring nodes. That is, at this time, the gradient Update Φ and W2, Q z A queryset representing the target object z.
[0179] In an embodiment of the present application, the node sample features in the support set are first used to correct the interaction parameters in the recommendation metamodel to be trained to obtain a candidate recommendation metamodel. Then, the node sample features and interaction features in the support set are used to update the interaction parameters in the candidate recommendation metamodel to obtain an updated recommendation metamodel. Subsequently, the sample node features and interaction features in the query set are used to globally update the updated recommendation metamodel, as shown in Figure 7.
[0180] From the above, it can be seen that in an embodiment of the present application, a heterogeneous data structure generated according to data in a recommendation system is obtained, and the heterogeneous data structure includes multiple nodes, each node corresponds to data, and the data includes objects and attributes of objects; from the heterogeneous data structure, the object node corresponding to the target object in the object and the neighbor nodes of the object node are screened out, and the neighbor nodes include interaction nodes corresponding to interactive objects that interact with the target object and attribute nodes corresponding to the attributes of the target object; feature extraction is performed on the object nodes and neighbor nodes respectively to obtain object features corresponding to the object nodes, interaction features corresponding to the interaction nodes, and attribute features corresponding to the attribute nodes; the object features, interaction features, and attribute features are fused to obtain sample node features of the target object; according to the sample node features, the interaction parameters in the recommendation metamodel to be trained are corrected to obtain a candidate recommendation metamodel; according to the sample node features, the candidate recommendation metamodel is trained to obtain a trained recommendation metamodel.
[0181] Because the metamodel can quickly and accurately learn from a small amount of data, in embodiments of the present application, even if the recommendation system has relatively little interaction data for new items or new users, when using the trained recommendation metamodel obtained by training the to-be-trained recommendation metamodel based on the data in the recommendation system for recommendation, new items can be recommended to users or items can be recommended to new users, thereby improving the accuracy of recommendations and resolving the cold start problem for new items or new users. Furthermore, because the sample node features of the target object include the attribute features of the target object, using the sample node features of the target object to correct the interaction parameters in the to-be-trained recommendation metamodel to obtain a candidate recommendation metamodel can ensure that objects with similar attribute features have similar interaction parameters. This allows items to be more accurately recommended to users when using the trained recommendation metamodel obtained by training the candidate recommendation metamodel based on the sample node features for recommendation, thereby improving the accuracy of recommendations.
[0182] The following describes a method for recommending objects using a trained recommendation meta-model with reference to FIG8 . In practical applications, the object recommendation method can be implemented by a terminal or a server alone, or by a terminal and a server in collaboration. For example, the object recommendation method may include:
[0183] S801: Obtain a target object node and target neighbor nodes of the target object node in a target heterogeneous data structure.
[0184] Here, the target heterogeneous data structure includes multiple nodes, each corresponding to an object, which can be a recommending object or a recommended object. The data or object data corresponding to each node includes the object (object identifier) and the object's attributes. The target object node is the node corresponding to the object to be recommended in the target heterogeneous data structure; the target neighbor nodes include: target interaction nodes corresponding to target interaction objects that interact with the object to be recommended, and target attribute nodes corresponding to the attributes of the object to be recommended. The object to be recommended can be an item in the recommendation system, and the recommended object can be a user in the recommendation system. That is, in the recommendation system, items are recommended to users.
[0185] The trained recommendation metamodel (also called the recall model) in the embodiments of this application is primarily used in the recall phase of the recommendation system. Specifically, the trained recommendation metamodel obtains item and user characteristics, then determines the interaction score between the item and user based on these characteristics. Then, a preset number of items with the highest interaction scores are recommended to the user, as shown in Figure 9.
[0186] S802 : Extract features of the target object node and the target neighbor node respectively to obtain initial node features corresponding to the target object node, target interaction features corresponding to the target interaction node, and target attribute features corresponding to the target attribute node.
[0187] In some embodiments, the recommendation metamodel includes a feature extraction layer. Accordingly, the feature extraction layer of the recommendation metamodel can be used to extract features of the target object node and the target neighbor node respectively to obtain initial node features, target interaction features, and target attribute features.
[0188] S803: Fusing the initial node features, target interaction features, and target attribute features to obtain target node features of the object to be recommended.
[0189] In some embodiments, the server can fuse the initial node features, target interaction features and target attribute features in the following manner: fuse the initial node features and the target interaction features to obtain a first target node feature, fuse the initial node features and the target attribute features to obtain a second target node feature, and then determine the target node features of the object to be recommended based on the first target node features and the second target node features.
[0190] Here, in actual application, based on the first target node feature and the second target node feature, the target node feature of the object to be recommended can be determined in the following manner:
[0191] The first target node feature and the second target node feature are concatenated to obtain the target node feature of the object to be recommended; or,
[0192] The weight of the first target node feature and the weight of the second target node feature are obtained respectively, and the first target node feature and the second target node feature are weightedly fused to obtain the target node feature of the object to be recommended.
[0193] In some embodiments, the recommendation meta-model includes not only the feature extraction layer but also a feature fusion layer. Accordingly, the operation of step S803 may be performed by the feature fusion layer of the recommendation meta-model.
[0194] S804: Obtain node features of the recommended object in the target heterogeneous data structure.
[0195] In actual applications, the process by which the server obtains the node features of the recommended object is similar to the process of obtaining the target node features of the object to be recommended. For example, the object node of the recommended object in the target heterogeneous data structure and the neighbor nodes of the object node are obtained, and the feature extraction layer of the recommendation metamodel is used to extract features of the object node of the recommended object and the neighbor nodes of the object node respectively to obtain the initial node features of the recommended object, the interaction features of the interactive objects that interact with the recommended object, and the attribute features of the attribute nodes corresponding to the recommended object; and the feature fusion layer of the recommendation metamodel is used to fuse the initial node features of the recommended object, the interaction features of the interactive objects that interact with the recommended object, and the attribute features of the attribute nodes corresponding to the recommended object to obtain the node features of the recommended object.
[0196] S805: Determine a target interaction score of the recommended object with respect to the object to be recommended based on the target node characteristics and the node characteristics of the recommended object.
[0197] In some embodiments, the recommendation meta-model includes not only a feature extraction layer and a feature fusion layer but also an interaction score prediction layer. Accordingly, the operation of step S805 can be performed by the interaction score prediction layer. That is, based on the target node features and the node features of the recommended object, the interaction score prediction layer performs interaction score prediction to obtain the target interaction score of the recommended object for the object to be recommended.
[0198] In practical applications, the above-mentioned interaction score prediction operations may include fusion operations and mapping operations. For example, the server first fuses the target node features and the node features of the recommended object, and then maps the target fused node features obtained by the fusion to obtain the target interaction score of the recommended object for the object to be recommended.
[0199] S806: Recommend the to-be-recommended object whose target interaction score is higher than the preset score to the recommended object.
[0200] Here, the preset score is also a preset score threshold, and the size of the score threshold can be set according to actual conditions.
[0201] In the embodiment of the present application, steps S801-S806 may all be performed by the trained recommendation metamodel, or, in the embodiment of the present application, steps S802-S805 may be performed by the trained recommendation metamodel, and steps S801 and S806 may not be performed by the trained recommendation metamodel.
[0202] In an embodiment of the present application, a target object node of an object to be recommended in a heterogeneous data structure and a target neighbor node corresponding to the target object node are obtained, the target neighbor node including a target interaction node corresponding to a target interaction object interacting with the object to be recommended and a target attribute node corresponding to an attribute of the object to be recommended, feature extraction is performed on the target object node and the target neighbor node to obtain an initial node feature corresponding to the target object node, a target interaction feature corresponding to the target interaction node and a target attribute feature corresponding to the target attribute node, the initial node feature, the target interaction feature and the target attribute feature are fused to obtain a target node feature of the object to be recommended, the node feature corresponding to the recommended object in the heterogeneous data structure is obtained, the target interaction score of the recommended object for the object to be recommended is determined based on the target node feature and the node feature corresponding to the recommended object, the object to be recommended having a target interaction score higher than a preset score is recommended to the recommended object, and object recommendation is implemented through a trained recommendation meta-model, so that even if there is less interaction data of new items or new users in the recommendation system, new items can be recommended to users or items can be recommended to new users. Moreover, since the interaction parameters in the trained recommendation meta-model are corrected according to the attribute characteristics of the target object, object recommendation through the trained recommendation meta-model can recommend items to users more accurately, thereby improving the accuracy of the recommendation.
[0203] The method described in the above embodiment will be described in detail below with examples.
[0204] The model training method and model application method provided in the embodiment of the present application are described below with reference to Figures 10 and 11. In this embodiment, item recommendations are made based on items, with items as target objects and users as interaction objects, i.e., item nodes are used as object nodes and user nodes are used as interaction nodes.
[0205] Please refer to Figure 10, which is a flow chart of the model training method provided in an embodiment of the present application. In practical applications, the method can be implemented by a terminal or a server alone, or by a terminal and a server in collaboration. Taking the terminal alone as an example, the model training method process may include:
[0206] S1001. The terminal obtains a heterogeneous data structure generated based on data in the recommendation system. The heterogeneous data structure includes multiple nodes, each node corresponds to data, and the data includes items, users, and item attributes.
[0207] S1002: The terminal obtains multiple preset meta-paths and determines the type of the starting node according to the directions in the preset meta-paths.
[0208] S1003. The terminal selects a node corresponding to the starting node type from the heterogeneous data structure, obtains an item node corresponding to the target item, and selects an initial neighbor node of the item node from the heterogeneous data structure.
[0209] S1004: The terminal selects the next node type corresponding to the starting node type from the preset meta-path according to the direction in the preset meta-path, and obtains the intermediate node type.
[0210] S1005: The terminal selects initial neighbor nodes corresponding to the intermediate node type from the initial neighbor nodes to obtain candidate neighbor nodes for the item node;
[0211] S1006. If there are unscreened node types in the preset meta-path, the terminal uses the initial neighbor node of the candidate neighbor node as the initial neighbor node, uses the intermediate node type as the starting node type, and returns to step S1004.
[0212] S1007: If there is no unscreened node type in the preset meta-path, the terminal uses the candidate neighbor nodes of the item node as neighbor nodes of the item node. The neighbor nodes include user nodes and attribute nodes of the item.
[0213] S1008. The terminal generates a sub-heterogeneous data structure corresponding to each preset meta-path of the target item based on the neighbor nodes and item nodes obtained for each preset meta-path.
[0214] The sub-heterogeneous data structure can be divided to obtain the sub-heterogeneous data structure of the target item in the support set and the sub-heterogeneous data structure in the query set.
[0215] The nodes in the sub-heterogeneous data structure correspond to items and users, or the nodes in the sub-heterogeneous data structure correspond to items and attributes of items, and the direction of the edges in the sub-heterogeneous data structure is opposite to the direction in the preset meta-path.
[0216] The items corresponding to the nodes in the sub-heterogeneous data structure may be only target items, or may include the target item and the first item, where the first item is the item in the recommendation system other than the target item.
[0217] S1009. The terminal selects the last-order node corresponding to the target item from the sub-heterogeneous data structure according to the direction of the edge in the sub-heterogeneous data structure.
[0218] S10010. The terminal selects the previous-order node of the last-order node from the sub-heterogeneous data structure according to the direction of the edge in the sub-heterogeneous data structure.
[0219] In this embodiment, since the sub-heterogeneous data structure of the target item includes the item node corresponding to the target item and the neighbor nodes corresponding to the item node, filtering out the previous-order node from the sub-heterogeneous data structure not only involves filtering out the previous-order node from the neighbor nodes of the item node, but also filtering out the previous-order node from the item node. Therefore, in this embodiment, the previous-order node includes the previous-order neighbor node, and the last-order node includes the last-order neighbor node.
[0220] The last-order nodes include the user node corresponding to the user, the attribute node corresponding to the attribute of the target item, or the first item node corresponding to the first item. The previous-order nodes include the user node corresponding to the user, the attribute node corresponding to the attribute of the target item, or the item node.
[0221] S10011. The terminal extracts features of the last-order node and the previous-order node respectively through the recommendation meta-model to be trained, and obtains node features of the last-order node and node features of the previous-order node.
[0222] The node features in the embodiments of this application are features obtained by directly extracting features from the node. If the final node is a user node of a target user who has interacted with the target item, the node features of the final node can also be called the target user's interaction features. If the final node is an attribute node of an attribute of the target item, the node features of the final node can also be called attribute features. In this case, the interaction features and attribute features are features obtained by direct feature extraction.
[0223] S10012. The terminal determines the similarity between the previous-order node and the last-order node based on the node features of the last-order node and the node features of the previous-order node through the recommendation meta-model to be trained, and uses the similarity as the weight between the last-order node and the previous-order node.
[0224] The weight indicates the importance of the last-order node to the previous-order node.
[0225] S10013. The terminal adjusts the node features of the last-order node according to the weights through the recommendation meta-model to be trained to obtain the adjusted node features of the last-order node, and fuses the adjusted node features with the node features of the previous-order node to obtain the sample node features of the previous-order node.
[0226] S10014. If the previous-order node is not the item node corresponding to the target item, the terminal uses the sample node feature of the previous-order node as the node feature of the previous-order node, uses the previous-order node as the last-order node, and returns to execute step S10010.
[0227] If the previous-order node is the user node of the target user who has interacted with the target item, the sample node features of the previous-order node can also be called the interaction features of the target user. If the previous-order node is the attribute node of the attribute of the target item, the sample node features of the previous-order node can also be called the attribute features. At this time, the interaction features and attribute features are fused features.
[0228] S10015. If the previous-order node is the item node corresponding to the target item, the terminal uses the sample node feature of the previous-order node as the sub-sample node feature of the item node for the sub-heterogeneous data structure.
[0229] When the sub-heterogeneous data structure is a data structure containing user nodes, the sub-sample node characteristics of the sub-heterogeneous data structure can also be called first sample node characteristics. When the sub-heterogeneous data structure is a data structure containing attribute nodes, the sub-sample node characteristics of the sub-heterogeneous data structure can also be called second sample node characteristics.
[0230] S10016. The terminal fuses the sub-sample node features of the item nodes for each sub-heterogeneous data structure through the recommendation meta-model to be trained to obtain the fused node features.
[0231] S10017. The terminal performs a first mapping on the fused node features through the recommendation meta-model to be trained to obtain first mapped node features, and selects sub-weights corresponding to each sub-sample node feature from the first mapped node features.
[0232] When the sub-heterogeneous data structure is a data structure containing user nodes, the sub-weight of the sub-sample node features of the sub-heterogeneous data structure can also be called the first weight. When the sub-heterogeneous data structure is a data structure containing attribute nodes, the sub-weight of the sub-sample node features of the sub-heterogeneous data structure can also be called the second weight.
[0233] S10018. The terminal adjusts the sub-sample node features according to the sub-weights corresponding to the sub-sample node features through the recommendation meta-model to be trained to obtain adjusted sub-sample node features, and adds up the adjusted sub-sample node features to obtain the sample node features corresponding to the item node.
[0234] S10019. The terminal performs a second mapping on the sample node features through the recommendation meta-model to be trained to obtain the second mapped node features corresponding to the target item.
[0235] S10020: The terminal performs a second fusion on the interaction parameters in the recommendation meta-model to be trained and the node features after the second mapping to correct the interaction parameters in the recommendation meta-model to be trained, and obtains a candidate recommendation meta-model.
[0236] S10021. The terminal determines the target loss value of the candidate recommendation metamodel based on the node characteristics of the target user who has interacted with the target item in the support set and the sample node characteristics of the target item in the support set, and updates the interaction parameters in the candidate recommendation metamodel based on the target loss value to obtain the updated recommendation metamodel.
[0237] S10022. The terminal determines a first target loss value of the updated recommendation meta-model based on the node features of the target users who have interacted with the target item in the query set and the sample node features of the target item in the query set.
[0238] S10023. If the first target loss value meets the preset loss condition, the terminal uses the updated recommendation meta-model as the trained recommendation meta-model.
[0239] S10024. If the first target loss value does not meet the preset loss condition, the terminal globally updates the model parameters in the recommendation meta-model to be trained according to the first target loss value, and returns to execute step S1009.
[0240] Please refer to Figure 11, which is a flow chart of the model application method provided in an embodiment of the present application. The model application method flow may include:
[0241] S1101. The terminal obtains multiple preset meta-paths, and obtains a target item node and target neighbor nodes corresponding to the target item node in a target heterogeneous data structure of the item to be recommended based on the preset meta-paths. The target neighbor nodes include a target user node corresponding to a first target user who interacts with the item to be recommended and a target attribute node corresponding to an attribute of the item to be recommended.
[0242] S1102: The terminal generates a target sub-heterogeneous data structure corresponding to each preset meta-path for the recommended item based on the target neighbor node and target item node obtained for each preset meta-path.
[0243] The implementation process of step S1102 can refer to steps S1002-S1008, and the embodiment of this application will not be repeated here.
[0244] S1103. The terminal extracts and fuses features of the nodes in each target sub-heterogeneous data structure through the trained recommendation meta-model to obtain target node features of the item to be recommended.
[0245] The implementation process of step S1103 can refer to steps S1009-S10018.
[0246] S1104: The terminal obtains the node features corresponding to the recommended user in the target heterogeneous data structure through the trained recommendation meta-model.
[0247] S1105: The terminal determines the target interaction score of the recommended user for the recommended item according to the trained recommendation meta-model and the target node features and the node features corresponding to the recommended user.
[0248] S1106. The terminal recommends the recommended items whose target interaction scores are higher than the preset scores to the recommended user.
[0249] The following uses the live broadcast room as an item to illustrate the recommendation effect of the trained recommendation meta-model. The effect of using the trained recommendation meta-model for live broadcast room recommendations can be shown in the following table (pv represents page views, Pctr represents page visits):
[0250] It can be seen from the above table that the recommendation effect is improved after applying the trained recommendation meta-model of the embodiment of the present application.
[0251] To facilitate better implementation of the model training method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above model training method. The meanings of the terms are the same as those in the above model training method, and the implementation details can be referred to the description in the method embodiment.
[0252] For example, as shown in FIG12 , the model training device may include:
[0253] The acquisition module 1201 is configured to acquire a heterogeneous data structure including a plurality of nodes, wherein the data corresponding to each node includes an object and attributes of the object.
[0254] The screening module 1202 is configured to obtain, from the heterogeneous data structure, an object node corresponding to the target object, an interaction node corresponding to an interaction object interacting with the target object, and an attribute node corresponding to an attribute of the target object.
[0255] The extraction module 1203 is configured to perform feature extraction on the object node, the interaction node and the attribute node respectively, to obtain object features corresponding to the object node, interaction features corresponding to the interaction node and attribute features corresponding to the attribute node.
[0256] The fusion module 1204 is configured to fuse the object features, interaction features and attribute features to obtain the sample node features of the target object.
[0257] The training module 1205 is configured to train the candidate recommendation meta-model according to the sample node characteristics to obtain a trained recommendation meta-model.
[0258] In some embodiments, the above-mentioned apparatus further includes a correction module configured to correct the interaction parameters in the trained recommendation meta-model according to the sample node characteristics to obtain a candidate recommendation meta-model.
[0259] In some embodiments, the screening module 1202 is further configured to:
[0260] Get multiple preset meta paths, which include different node types;
[0261] According to different node types, the object node corresponding to the target object in the object and the neighbor nodes of the object node are screened out from the heterogeneous data structure, and the neighbor nodes include interaction nodes and attribute nodes.
[0262] In some embodiments, different node types include starting node types and adjacent node types. Accordingly, the screening module 1202 is further configured to:
[0263] From the heterogeneous data structure, the node corresponding to the starting node type is filtered out to obtain the object node corresponding to the target object;
[0264] Get the initial neighbor node corresponding to the object node;
[0265] Filter out the initial neighbor nodes corresponding to the adjacent node type from the initial neighbor nodes as the neighbor nodes of the object node.
[0266] In some embodiments, the neighbor nodes include multi-order neighbor nodes, and the interaction nodes and attribute nodes are first-order neighbor nodes of the object nodes.
[0267] Accordingly, the fusion module 1204 is further configured to:
[0268] Filtering out the last-order neighbor node of the object node from the multi-order neighbor nodes, and filtering out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes;
[0269] The node features of the last-order neighbor node and the node features of the previous-order neighbor node are fused to obtain the sample node features of the previous-order neighbor node;
[0270] If the previous-order neighbor node is not a first-order neighbor node, then the sample node feature of the previous-order neighbor node is used as the node feature of the previous-order neighbor node, and the previous-order neighbor node is used as the last-order neighbor node, and the process returns to the step of filtering out the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes.
[0271] If the previous-order neighbor node is a first-order neighbor node, the sample node features of the previous-order neighbor node are used as interaction features or attribute features;
[0272] The object features, interaction features and attribute features are fused to obtain the sample node features of the target object.
[0273] In some embodiments, the fusion module 1204 is further configured to:
[0274] Obtaining a preset meta-path, where the preset meta-path includes adjacent node types;
[0275] According to the type of the adjacent nodes, the last-order neighbor node of the object node is filtered out from the multi-order neighbor nodes, and the previous-order neighbor node of the last-order neighbor node is filtered out from the multi-order neighbor nodes.
[0276] In some embodiments, the fusion module 1204 is further configured to:
[0277] Get the weight between the last-order neighbor node and the previous-order neighbor node. The weight represents the importance of the last-order neighbor node to the previous-order neighbor node.
[0278] Adjust the node features of the last-order neighbor node according to the weight to obtain the adjusted node features of the last-order neighbor node;
[0279] The adjusted node features and the node features of the previous-order neighbor nodes are fused to obtain the sample node features of the previous-order neighbor nodes.
[0280] In some embodiments, the fusion module 1204 is further configured to:
[0281] Determine the similarity between the previous-order neighbor node and the last-order neighbor node based on the node features of the last-order neighbor node and the node features of the previous-order neighbor node;
[0282] According to the similarity, the weight between the last-order neighbor node and the previous-order neighbor node is determined.
[0283] In some embodiments, the fusion module 1204 is further configured to:
[0284] The object features and interaction features are fused to obtain the first sample node features of the target object;
[0285] The object features and attribute features are fused to obtain the second sample node features of the target object;
[0286] The sample node feature of the target object is determined according to the first sample node feature and the second sample node feature.
[0287] In some embodiments, the fusion module 1204 is further configured to:
[0288] Obtain a first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature;
[0289] Adjusting the first sample node feature according to the first weight to obtain an adjusted first sample node feature;
[0290] Adjusting the second sample node feature according to the second weight to obtain an adjusted second sample node feature;
[0291] The sample node features of the target object are determined according to the adjusted first sample node features and the adjusted second sample node features.
[0292] In some embodiments, the fusion module 1204 is further configured to:
[0293] Performing a first fusion on the first sample node feature and the second sample node feature to obtain a fused node feature;
[0294] Performing a first mapping on the fused node features to obtain first mapped node features;
[0295] The first weight corresponding to the first sample node feature and the second weight corresponding to the second sample node feature are filtered out from the first mapped node feature.
[0296] In some embodiments, the correction module 1206 is further configured to:
[0297] Performing a second mapping on the sample node features to obtain the second mapped node features corresponding to the target object;
[0298] The interaction parameters and the second mapped node features are subjected to a second fusion to correct the interaction parameters in the recommendation meta-model to be trained, and a candidate recommendation meta-model is obtained.
[0299] In some embodiments, the training module 1205 is further configured to:
[0300] The interaction features and sample node features are fused and mapped to obtain the predicted interaction score of the interacting object for the target object;
[0301] Get the true interaction score between the interacting object and the target object;
[0302] Determine the target loss value of the candidate recommendation meta-model based on the predicted interaction score and the actual interaction score;
[0303] According to the target loss value, the candidate recommendation meta-model is trained to obtain the trained recommendation meta-model.
[0304] In practical applications, the sample node features include the sample node features of the adjacent node groups in the support set. Accordingly, the training module 1205 is further configured to:
[0305] According to the target loss value, the interaction parameters in the candidate recommendation meta-model are updated to obtain the updated recommendation meta-model;
[0306] Obtaining sample node features in the query set, and determining a first target loss value of the updated recommendation meta-model based on the sample node features in the query set;
[0307] If the first target loss value meets the preset loss condition, the updated recommendation meta-model is used as the trained recommendation meta-model;
[0308] If the first target loss value does not meet the preset loss condition, the model parameters in the recommendation meta-model to be trained are globally updated according to the first target loss value, and the process returns to execute the steps of extracting features of the object node and the neighboring nodes respectively.
[0309] In actual implementation, the above modules can be implemented as independent entities, or they can be arbitrarily combined and implemented as the same or several entities. The implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments and will not be repeated here.
[0310] To facilitate better implementation of the object recommendation method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above object recommendation method. The meanings of the terms are the same as those in the above object recommendation method, and the implementation details can be referred to the description in the method embodiment.
[0311] For example, as shown in FIG13 , the object recommendation device may include:
[0312] The first acquisition module 1301 is configured to obtain the target object node of the object to be recommended in the target heterogeneous data structure and the target neighbor nodes corresponding to the target object node, wherein the target neighbor nodes include the target interaction node corresponding to the target interaction object that interacts with the object to be recommended and the target attribute node corresponding to the attribute of the object to be recommended.
[0313] The first extraction module 1302 is configured to perform feature extraction on the target object node and the target neighbor node to obtain the initial node feature corresponding to the target object node, the target interaction feature corresponding to the target interaction node, and the target attribute feature corresponding to the target attribute node.
[0314] The first fusion module 1303 is configured to fuse the initial node features, the target interaction features and the target attribute features to obtain the target node features of the object to be recommended.
[0315] The second acquisition module 1304 is configured to acquire node features corresponding to the recommended object in the target heterogeneous data structure.
[0316] The first determining module 1305 is configured to determine a target interaction score of the recommended object with respect to the object to be recommended based on the target node feature and the node feature corresponding to the recommended object.
[0317] The object recommendation module 1306 is configured to recommend a to-be-recommended object having a target interaction score higher than a preset score to a recommended object.
[0318] In actual implementation, the above modules can be implemented as independent entities, or they can be arbitrarily combined and implemented as the same or several entities. The implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments and will not be repeated here.
[0319] An embodiment of the present application also provides an electronic device, which may be a server or a terminal, etc. As shown in FIG14 , it shows a schematic structural diagram of the electronic device involved in the embodiment of the present application.
[0320] The electronic device may include components such as a processor 1401 with one or more processing cores, a memory 1402 with one or more computer-readable storage media, a power supply 1403, and an input unit 1404. Those skilled in the art will appreciate that the electronic device structure shown in FIG14 does not limit the electronic device and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0321] Processor 1401 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and circuits. It executes computer programs and / or modules stored in memory 1402 and accesses data stored in memory 1402 to perform various functions of the electronic device and process data. For example, processor 1401 may include one or more processing cores. Preferably, processor 1401 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 1401.
[0322] The memory 1402 can be used to store computer programs and modules. The processor 1401 executes various functional applications and data processing by running the computer programs and modules stored in the memory 1402. The memory 1402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1402 may also include a memory controller to provide the processor 1401 with access to the memory 1402.
[0323] The electronic device also includes a power supply 1403 for supplying power to various components. For example, the power supply 1403 may be logically connected to the processor 1401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 1403 may also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0324] The electronic device may further include an input unit 1404 , which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0325] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. In some embodiments, the processor 1401 in the electronic device will load the executable files corresponding to one or more computer program processes into the memory 1402 according to the following instructions, and the processor 1401 will run the computer programs stored in the memory 1402 to implement various functions, such as:
[0326] Acquire a heterogeneous data structure including a plurality of nodes, wherein data corresponding to each of the nodes includes an object and attributes of the object;
[0327] Obtaining, from the heterogeneous data structure, an object node corresponding to a target object, an interaction node corresponding to an interaction object interacting with the target object, and an attribute node corresponding to an attribute of the target object;
[0328] Performing feature extraction on the object node, the interaction node, and the attribute node respectively to obtain object features corresponding to the object node, interaction features corresponding to the interaction node, and attribute features corresponding to the attribute node;
[0329] The object features, interaction features and attribute features are integrated to obtain the sample node features of the target object;
[0330] According to the characteristics of the sample nodes, the candidate recommendation meta-model is trained to obtain the trained recommendation meta-model.
[0331] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0332] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, which can be loaded by a processor to execute the steps of any model training method or object recommendation method provided in the embodiment of the present application.
[0333] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0334] Since the computer program stored in the computer-readable storage medium can execute the steps of any model training method or object recommendation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any model training method or object recommendation method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0335] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described model training method or object recommendation method.
[0336] The above is a detailed introduction to a model training method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Individual examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A model training method, the method being performed by an electronic device, comprising: Acquire a heterogeneous data structure including a plurality of nodes, wherein data corresponding to each of the nodes includes an object and attributes of the object; Acquire, from the heterogeneous data structure, an object node corresponding to a target object, an interaction node corresponding to an interaction object that interacts with the target object, and an attribute node corresponding to an attribute of the target object; Extracting features from the object node, the interaction node and the attribute node respectively to obtain object features corresponding to the object node, interaction features corresponding to the interaction node and attribute features corresponding to the attribute node; The object feature, the interaction feature and the attribute feature are integrated to obtain a sample node feature of the target object; According to the sample node features, the candidate recommendation meta-model is trained to obtain a trained recommendation meta-model.
2. The model training method according to claim 1, wherein: The acquiring, from the heterogeneous data structure, an object node corresponding to a target object in the object, an interaction node corresponding to an interaction object interacting with the target object, and an attribute node corresponding to an attribute of the target object includes: Acquire multiple preset meta-paths, where the preset meta-paths include different node types; According to the different node types, the object node corresponding to the target object in the object and the neighbor nodes of the object node are screened out from the heterogeneous data structure, and the neighbor nodes include the interaction node and the attribute node.
3. The model training method according to claim 2, wherein: The different node types include a starting node type and an adjacent node type; The step of filtering out the object node corresponding to the target object in the object and the neighbor nodes of the object node from the heterogeneous data structure according to the different node types includes: Filtering out a node corresponding to the starting node type from the heterogeneous data structure as an object node corresponding to the target object; Obtaining an initial neighbor node corresponding to the object node; From the initial neighbor nodes, initial neighbor nodes corresponding to the adjacent node type are screened out as neighbor nodes of the object node.
4. The model training method according to claim 1, wherein: The interactive node and the attribute node belong to neighbor nodes of the object node, the neighbor nodes include multi-order neighbor nodes, and the interactive node and the attribute node are first-order neighbor nodes of the object node; The fusing the object feature, the interaction feature and the attribute feature to obtain the sample node feature of the target object includes: Filtering out the last-order neighbor node of the object node and the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes; The node features of the last-order neighbor node and the node features of the previous-order neighbor node are merged to obtain the sample node features of the previous-order neighbor node; If the previous-order neighbor node is not the first-order neighbor node, the sample node feature of the previous-order neighbor node is used as the node feature of the previous-order neighbor node, the previous-order neighbor node is used as the last-order neighbor node, and the step of filtering out the previous-order neighbor node of the last-order neighbor node from the multiple-order neighbor nodes is returned; If the previous-order neighbor node is the first-order neighbor node, using the sample node feature of the previous-order neighbor node as the interaction feature or the attribute feature; The object feature, the interaction feature and the attribute feature are fused to obtain the sample node feature of the target object.
5. The model training method according to claim 4, wherein: The step of selecting the last-order neighbor node of the object node and the previous-order neighbor node of the last-order neighbor node from the multi-order neighbor nodes includes: Acquire a preset meta-path, where the preset meta-path includes adjacent node types; According to the adjacent node type, the last-order neighbor node of the object node and the previous-order neighbor node of the last-order neighbor node are screened out from the multi-order neighbor nodes.
6. The model training method according to claim 4, wherein: The step of fusing the node features of the last-order neighbor node and the node features of the previous-order neighbor node to obtain the sample node features of the previous-order neighbor node includes: Obtaining a weight of the last-order neighbor node, where the weight represents the importance of the last-order neighbor node to the previous-order neighbor node; Adjusting the node feature of the last-order neighbor node according to the weight to obtain the adjusted node feature of the last-order neighbor node; The adjusted node feature and the node feature of the previous-order neighbor node are fused to obtain the sample node feature of the previous-order neighbor node.
7. The model training method according to claim 6, wherein: The obtaining the weight of the last-order neighbor node includes: Determining the similarity between the previous-order neighbor node and the last-order neighbor node according to the node feature of the last-order neighbor node and the node feature of the previous-order neighbor node; The weight of the last-order neighbor node is determined according to the similarity.
8. The model training method according to claim 1, wherein: The fusing the object feature, the interaction feature and the attribute feature to obtain the sample node feature of the target object includes: The object feature and the interaction feature are merged to obtain a first sample node feature of the target object; Fusing the object feature and the attribute feature to obtain a second sample node feature of the target object; The sample node feature of the target object is determined according to the first sample node feature and the second sample node feature.
9. The model training method according to claim 8, wherein: The determining the sample node feature of the target object according to the first sample node feature and the second sample node feature includes: Obtaining a first weight of the first sample node feature and a second weight of the second sample node feature; According to the first weight, adjusting the first sample node feature to obtain an adjusted first sample node feature; According to the second weight, adjusting the second sample node feature to obtain an adjusted second sample node feature; The sample node feature of the target object is determined according to the adjusted first sample node feature and the adjusted second sample node feature.
10. The model training method according to claim 9, wherein: The obtaining a first weight of the first sample node feature and a second weight of the second sample node feature includes: Performing a first fusion on the first sample node feature and the second sample node feature to obtain a fused node feature; Performing a first mapping on the fused node features to obtain first mapped node features; A first weight of the first sample node feature and a second weight of the second sample node feature are screened out from the first mapped node features.
11. The model training method according to claim 1, wherein: Before training the candidate recommendation meta-model according to the sample node features, the method further includes: According to the sample node features, the interaction parameters in the recommendation meta-model to be trained are corrected to obtain the candidate recommendation meta-model.
12. The model training method according to claim 11, wherein: The step of correcting the interaction parameters in the recommendation meta-model to be trained according to the sample node features to obtain the candidate recommendation meta-model includes: Performing a second mapping on the sample node features to obtain a second mapped node feature corresponding to the target object; The interaction parameter and the second mapped node feature are second fused to correct the interaction parameter in the recommendation meta-model to be trained, so as to obtain a candidate recommendation meta-model.
13. The model training method according to claim 1, wherein: The step of training the candidate recommendation meta-model according to the sample node features to obtain the trained recommendation meta-model includes: Performing interaction score prediction based on the interaction feature and the sample node feature to obtain a predicted interaction score of the interaction object for the target object; Obtaining a real interaction score between the interaction object and the target object; Determining a target loss value of the candidate recommendation meta-model according to the predicted interaction score and the actual interaction score; The candidate recommendation meta-model is trained according to the target loss value to obtain a trained recommendation meta-model.
14. The model training method according to claim 13, wherein: The sample node features include sample node features of adjacent node groups in a support set; The step of training the candidate recommendation meta-model according to the target loss value to obtain a trained recommendation meta-model includes: According to the target loss value, the interaction parameters in the candidate recommendation metamodel are updated to obtain an updated recommendation metamodel; Acquire sample node features in the query set, and determine a first target loss value of the updated recommendation meta-model according to the sample node features in the query set; If the first target loss value satisfies a preset loss condition, using the updated recommendation meta-model as the trained recommendation meta-model; If the first target loss value does not meet the preset loss condition, the model parameters in the recommendation meta-model to be trained are globally updated according to the first target loss value, and the step of performing feature extraction on the object node, the interaction node and the attribute node is returned to be executed respectively.
15. An object recommendation method, the method being executed by an electronic device and implemented by the trained recommendation meta-model according to any one of claims 1 to 14, comprising: Acquire a target object node of the object to be recommended in the target heterogeneous data structure, a target interaction node corresponding to a target interaction object that interacts with the object to be recommended, and a target attribute node corresponding to an attribute of the object to be recommended; Extracting features of the target object node, the target interaction node and the target attribute node respectively to obtain initial node features corresponding to the target object node, target interaction features corresponding to the target interaction node and target attribute features corresponding to the target attribute node; The initial node feature, the target interaction feature and the target attribute feature are integrated to obtain the target node feature of the object to be recommended; Obtaining node features of nodes corresponding to the recommended objects in the target heterogeneous data structure; Determining a target interaction score of the recommended object for the object to be recommended according to the target node feature and the node feature of the recommended object; The to-be-recommended object whose target interaction score is higher than the preset score is recommended to the recommended object.
16. A model training device, comprising: An acquisition module is configured to acquire a heterogeneous data structure including a plurality of nodes, wherein the data corresponding to each of the nodes includes an object and attributes of the object; A screening module configured to obtain, from the heterogeneous data structure, an object node corresponding to a target object, an interaction node corresponding to an interaction object interacting with the target object, and an attribute node corresponding to an attribute of the target object; An extraction module is configured to perform feature extraction on the object node, the interaction node and the attribute node respectively, to obtain object features corresponding to the object node, interaction features corresponding to the interaction node and attribute features corresponding to the attribute node; A fusion module, configured to fuse the object feature, the interaction feature and the attribute feature to obtain a sample node feature of the target object; The training module is configured to train the candidate recommendation meta-model according to the sample node characteristics to obtain a trained recommendation meta-model.
17. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the model training method described in any one of claims 1 to 14 or the object recommendation method described in claim 15.
18. A computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor to execute the method according to any one of claims 1 to 15.
19. A computer program product, wherein the computer program product stores a computer program, wherein the computer program is suitable for being loaded by a processor to execute the method according to any one of claims 1 to 14.
