Model training method, object recommendation method, model training device, electronic device and computer program
By training a recommendation metamodel using a heterogeneous data structure to extract and fuse object, interaction, and attribute features, the method enhances recommendation accuracy even with limited interaction data, addressing the limitations of collaborative filtering algorithms.
Patent Information
- Application Number
- JP2025530036
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-06
- Filing Date
- 2023-11-03
- Publication Date
- 2025-11-28
AI Technical Summary
Collaborative filtering algorithms in recommendation systems struggle with low accuracy when there is a lack of interaction data, making it difficult to recommend new products to users or new users.
A model training method that utilizes a heterogeneous data structure to extract object, interaction, and attribute features, fusing them to train a recommendation metamodel, enabling accurate recommendations even with limited interaction data.
The method allows for quick and accurate recommendations of new items to users or new users by leveraging attribute features, improving recommendation accuracy compared to traditional methods.
Smart Images

Figure 2025538581000001_ABST
Abstract
Description
[Technical Field]
[0001] This application is based on and claims priority from a Chinese patent application filed on February 6, 2023, with application number 2023101276183, the entire contents of which are incorporated herein by reference.
[0002] The present application belongs to the technical field of data processing, and in particular to a model training method, apparatus, electronic device, storage medium and computer program product. [Background technology]
[0003] With the development of science and technology, the amount of data on the Internet is constantly increasing. To help users find data they like more easily, recommendation systems have emerged. Recommendation systems can recommend data to users based on existing interaction data between users and products. Summary of the Invention [Problem to be solved by the invention]
[0004] In the related art, recommendation systems mainly use collaborative filtering algorithms to recommend data to users based on interaction data. However, collaborative filtering algorithms must rely on a large amount of existing interaction data. If there is little existing interaction data, it may be impossible to recommend new products to users or recommend products to new users, resulting in low recommendation accuracy.
[0005] The embodiments of the present application provide a model training method, device, electronic device, computer-readable storage medium, and computer program product that can improve the accuracy of recommendations based on a recommendation metamodel obtained through training. [Means for solving the problem]
[0006] The model training method provided in the present embodiment includes: obtaining a heterogeneous data structure including a plurality of nodes, wherein data corresponding to each of the nodes includes an object and an attribute of the object; obtaining, from the heterogeneous data structure, an object node corresponding to a target object among the objects, 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; performing feature extraction on the object nodes, the interaction nodes, and the attribute nodes, respectively, to obtain object features of the object nodes, interaction features of the interaction nodes, and attribute features of the attribute nodes; fusing the object features, the interaction features and the attribute features to obtain sample node features of the target object; training the candidate recommendation metamodel based on the sample node features to obtain a trained recommendation metamodel.
[0007] Correspondingly, the model training device provided in this embodiment is: an acquisition module for acquiring 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; a selection module for obtaining, from the heterogeneous data structure, an object node corresponding to a target object among the objects, 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; an extraction module that performs 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 that fuses the object features, the interaction features, and the attribute features to obtain sample node features of the target object; a training module for training the candidate recommendation metamodel based on the sample node features to obtain a trained recommendation metamodel.
[0008] Furthermore, the electronic device provided in the embodiments of the present application includes a processor and a memory, and a computer program is stored in the memory. The processor is used to execute the model training method or object recommendation method provided in the embodiments of the present application by running the computer program in the memory.
[0009] Furthermore, the computer-readable storage medium provided in the embodiments of the present application stores a computer program, and the model training method or object recommendation method provided in the embodiments of the present application is executed by loading the computer program into a processor.
[0010] Furthermore, the computer program product provided in the embodiments of the present application includes a computer program, which, when executed by a processor, realizes the model training method or object recommendation method provided in the embodiments of the present application. [Effects of the Invention]
[0011] In the present embodiment, a heterogeneous data structure including multiple nodes is acquired. Data corresponding to each node includes an object and its attributes. 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 the target object's attributes are acquired. Feature extraction is then performed 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 features corresponding to the attribute node. The object features, interaction features, and attribute features are then combined to obtain sample node features of the target object. A candidate recommendation metamodel is then trained based on the sample node features to obtain a trained recommendation metamodel.
[0012] The metamodel can learn quickly and accurately with a small amount of data. Therefore, even if there are few interaction nodes corresponding to object nodes in a heterogeneous data structure, i.e., even if there is little interaction data during the model training process, when a recommendation is made using a trained recommendation metamodel obtained by training a candidate recommendation metamodel based on the heterogeneous data structure, it is possible to recommend a new item to a user or recommend an item to a new user, thereby improving the accuracy of the recommendation. In addition, the sample node features of a target object include the attribute features of the target object, and the sample node features are a combination of not only object features and interaction features but also attribute features. Therefore, by training a candidate recommendation metamodel using the sample node features, similar interaction parameters can be assigned to objects with similar attribute features, and when a recommendation is made using the trained recommendation metamodel, the accuracy of the recommendation can be improved compared to a recommendation method using a recommendation model trained in the related art. [Brief explanation of the drawings]
[0013] [Figure 1] FIG. 1 is a schematic diagram of the model training process provided in the present embodiment. [Figure 2] FIG. 2 is a flow chart of the model training method provided in the present embodiment. [Figure 3] FIG. 3 is a schematic diagram of a heterogeneous data structure provided in an embodiment of the present invention. [Figure 4] FIG. 4 is a schematic diagram of neighbor nodes provided in the embodiment of the present application. [Figure 5] FIG. 5 is a schematic diagram of a heterogeneous sub-data structure provided in an embodiment of the present invention. [Figure 6] FIG. 6 is a schematic diagram of the meta-learning provided in the present embodiment. [Figure 7] FIG. 7 is a process diagram of the model training method provided in the present embodiment. [Figure 8] FIG. 8 is a schematic diagram of the object recommendation method provided in this embodiment. [Figure 9] FIG. 9 is a schematic diagram of the recommendation system provided in this embodiment. [Figure 10] FIG. 10 is a schematic flow diagram of another model training method provided in an embodiment of the present application. [Figure 11] FIG. 11 is a flow chart of the model application method provided in the present embodiment. [Figure 12] FIG. 12 is a structural diagram of the model training device provided in this embodiment. [Figure 13] FIG. 13 is a structural diagram of an object recommendation device provided in this embodiment. [Figure 14] FIG. 14 is a structural schematic diagram of the electronic device provided in the present embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0014] The following clearly and comprehensively describes the technical schemes of the embodiments of the present application in combination with the drawings in the embodiments of the present application. Of course, the described embodiments are only a part of the embodiments of the present application, and are not all of the embodiments. All other embodiments that can be obtained by those skilled in the art based on the embodiments of the present application without requiring ingenuity fall within the scope of protection of the present application.
[0015] The present embodiments provide a model training method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product. The model training apparatus may be integrated into an electronic device, which may be a server, a terminal, or other device.
[0016] The server may be a standalone physical server, a server group or a distributed system consisting of multiple physical servers, or even 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 services, security services, CDNs (Content Delivery Networks), and big data and AI platforms.
[0017] Additionally, multiple servers may be combined to form a blockchain, and the servers may be nodes of the blockchain.
[0018] The terminal may be, but is not limited to, a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be connected directly or indirectly via a wired or wireless method, but the present embodiment is not limited thereto.
[0019] For example, as shown in FIG. 1, the server can generate a heterogeneous data structure based on data in the recommendation system and send the heterogeneous data structure to the terminal. The terminal then screens the heterogeneous data structure for an object node corresponding to a target object and neighbor nodes of the object node. The neighbor nodes include interaction nodes corresponding to interaction objects that interact with the target object and attribute nodes corresponding to attributes of the target object. Then, feature extraction is performed on the object node and the 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. Then, the object features, interaction features, and attribute features are fused to obtain sample node features of the target object. Then, a candidate recommendation metamodel is trained based on the sample node features to obtain a trained recommendation metamodel. The terminal then sends the trained recommendation metamodel to the server.
[0020] In the examples, "plurality" refers to two or more than two. Terms such as "first" and "second" are used to distinguish between the two and should not be understood as implying relative importance.
[0021] Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or devices controlled by digital computers to imitate, extend, and expand human intelligence to sense the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology of computer science that aims to understand the essence of intelligence and create new intelligent devices that respond in a manner similar to human intelligence. AI also involves researching the design principles and implementation methods of various intelligent devices to give them sensing, reasoning, and decision-making capabilities.
[0022] Artificial intelligence technology is a comprehensive academic field that spans a wide range of fields, including both hardware and software. The basic technologies of artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. AI software technology primarily encompasses several major fields, including computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0023] Machine learning (ML) is an interdisciplinary field that spans multiple disciplines, including probability theory, statistics, approximation theory, convex analysis, and computational complexity theory. It specializes in studying how computers imitate or realize human learning behavior, acquire new knowledge or skills, and reorganize existing knowledge structures to continually improve their performance. Machine learning is the core of artificial intelligence and the fundamental means of giving computers intelligence, and is applied across various fields of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, Bayesian networks, reinforcement learning, transfer learning, inductive learning, and imitation learning.
[0024] With the research and advancement of artificial intelligence technology, it is being researched and applied in many fields, such as the commonly seen smart homes, smart wearable devices, virtual assistants, smart speakers, intelligent marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, etc. With the development of technology, it is certain that artificial intelligence technology will be applied in more fields and will play an even more important role.
[0025] Each of these will be described in detail below. Note that the order of description in the following embodiments does not limit the order of priority of the embodiments.
[0026] In this embodiment, the description will be made from the perspective of a model training device. For convenience of explaining the model training method of the present application, the following detailed description will be made assuming that the model training device is integrated into a terminal. That is, the detailed description will be made with the terminal as the execution subject.
[0027] Please refer to Figure 2. Figure 2 is a flow diagram of the model training method provided in this embodiment. In actual operation, the model training method can be implemented by a server or a terminal alone, or by a server and a terminal working together. In this embodiment, the model training method is implemented by a server alone. The model training method includes the following steps:
[0028] S201: Obtain a heterogeneous data structure including multiple nodes. Data corresponding to each node includes an object and an attribute of the object.
[0029] Here, the heterogeneous data structure can be generated based on data in a recommender system, which includes data (e.g., ID, number of times recommended, object attributes, etc.) of recommended objects (e.g., items to be recommended, which may be real items such as apples or virtual items such as videos) and data (e.g., ID, number of times recommended, preference information of user objects, etc.) of recommended objects (e.g., user objects).
[0030] In actual operation, the heterogeneous data structure may be acquired by periodically generating the heterogeneous data structure based on the data in the recommender system, or by periodically generating and storing the heterogeneous data structure based on the data in the recommender system, and later retrieving the heterogeneous data structure directly from the storage space when a model training command is received to perform model training, or by generating the heterogeneous data structure based on the data in the recommender system when a model training command is received.
[0031] The heterogeneous data structure includes multiple nodes. Each node corresponds to an object. The object can be a recommending object or a recommended object. The data or object data corresponding to each node includes the object (object ID) and the object's attributes.
[0032] A heterogeneous data structure refers to a network structure that includes nodes corresponding to multiple node types. In some embodiments, the node types may include items and users. For example, in FIG. 3, network structure g1 includes nodes n1, n2, and n3, where node n1 represents shoes a1, node n2 represents user u1, and node n3 represents sports shoes t1 (a type of shoes a1). The node type of shoes a1 is an item, the node type of user u1 is a user, and the node type of node n3 is sports shoes t1, i.e., an attribute of shoes a1. Therefore, network structure g1 is a heterogeneous data structure.
[0033] An object refers to an entity that can exist independently in a recommendation system, and can include at least one of an item (i.e., a recommended object) and a user (i.e., a recommended object). An item can include multiple types, and the type of the item can be selected based on the actual situation. For example, an item can include goods or products, and a product can be, for example, a video channel, a live commentary room, or text, but the present embodiment is not limited thereto.
[0034] For example, if an object refers to an item, the object's attributes may include the type of item, the provider of the item, etc. For example, if an object refers to a user, the object's attributes may include the user's age, gender, etc.
[0035] S202: 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 are obtained.
[0036] An interaction refers to an action initiated by one object to affect another object. The type of interaction can be selected based on the actual situation. For example, if a user clicks on an icon of an item, the interaction refers to the click, and the click is initiated by the user to affect the item. For example, when a user watches a video, the user may click on a streaming widget to trigger a streaming command for the video. In this case, the interaction refers to the user triggering a streaming command for the video, and watching is initiated by the user to affect the video. The embodiments of the present application are not limited thereto.
[0037] The recommender system may make recommendations based on the user (i.e., recommending an item to a new user) or on the item (i.e., recommending a new item to a user). When recommending a new item to a user, the target object is the item, and in this case, the recommendation is made based on the item. When recommending an item to a new user, the target object is the user, and in this case, the recommendation is made based on the user. When the target object is an item, the interaction object that interacts with the target object is the user, and the attributes of the target object refer to the attributes of the item. In this case, the heterogeneous data structure may or may not include the attributes of the user. When the target object is a user, the interaction object that interacts with the target object is an item, and the attributes of the target object refer to the attributes of the user. In this case, the heterogeneous data structure may or may not include the attributes of the item.
[0038] The server first identifies the node type corresponding to the target object, and then, based on the node type corresponding to the target object, screens the heterogeneous data structure for an object node corresponding to the target object, and then screens the heterogeneous data structure for a neighbor node corresponding to the object node. In actual operation, the interaction node and the attribute node may belong to the neighbor node of the object node.
[0039] Alternatively, the server may screen the heterogeneous data structure for an object node corresponding to a target object among the objects and neighbor nodes of the object node based on a predetermined meta path. In this case, the process of obtaining the object node corresponding to the target object, the interaction nodes corresponding to the interaction objects interacting with the target object, and the attribute nodes corresponding to the attributes of the target object from the heterogeneous data structure may be as follows: obtain a plurality of predetermined meta paths including different node types; and then, based on the different node types, screen the heterogeneous data structure for the object node corresponding to the target object among the objects, the interaction nodes corresponding to the interaction objects interacting with the target object, and the attribute nodes corresponding to the attributes of the target object.
[0040] A predetermined meta path refers to a path connecting multiple nodes, and the nodes in the path include at least two node types. The path indicates the association relationship between multiple nodes, and different predetermined meta paths typically represent different semantic information. The node types in a predetermined meta path may be set based on actual situations. The present embodiment is not limited thereto. For example, if the predetermined meta path p1 is item → user → item, the semantic information represented by the predetermined meta path p1 indicates that two items preferred by the same user may be similar. If the predetermined meta path p2 is item → attribute → item, the semantic information represented by the predetermined meta path p2 indicates that two items with the same attribute may be similar.
[0041] Different attribute nodes may be stored in different predetermined meta paths or in the same predetermined meta path, and attribute nodes and interaction nodes may be stored in different predetermined meta paths or in the same predetermined meta path.
[0042] For example, if different attribute nodes are stored in different predetermined meta paths, the predetermined meta paths may be Item → Type → Item and Item → Provider → Item. If different attribute nodes are stored in the same predetermined meta path, the predetermined meta path may be Item → Type → Item → Provider → Item.
[0043] When an attribute node and an interaction node are stored in different predetermined meta paths, the predetermined meta path containing the attribute node may be item → attribute → item, and the predetermined meta path containing the interaction node may be item → user → item. When an attribute node and an interaction node are stored in the same predetermined meta path, the predetermined meta path may be item → attribute → item → user → item.
[0044] In some embodiments, after obtaining a predetermined meta path, the heterogeneous data structure may be screened for node sequences corresponding to different types of nodes in the predetermined meta path, and the node sequences may be further screened for object nodes corresponding to the target object and neighbor nodes of the object nodes.
[0045] For example, if a given meta path is item → attribute, the node series corresponding to different node types in the given meta path is shoes a1 → sports shoes, and furthermore, from shoes a1 → sports shoes, shoes a1 can be screened as the object node and sports shoes as the neighbor node.
[0046] Alternatively, since the predetermined meta path includes a direction, the terminal may obtain the predetermined meta path, and then identify different node types within the predetermined meta path, namely, an origin node type and an adjacent node type, based on the direction in the predetermined meta path, and then screen the nodes corresponding to the origin node type from the heterogeneous data structure to obtain an object node corresponding to the target object, then obtain an initial neighbor node corresponding to the object node, and screen the initial neighbor nodes from the initial neighbor nodes to obtain an initial neighbor node corresponding to the adjacent node type to obtain the neighbor node of the object node.
[0047] For example, if a given meta-path is from item to attribute, the starting node type is item and the neighboring node type is attribute. The node corresponding to the item is set as the object node of the target object, and the initial neighbor node of the object node that corresponds to the attribute is set as the neighbor node of the object.
[0048] Note that at least one type of adjacent node type may be included. For example, if a given meta path is item → attribute, the adjacent node type is attribute, and in this case, one type of adjacent node type is included. For example, if a given meta path is item → attribute → item, the adjacent node types are attribute and item, and in this case, two types of adjacent node types are included.
[0049] That is, the process of obtaining the neighbor nodes of the object node by screening the initial neighbor nodes corresponding to the adjacent node type may be as follows: From the adjacent node types, screen the next node type corresponding to the origin node type to obtain the intermediate node type; Then, from the initial neighbor nodes, screen the initial neighbor nodes corresponding to the intermediate node type to obtain the candidate neighbor nodes of the object node; If there is a node type that has not been screened within the predetermined meta path, the initial neighbor node of the candidate neighbor node is set as the initial neighbor node, and the intermediate node type is set as the origin node type; Then, return to the step of screening the next node type corresponding to the origin node type from the adjacent node types to obtain the intermediate node type; If there is no node type that has not been screened within the predetermined meta path, the candidate neighbor nodes of the object node are set as the neighbor nodes of the object node.
[0050] For example, as shown in Figure 4, a given meta path is Item → Type → Item, which includes two neighbor node types, and the node corresponding to the starting node type is shoes a1. The initial neighbor nodes of shoes a1 are user u1, sports shoes t1, provider i1, and price s1. The next node type after the starting node type is type, and by screening the initial neighbor nodes corresponding to type from among the initial neighbor nodes, a candidate neighbor node "sports shoes t1" of shoes a1 is obtained. The initial neighbor nodes of the candidate neighbor nodes include shoes a3 and shoes a4.
[0051] In this case, there is a node type "item" that has not been screened among the adjacent node types. Therefore, shoes a3 and shoes a4 are set as the initial neighbor nodes, type is set as the starting node type, and the node type next to type among the adjacent node types is item, so shoes a3 and shoes a4 are screened for initial neighbor nodes that are items, and candidate neighbor nodes "shoes a3" and "shoes a4" of the object node are obtained.
[0052] In this case, since there is no node type that has not been screened among the neighbor node types, the candidate neighbor node "sports shoes t1", the candidate neighbor node "shoes a3", and the candidate neighbor node "shoes a4" of the object node are set as the neighbor nodes of the object node. In other words, the neighbor nodes of the object node in this case include the first-rank neighbor node and the second-rank neighbor node of the object node.
[0053] Note that a node may be both a first-rank neighbor node and a second-rank neighbor node. For example, as shown in Figure 4, node "shoes a4" is a first-rank neighbor node of node "sports shoes t1" and a second-rank neighbor node of node "shoes a1".
[0054] In some embodiments, the object node and the neighbor nodes obtained for each predetermined meta path may be combined to form a sub-heterogeneous data structure. For example, if the heterogeneous data structure is as shown in 501 of Figure 5 and the predetermined meta paths include item → type → item, item → user → item, and item → provider → item, the sub-heterogeneous data structure obtained by item → user → item is as shown in 502 of Figure 5, the sub-heterogeneous data structure obtained by item → type → item is as shown in 503 of Figure 5, and the sub-heterogeneous data structure obtained by item → provider → item is as shown in 504 of Figure 5.
[0055] It should be noted that the edges in the sub-heterogeneous data structure may be undirected edges, or for the convenience of subsequent feature fusion processing, the edges in the sub-heterogeneous data structure may be directional edges, and the direction of the directional edges may be opposite to the direction of the predetermined meta-path.
[0056] For example, as shown in 502 of FIG. 5, if shoes a1 → user u2 → shoes a11 are obtained by item → user → item, in the sub-heterogeneous data structure corresponding to item → user → item, it is expressed as shoes a11 → user u2 → shoes a1.
[0057] S203: Feature extraction is performed on each of the object node, interaction node, and attribute node to obtain object features corresponding to the object node, interaction features corresponding to the interaction node, and attribute features corresponding to the attribute node.
[0058] After obtaining the object nodes and neighbor nodes (including the above-mentioned interaction nodes and attribute nodes), 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.
[0059] In actual operation, the server may simultaneously perform feature extraction on the object node and the neighbor node, or may first perform feature extraction on the neighbor node and then on the object node, or may first perform feature extraction on the object node and then on the neighbor node. The embodiment of the present application is not limited thereto.
[0060] S204: The object feature, the interaction feature and the attribute feature are fused to obtain the sample node feature of the target object.
[0061] The server may directly add the object feature, interaction feature, and attribute feature to achieve fusion of the object feature, interaction feature, and attribute feature. Alternatively, the server may obtain weights of the object feature, interaction feature, and attribute feature, and calculate a weighted sum of the object feature, interaction feature, and attribute feature based on the respective weights. Alternatively, the server may obtain a first fusion result by fusing the object feature and the interaction feature, and a second fusion result by fusing the object feature and the attribute feature, and add the obtained first fusion result and second fusion result to obtain the sample node feature of the target object.
[0062] For example, fusing object features, interaction features and attribute features to obtain sample node features of a target object may be the following process: The object feature and the interaction feature are fused to obtain a first sample node feature of the target object, the object feature and the attribute feature are fused to obtain a second sample node feature of the target object, and the sample node feature of the target object is determined based on the first sample node feature and the second sample node feature.
[0063] When there are multiple types of attribute nodes, a fusion process is performed between each attribute feature and the object feature to obtain multiple second sample node features.
[0064] In the present embodiment, the object feature and the interaction feature are fused to obtain a first node sample feature, the object feature and the attribute feature are fused to obtain a second sample node feature of the target object, and finally the sample node feature of the target object is determined based on the first sample node feature and the second sample node feature, thereby improving the accuracy of determining the sample node feature of the target object.
[0065] The process of determining the sample node feature of the target object based on the first sample node feature and the second sample node feature may be adding the first sample node feature and the second sample node feature to obtain the sample node feature of the target object.
[0066] Alternatively, the process of determining the sample node features of the target object based on the first sample node features and the second sample node features may be the following process: A first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature are obtained. Based on the first weight, an adjustment process is performed on the first sample node feature to obtain an adjusted first sample node feature. Based on the second weight, an adjustment process is performed on the second sample node feature to obtain an adjusted second sample node feature. Then, based on the adjusted first sample node feature and the adjusted second sample node feature, a sample node feature of the target object is determined.
[0067] In this embodiment, the importance of the interaction feature and the attribute feature to the target object may not be the same. Therefore, a first weight for the first sample node feature and a second weight for the second sample node feature are determined based on the importance. The first sample node feature is adjusted based on the first weight of the first sample node feature to obtain an adjusted first sample node feature, and the second sample node feature is adjusted based on the second weight of the second sample node feature to obtain an adjusted second sample node feature. Finally, the adjusted first sample node feature and the adjusted second sample node feature are added together to obtain the sample node feature of the target object. This improves the accuracy of the sample node feature.
[0068] In actual operation, the importance of the interaction feature and the attribute feature to the target object may be set according to the actual situation. The importance and the weight of the sample node feature may be positively correlated. For example, if the importance of the interaction feature to the target object is a first importance and the importance of the attribute feature to the target object is a second importance, the first weight of the first sample node feature and the second weight of the second sample node feature may be determined in accordance with the ratio of the first importance to the second importance. The sum of the first weight and the second weight is 1.
[0069] Note that when multiple second sample node features exist, the second weights corresponding to each second sample node feature may or may not be the same. When neighbor nodes are obtained using a predetermined meta path, each predetermined meta path may be understood to correspond to one weight. In other words, each sub-heterogeneous data structure may be understood to correspond to one weight. For example, when a first sample node feature x1 is obtained using a predetermined meta path p1, a second sample node feature x2 is obtained using a predetermined meta path p2, and a second sample node feature x3 is obtained using a predetermined 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 not the same.
[0070] In this case, the sample node feature of the target object can be obtained by substituting the first sample node feature, the first weight, the second weight, and the second sample node feature into the following equation (1).
[0071]
number
[0072] where h represents the sample node feature and β q represents the first or second weight, and h qrepresents 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.
[0073] In some embodiments, obtaining a first weight corresponding to the first sample node feature and a second weight corresponding to 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 feature to obtain a first mapped node feature; and screening the first weight corresponding to the first sample node feature and the second weight corresponding to the second sample node feature from among the first mapped node features.
[0074] In the present embodiment, 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, thereby increasing the accuracy of the first weight and the second weight, and thereby improving the accuracy of the sample node feature obtained based on the first weight and the second weight.
[0075] The first fusion may be a concatenation fusion or an addition fusion. When the first fusion is a concatenation fusion process, the first sample node feature and the second sample node feature are substituted into the following formula (2) to perform the first fusion and the first mapping, thereby obtaining the first mapped node feature.
[0076]
number
[0077] However, h qrepresents the first sample node feature or the second sample node feature, +{+ is the character + surrounded by a circle} represents the concatenation fusion process, W represents the first mapping function, and β represents the first mapped node feature.
[0078] In actual operation, after the first mapped node feature is obtained, the first mapped node feature may be normalized to obtain a normalized node feature. That is, the first mapped node feature is substituted into the following equation (3) and normalized to obtain the normalized node feature.
[0079]
number
[0080] where β' represents the normalized node feature and softmax represents the normalization function.
[0081] In actual operation, after obtaining the normalized node features, the server screens the normalized node features for a first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature. For example, the server determines 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 fusion order in the first fusion of the first sample node feature and the second sample node feature, and screens the normalized node features for a first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature based on the weight order.
[0082] For example, if q is 3, h1 represents the first sample node feature, and h2 and h3 represent the second sample node features, then according to the fusion order in equation (2), the weight order of h1 is the first rank, the weight order of h2 is the second rank, and the weight order of h3 is the third rank. The first-rank sub-feature in the normalized node feature is the first weight, the second-rank sub-feature in the normalized node feature is the second weight of h2, and the second-rank sub-feature in the normalized node feature is the second weight of h3.
[0083] In some embodiments, to extract high-rank features corresponding to an object node, the neighbor nodes of the object node may include neighbor nodes of multiple ranks. That is, the neighbor nodes not only include interaction nodes and attribute nodes, but also other object nodes corresponding to other objects among the objects. The other objects are objects excluding the target object and interaction object. In this case, the step of fusing object features, interaction features, and attribute features to obtain a sample node feature of the target object includes the following steps: from the neighbor nodes of multiple ranks, a neighbor node of the final rank of the object node is screened, and from the neighbor nodes of multiple ranks, a neighbor node of one rank higher than the final rank neighbor node is screened. The node feature of the neighbor node of the final rank and the node feature of the neighbor node of one rank higher are combined to obtain a sample node feature of the neighbor node of one rank higher. If the neighbor node one rank higher is not the first-rank neighbor node, the sample node feature of the neighbor node one rank higher is taken as the node feature of the neighbor node one rank higher, and the neighbor node one rank higher is taken as the neighbor node of the final rank, and the process returns to the step of screening the neighbor node one rank higher than the final-rank neighbor node from among the neighbor nodes of multiple ranks. If the neighbor node one rank higher is the first-rank neighbor node, the sample node feature of the neighbor node one rank higher is taken as the interaction feature or attribute feature. Then, the object feature, interaction feature, and attribute feature are combined to obtain the sample node feature of the target object.
[0084] For example, as shown in 502 of FIG. 5, if the object node "shoes a1" includes neighbor nodes of the first rank and neighbor nodes of the second rank, the neighbor nodes of the first rank include users u1 and u2, and the neighbor nodes of the second rank include shoes a2, shoes a6, and shoes a11. The neighbor nodes of the second rank are the neighbor nodes of the final rank of the object node, i.e., shoes a2, shoes a6, and shoes a11 are the neighbor nodes of the final rank. The neighbor node of the rank one level above the neighbor node of the second rank is the neighbor node of the first rank. That is, the neighbor node of the rank one level above the neighbor node of the final rank "shoes a2" and the neighbor node of the final rank "shoes a6" is user u1, and the neighbor node of the rank one level above the neighbor node of the final rank "shoes a11" is user u2.
[0085] The node features of the neighbor node at the final rank are combined with the node features of the neighbor node at the next higher rank to obtain a sample node feature of the neighbor node at the next higher rank. That is, the node features of shoe a2, shoe a6, and user u1 are combined to obtain a sample node feature of "user u1," the neighbor node at the next higher rank. The node features of shoe a11 and user u2 are combined to obtain a sample node feature of "user u2," the neighbor node at the next higher rank.
[0086] The neighbor nodes "user u1" and "user u2" of the next higher rank are neighbor nodes of the first rank. Therefore, the sample node features of the neighbor node "user u1" of the next higher rank are set as the interaction features of user u1, and the sample node features of the neighbor node "user u2" of the next higher rank are set as the interaction features of user u2.
[0087] Then, by adding the object features of shoe a1, the interaction features of user u1, and the interaction features of user u2, a fusion of the object features of shoe a1, the interaction features of user u1, and the interaction features of user u2 is achieved, and a first sample node feature of the object node is obtained.
[0088] In this case, by extracting features from the interaction nodes and attribute nodes, the node features of the interaction nodes and the node features of the attribute nodes are obtained, and only after the node features are fused can the interaction features of the interaction nodes and the attribute features of the attribute nodes be obtained.
[0089] In actual operation, the terminal may traverse the neighbor nodes of the object node to screen the neighbor node of the final rank of the object node from among the neighbor nodes of multiple ranks, and may also screen the neighbor node of one rank higher than the neighbor node of the final rank from among the neighbor nodes of multiple ranks.
[0090] Alternatively, when obtaining neighbor nodes of an object node using a predetermined meta path, the predetermined meta path may be used to screen neighbor nodes of multiple ranks for a neighbor node of the object node's final rank, and to screen neighbor nodes of multiple ranks for a neighbor node of one rank higher than the neighbor node of the final rank. In this case, the process of screening neighbor nodes of multiple ranks for a neighbor node of the object node's final rank and selecting neighbor nodes of multiple ranks for a neighbor node of one rank higher than the neighbor node of the final rank may be as follows: A predetermined meta path including neighbor node types is obtained. Then, based on the neighbor node types, neighbor nodes of multiple ranks are screened for a neighbor node of the object node's final rank, and neighbor nodes of multiple ranks for a neighbor node of one rank higher than the neighbor node of the final rank.
[0091] Since a given meta path includes a direction, after screening the terminal node type from among the adjacent node types based on the direction, a node corresponding to the terminal node type from among neighbor nodes of multiple ranks can be set as the neighbor node of the final rank of the object node, and a node corresponding to the node type one level above the terminal node type in the given meta path can be set as the neighbor node of one level above the final rank neighbor node.
[0092] For example, if a given meta path is item → user → item (arrows indicate directions) from left to right, and the obtained object node and neighbor node are shoes a1 → user u1 → shoes a2, the adjacent node types are user and item. Because the direction is from left to right, the end node type among the adjacent node types is item, and the neighbor node at the final rank is shoes a2, which corresponds to the end node type "item." Since the node type immediately before the end node type "item" in the given meta path is user, the node corresponding to the previous node type is user u1. In other words, the neighbor node at the rank immediately above the neighbor node at the final rank is user u1.
[0093] In addition, when a sub-heterogeneous data structure is generated and the edges in the sub-heterogeneous data structure include a direction, based on the sub-heterogeneous data structure, a neighbor node of the final rank of the object node may be screened from among neighbor nodes of multiple ranks, and a neighbor node of one rank higher than the neighbor node of the final rank may be screened from among neighbor nodes of multiple ranks.
[0094] For example, as shown in 502 of FIG. 5 , in the direction of the edge in the sub-heterogeneous data structure, if the second-rank neighbor node “shoes a2” and the second-rank neighbor node “shoes a6” point to the first-rank neighbor node “user u1”, then the second-rank neighbor node “shoes a2” and the second-rank neighbor node “shoes a6” can be screened from the neighbor nodes of multiple ranks as the neighbor nodes of the final rank of the object node “shoes a1”, and the first-rank neighbor node “user u1” can be the neighbor node of one rank higher than the neighbor node of the final rank.
[0095] In some embodiments, a predetermined meta path is used to screen the object node's final-rank neighbor node from among neighbor nodes of multiple ranks, and also screen the neighbor node of one rank higher than the final-rank neighbor node from among neighbor nodes of multiple ranks, thereby eliminating the need to traverse neighbor nodes of multiple ranks and improving the speed of obtaining the final-rank neighbor node and the neighbor node of one rank higher.
[0096] After obtaining the neighbor node of the final rank and the neighbor node of the next higher rank, the server may directly combine the node features of the neighbor node of the final rank with the node features of the neighbor node of the next higher rank to obtain a sample node feature of the neighbor node of the next higher rank. Alternatively, the terminal may combine the node features of the neighbor node of the final rank with the node features of the neighbor node of the next higher rank based on the importance between the neighbor node of the final rank and the neighbor node of the next higher rank to obtain a sample node feature of the neighbor node of the next higher rank. In this case, the step of combining the node features of the neighbor node of the final rank with the node features of the neighbor node of the next higher rank to obtain a sample node feature of the neighbor node of the next higher rank includes the following steps: Obtain the weight between the neighbor node of the final rank and the neighbor node of the next higher rank. The weight represents the importance of the neighbor node of the final rank to the neighbor node of the next higher rank. Then, adjust the node feature of the neighbor node of the final rank based on the weight to obtain the adjusted node feature of the neighbor node of the final rank. Then, fuse the adjusted node feature with the node feature of the neighbor node of the next higher rank to obtain the sample node feature of the neighbor node of the next higher rank.
[0097] In the present embodiment, the node feature of the neighbor node of the final rank is adjusted based on the weight between the neighbor node of the final rank and the neighbor node of the next higher rank to obtain the adjusted node feature of the neighbor node of the final rank. Then, a fusion process is performed on the adjusted node feature and the node feature of the neighbor node of the next higher rank to obtain the sample node feature of the neighbor node of the next higher rank. This ensures that the sample node feature includes the importance of the neighbor node of the final rank to the neighbor node of the next higher rank. Therefore, when a recommendation is made using the trained recommendation metamodel obtained by training based on the sample node feature, the recommendation result is more accurate.
[0098] In this case, the node features of the neighbor node at the final rank and the node features of the neighbor node at the next higher rank are substituted into the following equation (4) and combined to obtain the sample node features of the neighbor node at the next higher rank.
[0099]
number
[0100] h k ´ denotes the sample node feature of the next higher-rank neighbor node k, σ() denotes the activation mapping function, and N k represents the set of neighbor nodes of the final rank of the next higher rank neighbor node k, and α kjrepresents the weight between the final-ranked neighbor node j and the next higher-ranked neighbor node k, and h j represents the node feature of the final ranked neighbor node j, and h k represents the node feature of the neighbor node k of the next higher rank.
[0101] In addition, in the process of fusing the object features, interaction features, and attribute features to obtain the sample node features of the target object, the weight between the object feature and the interaction feature may be determined based on the importance between the object node and each interaction node, each interaction feature may be adjusted based on the weight between the object feature and the interaction feature, and the adjusted interaction feature may be merged with the object feature; the weight between the object feature and the attribute feature may be determined based on the importance between the object node and each attribute node, each attribute feature may be adjusted based on the weight between the object feature and the attribute feature, and the adjusted attribute feature may be merged with the object feature.
[0102] That is, according to formula (4), object features and interaction features may be fused, and object features and attribute features may also be fused. In this case, it can be understood that the object node is the neighbor node of the next higher rank, and the interaction node and attribute node are the neighbor nodes of the final rank.
[0103] In some other embodiments, the step of obtaining a weight between the neighbor node of the final rank and the neighbor node of the next higher rank includes the step of determining a similarity between the neighbor node of the next higher rank and the neighbor node of the final rank based on node features of the neighbor node of the final rank and node features of the neighbor node of the next higher rank, and determining a weight between the neighbor node of the final rank and the neighbor node of the next higher rank based on the similarity.
[0104] The server maps the node features of the neighbor node with the final rank and the node features of the neighbor node with the next higher rank into the same feature space, then concatenates and merges the mapped node features of the final rank and the mapped node features of the next higher rank to obtain a concatenated node feature, then maps the concatenated node feature into a real number, which can be used to represent the similarity between the neighbor node with the next higher rank and the neighbor node with the final rank, and finally uses the similarity as the weight between the neighbor node with the final rank and the neighbor node with the next higher rank.
[0105] In actual operation, after obtaining the similarity, the terminal may normalize the similarity and use the normalized similarity as the weight between the neighbor node of the final rank and the neighbor node of the next higher rank. In this case, the node characteristics of the neighbor node of the final rank and the node characteristics of the neighbor node of the next higher rank are substituted into the following equation (5) for calculation to obtain the weight between the neighbor node of the final rank and the neighbor node of the next higher rank.
[0106]
number
[0107] However, α kj represents the weight between the final-ranked neighbor node j and the next higher-ranked neighbor node k, exp() represents the exponential operation, LeakyReLU() represents the activation function, and a T represents the operation of mapping the concatenated node features to a single real number, [||] represents the concatenation and fusion process, W1 represents mapping the node features to the same feature space, and N k represents the set of neighbor nodes of the final rank of the neighbor node k of the next higher rank.
[0108] In the present embodiment, the similarity between the final-ranked neighbor node and the neighbor node one rank higher is determined in real time based on the node characteristics of the final-ranked neighbor node and the node characteristics of the neighbor node one rank higher, thereby making the importance of the final-ranked neighbor node relative to the neighbor node one rank higher, determined in real time based on the similarity, more accurate, and thereby making the weight between the final-ranked neighbor node and the neighbor node one rank higher more accurate.
[0109] In some embodiments, the object features, interaction features, and attribute features may be fused to obtain sample node features of the target object, and then the interaction parameters in the training recommendation metamodel may be corrected based on the sample node features to obtain a candidate recommendation metamodel. The interaction parameters may be referred to as preference parameters or antecedent parameters of the interaction object with respect to the target object.
[0110] Meta-learning is a technique that gives a model the ability to learn how to adjust learning parameters, and a model that has the ability to learn how to adjust learning parameters can be called a metamodel. The recommendation metamodel in the present embodiment is a recommendation model that has the ability to learn how to adjust learning parameters. The principle of meta-learning is to train a metamodel using multiple tasks, as shown in Figure 6, where one task includes one type of training sample, and each task is divided into a support set and a query set. First, using the samples in the support set for task m, the model parameters φ in the metamodel are calculated. 0 Perform a partial update on θ m∧ {θ m∧ is θ m On top ∧} and θ m∧Based on the above, we calculate the loss value for task m using the query set samples in task m, and m∧ Based on the gradient of the loss value with respect to the model parameter φ 0 and perform a global update of the model parameters φ 1 Next, we obtain the model parameters φ in the metamodel using task n. 1 By performing partial and global updates of 2 By first modifying the model parameters in the metamodel, we can then train the metamodel using fewer samples.
[0111] Therefore, in this embodiment, a metamodel is applied to a recommendation system, that is, a training recommendation metamodel is trained using sample node features to obtain a trained recommendation metamodel, so that even when there is little interaction data for a new product or a new user, the cold start problem of the product or the user can be solved by making recommendations using the trained recommendation metamodel.
[0112] However, if all objects in the recommender system share the same interaction parameters during the process of training the recommendation metamodel, the accuracy of the recommendations may be low, resulting in poor recommendation results. Objects typically have several unique attributes. Therefore, in this embodiment, object features, interaction features, and attribute features are combined to obtain sample node features of the target object, so that the sample node features include attribute features. Then, the interaction parameters in the recommendation metamodel to be trained are adjusted based on the sample node features to obtain a candidate recommendation metamodel. Adjusting the interaction parameters in the recommendation metamodel to be trained based on the object attributes allows objects with similar attribute features to be given similar interaction parameters, thereby achieving feature self-adaptation. Therefore, when recommendations are made using the trained recommendation metamodel obtained by training a candidate recommendation metamodel based on the sample node features, items can be more accurately recommended to users, improving recommendation accuracy.
[0113] In actual operation, the terminal may directly perform a second fusion between the sample node features and the interaction parameters to correct the interaction parameters in the training-recommended recommendation meta-model to obtain a candidate recommendation meta-model, or the terminal may perform a second mapping on the sample node features to obtain second mapped node features corresponding to the target object, and then perform a second fusion between the interaction parameters and the second mapped node features to correct the interaction parameters in the training-recommended recommendation meta-model to obtain a candidate recommendation meta-model.
[0114] The second mapped node feature can be understood as prior knowledge corresponding to the target object, and the interaction parameters are corrected according to the prior knowledge of the target object.
[0115] In actual operation, the terminal maps the sample node features as second mapped node features using the fully connected layer in the training recommendation meta-model. That is, the second mapped node features are obtained by substituting the sample node features into the following equation (6) to perform the second mapping.
[0116]
number
[0117] x z represents the second mapped node feature of the target object z, δ() represents the second mapping, and W g represents the matrix parameters of the fully connected layer, and h z ´ represents the sample node feature of the target object z, and b g represents the bias parameters of all connected layers.
[0118] After obtaining the second mapped node features, the terminal multiplies the second mapped node features by the interaction parameters to achieve second fusion and obtain candidate interaction parameters. The recommendation meta-model that needs to be trained and includes the candidate interaction parameters is called the candidate recommendation meta-model. That is, the candidate interaction parameters can be obtained by substituting the second mapped node features and the interaction parameters into the following equation (7):
[0119]
number
[0120] However, Φ z denotes the candidate interaction parameter, Φ denotes the interaction parameter, and ∘ denotes the element-wise product.
[0121] S205: Train a candidate recommendation metamodel based on the sample node features to obtain a trained recommendation metamodel.
[0122] After obtaining the candidate recommendation metamodel, the server performs interaction score prediction based on the interaction features and the sample node features to obtain a predicted interaction score of the interaction object to the target object, obtains the actual interaction score between the interaction object and the target object, determines a target loss value for the candidate recommendation metamodel based on the predicted interaction score and the actual interaction score, and trains the candidate recommendation metamodel based on the target loss value to obtain a trained recommendation metamodel.
[0123] The operation of interaction score prediction includes a fusion operation and a mapping operation, and the fusion mapping can be performed by substituting the interaction features and sample node features into the following equation (8).
[0124]
number
[0125] However, r uz ´ represents the predicted interaction score of interaction object u to target object z, sigmoid() represents the activation function used to perform the mapping, +{+ is the character + surrounded by a circle} represents concatenation fusion, and f() represents a multi-layer perceptron.
[0126] In actual operation, the process of training a candidate recommendation metamodel based on a target loss value to obtain a trained recommendation metamodel may be as follows: Update interaction parameters in the candidate recommendation metamodel based on the target loss value to obtain an updated recommendation metamodel; Obtain sample node features in a query set and determine a first target loss value for the updated recommendation metamodel based on the sample node features in the query set; If the first target loss value meets the predetermined loss condition, use the updated recommendation metamodel as the trained recommendation metamodel; If the first target loss value does not meet the predetermined loss condition, globally update model parameters in the recommendation metamodel to be trained based on the first target loss value, and return to the step of performing feature extraction on object nodes, interaction nodes, and attribute nodes, respectively.
[0127] After obtaining the object node and the neighbor nodes of the object node, the neighbor nodes of the object node may be classified to obtain a support set and a query set corresponding to the object node, and then feature extraction may be performed on the nodes in the support set and the query set to obtain sample node features corresponding to the support set and sample node features corresponding to the query set.
[0128] The process of updating the interaction parameters in the candidate recommendation metamodel based on the target loss value to obtain an updated recommendation metamodel may be as follows: calculate the gradient of the target loss value to the interaction parameters, and update the interaction parameters based on the gradient of the interaction parameters to obtain an updated recommendation metamodel. That is, the gradient ▽L(W2∪Φ z ,S z ) to perform gradient descent updates, and z Φ z ´ and W2 is not updated. W2∪Φ zrepresents all model parameters, W2 represents the parameters for feature extraction and fusion processing for object nodes and neighbor nodes, and S z represents the support set of the target object z.
[0129] The process of determining the first target loss value of the updated recommendation metamodel based on the sample node features in the query set may be as follows: Fusion mapping is performed on the interaction features in the query set and the sample node features in the query set to obtain a target predicted interaction score; Then, the target actual interaction score between the interaction object and the target object in the query set is obtained; Then, the first target loss value is determined based on the target predicted interaction score and the target actual interaction score. The method for determining the first target loss value based on the target predicted interaction score and the target actual interaction score may be selected according to actual circumstances. For example, the first target loss value can be calculated using a least squares error function or a cross-entropy error function, but the present embodiment is not limited thereto.
[0130] When the first target loss value is calculated using the least squares error function, the first target loss value can be calculated by the following equation (9).
[0131]
number
[0132] where L' represents the first target loss value, R represents the interaction matrix between the target object z and the interaction object u, and r uz represents the target actual interaction score between target object z and interaction object u, and r uz´ ´ denotes the target predicted interaction score between target object z and interaction object u.
[0133] If the first target loss value does not satisfy the predetermined loss condition, globally updating the model parameters in the training-recommended recommendation meta-model based on the first target loss value may be understood as updating all model parameters in the training-recommended recommendation meta-model. All model parameters include not only interaction parameters but also parameters for feature extraction and fusion for object nodes and neighbor nodes. That is, in this case, the gradient ▽L'(W2∪Φ z ´,Q z ) to update Φ and W2. z represents the query set of target object z.
[0134] In this embodiment, as shown in Fig. 7, first, the node sample features in the support set are used to correct the interaction parameters in the training recommendation metamodel to obtain a candidate recommendation metamodel, and 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, and then the sample node features and interaction features in the query set are used to globally update the updated recommendation metamodel.
[0135] As described above, in the present embodiment, a heterogeneous data structure generated based on data in a recommendation system is obtained. The heterogeneous data structure includes multiple nodes, each corresponding to data including an object and its attributes. Then, an object node corresponding to a target object among the objects and neighbor nodes of the object node are screened from the heterogeneous data structure. The neighbor nodes include interaction nodes corresponding to interaction objects that interact with the target object and attribute nodes corresponding to the attributes of the target object. Then, feature extraction is performed on the object node and the neighbor node to obtain object features corresponding to the object node, interaction features corresponding to the interaction node, and attribute features corresponding to the attribute node. Then, a fusion process is performed on the object features, interaction features, and attribute features to obtain sample node features of the target object. Then, interaction parameters in the training recommendation metamodel are corrected based on the sample node features to obtain a candidate recommendation metamodel. Then, the candidate recommendation metamodel is trained based on the sample node features to obtain a trained recommendation metamodel.
[0136] The metamodel can learn quickly and accurately with a small amount of data. Therefore, in the present embodiment, even if there is little interaction data for new items or new users in the recommender system, by using the trained recommendation metamodel obtained by training the training-recommended recommendation metamodel using the data in the recommender system, new items can be recommended to the user or items can be recommended to the new user, improving the recommendation accuracy and solving the cold start problem for new items or new users. Furthermore, the sample node features of the target object include the attribute features of the target object. Therefore, by correcting the interaction parameters in the training-recommended recommendation metamodel using the sample node features of the target object to obtain a candidate recommendation metamodel, similar interaction parameters can be assigned to objects with similar attribute features. As a result, when the trained recommendation metamodel obtained by training the candidate recommendation metamodel based on the sample node features is used to make recommendations, items can be more accurately recommended to the user, improving the recommendation accuracy.
[0137] Next, a method for recommending an object using the trained recommendation meta-model will be described with reference to Figure 8. In actual operation, the object recommendation method may be implemented by a terminal or a server alone, or by a terminal and a server together. Taking the case where the server alone implements the object recommendation method as an example, the object recommendation method may include the following steps:
[0138] S801: Obtain a target object node in the target heterogeneous data structure of the recommended object and a target neighbor node of the target object node.
[0139] Here, the target heterogeneous data structure includes multiple nodes. Each node corresponds to an object. The object can be a recommended object or a recommended object. The data or object data corresponding to each node includes the object (object ID) and the attributes of the object. The target object node is a node corresponding to the recommended object in the target heterogeneous data structure, and the target neighbor node includes a target interaction node corresponding to the target interaction object that interacts with the recommended object and a target attribute node corresponding to the attributes of the recommended object. The recommended object can be an item in the recommendation system. The recommended object is a user in the recommendation system. That is, the recommendation system recommends items to users.
[0140] The trained recommendation metamodel in this embodiment (the trained recommendation metamodel is also referred to as a recall model) is mainly used in the recall stage of the recommendation system, that is, as shown in Figure 9, the trained recommendation metamodel obtains the features of the item and the user, and then determines the interaction scores between the item and the user based on the features of the item and the user, and then recommends a predetermined number of items with the highest interaction scores to the user.
[0141] S802: Perform feature extraction on 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.
[0142] In some embodiments, the recommendation metamodel may include a feature extraction layer, and correspondingly, the feature extraction layer of the recommendation metamodel may perform feature extraction on the target object node and the target neighbor node, respectively, to obtain initial node features, target interaction features, and target attribute features.
[0143] S803: Fuse the initial node feature, the target interaction feature, and the target attribute feature to obtain the target node feature of the recommended object.
[0144] In some embodiments, the server may fuse the initial node features, the target interaction features, and the target attribute features as follows: 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 recommended object based on the first target node feature and the second target node feature.
[0145] In actual operation, the target node feature of the recommended object may be determined based on the first target node feature and the second target node feature as follows: The first target node feature and the second target node feature are concatenated to obtain the target node feature of the recommended object; or the weight of the first target node feature and the weight of the second target node feature are obtained, and the first target node feature and the second target node feature are weighted and fused to obtain the target node feature of the recommended object.
[0146] In some embodiments, the recommendation metamodel includes a feature fusion layer in addition to the feature extraction layer, and correspondingly, the operation of step S803 may be performed in the feature fusion layer of the recommendation metamodel.
[0147] S804: Obtain node features of the recommended object in the target heterogeneous data structure.
[0148] In actual operation, the process by which the server acquires the node features of the recommended object is similar to the process by which the server acquires the target node features of the recommended object. For example, the object node of the recommended object and its neighbor nodes in the target heterogeneous data structure are acquired, and the feature extraction layer of the recommendation metamodel performs feature extraction on the object node of the recommended object and its neighbor nodes, respectively, to obtain the initial node features of the recommended object, the interaction features of the interaction objects interacting with the recommended object, and the attribute features of the attribute nodes corresponding to the recommended object. Then, the feature fusion layer of the recommendation metamodel fuses the initial node features of the recommended object, the interaction features of the interaction objects interacting 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.
[0149] S805: Determine a target interaction score of the recommended object to the recommended object based on the target node features and the node features of the recommended object.
[0150] In some embodiments, the recommendation meta-model includes an interaction score prediction layer in addition to the feature extraction layer and the feature fusion layer, and correspondingly, the operation of step S805 may be performed in the interaction score prediction layer, that is, based on the target node features and the node features of the recommended object, interaction score prediction may be performed by the interaction score prediction layer to obtain the target interaction score of the recommended object relative to the recommended object.
[0151] In actual operation, the above interaction score prediction operation includes a fusion operation and a mapping operation, for example, the server first fuses the target node features with the node features of the recommended object, and then maps the target fusion node features obtained by the fusion to obtain the target interaction score of the recommended object to the recommended object.
[0152] S806: A recommended object having a target interaction score higher than a predetermined score is recommended to the recommended object.
[0153] Here, the predetermined score is a preset score threshold, and the magnitude of the score threshold may be set based on the actual situation.
[0154] Steps S801 to S806 in this embodiment may all be performed by the trained recommendation metamodel, or steps S802 to S805 in this embodiment may be performed by the trained recommendation metamodel, and steps S801 to S806 may not be performed by the trained recommendation metamodel.
[0155] In this embodiment, a target object node of a recommended object in a heterogeneous data structure and a target neighbor node corresponding to the target object node are obtained. The target neighbor node includes a target interaction node corresponding to a target interaction object that interacts with the recommended object and a target attribute node corresponding to an attribute of the recommended object. Feature extraction is then 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. Fusion processing is then performed on the initial node feature, the target interaction feature, and the target attribute feature to obtain a target node feature of the recommended object. Node features corresponding to a recommended object in the heterogeneous data structure are then obtained. A target interaction score of the recommended object for the recommended object is determined based on the target node feature and the node feature corresponding to the recommended object. Recommended objects with target interaction scores higher than a predetermined score are recommended to the recommended object. By implementing the recommendation of an object through the trained recommendation meta-model, even if there is little interaction data of the new item or the new user in the recommendation system, it is possible to recommend a new item to a user or recommend an item to a new user. Furthermore, since the interaction parameters in the trained recommendation meta-model are corrected based on the attribute features of the target object, by recommending an object through the trained recommendation meta-model, it is possible to more accurately recommend an item to a user and improve the accuracy of the recommendation.
[0156] The method described in the above embodiment will be explained in detail below with reference to examples.
[0157] The model training method and model application method provided in this embodiment will be described below with reference to Figures 10 and 11. In this embodiment, product recommendation is based on products, with products as target objects and users as interaction objects, i.e., product nodes are object nodes and user nodes are interaction nodes.
[0158] Please refer to Figure 10. Figure 10 is a flow diagram of the model training method provided in this embodiment. In actual operation, the method may be performed by a terminal or a server alone, or by a terminal and a server together. Taking the case where the method is performed by a terminal alone as an example, the model training method may include the following steps:
[0159] S1001: A terminal acquires a heterogeneous data structure generated based on data in a recommendation system. The heterogeneous data structure includes a plurality of nodes, each node corresponding to data, and the data includes an item, a user, and an attribute of the item.
[0160] S1002: The terminal acquires a plurality of predetermined meta paths, and determines a source node type based on a direction in the predetermined meta path.
[0161] S1003: The terminal screens the heterogeneous data structure for a node corresponding to the origin node type to obtain a product node corresponding to the target product, and screens the heterogeneous data structure for an initial neighbor node of the product node.
[0162] S1004: The terminal screens the next node type corresponding to the source node type from the predetermined meta path based on the direction in the predetermined meta path, and obtains an intermediate node type.
[0163] S1005: The terminal screens the initial neighbor nodes corresponding to the intermediate node type from among the initial neighbor nodes to obtain candidate neighbor nodes of the item node.
[0164] S1006: If there is a node type in the specified meta path that has not been screened, the terminal sets the initial neighbor node of the candidate neighbor node as the initial neighbor node, sets the intermediate node type as the starting node type, and returns to step S1004 to execute.
[0165] S1007: If there is no node type that has not been screened in the predetermined meta path, the terminal determines that the candidate neighbor nodes of the item node are neighbor nodes of the item node, including user nodes and attribute nodes of the item.
[0166] S1008: The terminal generates a sub-heterogeneous data structure of the target item corresponding to each of the predetermined meta paths based on the neighbor nodes and item nodes obtained in each of the predetermined meta paths.
[0167] Partitioning the sub-heterogeneous data structure results in a sub-heterogeneous data structure in the support set of the target article and a sub-heterogeneous data structure in the query set.
[0168] The nodes in the sub-heterogeneous data structure correspond to items and users, or alternatively, the nodes in the sub-heterogeneous data structure correspond to items and item attributes. The direction of the edges in the sub-heterogeneous data structure is opposite to that in the given meta-path.
[0169] The items corresponding to the nodes in the sub-heterogeneous data structure may be only the target item, or may include the target item and a first item, where the first item is an item other than the target item in the recommender system.
[0170] S1009: The terminal screens the sub-heterogeneous data structure for a node of a final rank corresponding to the target item based on the direction of the edge in the sub-heterogeneous data structure.
[0171] S10010: The terminal screens the node of the rank one rank above the node of the final rank from the sub-heterogeneous data structure based on the direction of the edge in the sub-heterogeneous data structure.
[0172] In this embodiment, the sub-heterogeneous data structure of the target item includes an item node corresponding to the target item and neighbor nodes corresponding to the item node. Therefore, screening for a node one rank higher from the sub-heterogeneous data structure does not simply mean screening for a node one rank higher from the neighbor nodes of the item node, but also screening for a node one rank higher from the item node. Therefore, in this embodiment, a node one rank higher includes a neighbor node one rank higher, and a node at the final rank includes a neighbor node at the final rank.
[0173] The node at the final rank includes a user node corresponding to a user, an attribute node corresponding to an attribute of the target item, or a first item node corresponding to the first item. The node at the next higher rank includes a user node corresponding to a user, an attribute node corresponding to an attribute of the target item, or an item node.
[0174] S10011: The terminal performs feature extraction on the node of the final rank and the node of the next higher rank using the training recommendation meta-model to obtain the node features of the node of the final rank and the node features of the node of the next higher rank.
[0175] The node features in the present embodiment are features obtained by directly extracting features from the nodes. If the node with the final rank is a user node of a target user who has interacted with the target item, the node features of the node with the final rank may be referred to as the interaction features of the target user. If the node with the final rank is an attribute node of an attribute of the target item, the node features of the node with the final rank may be referred to as the attribute features. In this case, the interaction features and attribute features are features obtained after directly extracting features.
[0176] S10012: The terminal determines the similarity between the node one rank higher and the node of the final rank based on the node features of the node of the final rank and the node of the next higher rank using the training recommendation meta-model, and sets the similarity as the weight between the node of the final rank and the node of the next higher rank.
[0177] The weight represents the importance of the final ranked node relative to the node next higher in rank.
[0178] S10013: The terminal adjusts the node features of the node with the final rank based on the weights using the training recommendation meta-model to obtain adjusted node features of the node with the final rank, and combines the adjusted node features with the node features of the node with the next higher rank to obtain sample node features of the node with the next higher rank.
[0179] S10014: If the node one rank higher is not an item node corresponding to the target item, the terminal sets the sample node feature of the node one rank higher as the node feature of the node one rank higher, sets the node one rank higher as the node of the final rank, and returns to step S10010 to execute.
[0180] If the node one rank higher is a user node of a target user who has interacted with the target item, the sample node feature of the node one rank higher may be referred to as the interaction feature of the target user. If the node one rank higher is an attribute node of an attribute of the target item, the sample node feature of the node one rank higher may be referred to as the attribute feature. In this case, the interaction feature and the attribute feature are features that have undergone fusion.
[0181] S10015: If the node one rank higher is a product node corresponding to the target product, the terminal sets the sample node feature of the node one rank higher as the sub-sample node feature of the product node for the sub-heterogeneous data structure.
[0182] If the sub-heterogeneous data structure is a data structure containing user nodes, the sub-sample node features of the sub-heterogeneous data structure may be referred to as first sample node features. If the sub-heterogeneous data structure is a data structure containing attribute nodes, the sub-sample node features of the sub-heterogeneous data structure may be referred to as second sample node features.
[0183] S10016: The terminal fuses the sub-sample node features of the item nodes for each sub-heterogeneous data structure according to the training recommendation meta-model to obtain a fused node feature.
[0184] S10017: The terminal performs a first mapping on the fused node feature using the training recommendation meta-model to obtain a first mapped node feature, and screens sub-weights corresponding to each sub-sample node feature from the first mapped node features.
[0185] If the sub-heterogeneous data structure is a data structure containing user nodes, the sub-weights of the sub-sample node features of the sub-heterogeneous data structure may be referred to as first weights. If the sub-heterogeneous data structure is a data structure containing attribute nodes, the sub-weights of the sub-sample node features of the sub-heterogeneous data structure may be referred to as second weights.
[0186] S10018: The terminal adjusts the sub-sample node features according to the sub-weights corresponding to the sub-sample node features using the training recommendation meta-model to obtain adjusted sub-sample node features, and adds each adjusted sub-sample node feature to obtain a sample node feature corresponding to the item node.
[0187] S10019: The terminal performs a second mapping on the sample node features according to the training recommendation meta-model to obtain second mapped node features corresponding to the target article.
[0188] S10020: The terminal performs a second fusion of the interaction parameters in the training-needed recommendation metamodel with the second mapped node features, correcting the interaction parameters in the training-needed recommendation metamodel to obtain a candidate recommendation metamodel.
[0189] S10021: The terminal determines a target loss value for a candidate recommendation metamodel based on node features of a target user who has interacted with the target item in the support set of the target item and sample node features in the support set of the target item, and updates interaction parameters in the candidate recommendation metamodel based on the target loss value to obtain an updated recommendation metamodel.
[0190] S10022: The terminal determines a first target loss value of the updated recommendation metamodel based on node features of a target user who has interacted with the target item in the query set of the target item and sample node features of the target item in the query set.
[0191] S10023: If the first target loss value satisfies a predetermined loss condition, the terminal sets the updated recommendation metamodel as a trained recommendation metamodel.
[0192] S10024: If the first target loss value does not satisfy the predetermined loss condition, the terminal globally updates the model parameters in the training-needed recommendation meta-model based on the first target loss value, and returns to step S1009 to execute.
[0193] Please refer to Figure 11. Figure 11 is a flow diagram of the model application method provided in the present embodiment. The flow of the model application method may include the following steps:
[0194] S1101: A terminal acquires multiple predetermined meta paths, and acquires a target product node of a recommended product in a target heterogeneous data structure according to the predetermined meta paths, and a target neighbor node corresponding to the target product node, wherein the target neighbor node includes a target user node corresponding to a first target user who interacts with the recommended product, and a target attribute node corresponding to an attribute of the recommended product.
[0195] S1102: The terminal generates a target sub-heterogeneous data structure of recommended items, respectively corresponding to each predetermined meta path, based on the target neighbor node and the target item node obtained based on each predetermined meta path.
[0196] The process of implementing step S1102 can refer to steps S1002 to S1008, so the embodiment of the present invention will not be described repeatedly here.
[0197] S1103: The terminal performs feature extraction and fusion on the nodes in each target sub-heterogeneous data structure according to the trained recommendation meta-model to obtain target node features of the recommended items.
[0198] The process for realizing step S1103 can refer to steps S1009 to S10018.
[0199] S1104: The terminal obtains node features corresponding to the recommended user in the target heterogeneous data structure according to the trained recommendation meta-model.
[0200] S1105: The terminal determines, according to the trained recommendation meta-model, a target interaction score for the recommended user with respect to the recommended article based on the target node features and the node features corresponding to the recommended user.
[0201] S1106: The terminal recommends to the recommended user the recommended article whose target interaction score is higher than a predetermined score.
[0202] Next, we will explain the recommendation effect of the trained recommendation metamodel using a live commentary room as an item. The effect of recommending a live commentary room using the trained recommendation metamodel is shown in the table below (pv represents the number of page views, and Pctr represents the number of page accesses).
[0203] [Table 1]
[0204] From the above table, it can be seen that the recommendation effect is improved after applying the trained recommendation meta-model of the present embodiment.
[0205] To better implement the model training method provided in the embodiments of the present application, the embodiments of the present application also provide an apparatus based on the model training method, where the terminology is the same as that of the model training method, and for implementation details, please refer to the description in the method embodiments.
[0206] For example, as shown in FIG. 12, the model training device may include the following modules:
[0207] The retrieval module 1201 is configured to retrieve a heterogeneous data structure that includes a plurality of nodes, where the data corresponding to each node includes an object and attributes of the object.
[0208] The selection module 1202 is configured to retrieve, 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.
[0209] 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.
[0210] The fusion module 1204 is configured to perform a fusion process on the object features, the interaction features, and the attribute features to obtain sample node features of the target object.
[0211] The training module 1205 is configured to train the candidate recommendation metamodel based on the sample node features to obtain a trained recommendation metamodel.
[0212] In some embodiments, the apparatus further includes a correction module, wherein the correction module is configured to correct interaction parameters in the to-be-trained recommendation meta-model based on the sample node features to obtain a candidate recommendation meta-model.
[0213] In some embodiments, the selection module 1202 is further configured to obtain a plurality of predefined meta paths including different node types, and based on the different node types, screen from the heterogeneous data structure an object node corresponding to a target object among the objects and a neighbor node of the object node, where the neighbor node includes an interaction node and an attribute node.
[0214] In some embodiments, the different node types include an origin node type and an adjacent node type, and correspondingly, the selection module 1202 is further configured to: screen nodes corresponding to the origin node type from within the heterogeneous data structure to obtain an object node corresponding to the target object, obtain initial neighbor nodes corresponding to the object node, and screen initial neighbor nodes corresponding to the adjacent node type from within the initial neighbor nodes to be the neighbor nodes of the object node.
[0215] In some embodiments, the neighbor nodes include neighbor nodes of multiple ranks, and the interaction node and the attribute node are first-rank neighbor nodes of the object node.
[0216] Correspondingly, the fusion module 1204 screens the neighbor node of the final rank of the object node from among the neighbor nodes of multiple ranks, and also screens the neighbor node of the rank one rank above the neighbor node of the final rank from among the neighbor nodes of multiple ranks, and performs a fusion process between the node feature of the neighbor node of the final rank and the node feature of the neighbor node of the rank one rank above to obtain the sample node feature of the neighbor node of the rank one rank above; if the neighbor node of the rank one rank above is not the neighbor node of the first rank, is taken as the node feature of the neighbor node one rank higher, the neighbor node one rank higher is taken as the neighbor node of the final rank, and the process returns to the step of screening the neighbor node one rank higher than the final rank neighbor node from among the neighbor nodes of multiple ranks; if the neighbor node one rank higher is the neighbor node of the first rank, the process is configured to take the sample node feature of the neighbor node one rank higher as an interaction feature or an attribute feature, and fuse the object feature, the interaction feature, and the attribute feature to obtain the sample node feature of the target object.
[0217] In some embodiments, the fusion module 1204 is further configured to obtain a predetermined meta path including a neighbor node type, and based on the neighbor node type, screen a neighbor node of a final rank of the object node from among neighbor nodes of multiple ranks, and screen a neighbor node of a rank one rank higher than the neighbor node of the final rank from among neighbor nodes of multiple ranks.
[0218] In some embodiments, the fusion module 1204 is further configured to obtain a weight between the neighbor node of the final rank and the neighbor node of the next higher rank, the weight representing the importance of the neighbor node of the final rank to the neighbor node of the next higher rank; adjust a node feature of the neighbor node of the final rank based on the weight to obtain an adjusted node feature of the neighbor node of the final rank; and fuse the adjusted node feature with the node feature of the neighbor node of the next higher rank to obtain a sample node feature of the neighbor node of the next higher rank.
[0219] In some embodiments, the fusion module 1204 is further configured to determine a similarity between the neighbor node of the next higher rank and the neighbor node of the final rank based on the node features of the neighbor node of the final rank and the node features of the neighbor node of the next higher rank, and determine a weight between the neighbor node of the final rank and the neighbor node of the next higher rank based on the similarity.
[0220] In some embodiments, the fusion module 1204 further fuses the object feature and the interaction feature to obtain a first sample node feature of the target object, fuses the object feature and the attribute feature to obtain a second sample node feature of the target object, and determines the sample node feature of the target object based on the first sample node feature and the second sample node feature.
[0221] In some embodiments, the fusion module 1204 is further configured to obtain a first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature, adjust the first sample node feature based on the first weight to obtain an adjusted first sample node feature, adjust the second sample node feature based on the second weight to obtain an adjusted second sample node feature, and determine a sample node feature of the target object based on the adjusted first sample node feature and the adjusted second sample node feature.
[0222] In some embodiments, the fusion module 1204 further includes the steps of: 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 feature to obtain a first mapped node feature; and screening, from the first mapped node features, a first weight corresponding to the first sample node feature and a second weight corresponding to the second sample node feature.
[0223] In some embodiments, the correction module 1206 is further configured to perform a second mapping on the sample node features to obtain second mapped node features corresponding to the target object, perform a second fusion of the interaction parameters with the second mapped node features, and correct the interaction parameters in the training-required recommendation metamodel to obtain a candidate recommendation metamodel.
[0224] In some embodiments, the training module 1205 is further configured to: fuse-map the interaction features and the sample node features to obtain a predicted interaction score of the interaction object with the target object; obtain an actual interaction score between the interaction object and the target object; determine a target loss value for the candidate recommendation metamodel based on the predicted interaction score and the actual interaction score; and train the candidate recommendation metamodel based on the target loss value to obtain a trained recommendation metamodel.
[0225] In actual operation, the sample node features include the sample node features of the neighbor nodes in the support set. Correspondingly, the training module 1205 is further configured to: update the interaction parameters in the candidate recommendation metamodel according to the target loss value to obtain an updated recommendation metamodel; obtain sample node features in the query set; determine a first target loss value of the updated recommendation metamodel according to the sample node features in the query set; if the first target loss value satisfies the predetermined loss condition, take the updated recommendation metamodel as the trained recommendation metamodel; if the first target loss value does not satisfy the predetermined loss condition, globally update the model parameters in the recommendation metamodel to be trained according to the first target loss value, and return to the step of respectively extracting features for the object node and the neighbor node.
[0226] In actual implementation, each of the above modules can be realized as an independent entity, or can be arbitrarily combined to realize one or several entities. The embodiments and corresponding beneficial effects of each of the above modules can be referred to the method examples described above, and will not be repeated here.
[0227] To better implement the object recommendation method provided in the embodiment of the present application, the embodiment of the present application further provides an apparatus based on the object recommendation method, where the meanings of terms are the same as those in the object recommendation method, and for implementation details, please refer to the description in the method embodiment.
[0228] For example, as shown in FIG. 13, the object recommendation device may include the following modules:
[0229] The first obtaining module 1301 is configured to obtain a target object node of a recommended object in the target heterogeneous data structure and a target neighbor node corresponding to the target object node, where the target neighbor node includes a target interaction node corresponding to a target interaction object interacting with the recommended object and a target attribute node corresponding to an attribute of the recommended object.
[0230] The first extraction module 1302 is configured to perform feature extraction on the target object node and the target neighbor node 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.
[0231] The first fusion module 1303 is configured to fuse the initial node feature, the target interaction feature, and the target attribute feature to obtain a target node feature of the recommended object.
[0232] The second obtaining module 1304 is configured to obtain node features corresponding to the recommended objects in the target heterogeneous data structure.
[0233] The first identification module 1305 is configured to identify a target interaction score of the recommended object relative to the recommended object based on the target node feature and the node feature corresponding to the recommended object.
[0234] The object recommendation module 1306 is configured to recommend a recommended object having a target interaction score higher than a predetermined score to the recommended object.
[0235] In actual implementation, each of the above modules can be realized as an independent entity, or can be arbitrarily combined to realize one or several entities. The embodiments and corresponding beneficial effects of each of the above modules can be referred to the method examples described above, and will not be repeated here.
[0236] The present embodiment further provides an electronic device, which may be a server or a terminal, etc. Figure 14 shows a structural diagram of the electronic device according to the present embodiment.
[0237] The electronic device may include components such as a processor 1401, which is one or more processing cores, a memory 1402, which is one or more computer-readable storage media, a power supply 1403, and an input unit 1404. As will be understood by those skilled in the art, the structure of the electronic device shown in Figure 14 is not intended to limit the electronic device, and the electronic device may include more or fewer components than those shown, or may combine any of the components, or may have different arrangements of the components.
[0238] The processor 1401 is the control center of the electronic device and is connected to each part of the entire electronic device via various interfaces and lines. It operates or executes computer programs and / or modules stored in the memory 1402 and accesses data stored in the memory 1402 to perform various functions and data processing of the electronic device. For example, the processor 1401 may include one or more processing cores. The processor 1401 is preferably integrated with an application processor and a modulation / demodulation processor. The application processor mainly processes the operating system, user interface, application programs, etc., while the modulation / demodulation processor mainly processes wireless communications. The modulation / demodulation processor does not have to be integrated into the processor 1401.
[0239] The memory 1402 is used to store computer programs and modules, and 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 mainly includes a program storage area and a data storage area. The program storage area can store an operating system or a computer program required for at least one function (e.g., an audio playback function, an image playback function, etc.). The data storage area can store data generated in accordance with the use of the electronic device. The memory 1402 may also include a high-speed random access memory, or may include, for example, at least one nonvolatile memory such as a magnetic disk storage device, a flash storage device, or other volatile solid-state storage device. Correspondingly, the memory 1402 may further include a memory controller for the processor 1401 to access the memory 1402.
[0240] The electronic device further includes a power supply 1403 that supplies power to each component. For example, the power supply 1403 is logically connected to the processor 1401 via a power management system, which realizes functions such as charge / discharge management and power consumption management. The power supply 1403 may further include any assemblies such as one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0241] The electronic device may further include an input unit 1404 configured to receive input numeric or character information and generate keyboard, mouse, joystick, optical signal or trackball signal inputs for user settings and function control.
[0242] Although not described, the electronic device may further include a display unit, etc. (This will not be described here.) In some embodiments, the processor 1401 in the electronic device loads executable files corresponding to one or more computer program processes into the memory 1402 according to the following instructions, and causes the processor 1401 to run the computer programs stored in the memory 1402, thereby achieving various functions, for example: A heterogeneous data structure including a plurality of nodes is obtained. Data corresponding to each of the nodes includes an object and its attributes. From the heterogeneous data structure, an object node corresponding to a target object among the objects, an interaction node corresponding to an interaction 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 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 features, interaction features, and attribute features are fused to obtain sample node features of the target object. A candidate recommendation metamodel is trained based on the sample node features to obtain a trained recommendation metamodel.
[0243] As can be understood by those skilled in the art, all or some of the steps in the various methods of the above embodiments can be realized by a computer program or by controlling related hardware with a computer program. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0244] For this purpose, the present embodiment provides a computer-readable storage medium having a computer program stored therein, which is loaded by a processor to execute any one of the model training methods or object recommendation methods provided in the present embodiment.
[0245] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or the like.
[0246] The computer program stored in the computer-readable storage medium can execute the steps in any one of the model training methods or object recommendation methods provided in the embodiments of the present application, and thus achieves the beneficial effects that can be achieved by any one of the model training methods or object recommendation methods provided in the embodiments of the present application. For details, please refer to the above embodiments and will not be described again here.
[0247] The present embodiment further provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium, such that a processor of a computing device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, thereby causing the computing device to perform the model training method or the object recommendation method described above.
[0248] The model training method, device, electronic device, computer-readable storage medium, and computer program product provided in the examples of the present application have been described in detail above. Although the present application has provided detailed examples to explain the principles and embodiments of the present application, the description of the above examples is merely intended to aid in understanding the method and core idea of the present application. Furthermore, those skilled in the art may make partial modifications to the embodiments and application scope based on the ideas of the present application, and as stated above, the contents of this specification should not be understood as limitations on the present application.
Claims
1. 1. A method of model training performed by an electronic device, comprising: obtaining a heterogeneous data structure including a plurality of nodes, wherein data corresponding to each of the nodes includes an object and an attribute of the object; obtaining, 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; 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; fusing the object features, the interaction features, and the attribute features to obtain sample node features of the target object; training a candidate recommendation metamodel based on the sample node features to obtain a trained recommendation metamodel; Model training method.
2. The step of obtaining, from the heterogeneous data structure, an object node corresponding to a target object among the objects, 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, includes: obtaining a plurality of predetermined meta paths containing different node types; screening, from the heterogeneous data structure based on the different node types, an object node corresponding to a target object among the objects and neighbor nodes of the object node, the neighbor nodes including the interaction node and the attribute node; The method of claim 1 .
3. The different node types include an origin node type and an adjacent node type; The step of screening, in the heterogeneous data structure, an object node corresponding to a target object among the objects and a neighbor node of the object node based on the different node types, includes: screening a node from the heterogeneous data structure corresponding to the origin node type as an object node corresponding to the target object; obtaining an initial neighbor node corresponding to the object node; screening the initial neighbor nodes corresponding to the adjacent node type from the initial neighbor nodes to be the neighbor nodes of the object node; The method of claim 2 .
4. The interaction node and the attribute node belong to neighbor nodes of the object node, the neighbor nodes include neighbor nodes of multiple ranks, and the interaction node and the attribute node are first-rank neighbor nodes of the object node; the step of fusing the object feature, the interaction feature, and the attribute feature to obtain a sample node feature of the target object includes: screening a neighbor node of a final rank of the object node and a neighbor node of a rank one rank above the final rank neighbor node from among the neighbor nodes of the plurality of ranks; Fusing the node feature of the final-rank neighbor node with the node feature of the next-higher-rank neighbor node to obtain a sample node feature of the next-higher-rank neighbor node; If the neighbor node of the next higher rank is not the neighbor node of the first rank, the sample node feature of the neighbor node of the next higher rank is set as the node feature of the neighbor node of the next higher rank, and the neighbor node of the next higher rank is set as the neighbor node of the last rank, and the process returns to the step of screening the neighbor node of the next higher rank of the neighbor node of the last rank from the neighbor nodes of the multiple ranks; If the next higher rank neighbor node is the first rank neighbor node, setting a sample node feature of the next higher rank neighbor node as the interaction feature or the attribute feature; fusing the object features, the interaction features, and the attribute features to obtain a sample node feature of the target object. The method of claim 1 .
5. The step of screening a neighbor node of the final rank of the object node and a neighbor node of one rank above the final rank neighbor node from among the neighbor nodes of the plurality of ranks includes: obtaining a predefined meta path including neighbor node types; and screening, from among the plurality of ranks of neighbor nodes, a neighbor node of a final rank of the object node and a neighbor node of a rank one rank above the final rank of the neighbor node, based on the adjacent node type. The method of claim 4 .
6. The step of fusing the node feature of the final-rank neighbor node and the node feature of the next-higher-rank neighbor node to obtain a sample node feature of the next-higher-rank neighbor node includes: obtaining a weight of the final-ranked neighbor node, the weight representing the importance of the final-ranked neighbor node relative to the next higher-ranked neighbor node; adjusting a node feature of the final-ranked neighbor node based on the weight to obtain an adjusted node feature of the final-ranked neighbor node; and fusing the adjusted node feature with a node feature of the next higher-ranked neighbor node to obtain a sample node feature of the next higher-ranked neighbor node. The method of claim 4 .
7. The step of obtaining the weight of the neighbor node of the final rank comprises: determining a similarity between the neighbor node of the next higher rank and the neighbor node of the final rank based on a node feature of the neighbor node of the final rank and a node feature of the neighbor node of the next higher rank; and determining a weight for the final ranked neighbor node based on the similarity. The method of claim 6 .
8. the step of fusing the object feature, the interaction feature, and the attribute feature to obtain a sample node feature of the target object includes: fusing the object feature and the interaction feature 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; determining sample node features of the target object based on the first sample node feature and the second sample node feature; The method of claim 1 .
9. determining sample node features of the target object based on the first sample node feature and the second sample node feature, obtaining a first weight for the first sample node feature and a second weight for the second sample node feature; adjusting the first sample node feature based on the first weight to obtain an adjusted first sample node feature; adjusting the second sample node feature based on the second weight to obtain an adjusted second sample node feature; determining sample node features of the target object based on the adjusted first sample node features and the adjusted second sample node features; The method of claim 8 .
10. obtaining a first weight for the first sample node feature and a second weight for the second sample node feature; 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 a first mapped node feature; screening a first weight of the first sample node feature and a second weight of the second sample node feature from among the first mapped node features. The method of claim 9 .
11. Before the step of training a candidate recommendation meta-model based on the sample node features, the model training method further comprises: correcting interaction parameters in the training recommendation meta-model based on the sample node features to obtain the candidate recommendation meta-model; The method of claim 1 .
12. The step of correcting interaction parameters in the training recommendation meta-model based on the sample node features to obtain the candidate recommendation meta-model includes: performing a second mapping on the sample node features to obtain second mapped node features corresponding to the target object; performing a second fusion of the interaction parameters and the second mapped node features to correct the interaction parameters in the training-recommendation meta-model to obtain a candidate recommendation meta-model; The method of training a model according to claim 11.
13. training a candidate recommendation meta-model based on the sample node features to obtain a trained recommendation meta-model; performing an interaction score prediction based on the interaction features and the sample node features to obtain a predicted interaction score of the interaction object relative to the target object; obtaining an actual interaction score between the interaction object and the target object; determining a target loss value for the candidate recommendation meta-model based on the predicted interaction scores and the actual interaction scores; training the candidate recommendation meta-model based on the target loss value to obtain a trained recommendation meta-model; The method of claim 1 .
14. the sample node features include sample node features of neighboring nodes in a support set; The step of training the candidate recommendation meta-model based on the target loss value to obtain a trained recommendation meta-model includes: updating interaction parameters in the candidate recommendation metamodel based on the target loss value to obtain an updated recommendation metamodel; Obtaining sample node features in a 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; If the first target loss value satisfies a predetermined loss condition, the updated recommendation meta-model is a trained recommendation meta-model; If the first target loss value does not satisfy a predetermined loss condition, globally update model parameters in the training-required recommendation meta-model based on the first target loss value, and return to the step of respectively extracting features for the object node, the interaction node, and the attribute node.
14. The method of claim 13.
15. A method for recommending objects executed by an electronic device and implemented by a trained recommendation metamodel according to any one of claims 1 to 14, comprising: Obtaining a target object node of a recommended object in a target heterogeneous data structure, a target interaction node corresponding to a target interaction object that interacts with the recommended object, and a target attribute node corresponding to an attribute of the recommended object; performing feature extraction on 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; Fusing the initial node features, the target interaction features and the target attribute features to obtain target node features of the recommended object; obtaining node features of a node corresponding to a recommended object in the target heterogeneous data structure; determining a target interaction score of the recommended object with respect to the recommended object based on the target node features and the node features of the recommended object; recommending a recommended object having a target interaction score higher than a predetermined score to the recommended object; Object recommendation methods.
16. an acquisition module for acquiring 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; a selection module for obtaining, 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; an extraction module that performs feature extraction on the object nodes, the interaction nodes, and the 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; a fusion module that fuses the object features, the interaction features, and the attribute features to obtain sample node features of the target object; a training module for training a candidate recommendation metamodel based on the sample node features to obtain a trained recommendation metamodel. Model training equipment.
17. A computer system including a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the model training method according to any one of claims 1 to 14 or the object recommendation method according to claim 15 by running the computer program in the memory. electronic equipment.
18. A computer program is stored in the memory, and the computer program is loaded by a processor to execute the method according to any one of claims 1 to 15. A computer-readable storage medium.
19. A computer program is stored in the computer, and the model recommendation method according to any one of claims 1 to 14 is realized by loading the computer program into a processor. Computer program products.
Citation Information
Patent Citations
Cold start recommendation method based on preference adaptive meta-learning
CN113836393A
Information pushing method and system fusing knowledge graph structure and path semantics
CN114265986A
Prediction method and system based on multi-view task relation perception element learning
CN115544352A
Highly Efficient Convolutional Networks for Recommender Systems
JP2021517295A
Social recommendation method based on multi-feature heterogeneous graph neural networks
US20220414792A1