Model training method, content recommendation method, device and electronic device

By constructing a heterogeneous graph and iteratively training the target feature extraction model, the problem of insufficient behavioral data of cold users is solved, and the accuracy of the recommendation system in capturing the interests of cold users and improving the recommendation is improved.

CN118674017BActive Publication Date: 2024-10-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411135615.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-10-29
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

Existing recommendation algorithms are difficult to provide accurate recommendations for cold users because cold users have less behavioral data and traditional algorithms cannot effectively capture their interests.

Method used

By constructing a heterogeneous graph, the meta-path between users and content nodes is determined, and the initial feature extraction model and mapping function are used for iterative training to generate the target feature extraction model and mapping function, which are used to map the basic features of cold users into active features. Thereby accelerating the interest expression of cold users.

Benefits of technology

It improves the accuracy and completeness of cold user interest expressions, generates more accurate feature representations, and enhances the accuracy of content recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674017B_ABST
    Figure CN118674017B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a model training method, a content recommendation method, an apparatus, an electronic device, and a computer-readable storage medium, which relate to the field of artificial intelligence. The method includes: obtaining a heterogeneous graph and attribute information of each node in the heterogeneous graph, determining at least one path from the heterogeneous graph for each sample node, iteratively training the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path, obtaining a target feature extraction model and a target feature mapping function, and the total loss of the iterative training includes a first training loss, which characterizes the target feature of the corresponding hot user node, and the difference between the mapping feature obtained by the initial feature mapping function according to the basic feature mapping. The embodiments of the present application accelerate the process of turning cold users into hot users, enhance the interest expression of cold users, thereby generating a more accurate and complete feature representation, which is naturally more accurate when recommending content based on mapping features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology. Specifically, the present application relates to a model training method, a content recommendation method, a device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] The personalized recommendation system collects user attributes and historical behavior data, uses a designed recommendation algorithm to build a user interest model, generates a specific recommendation list for each user and pushes it to them, thereby achieving the purpose of personalized recommendation.

[0003] In the recommendation system, new users are constantly entering. Since there is very little or even no behavioral data about new users, these users are called cold users.

[0004] However, traditional recommendation algorithms capture users' interests based on their behavioral data to generate appropriate recommendations. Since there is less behavioral data for cold users, existing recommendation algorithms cannot give accurate recommendations. Summary of the invention

[0005] The embodiments of the present application provide a model training method, a content recommendation method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product, which can solve the above-mentioned problems of the prior art. The technical solution is as follows:

[0006] According to a first aspect of an embodiment of the present application, a model training method is provided, the method comprising:

[0007] Obtaining a heterogeneous graph and attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an association relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing recommended content, wherein the plurality of user nodes include at least one hot user node, and the hot user node is a user node having an edge with at least one content node and at least one other user node;

[0008] At least one sample node is selected from the heterogeneous graph, and for each sample node, at least one meta-path with the sample node as a central node is determined from the heterogeneous graph, wherein all first-order neighbor nodes on a meta-path are user nodes or content nodes, and a meta-path in which all first-order neighbor nodes are user nodes is a first meta-path, and a meta-path in which all first-order neighbor nodes are content nodes is a second meta-path, wherein the at least one sample node includes at least one hot user node, and each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path;

[0009] Iteratively train the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path of each sample node to obtain the target feature extraction model and the target feature mapping function;

[0010] The total loss of the iterative training includes a first training loss of each hot user node, and the first training loss is used to characterize the difference between the target feature of the corresponding hot user node in each round of iteration and the mapping feature obtained by the initial feature mapping function according to the basic feature mapping of the corresponding hot user node in each round of iteration;

[0011] The target feature is a node feature or an active feature; the initial feature extraction model is used to input the attribute information of the nodes on each meta-path of the sample node, and output the node feature of the sample node; if the meta-paths of the sample node include at least one first meta-path, the node feature includes the basic feature obtained according to the attribute information of the nodes on each first meta-path; if the meta-paths of the sample node include at least one second meta-path, the node feature includes the active feature obtained according to the attribute information of the nodes on each second meta-path.

[0012] According to a second aspect of an embodiment of the present application, a content recommendation method is provided, including:

[0013] Constructing a heterogeneous graph and obtaining attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing candidate recommended content; and the plurality of user nodes include a target user node representing a target user;

[0014] Determining in the heterogeneous graph at least one third-element path with a target user node as a central node, and at least one fourth-element path with a content node of the candidate recommended content as a central node;

[0015] Inputting each third-dimensional path corresponding to the target user node and the attribute information of the nodes on each third-dimensional path into the target feature extraction model to obtain the node feature of the target user node, and inputting each fourth-dimensional path corresponding to each candidate recommended content and the attribute information of the nodes on each fourth-dimensional path into the target feature extraction model to obtain the node feature of each candidate recommended content;

[0016] If all nodes connected to the target user node are content nodes, it is determined that all third-dimensional paths of the target user are first-dimensional paths, and the node features of the target user node are mapped by a target mapping function to obtain mapping features. For each candidate recommended content, the similarity between the target user and the candidate recommended content is obtained according to the mapping features and the node features of the candidate recommended content.

[0017] Determine the target recommended content to be recommended to the target user from among the candidate recommended content according to the similarity corresponding to each candidate recommended content;

[0018] Wherein, the target feature extraction model and the target mapping function are trained according to the model training method provided in the first aspect.

[0019] According to a third aspect of an embodiment of the present application, a model training device is provided, the device comprising:

[0020] A heterogeneous graph acquisition module, used to obtain a heterogeneous graph and attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing recommended content, wherein the plurality of user nodes include at least one hot user node, and the hot user node is a user node having an edge with at least one content node and at least one other user node;

[0021] a meta-path determination module, configured to select at least one sample node from the heterogeneous graph, and for each sample node, determine at least one meta-path with the sample node as a central node from the heterogeneous graph, wherein all first-order neighbor nodes on a meta-path are user nodes or content nodes, and a meta-path with all first-order neighbor nodes being user nodes is a first meta-path, and a meta-path with all first-order neighbor nodes being content nodes is a second meta-path, wherein the at least one sample node includes at least one hot user node, and each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path;

[0022] A training module, used for iteratively training the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path of each sample node, so as to obtain the target feature extraction model and the target feature mapping function;

[0023] The total loss of the iterative training includes a first training loss of each hot user node, and the first training loss is used to characterize the difference between the target feature of the corresponding hot user node in each round of iteration and the mapping feature obtained by the initial feature mapping function according to the basic feature mapping of the corresponding hot user node in each round of iteration;

[0024] The target feature is a node feature or an active feature; the initial feature extraction model is used to input the attribute information of the nodes on each meta-path of the sample node, and output the node feature of the sample node; if the meta-paths of the sample node include at least one first meta-path, the node feature includes the basic feature obtained according to the attribute information of the nodes on each first meta-path; if the meta-paths of the sample node include at least one second meta-path, the node feature includes the active feature obtained according to the attribute information of the nodes on each second meta-path.

[0025] According to a fourth aspect of an embodiment of the present application, a content recommendation device is provided, including:

[0026] A heterogeneous graph construction module, used to construct a heterogeneous graph and obtain attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing candidate recommended content; and the plurality of user nodes include a target user node representing a target user;

[0027] A meta-path screening module, used to determine at least one third meta-path with a target user node as a central node and at least one fourth meta-path with a content node of a candidate recommended content as a central node in the heterogeneous graph;

[0028] A feature output module, used to input the attribute information of each third-dimensional path and the nodes on each third-dimensional path corresponding to the target user node into a target feature extraction model to obtain the node feature of the target user node, and input the attribute information of each fourth-dimensional path and the nodes on each fourth-dimensional path corresponding to each candidate recommended content into the target feature extraction model to obtain the node feature of each candidate recommended content;

[0029] A similarity calculation module, configured to determine that all third-dimensional paths of the target user are first-dimensional paths if all nodes connected to the target user node are content nodes, map the node features of the target user node through a target mapping function to obtain mapping features, and for each candidate recommended content, obtain the similarity between the target user and the candidate recommended content according to the mapping features and the node features of the candidate recommended content;

[0030] A recommendation module, used to determine target recommended content to be recommended to a target user from among the candidate recommended content according to the similarities corresponding to the candidate recommended content;

[0031] Wherein, the target feature extraction model and the target mapping function are trained according to the model training method provided in the first aspect.

[0032] According to a fifth aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method provided in the first aspect or the second aspect above.

[0033] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method provided in the first aspect or the second aspect are implemented.

[0034] According to a seventh aspect of an embodiment of the present application, a computer program product is provided, including a computer program, which implements the steps of the method provided in the first aspect or the second aspect when the computer program is executed by a processor.

[0035] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0036] By obtaining a heterogeneous graph, selecting at least one sample node from the heterogeneous graph, and for each sample node, determining at least one meta-path with the sample node as the central node from the heterogeneous graph, and dividing the meta-path into two categories, the first meta-path and the second meta-path, according to whether the first-order nodes in the meta-path are all user nodes or all content nodes. The hot user node has an edge with at least one content node and at least one other user node. Therefore, the node features output by the initial feature extraction model for the attribute information of the nodes on each meta-path of the hot user node include the basic features obtained according to the attribute information of the nodes on each first meta-path, and the active features obtained according to the attribute information of the nodes on each second meta-path. Furthermore, the basic features are mapped to the initial feature mapping function. The total loss of iterative training includes the first training loss of each hot user node. The first training loss is the difference between the target feature and the mapping feature. Therefore, when the model converges, it means that the initial feature mapping function has the ability to map the user's basic features to the target features. When the target feature extraction model and the target feature mapping function are used for reasoning later, even if the user is a cold user of the behavior coefficient, after the node features of the cold user (including only the basic features) are extracted by the target feature extraction model, the mapping features obtained after mapping through the target feature mapping function accelerate the process of turning cold users into hot users and enhance the interest expression of cold users, thereby generating a more accurate and complete feature representation, which is naturally more accurate when recommending content based on the mapping features. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0038] Figure 1 A schematic diagram of a model training scenario provided in an embodiment of the present application;

[0039] Figure 2A A flowchart of a model training method provided in an embodiment of the present application;

[0040] Figure 2B A schematic diagram of a heterogeneous graph provided in an embodiment of the present application;

[0041] Figure 2C A schematic diagram of a second element path provided in an embodiment of the present application;

[0042] Figure 2D A schematic diagram of various meta-paths of a central node provided in an embodiment of the present application;

[0043] Figure 2E A flowchart of a model training method provided in an embodiment of the present application;

[0044] Figure 3A A flowchart of a model training method provided in an embodiment of the present application;

[0045] Figure 3B A flowchart of a model training method provided in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of a process flow of a round of iterative training provided in an embodiment of the present application;

[0047] Figure 5 A flowchart of a content recommendation method provided in an embodiment of the present application;

[0048] Figure 6 A flowchart of a content recommendation method provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0050] Figure 8 A schematic diagram of the structure of a model training device provided in an embodiment of the present application;

[0051] Fig. 9 A schematic diagram of the structure of a content recommendation device provided in an embodiment of the present application;

[0052] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0054] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "an" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we call an element "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here may include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".

[0055] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0056] First, several terms involved in this application are introduced and explained:

[0057] Heterogeneous graph: A graph whose nodes and edges have different types or properties. Specifically, if the vertex sets and edge sets of two graphs G1 and G2 are not exactly the same, that is, V(G1)≠V(G2) or E(G1)≠E(G2), then they are heterogeneous graphs. Heterogeneous graphs can be regarded as graphs with different structures in which the vertex and edge labels or connection methods are different.

[0058] Neighbor node: For any node v in a heterogeneous graph, any node that has a direct or indirect edge with it is called a neighbor node of the node v. If a neighbor node is connected to the node v through at least n edges, the neighbor node is called the nth-order neighbor node of the node v.

[0059] Graph Neural Networks (GNNs): is an algorithm that uses deep learning models to perform feature mining and extraction on graph structured data.

[0060] Meta-path: In a heterogeneous graph, a meta-path is a specific path connecting multiple nodes, which can describe the composite relationship between nodes. Different meta-paths usually express different semantics.

[0061] The personalized recommendation system collects user attributes and historical behavior data, uses a designed recommendation algorithm to build a user interest model, generates a specific recommendation list for each user and pushes it to them, thereby achieving the purpose of personalized recommendation. However, in the recommendation system, new users continue to enter, and these users are called cold users.

[0062] The recommendation system aims to improve the user experience and provide users with high-quality recommended content. If new users cannot quickly obtain high-quality content from the recommendation system, they may be lost.

[0063] Traditional recommendation algorithms recommend the most likely items to the current user based on the historical interaction data between users and items. According to the different learning subjects, traditional recommendation algorithms can be divided into two types: user-based and item-based (i.e., recommended content). Among them, the user-based recommendation algorithm aims to find users with similar interests and then recommend their favorite items to the target users; the item-based recommendation algorithm recommends based on item similarity. This type of method tends to find items of a certain style and type for recommendation.

[0064] With the development of deep learning technology, some researchers have integrated deep learning with recommendation algorithms. Deep learning has powerful feature expression capabilities and can effectively mine hidden connections and patterns from large-scale data. It has three main advantages:

[0065] Nonlinear transformation: Deep neural networks can effectively capture nonlinear relationships in data, thereby modeling complex interaction patterns between users and items;

[0066] Feature learning ability: Deep neural networks can automatically learn to extract features from raw data by designing network learning objectives, without the need to manually design features;

[0067] Scalability: Different deep model modules can be easily combined to form more powerful hybrid models.

[0068] The neural network-based collaborative filtering model (NCF) uses deep learning to describe the architecture of the matrix decomposition model. In NCF, there are both linear matrix decomposition and nonlinear multilayer perceptron. Through organic combination, the recommendation effect is improved. Deep Factorization Machine (DeepFM) is an end-to-end model that integrates factorization machine and multilayer perceptron. Deep Interest Network (DIN) introduces the attention mechanism into the recommendation model. In the modeling process, different attention is given to historical behavior products based on candidate products. In recent years, some work has also introduced graph neural networks into the recommendation system, using high-order connections to enhance the connection between users and items. Among them, the Pinsage model uses a random walk strategy to sample node neighbors and uses a graph convolutional network to aggregate neighbor information to generate node representations, while considering the graph structure and node feature information. The NGCF model explicitly models the high-order connectivity between users and items through high-order graph convolutions to improve the representation quality. The LightGCN model is a simplification of the NGCF model, removing the nonlinear activation function and feature transformation matrix, and only adding a set of weight coefficients to aggregate the outputs of different layers to produce the final representation.

[0069] Although existing recommendation algorithms have achieved certain results, they all rely on rich user behavior data to capture user interests and generate appropriate recommendations. However, for cold users, their historical behavior data is very small, and traditional recommendation algorithms find it difficult to make appropriate recommendations for them. This problem is called the user cold start problem. Therefore, user cold start recommendation is a practical and challenging problem.

[0070] The model training method, content recommendation method, device, electronic device, computer-readable storage medium and computer program product provided in this application are intended to solve the above technical problems in the prior art.

[0071] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0072] The model training method provided in the embodiment of the present application can be implemented by a computer device, which can be a terminal device or a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0073] Figure 1 A schematic diagram of a model training scenario provided in an embodiment of the present application, in which the server 100 is used as the aforementioned computer device for illustration.

[0074] Before training the initial feature extraction model and the initial feature mapping function, a heterogeneous graph is first constructed and the attribute information of each node on the heterogeneous graph is determined. The heterogeneous graph includes multiple nodes and there is an edge between two nodes with an associated relationship. The types of nodes include user nodes representing users and content nodes representing recommended content. The user nodes are further subdivided into hot user nodes and cold user nodes. Hot user nodes are nodes that characterize hot users. Therefore, hot user nodes have an edge with at least one content node and at least one other user node. The recommended content of the embodiment of the present application can be implemented as news content, music works, video content, blog content, novel content, physical products, virtual products, etc., and the embodiment of the present application does not make specific limitations.

[0075] The server 100 selects at least one sample node from the heterogeneous graph, and for each sample node, determines at least one meta-path with the sample node as the central node from the heterogeneous graph. In the embodiment of the present application, the first-order neighbor nodes on a meta-path are either all user nodes or all content nodes, and the meta-path whose first-order neighbor nodes are all user nodes is called a first meta-path, and the meta-path whose first-order neighbor nodes are all content nodes is called a second meta-path. Accordingly, for a hot user node, each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path.

[0076] The server 100 inputs the attribute information of the nodes on each meta-path of the sample node into the initial feature extraction model to obtain the node features output by the initial feature extraction model. If each meta-path of the sample node includes at least one first meta-path, the node features include the basic features obtained according to the attribute information of the nodes on each first meta-path; if each meta-path of the sample node includes at least one second meta-path, the node features include the active features obtained according to the attribute information of the nodes on each second meta-path. The initial feature mapping function obtains the mapping features according to the basic feature mapping of the hot user node, and obtains the first training loss in the total loss of iterative training by calculating the difference between the mapping features and the target features.

[0077] Since the target feature includes at least active features, and the mapping feature is obtained through basic feature mapping, when the first training loss converges, it means that the initial feature mapping function has the ability to map the user's basic features into target features. When the target feature extraction model and the target feature mapping function are used for reasoning later, even if the user is a cold user of the behavior coefficient, after the node features of the cold user (including only basic features) are extracted through the target feature extraction model, the mapping features obtained after mapping through the target feature mapping function accelerate the process of turning cold users into hot users and enhance the interest expression of cold users, thereby generating a more accurate and complete feature representation, which is naturally more accurate when recommending content based on the mapping features.

[0078] The present application embodiment provides a model training method, such as Figure 2A As shown, the method includes:

[0079] S101: Obtain a heterogeneous graph and attribute information of each node in the heterogeneous graph.

[0080] See also Figure 2B , which exemplarily shows a schematic diagram of a heterogeneous graph provided in an embodiment of the present application. As shown in the figure, the heterogeneous graph includes multiple nodes. It should be noted that: Figure 2B The number of nodes is only an example. These nodes are mainly divided into two categories: user nodes (represented by U in the figure, Un represents user node n, and n is a positive integer) and content nodes (represented by I in the figure, Im represents content node m, and m is a positive integer. The embodiment of the present application does not limit the size relationship between m and n).

[0081] There is an edge between two nodes with an association relationship in a heterogeneous graph. That is to say, on the one hand, there is no restriction on the types of two nodes with an edge. User nodes can have edges with other user nodes, content nodes can have edges with other content nodes, and user nodes and content nodes can also have edges. On the other hand, if there is no association relationship between two nodes, it means that the two nodes need to be connected by multiple edges, or cannot be connected by any number of edges. For example, user nodes U6 and U1 cannot be connected by any number of edges, while user nodes U1 and U5 can be connected by two edges between U1-I1 and I1-U5.

[0082] In some embodiments, two user nodes have an association relationship, indicating that the users corresponding to the two user nodes have a friend relationship. In other embodiments, two user nodes have an association relationship, indicating that the users corresponding to the two user nodes have a relative relationship, a colleague relationship, a classmate relationship, etc.

[0083] In some embodiments, the user node and the content node have an association relationship, which means that the user represented by the user node is interested in the recommended content represented by the content node. The embodiments of the present application do not specifically limit the expression of interest. For example, by clicking on the link of the recommended content in the advertisement, you can jump to the recommended content webpage for browsing (this behavior is also called a click). After jumping to the product page by clicking, the user may purchase / download the recommended content on the product page (this behavior is also called a conversion).

[0084] In some embodiments, two content nodes have an association relationship, indicating that the recommended contents corresponding to the two content nodes are similar or have a consumption dependency relationship:

[0085] In the field of content recommendation, similar recommended content often overlaps in target market, product positioning or selection strategy. For example, a smart health bracelet is positioned as comprehensive health management, including heart rate monitoring, blood oxygen detection, sleep quality analysis, step counting and exercise pattern recognition. The target market is for young people and middle-aged and elderly people who focus on healthy living, especially fitness enthusiasts, office workers and people who care about the health of their families. Promotional highlights include ultra-long battery life, accurate monitoring, personalized health advice push, and seamless connection with smartphones. A smart watch, whose product positioning also emphasizes all-round monitoring and management, covers multi-dimensional monitoring such as heart rate, sleep, sleep, steps, calorie consumption, and adds stress management functions. The target market is similar to the above-mentioned smart bracelets, but it may focus more on urban white-collar workers and high-stress people, emphasizing the use of technology to help users relieve stress and improve the quality of life. Promotional highlights: unique stress monitoring and relief guidance, advanced sports data analysis, and fashionable design that conforms to trendy aesthetics. The content nodes corresponding to the smart watch and the smart health bracelet are considered to have similar relationships, and there is an edge between the two content nodes;

[0086] Commodities with consumer interdependence usually refer to two or more commodities that have a certain consumption interdependence or supporting use relationship. This relationship means that the consumption of one commodity often needs to be combined with the consumption of one or more other commodities in order to meet the complete needs of consumers or achieve the best use effect. Typical commodities with consumer interdependence include: cars and gasoline, printers and ink cartridges / toner cartridges, smart phones and mobile power supplies, cameras and lenses, etc. These examples all show the consumer interdependence between different commodities. In real life, there are many similar interdependencies, which together constitute a complex and diverse consumer market. For producers and sellers, understanding and grasping these interdependencies is of great significance for formulating marketing strategies and meeting consumer needs. At the same time, for consumers, recognizing and understanding these interdependencies can also help them make more informed purchasing decisions.

[0087] The embodiments of the present application further subdivide the types of user nodes, which can be divided into at least hot user nodes. A hot user node refers to a user node that has an edge with at least one content node and at least one other user node. The user corresponding to the hot user node is called a hot user. A hot user refers to a user who has a high degree of interaction with a company or brand and has high data clarity. They are not only highly active, but also able to interact with the content published by the company. The company can reach such users effectively and quickly. The recommendation system has a certain degree of accumulation of the relationship between hot users and other users, as well as the recommended content that the user is interested in. Hot users are represented in a heterogeneous graph, that is, they have an edge with at least one content node and at least one other user node. With Figure 2BFor example, user node U1 has edges with content node I1 and user node U2, so user node U1 is a hot user node.

[0088] The embodiment of the present application also needs to obtain the attribute information of each node in the heterogeneous graph. Taking the user node as an example, the corresponding attribute information may include demographic information and user behavior information, such as the user's gender, age group, education, province, hobbies, etc., which are not specifically limited in the embodiment of the present application. It should be noted that the relevant data collection and processing in the embodiment of the present application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in the example, and the informed consent or separate consent of the subject of personal information should be obtained, and the subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the subject of personal information.

[0089] The attribute information of the content node may include advertising attribution attributes such as the advertiser, the group to which the advertiser belongs, the company to which the advertiser belongs, the industry to which the advertisement belongs, the region to which the advertisement belongs, etc. It may also include advertising content attributes such as the advertised product name, product type, product industry type, advertising title information, advertising picture information, etc. It may also include advertising audience attributes such as the gender, age, region, occupation, behavioral interests, etc. of the advertising target group, and the embodiments of the present application do not make specific limitations.

[0090] S102: Select at least one sample node from the heterogeneous graph, and for each sample node, determine at least one meta-path with the sample node as a central node from the heterogeneous graph.

[0091] The embodiment of the present application selects at least one sample node from a heterogeneous graph. The sample nodes selected by the present application include user nodes, and in some embodiments may further include content nodes.

[0092] For each sample node, the embodiment of the present application determines at least one meta-path (Meta-Path) with the sample node as the central node from the heterogeneous graph. Generally, a meta-path (Meta-Path) is defined as a connection path with a sequence of nodes and edges of a specific type in a heterogeneous graph. It describes a composite relationship between two objects, which includes node and edge type information.

[0093] In the content recommendation system, "user node 1-content node 1-user node 2" is a meta-path (meta-path 1), which indicates the relationship between two user nodes through a common content node, that is, two users are interested in the same recommended content. "User node 1-user node 2-content node 1" is also a meta-path (meta-path 2), which indicates the relationship between a user node and a content node through a common user node, that is, a user (user node 1) will be interested in the recommended content (content node 1) because his friend (user node 2) is interested in the recommended content. The starting node of the meta-path is also called the central node. Taking the above two meta-paths as an example, the central nodes of the two meta-paths are both user node 1. Nodes other than the central node in the meta-path are called neighbor nodes. The shortest number of edges required to connect a neighbor node to the central node is the number of neighbor nodes of the neighbor node. Taking the above meta-path 1 as an example, content node 1 and user node 1 are connected by one edge, which is called a first-order neighbor node, and user node 2 and user node 1 are connected by two edges, which is called a second-order neighbor node.

[0094] It should be noted that the two meta-paths exemplified above are the simplest structures, with only one neighbor node at each order. The structure of each meta-path constructed in the embodiment of the present application can be more complex, with at least one neighbor node at each order.

[0095] Cold users refer to users with scarce data. Only limited information about cold users is stored in the recommendation system. In addition, cold users are often inactive on platforms such as social media, which makes it impossible for the recommendation system to obtain more behavioral data, making it difficult to understand the needs and preferences of cold users. Since the starting point of this application is that there is less behavioral information about cold users, there may be no records of recommended information of interest. In order to better distinguish the characteristics of cold and hot users, the first-order neighbor nodes on each meta-path in the embodiment of the present application are either all user nodes or all content nodes. That is to say, if all the first-order neighbor nodes on a meta-path are user nodes, it means that the meta-path is for obtaining recommended content of interest to other users with related relationships, and if all the first-order neighbor nodes on a meta-path are content nodes, it means that the meta-path is for obtaining recommended content of interest to the user himself. Furthermore, in the embodiment of the present application, the meta-path whose first-order neighbor nodes are all user nodes is called the first meta-path, and the meta-path whose first-order neighbor nodes are all content nodes is called the second meta-path. Please refer to Figure 2C, which exemplarily shows a schematic diagram of a second meta-path provided by an embodiment of the present application, which more clearly shows a second meta-path with a second-order leader node in the form of a multi-layer ring, wherein the user node U1 is the central node, the first-order neighbor nodes are two content nodes I1 and I2, and there are 4 second-order neighbor nodes, wherein the first-order neighbor node corresponding to users U2 and U3 is the content node I1, and the first-order neighbor node corresponding to users U4 and U5 is the content node I2. Since the types of the same-order neighbor nodes in the second meta-path are the same, according to the types of the neighbor nodes of each order of the meta-path, the second meta-path can be referred to as<U,I,U> Type path. Similarly, the second element path also includes<U,I,I> Type path, the first element path also includes<U,U,I> Type Path and<U,U,U> Type path.

[0096] The embodiment of the present application classifies the meta-path into a first meta-path and a second meta-path, thereby laying a foundation for subsequently obtaining corresponding features based on the first meta-path and the second meta-path, thereby more clearly distinguishing the composition of node features of hot user nodes and cold user nodes, and creating conditions for mapping the node features of cold user nodes to the features of hot user nodes.

[0097] See also Figure 2D , which exemplarily shows a schematic diagram of each meta-path of the central node provided by an embodiment of the present application. As shown in the figure, when U1 is used as the central node, since the three nodes connected to U1 include both user nodes U2 and U3 and content node I1, the meta-path selected with U1 as the central node includes both the first meta-path and the second meta-path. Since the first meta-path and the second meta-path only have requirements on the type of first-order neighbor nodes, but no requirements on the number of first-order neighbor nodes, the first meta-path with U1 as the central node can have two or only one. Taking the meta-path including two-order neighbor nodes as an example, when there is one, the first-order neighbor nodes on the first meta-path are U2 and U3, and the second-order neighbor nodes are I2, I3 and U4. When there are two, the first-order neighbor node of one first meta-path is U2, and the second-order neighbor nodes are U3 and I3, and the first-order node of the other first meta-path is U3, and the second-order neighbor node is I2. There is one second-order path with U1 as the central node, in which the first-order neighbor node is I1, and the second-order nodes are I4 and U5.

[0098] At least one sample node in the embodiment of the present application includes at least one hot user node. Through the above definition of the hot user node, it can be found that each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path.

[0099] S103, iteratively training the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path of each sample node to obtain the target feature extraction model and the target feature mapping function.

[0100] The embodiment of the present application takes all meta-paths of each sample node and the attribute information of all nodes on the meta-paths as a training sample, that is, one training sample corresponds to one sample node, and one training sample contains all meta-paths with the corresponding sample node as the center node and the attribute information of all nodes on the meta-paths.

[0101] The embodiment of the present application iteratively trains the initial feature extraction model and the initial feature mapping function through various training samples, which means that the parameters of the initial feature extraction model and the initial feature mapping model will be adjusted in each round of iterative training. When the stop condition of the iterative training is met, the initial feature mapping model that meets the iterative condition is used as the target feature extraction model, and the initial feature mapping function that meets the iterative condition is used as the target feature mapping function.

[0102] The initial feature extraction model of the embodiment of the present application is used to input the attribute information of the nodes on each meta-path of the sample node and output the node features of the sample node. If each meta-path of the sample node includes at least one first meta-path, the node features include basic features obtained according to the attribute information of the nodes on each first meta-path, and if each meta-path of the sample node includes at least one second meta-path, the node features include active features obtained according to the attribute information of the nodes on each second meta-path. It can be seen that since each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path, the node features of the hot user node include basic features and active features. When multiple sample nodes include content nodes, when determining the meta-path with the content node as the central node, since there is no concept of cold and hot for the content node, the meta-path corresponding to the content node may include the first meta-path or the second meta-path, which is not specifically limited in the embodiment of the present application.

[0103] It should be understood that the node features of hot user nodes include basic features and active features, which means that the information contained in the node features includes both basic feature information and active feature information. Since the basic features and active features are essentially based on the attribute information of each node on the meta-path and are obtained through the initial feature extraction model, the dimensions of the basic features and the active features are the same. For hot user nodes, their node features refer to the results of feature fusion of the basic features and the active features. For example, the basic features and the active features can be directly added and the result of the addition can be used as the node feature, or they can be spliced ​​and then fully connected. The embodiment of the present application does not specifically limit the method of obtaining node features based on the basic features and the active features.

[0104] The initial feature mapping function of the embodiment of the present application is used to map the basic features of the hot user nodes in each round of iteration to obtain the mapping features. Accordingly, the total loss of the iterative training of the embodiment of the present application includes the first training loss of each hot user node, and the first training loss is used to characterize the difference between the target feature of the corresponding hot user node in each round of iteration (the target feature is the node feature or the active feature) and the mapping feature. In each round of iterative training, after obtaining the total loss of this round of iteration, the parameters of the initial feature extraction model and the initial feature mapping function are adjusted according to the total loss, and the next round of iterative training is continued after the adjustment until the conditions for stopping the iterative training are met. The embodiment of the present application does not limit the stopping conditions for iterative training, for example, it may be that the number of iterations meets a preset threshold or the total training loss converges.

[0105] Since the target feature includes at least active features, and the mapping feature is obtained through basic feature mapping, when the first training loss converges, it means that the initial feature mapping function has the ability to map the user's basic features into target features. When the target feature extraction model and the target feature mapping function are used for reasoning later, even if the user is a cold user of the behavior coefficient, after the node features of the cold user (including only basic features) are extracted through the target feature extraction model, the mapping features obtained after mapping through the target feature mapping function accelerate the process of turning cold users into hot users and enhance the interest expression of cold users, thereby generating a more accurate and complete feature representation, which is naturally more accurate when recommending content based on the mapping features.

[0106] See also Figure 2E, which exemplarily shows a flow chart of a model training provided by an embodiment of the present application. As shown in the figure, each first meta-path of a hot user node (UUI and type path are taken as examples in the figure) and the attribute information of each node on each first meta-path are input into the initial feature extraction model to obtain the basic features output by the initial feature extraction model, each second meta-path of the hot user node (UIU and UII type paths are taken as examples in the figure) and the attribute information of each node on each second meta-path are input into the initial feature extraction model to obtain the active features output by the initial feature extraction model, the node features (including basic features and active features) or the active features are used as the target features, and the basic features of the hot user nodes are input into the initial feature mapping function to obtain the mapping features, and the first training loss is obtained by calculating the difference between the target features and the mapping features, and the parameters of the initial feature extraction model and the initial feature mapping function are adjusted based on the first training loss until the training loss converges.

[0107] In the embodiment of the present application, a heterogeneous graph is obtained, and at least one sample node is selected from the heterogeneous graph. For each sample node, at least one meta-path with the sample node as the central node is determined from the heterogeneous graph. The meta-path is divided into two categories, namely, a first meta-path and a second meta-path, according to whether all the first-order nodes in the meta-path are user nodes or all are content nodes. The hot user node has an edge with at least one content node and at least one other user node. Therefore, the node features output by the initial feature extraction model for the attribute information of the nodes on each meta-path of the hot user node include the basic features obtained according to the attribute information of the nodes on each first meta-path, and the active features obtained according to the attribute information of the nodes on each second meta-path. Furthermore, the basic features are mapped by the initial feature mapping function to obtain the mapping features. The total loss of the iterative training includes the first training loss of each hot user node, and the first training loss is the difference between the target feature and the mapping feature. Therefore, when the model converges, the mapping features obtained by the target feature mapping function by mapping the user's basic features can reflect the user's active behavior, more accurately and completely represent the user's expression, enhance the user's interest expression, and also lay the foundation for obtaining more accurate content push.

[0108] Based on the above embodiments, as an optional embodiment, at least one sample node also includes a content node. That is, during iterative training, the embodiment of the present application also needs to extract node features of the content node through the initial feature extraction model.

[0109] The total loss of the embodiment of the present application also includes the second training loss of each hot user node. In each round of iterative training, the second loss value of each hot user node is obtained in the following manner:

[0110] For each hot user node, content nodes having an edge connected to the hot user node are selected from the heterogeneous graph as positive content nodes, and content nodes having no edge connected to the hot user node are selected from the heterogeneous graph as negative content nodes;

[0111] Traversing each positive content node and each negative content node to obtain a plurality of content node pairs, each content node pair including a positive content node and a negative content node;

[0112] For each content node pair, a first similarity between the hot user node and the positive content node in the content node pair is obtained according to the node features of the hot user node and the positive content node in the content node pair in this round of iteration; a second similarity between the hot user node and the negative content node in the content node pair is obtained according to the node features of the hot user node and the negative content node in the content node pair in this round of iteration; and a recommendation loss of the hot user node for the content node pair is obtained according to the negative value of the difference between the first similarity and the second similarity;

[0113] A second training loss of the hot user node is obtained according to the sum of the recommendation losses of the hot user node to all content node pairs.

[0114] The second training loss of the embodiment of the present application is used to mine the interest preferences of hot users. The content nodes that have edges with the hot user nodes indicate that the corresponding hot users are interested in the corresponding recommended content, and the content nodes that have no edges with the hot user nodes indicate that the corresponding hot users are not interested in the corresponding recommended content. Therefore, the positive content nodes and negative content nodes corresponding to the hot user nodes are obtained from the heterogeneous graph, and the first similarity of the node features of the hot user nodes and each positive content node in this round of iteration is further calculated, and the interest degree of the hot user node in the positive content node is characterized by the first similarity; the second similarity of the node features of the hot user node and each negative content node in this round of iteration is calculated, and the interest degree of the hot user node in the negative content node is characterized by the similarity. The greater the difference between the first similarity and the second similarity, the clearer it can reflect the interest preferences of the hot users, that is, what they like more clearly and what they don't like more clearly. Based on this, the present application can obtain the second training loss of the hot user node.

[0115] In some embodiments, the second training loss for a hot user node in the embodiments of the present application can be obtained by the following steps: for each content node pair of the hot user node, transpose the node features of the hot user node in this round of iteration to obtain the transposed node features of the hot user node, multiply the transposed node features of the hot user node with the node features of the positive content node in the content node pair to obtain a first similarity, multiply the transposed node features of the hot user node with the node features of the negative content node in the content node pair to obtain a second similarity, subtract the negative value of the result of subtracting the second similarity from the first similarity as the recommendation loss of the hot user node for the content node pair, sum the recommendation losses of the hot user node for all content node pairs, and obtain the second training loss of the hot user node.

[0116] In some embodiments, the second training loss of the hot user node can also be calculated by the following formula:

[0117]

[0118] in, L rec represents the second training loss of the hot user node, h u Indicates hot users u The node characteristics of h i Represents the node characteristics of the positive content node, h j Represents the node feature of the negative content node, S + Indicates hot users u The set of all positive content nodes, S - Indicates hot users u The set of all negative content nodes. From the above formula, we can find that after summing all the differences, by taking the negative sign and calculating the negative of the sum of all differences, the loss convergence can be achieved. In the continuous iterative training, the user nodes are brought closer to the positive content nodes and away from the negative user nodes.

[0119] See also Figure 3A, which exemplarily illustrates a model training method provided by an embodiment of the present application. As shown in the figure, the embodiment of the present application selects multiple sample nodes from a heterogeneous graph, the multiple sample nodes include hot user nodes, and selects at least one meta-path with each hot user node as a central node from the heterogeneous graph. Since the hot user node and the content node and other user nodes all have edges, the meta-path of the hot user node includes both the first meta-path and the second meta-path. At the same time, the content nodes with edges connected to the hot user nodes can be used as positive content nodes, and the content nodes without edges can be used as negative content nodes. On the one hand, the initial feature extraction model outputs node features according to the attribute information of the nodes on each meta-path of the hot user node, and uses the node features or active features as the target features. The hot user nodes are mapped to the content nodes using the initial feature mapping function. The basic feature mapping of the hot user node is the mapping feature. According to the difference between the mapping feature and the target feature, the first training loss of the iterative training is obtained. At the same time, the initial feature extraction model outputs the node features of the positive content node and the negative content node respectively according to the attribute information of the nodes on each meta-path of the positive content node and the negative content node. According to the difference between the first similarity of the node features of the hot user node and each positive content node in this round of iteration and the second similarity of the node features of the hot user node and each negative content node in this round of iteration, the second training loss is obtained. According to the first training loss and the second training loss of each hot user node, the initial feature extraction model and the initial feature mapping function are iteratively trained. When the iterative training stop condition is met, the target feature extraction model and the target feature mapping function are obtained.

[0120] Based on the above embodiments, as an optional embodiment, the total loss of iterative training in the embodiment of the present application also includes a third training loss of the user node in each sample node. The third training loss can also be called a clustering loss, that is, by clustering the user nodes in each sample node, whether the clustering result is accurate is used as the third training loss.

[0121] Specifically, in the embodiment of the present application, for each user node among the multiple sample nodes, the third training loss of the user node is obtained in the following manner:

[0122] S201, for each round of iterative training, obtain the center features of the cluster centers of each cluster in this round of iteration and the node features of each user node in this round of iteration;

[0123] S202, for each user node, according to the node feature of the user node in this iteration and the center feature of each cluster center, obtain the similarity between the sample user node and the corresponding cluster center;

[0124] S203, obtaining the confidence that each user node belongs to each cluster cluster according to the similarity between each user node and each cluster center;

[0125] S204: For each user node, obtain a third training loss of the user node according to the difference between the similarity between the user node and each cluster center and the confidence that the user node belongs to the corresponding cluster.

[0126] In the first round of iteration, the embodiment of the present application initializes k clusters and the central features of the cluster center of each cluster. . Due to the huge sample size of this application, it is unreliable to use a global approach similar to k-means to determine the cluster centers. Therefore, this application adopts a batch training and update method to learn the cluster centers. Batch training involves dividing the training data set into multiple smaller subsets (called batches) and then processing these subsets in parallel. Since the training of this application involves the processing of graphs (meta-paths), it is suitable to be trained based on a graphics processing unit (GPU). When training with a GPU, processing multiple samples in parallel can significantly improve computing efficiency.

[0127] In each round of iterative training, we first obtain the central features of the cluster centers of each cluster in this round of iteration and the node features of each user node in this round of iteration. It can be understood that the cluster centers of each cluster in the first round of iteration are initialized preset values. After each round of iterative training, the cluster centers of each cluster will also be updated accordingly.

[0128] For each user node in the multiple sample nodes, the similarity between the user node and the cluster center is obtained according to the node features of the user node in this iteration and the center features of each cluster center. The embodiment of the present application does not specifically limit the method for calculating the similarity between features, for example, it can be calculated based on Euclidean distance, cosine similarity, correlation coefficient, etc.

[0129] In some embodiments, considering that the third training loss of the present application is used to describe the accuracy of the clustering results, and the Student's t distribution can provide a more accurate confidence interval when performing hypothesis verification, especially when estimating the overall mean with sample data, the t distribution can provide a more accurate confidence interval, so the embodiment of the present application can use the Student's t distribution to calculate the similarity between the user node and the cluster center. Specifically, for each cluster center, according to the difference between the node characteristics of the user node and the center characteristics of the cluster center, combined with the degree of freedom of the Student's t distribution, the distance measure between the user node and the cluster center is obtained; for each cluster center, the distance measure between the user node and the cluster center is taken as the quotient of the sum of the distance measures between the user node and all cluster centers as the similarity between the user node and the cluster center.

[0130] In the embodiment of the present application, the similarity q between the user node i and the cluster j can be calculated by the following formula ij :

[0131]

[0132] Among them, u i represents the node characteristics of the user node, μ j represents the central feature of the cluster center of cluster j, α represents the degree of freedom of Student's t distribution, and the embodiment of the present application does not limit the value of α, for example, it can be 1, Represents the distance measure between user node i and cluster center j.

[0133] The embodiment of the present application uses the similarity between the user node and the cluster center as the probability that the user node belongs to the corresponding cluster cluster. After obtaining the probability, the embodiment of the present application can further obtain the confidence that each user node belongs to each cluster cluster according to the probability that each user node belongs to each cluster cluster. In this way, for the clustering of the user node, two values ​​- confidence and probability can be obtained. The embodiment of the present application hopes to have a more confident distribution as the target distribution, so that the probability of the user node belonging to a certain cluster cluster is higher, so that it is closer to the cluster center of the cluster cluster. Therefore, when calculating the cluster loss, the difference between the similarity between the user node and the cluster center of a cluster cluster and the confidence that the user node belongs to the corresponding cluster cluster can be used to obtain the third training loss of the user node. The purpose is to make the distribution of similarity and confidence overlap as much as possible.

[0134] The confidence calculation of clustering results is not a standardized process with a unique answer, because it depends on the specific clustering algorithm, data set characteristics, and clustering result evaluation method. In some embodiments, the confidence of clustering results can be evaluated based on internal evaluation indicators. Internal evaluation indicators evaluate the quality of clustering results themselves without external information (such as true labels). These indicators can be used to indirectly reflect the confidence of clustering results. Common internal evaluation indicators include: Silhouette Coefficient: It measures the quality of clustering effect. The larger the value, the better the clustering effect. It combines the compactness and separation of clustering, and can reflect the confidence of clustering results to a certain extent. Calinski-Harabasz Index: Also known as the Variance Ratio Criterion, it evaluates the clustering effect by calculating the ratio of intra-class hashing degree to inter-class hashing degree. The larger the value, the better the clustering effect, and the higher the confidence of clustering results. In some embodiments, confidence can also be measured based on the stability of clustering. Stability evaluation is usually achieved by running the clustering algorithm multiple times and comparing the consistency of the results. If the results of multiple runs are similar, it means that the clustering result has high stability and confidence. In other embodiments, the confidence can also be obtained based on the distance and density of each node in the cluster, and the confidence is evaluated by calculating the density of each cluster in the clustering result, the distance between clusters and other statistics. For example, if the data points within a cluster are very close and the distance between clusters is relatively large, then it can be considered that this clustering result has a high confidence.

[0135] KL divergence (Kullback-Leibler divergence), also known as relative entropy or information divergence, is a method for measuring the difference between two probability distributions P and Q. Considering that the similarity between the user node and each cluster center in the present application, and the confidence that the user node belongs to each cluster cluster also belong to the probability distribution, the embodiment of the present application can characterize the difference between the similarity between the user node and each cluster center and the confidence that the user node belongs to the corresponding cluster cluster based on KL divergence.

[0136] In some embodiments, for each clustering cluster, the ratio between the similarity between the user node and the cluster center of the clustering cluster and the confidence that the user node belongs to the clustering cluster is calculated, and then the logarithm of the ratio is taken, and the result of the logarithm is multiplied by the confidence to obtain the information entropy between the user node and the clustering cluster, and further the information entropy between the user node and all clustering clusters is summed to obtain the third training loss of the user node.

[0137] In some embodiments, the third training loss L of the user nodecls It can be calculated by the following formula:

[0138]

[0139] in, p ij Indicates the confidence that user node i belongs to cluster j, q ij Represents the similarity between the user node and the cluster center of cluster j.

[0140] Based on the above embodiments, as an optional embodiment, each round of iterative training further includes:

[0141] For each user node, the cluster center with the highest similarity corresponding to the user node is used as the target cluster center, and the cluster cluster corresponding to the target cluster center is used as the cluster cluster to which the user node belongs in the next iteration;

[0142] For each cluster of the next iteration, the central feature of the corresponding cluster center is updated according to the total loss of the iterative training.

[0143] In consideration of the large amount of data in the training samples, the embodiment of the present application does not use the k-means method to determine the cluster to which the user node belongs. Instead, for each user node, the similarity between the user node and each cluster center is counted, and the cluster center with the highest similarity is used as the target cluster center, and the cluster corresponding to the target cluster center is further used as the cluster to which the user node belongs in the next iteration. For example, if there are three clusters, and the similarity between the user node and the cluster centers of the three clusters is 98%, 70%, and 60%, respectively, the cluster corresponding to the highest similarity of 98% is used as the cluster to which the user node belongs in the next iteration.

[0144] In the embodiment of the present application, the central feature of the cluster center of the cluster cluster is not directly updated by taking the average of the node features of all user nodes in the cluster cluster, but is updated with the update of the model through the total loss of the current iterative training. In some embodiments, the result of the central feature of the final cluster center will approximate the result of taking the average of the node features of all user nodes in the cluster cluster.

[0145] It should be noted that the total loss of iterative training in the embodiment of the present application may include at least one of the first training loss, the second training loss, and the third training loss. For example, the total loss may include the first training loss and the second training loss, or the first training loss and the third training loss, or the second training loss and the third training loss, or the first training loss, the second training loss, and the third training loss.

[0146] See also Figure 3B, which exemplarily illustrates a model training method provided by an embodiment of the present application. As shown in the figure, the embodiment of the present application obtains multiple sample nodes from a heterogeneous graph, the multiple sample nodes include hot user nodes and content nodes, and each content node further includes positive content nodes and negative content nodes of the hot user nodes, so the iterative training of the embodiment of the present application involves three aspects of training losses:

[0147] The first training loss associated with the hot user node:

[0148] For each hot user node, each first meta-path of the hot user node and the attribute information of each node on each first meta-path are input into the initial feature extraction model to obtain the basic features output by the initial feature extraction model, each second meta-path of the hot user node and the attribute information of each node on each second meta-path are input into the initial feature extraction model to obtain the active features output by the initial feature extraction model, the node features (including the basic features and the active features) or the active features are used as the target features, and the basic features of the hot user nodes are input into the initial feature mapping function to obtain the mapping features, and the first training loss is obtained by calculating the difference between the target features and the mapping features;

[0149] Second training loss associated with hot user nodes:

[0150] The initial feature extraction model outputs node features of the positive content node and the negative content node respectively according to the attribute information of the nodes on each meta-path of the positive content node and the negative content node, and obtains a second training loss according to the difference between the first similarity of the node features of the hot user node and each positive content node in this round of iteration and the second similarity of the node features of the hot user node and each negative content node in this round of iteration;

[0151] The third training loss associated with the user node:

[0152] The central features of the cluster centers of each cluster cluster in this iteration and the node features of each user node in this iteration are obtained. For each user node, the similarity between the user node and the corresponding cluster center is obtained according to the node features of the user node in this iteration and the central features of each cluster center. The confidence that each user node belongs to each cluster cluster is obtained according to the similarity between each user node and each cluster center. For each user node, the third training loss of the user node is obtained according to the difference between the similarity between the user node and each cluster center and the confidence that the user node belongs to the corresponding cluster cluster.

[0153] For each user node, the cluster center with the highest similarity corresponding to the user node is used as the target cluster center, and the cluster cluster corresponding to the target cluster center is used as the cluster cluster to which the user node belongs in the next iteration. The parameters of the initial feature extraction model and the initial feature mapping model are adjusted through the first, second and third training losses, and the central features of each cluster center are updated.

[0154] In some embodiments, the present application obtains the confidence that each user node belongs to each cluster cluster according to the similarity between each user node and each cluster center, which may include the following steps:

[0155] S301, for each cluster center, taking the sum of the similarities of each sample user node corresponding to the cluster center as the convening degree of the cluster corresponding to the cluster center;

[0156] S302: for each user node, according to the similarity between the user node and a cluster center, and the convening degree of the cluster corresponding to the cluster center, obtain the relative influence of the user node in the cluster cluster;

[0157] S303: For each user node, the ratio of the relative influence of the user node in a cluster to the total relative influence of the user node in all clusters is used as the confidence that the user node belongs to the cluster.

[0158] Specifically, after obtaining the similarity between each user node and each cluster center, the embodiment of the present application can calculate the sum of the similarities between all user nodes and the cluster center for a cluster center, thereby serving as the convening degree of the cluster cluster corresponding to the cluster center. The convening degree can reflect the overall distribution of user nodes on the cluster cluster to a certain extent. Further, for each user node, the square of the similarity between the user node and the cluster center is divided by the convening degree of the cluster cluster corresponding to the cluster center to obtain the relative influence of the user node in the cluster cluster. Through this step, the relative influence of a user node in each cluster cluster can be calculated. Finally, the relative influence of the user node in a cluster cluster is calculated as the proportion of the total relative influence of the user node in all cluster clusters as the confidence that the user node belongs to the cluster cluster.

[0159] In some embodiments, the present application embodiment can obtain the confidence that user node i belongs to cluster j by the following formula: p ij :

[0160]

[0161] in, f jIndicates the degree of convening of the cluster corresponding to the cluster center j, , which is the sum of the similarities of all user nodes corresponding to cluster center j, Represents the relative influence of user node i in cluster j.

[0162] On the basis of the above embodiments, as an optional embodiment, the embodiment of the present application can also use the clustering results of the user nodes to perform feature enhancement on the nodes of the hot user nodes when calculating the first training loss of the hot user nodes, so as to calculate the first training loss using the node features after feature enhancement. In this way, on the one hand, since clustering can group user nodes, the samples in each cluster cluster have a high degree of similarity in the feature space. Since the entire group is represented by the cluster center or cluster feature, the complexity of the data is reduced, and the feature dimension reduction is indirectly achieved, reducing the complexity of the data. At the same time, the clustering results are involved in the calculation of the mapping loss, which can enhance the expressive power of the model, help the model to better learn the data characteristics of the user nodes, improve the generalization ability of the model, and at the same time, enhance the interpretability of the model.

[0163] The first training loss of the hot user node in the embodiment of the present application is obtained in the following way:

[0164] S401. According to the distance between each cluster center and the target feature of the hot user node in this round of iteration, perform weighted summation on the central features of each cluster center as the first reference feature, perform feature enhancement on the target feature according to the first reference feature to obtain the target feature after feature enhancement, and use the target feature after feature enhancement as the hot feature of the hot user node in this round of iteration.

[0165] The embodiment of the present application can calculate the product of the target feature of the hot user node in this round of iteration and the transposed central feature of the cluster center. On the one hand, this product can be used to measure the distance between two vectors, and can also be used to measure the similarity between two vectors. Further, the product is processed by the softmax function to obtain the weight of the cluster center. The central features of all cluster centers and the corresponding weights are weighted and summed to obtain the first reference feature.

[0166] In some embodiments, the first reference characteristic can be obtained by the following formula e c :

[0167]

[0168] in, e b represents the target feature of hot user nodes, E c represents the central features of each cluster center,d Represents the feature dimension. In this application, the dimension of the target feature and the center feature are the same.

[0169] After obtaining the first reference feature, the first reference feature can be used to enhance the target feature. It should be noted that when using one feature to enhance another feature, a new feature can usually be produced by combining, transforming or utilizing the relationship between the two features to obtain the enhanced result.

[0170] In some embodiments, feature enhancement can be performed by using feature combination. Feature enhancement of the target feature is achieved by multiplying the first reference feature with the target feature or performing a polynomial operation. The polynomial combination method can help the model capture the nonlinear relationship between features.

[0171] In some embodiments, feature enhancement can be achieved with the help of a multilayer perceptron (MLP). MLP is mainly achieved through its multilayer structure and nonlinear transformation capabilities. By inputting the first reference feature and the target feature into the MLP, the hidden layer of the MLP transforms the input feature through a nonlinear activation function (such as Sigmoid, Tanh, ReLU, etc.). This nonlinear transformation can capture the complex relationship between the input features, thereby generating a more expressive feature representation. The multilayer structure of the MLP allows for deep processing and extraction of input features. Each hidden layer can be regarded as a further abstraction and representation of the output of the previous layer. Through multi-layer stacking, the MLP can learn high-level representations of the input features. These high-level representations are often more discriminative and expressive than the original features, and therefore can be used as the result of feature enhancement.

[0172] S402. According to the distance between each cluster center and the basic feature of the hot user node in this round of iteration, a weighted sum is taken for the central feature of each cluster center, and the sum is used as the second reference feature. According to the second reference feature, the basic feature is enhanced to obtain the basic feature after feature enhancement. The enhanced basic feature is mapped by the initial feature mapping function to obtain the mapping feature of the hot user node in this round of iteration.

[0173] Based on a method similar to step S401, the embodiment of the present application can also obtain the second reference feature and the basic feature after feature enhancement. After obtaining the basic feature after feature enhancement from the initial feature mapping function, the mapping feature of the hot user node in this round of iteration can be obtained. It should be noted that in order to distinguish the mapping features obtained by mapping the basic features without feature enhancement by the initial feature mapping function in the above embodiment, the embodiment of the present application refers to the mapping features obtained by mapping based on the basic features enhanced by the feature as hot mapping features for distinction.

[0174] S403: Obtain a first training loss of the hot user node according to a difference between a hot feature and a mapping feature of the hot user node in this iteration.

[0175] In the embodiment of the present application, the target features and basic features of the hot user nodes are enhanced based on the clustering results to obtain the hot features and the enhanced basic features, and the enhanced basic features are further mapped using the initial feature mapping function to obtain the hot mapping features. The first training loss is obtained by the difference between the hot features and the hot mapping features. Compared with the first training loss obtained by directly mapping the basic features and obtaining the first training loss by the difference between the mapping features and the target features, the first training loss takes into account the loss existing in mapping the basic features of the hot user nodes to the target features, and also takes into account the clustering loss existing in clustering the hot user nodes. The node features obtained in this way can also express more information.

[0176] Based on the above embodiments, as an optional embodiment, when calculating the second training loss, the embodiment of the present application can also calculate the correlation between the hot features of the hot user nodes and the node features of the positive and negative content nodes, and further calculate the recommendation loss of the content node pairs corresponding to the hot user nodes.

[0177] See also Figure 4 , which exemplarily shows a flow chart of a round of iterative training provided by an embodiment of the present application, as shown in the figure, including:

[0178] S501, obtaining the central features of the cluster centers of each cluster in this round of iteration, inputting each meta-path of multiple sample nodes into the initial feature extraction model, and obtaining the node features of the sample nodes in this round of iteration; wherein the multiple sample nodes include content nodes and hot user nodes, and the node features or active features of the hot user nodes are used as the target features of the hot user nodes;

[0179] S502a, according to the distances between each cluster center and the target feature of the hot user node in this round of iteration, weighted sum of the central features of each cluster center is taken as the first reference feature, and the target feature is enhanced according to the first reference feature to obtain the target feature after feature enhancement, and the target feature after feature enhancement is taken as the hot feature of the hot user node in this round of iteration;

[0180] S502b, according to the distance between each cluster center and the basic feature of the hot user node in this round of iteration, the central feature of each cluster center is weighted summed as the second reference feature, and the basic feature is enhanced according to the second reference feature to obtain the basic feature after feature enhancement;

[0181] S503, mapping the basic features after feature enhancement through the initial feature mapping function to obtain the mapping features of the hot user nodes in this round of iteration;

[0182] S504, obtaining a first training loss of the hot user node according to the difference between the hot feature and the mapping feature of the hot user node in this round of iteration;

[0183] S505, traverse each positive content node and each negative content node to obtain a plurality of content node pairs, each content node pair including a positive content node and a negative content node;

[0184] S506. For each content node pair, according to the hot feature of the hot user node and the node feature of the positive content node in the content node pair in this round of iteration, obtain a first similarity between the hot user node and the positive content node; according to the hot feature of the hot user node and the node feature of the negative content node in the content node pair in this round of iteration, obtain a second similarity between the hot user node and the negative content node; according to the negative value of the difference between the first similarity and the second similarity, obtain a recommendation loss of the hot user node for the content node pair;

[0185] S507, obtaining a second training loss of the hot user node according to the sum of the recommendation losses of the hot user node to all content node pairs;

[0186] S508, for each user node, according to the node feature of the user node in this round of iteration and the center feature of each cluster center, obtain the similarity between the user node and the corresponding cluster center;

[0187] S509, obtaining the confidence that each user node belongs to each cluster cluster according to the similarity between each user node and each cluster center;

[0188] S510, for each user node, obtaining a third training loss of the user node according to the difference between the similarity between the user node and each cluster center and the confidence that the user node belongs to the corresponding cluster cluster;

[0189] S511. According to the first training loss and the second training loss of the hot user nodes and the third training loss of each user node, the initial feature extraction model, the initial feature mapping function and the cluster centers of each cluster cluster are adjusted. For each user node, the cluster center with the highest similarity corresponding to the user node is used as the target cluster center, and the cluster cluster corresponding to the target cluster center is used as the cluster cluster to which the user node belongs in the next iteration.

[0190] On the basis of the above embodiments, as an optional embodiment, the multiple user nodes in the embodiments of the present application also include cold user nodes, and the cold user nodes also refer to the user nodes of the cold users mentioned in the above embodiments.

[0191] Since there are few recommendation records of cold users in the recommendation system, it can be considered that there is no recommended content that cold users are interested in in the recommendation system. Therefore, in the heterogeneous graph, there is no edge between the cold user node and the content node, but there is an edge between the cold user node and other user nodes (which may be cold user nodes or hot user nodes). According to the definition of the first meta-path and the second meta-path, since there is no edge between the cold user node and the content node, the meta-path of the cold user node is the first meta-path, and the node features of the cold user are only the basic features obtained based on the first meta-path, but not the active features obtained based on the second meta-path.

[0192] The multiple sample nodes selected from the heterogeneous graph in the embodiment of the present application also include cold user nodes. Therefore, when clustering each user node, the cold user nodes and the hot user nodes are clustered together to help the cold user nodes quickly find similar groups, enhance the interest expression of cold users, and improve the predictability of the behavior information of the cold user nodes.

[0193] Based on the above embodiments, as an optional embodiment, the basic features and active features of each sample node of the present application, namely, cold user nodes, hot user nodes, and content nodes, can be obtained in the following manner:

[0194] From each meta-path with the sample node as the central node, obtain each reference meta-path, where the reference meta-paths are all first meta-paths or all second meta-paths;

[0195] For each reference meta-path, starting from the second highest-order node in the reference meta-path, according to the aggregation features of each higher-order neighboring node connected to the node and the attributes of the node itself, the aggregation features are gradually aggregated toward the central node until the aggregation features of the central node are obtained; wherein the aggregation features of the highest-order neighboring node are determined according to the attribute information of the highest-order neighboring node itself;

[0196] Through the attention mechanism, the aggregated features of the sample nodes on each reference meta-path are aggregated with weights to obtain the features of the sample nodes corresponding to the reference meta-path.

[0197] It should be noted that since the basic features are related to the first meta-path and the active features are related to the second meta-path, if the reference meta-path is the first meta-path, the features obtained through the embodiment of the present application are basic features; if the reference meta-path is the second meta-path, the features obtained through the embodiment of the present application are active features.

[0198] After determining the reference meta-path, the embodiment of the present application adopts a step-by-step aggregation method to obtain the aggregation characteristics of each order node on the reference meta-path step by step. It should be understood that the order of each neighbor node on the sampling meta-path is consistent with the order of aggregation. That is, each neighbor node on the sampling meta-path is sampled step by step from the central node to the highest-order neighbor node, and the aggregation is aggregated step by step from the highest-order neighbor node to the central node.

[0199] The embodiment of the present application uses a step-by-step aggregation method to enable the aggregation features of the central node to include the attribute information of all nodes in the meta-path, and reuse the information of each node on the meta-path. The embodiment of the present application does not specifically limit the step-by-step aggregation method. For example, the weight can be set according to the order. The higher the order, the lower the weight. For the node of the current order, the aggregation features of each higher-order neighbor node are weighted by the weight of the higher order, and then summed with the features obtained based on the attributes of the node itself, to obtain the aggregation features of the node.

[0200] In the embodiment of the present application, the aggregated features of a central node on each reference meta-path are obtained, and the aggregated features obtained from multiple reference meta-paths are weighted aggregated through an attention mechanism to form a richer and more comprehensive feature representation.

[0201] In some embodiments, the aggregated features on each reference meta-path may be calculated by the following formula to perform weighted aggregation to obtain features of the sample node corresponding to the reference meta-path:

[0202]

[0203]

[0204]

[0205] in, represents the aggregated features of node i in the i-th reference meta-path, Indicates that node i is in m The aggregation characteristics of the path reference metapath, Represents a splicing operation, represents the mapping function, represents the normalization function, Represents the weight of the i-th reference meta-path.

[0206] Based on the above embodiments, as an optional embodiment, the step of each stage of aggregation in the step-by-step aggregation to the central node includes:

[0207] S501, for any node of the current order aggregation, obtaining the meta-feature of the node according to the attribute information of the node;

[0208] S502: For any node of the current order aggregation, each higher-order neighbor node having an edge connected to the node is used as a reference node, and the aggregation feature of the reference node is obtained;

[0209] S503: for any node of the current order aggregation, obtain the correlation between the node and each reference node according to the meta-feature of the node and the aggregation features of each reference node;

[0210] S504. For any node of the current order aggregation, perform weighted summation on the aggregation features of each reference node according to the corresponding correlation of each reference node, and obtain the aggregation feature of the node according to the result of the weighted summation and the meta-feature of the node.

[0211] It should be noted that the process of the embodiment of the present application is applicable to any node from the next highest order neighbor node to the central node, and does not limit the number of nodes aggregated at the current order. Starting from the next highest order node, the aggregation features of the next highest order node are obtained based on the aggregation features of the higher order neighbor nodes and the attribute information of the node itself. Figure 2DFor example, in the figure, there is a reference meta-path with a first-order neighbor node of I1 and second-order neighbor nodes of I4 and U5. Since the reference meta-path has only two-order neighbor nodes, the next highest-order node is a first-order neighbor node, and there is only one. Therefore, according to the aggregated features of I4 and U5 and the attributes of node I1 itself, the aggregated features of content node I1 are obtained. In an embodiment of the present application, the aggregated features of the highest-order node are determined by its own attribute information. By inputting the attribute information of the highest-order node itself into the initial feature extraction model, the initial feature extraction model converts the information of each dimension (such as age group, gender, location, etc.) contained in the attribute information into a binary vector, that is, the aggregated features of the highest-order node. Meta features of other order nodes can also be obtained by this method. Taking one-hot encoding as an example, the length of the binary vector is equal to the number of possible values ​​of the dimension, and only one element in the vector is "hot" (value is 1), indicating the specific value of the dimension, and the other elements are "cold" (value is 0). After obtaining the aggregation features of content node I1, since the central node has only one first-order neighbor node in the reference meta-path, namely content node I1, the aggregation features of central node U1 on the reference meta-path can be obtained based on the aggregation features of content node I1 and the attributes of central node U1 itself.

[0212] The embodiment of the present application obtains the manner in which the correlation between the node and each reference node is obtained according to the meta-features of the node and the aggregate features of each reference node. Specifically, the manner may include: for any reference node, obtaining the metric between the node and the reference node according to the meta-features of the node and the aggregate features of the reference node, and obtaining the correlation between the node and the reference node by normalizing the metric. The embodiment of the present application does not specifically limit the manner in which the normalization is performed. For example, the ratio of the metric between the node and the reference node to the total metric between the node and all reference nodes may be used as the correlation between the node and the reference node.

[0213] In some embodiments, the correlation between the node u of the current order aggregation and the reference node i can be obtained using the following formula:

[0214]

[0215] Among them, W is the weight, h u represents the meta-feature of node u, h i represents the aggregated features of node i, h k represents any reference node of node u, α is the preset coefficient.

[0216] The embodiment of the present application can use the target feature extraction model and target feature mapping function trained by the model training method provided in the above embodiments to perform content recommendation, such as Figure 5 As shown, the content recommendation method may include:

[0217] S601: construct a heterogeneous graph and obtain attribute information of each node in the heterogeneous graph.

[0218] The method of constructing a heterogeneous graph in an embodiment of the present application can specifically refer to the schemes of the heterogeneous graph involved in the above-mentioned model training methods. The heterogeneous graph includes multiple nodes and there is an edge between two nodes with an associated relationship. The multiple nodes include multiple user nodes representing users and multiple content nodes representing candidate recommended content; the multiple user nodes include a target user node representing the target user.

[0219] It should be understood that the heterogeneous graph constructed in the embodiment of the present application may be the same heterogeneous graph as the heterogeneous graph constructed during model training, or it may be a subgraph of the heterogeneous graph constructed during model training, or it may be a heterogeneous graph completely different from the heterogeneous graph constructed during model training, and the embodiment of the present application does not make specific limitations.

[0220] In some embodiments, the candidate recommended content is content delivered by content delivery personnel; or, the candidate recommended content is content automatically generated by artificial intelligence technology, for example: recommended content copy automatically generated based on the search content of the target user and image content related to the recommended content copy.

[0221] S602: Determine in the heterogeneous graph at least one third-element path with a target user node as a central node, and at least one fourth-element path with a content node of a candidate recommended content as a central node.

[0222] The embodiment of the present application can refer to the method of determining the meta-path with the sample node as the central node involved in the above-mentioned model training method to obtain each third meta-path and each fourth meta-path.

[0223] S603. Input the attribute information of each third-dimensional path corresponding to the target user node and the nodes on each third-dimensional path into the target feature extraction model to obtain the node feature of the target user node, and input the attribute information of each fourth-dimensional path corresponding to each candidate recommended content and the nodes on each fourth-dimensional path into the target feature extraction model to obtain the node feature of each candidate recommended content.

[0224] By training the target feature extraction model twice through the embodiments of the above-mentioned model training methods, the node features of the target user node and each candidate recommended content can be obtained.

[0225] S604: If all nodes connected to the target user node are content nodes, it is determined that all third-dimensional paths of the target user are first-dimensional paths, and the node features of the target user node are mapped by a target mapping function to obtain mapping features. For each candidate recommended content, the similarity between the target user and the candidate recommended content is obtained based on the mapping features and the node features of the candidate recommended content.

[0226] It should be noted that, since the target feature obtained for the hot user node during model training in the embodiment of the present application can be an active feature or a node feature, if the target feature during model training is an active feature, then the similarity between the target user and the candidate recommended content is obtained based on the mapping feature and the node feature of the candidate recommended content, including:

[0227] The node features and mapping features of the target user node are fused to obtain fused features, and the similarity between the target user and the candidate recommended content is obtained based on the fused features and the node features of the candidate recommended content.

[0228] In the embodiment of the present application, the target user is a cold user, so the node features obtained by the target feature extraction model are actually basic features, and the target features used in model training are active features. Therefore, the mapping features of the target user nodes are similar to the active features. Therefore, the node features and mapping features of the target user nodes are fused to obtain more complete features and then calculate the similarity, and the results will be more accurate.

[0229] If the target feature during model training is the node feature of the hot user node, since the node feature includes the basic feature and the active feature, the similarity between the target user and the candidate recommended content can be directly obtained based on the mapping feature and the node feature of the candidate recommended content.

[0230] S605 : Determine target recommended content to be recommended to the target user from among the candidate recommended content according to the similarities corresponding to the candidate recommended content.

[0231] After obtaining the similarity corresponding to each recommended content, the embodiment of the present application can use the similarity as the degree of match between the target user and the candidate recommended content. Obviously, the higher the degree of match, the higher the possibility that the target user is interested in the candidate recommended content. The embodiment of the present application can determine the target recommended content recommended to the target user from each candidate recommended content based on the similarity according to the preset recommendation strategy. For example, if the recommendation strategy configures the number of target recommended content, the corresponding number of candidate recommended content can be selected as the target recommended content based on the order of similarity from high to low.

[0232] The content recommendation method of the embodiment of the present application constructs a heterogeneous graph and obtains attribute information of each node in the heterogeneous graph, wherein each node includes a target user node representing a target user and multiple content nodes representing candidate recommended content, further determines at least one third-dimensional path with the target user node as a central node, and at least one fourth-dimensional path with the content node of the candidate recommended content as a central node in the heterogeneous graph, inputs the attribute information of each third-dimensional path corresponding to the target user node and the nodes on each third-dimensional path into a target feature extraction model, obtains the node feature of the target user node, inputs the attribute information of each fourth-dimensional path corresponding to each candidate recommended content and the nodes on each fourth-dimensional path into the target feature extraction model, obtains the node feature of each candidate recommended content, and since the target feature extraction model is trained based on the above-mentioned model training method, the obtained node feature can be more accurately represented. When it is determined that the target user is a cold user, the node features are mapped to mapping features through the target mapping function, thereby helping the target user to accelerate the process of becoming a hot user, generating mapping features that reflect more behavioral information, and calculating the similarity based on the node features of the mapping and candidate recommended content. When performing content recommendation at one time, more appropriate recommendations can be made. The embodiment of the present application can also generate accurate recommendation results based on the rich behavioral data of users in the model reasoning stage.

[0233] Based on the above embodiments, as an optional embodiment, the embodiment of the present application also includes:

[0234] If the nodes connected to the target user node include content nodes and user nodes, it is determined that each third meta-path of the target user includes a first meta-path and a second meta-path, and for each candidate recommended content, the similarity between the target user and the candidate recommended content is obtained based on the node features of the target user and the candidate recommended content.

[0235] See also Figure 6 , which exemplarily shows a flow chart of a content recommendation method according to another embodiment of the present application, as shown in the figure, comprising:

[0236] S701, constructing a heterogeneous graph and obtaining attribute information of each node in the heterogeneous graph;

[0237] S702: Determine, in the heterogeneous graph, at least one third-element path with a target user node as a central node, and at least one fourth-element path with a content node of a candidate recommended content as a central node;

[0238] S703, inputting each third-dimensional path corresponding to the target user node and the attribute information of the nodes on each third-dimensional path into the target feature extraction model to obtain the node feature of the target user node, and inputting each fourth-dimensional path corresponding to each candidate recommended content and the attribute information of the nodes on each fourth-dimensional path into the target feature extraction model to obtain the node feature of each candidate recommended content;

[0239] S704, determining whether the target user node is a cold user node or a hot user node, if the target user node is a cold user node, executing S705, if the target user node is a hot user node, executing S708;

[0240] S705, mapping the node feature of the target user node through the target mapping function to obtain a mapping feature, if the target feature in the model training phase is a node feature, executing S706A, if the target feature in the model training phase is an active feature, executing S706B;

[0241] S706A: For each candidate recommended content, obtain the similarity between the target user and the candidate recommended content according to the mapping feature and the node feature of the candidate recommended content;

[0242] S706B, performing feature fusion on the node feature of the target user node and the mapping feature to obtain fused features, and obtaining the similarity between the target user and the candidate recommended content based on the fused features and the node feature of the candidate recommended content;

[0243] S707, for each candidate recommended content, obtaining the similarity between the target user and the candidate recommended content according to the mapping feature and the node feature of the candidate recommended content;

[0244] S708, obtaining the similarity between the target user and the candidate recommended content according to the node features of the target user and the candidate recommended content;

[0245] S709: Determine target recommended content to be recommended to the target user from among the candidate recommended content according to the similarities corresponding to the candidate recommended content.

[0246] The target feature extraction model and target feature mapping function obtained by training the training method provided in the embodiment of the present application can be applied to the content recommendation scenario. The application scenario of the content recommendation method provided in the embodiment of the present application is introduced below. Figure 7As shown in the figure, a new user registers an account on a short video program through a terminal. When registering, he also fills in some basic information about himself, such as age, gender, location, mobile phone number, etc., and follows the accounts of some of his friends. In some embodiments, the new user can also enable the permission to obtain the user's address book on the terminal, so that the short video program can obtain the user's address book and obtain the accounts of the new user's friends based on the mobile phone numbers in the address book. The terminal sends the basic information of the new user and the accounts of each of the above friends to the data server. The data server pre-constructs a heterogeneous graph, which includes multiple user nodes representing users and content nodes representing short videos. The data server creates a new user node based on the basic information of the new user, and generates various meta-paths with the new user node as the central node based on the accounts and attribute information of each friend.

[0247] In response to the search operation of the new user, the terminal sends the search keywords to the application server of the short video program. The application server obtains several candidate recommended videos based on the search keywords and sends the video identifiers of the candidate recommended videos to the data server. The data server determines the meta-path of each candidate recommended video based on the video identifier.

[0248] The data server sends the attribute information of each meta-path of the new user node and each candidate recommended video and each node on the meta-path to the recommendation server. The target feature extraction model and target feature mapping function trained based on the various embodiments of the present application are pre-deployed on the recommendation server, so as to obtain the node features of the new user node and each candidate recommended video through the target feature extraction model, map the node features of the new user node through the target mapping function to obtain the mapping features, and obtain the similarity between the new user and the candidate recommended video based on the mapping features and the node features of the candidate recommended video; and determine the target video recommended to the new user from the candidate recommended videos based on the corresponding similarities of the candidate recommended videos.

[0249] The embodiment of the present application deploys the trained target feature extraction model and target feature mapping model into the recall module of a live broadcast service, covering millions of online users. After a period of testing, the test results are shown in Table 1.

[0250]

[0251] Table 1 Online improvement range of the target feature extraction model and the target feature mapping model based on the embodiment of the present application

[0252] It can be seen from the data in Table 1 that the target feature extraction model and the target feature mapping model based on the embodiment of the present application have achieved a certain rate of improvement in user click-through rate (uctr), click-through rate (pctr), viewing time and daily active users (dau).

[0253] The present application embodiment provides a model training device, such as Figure 8 As shown, the model training device may include: a heterogeneous graph acquisition module 801, a meta-path determination module 802 and a training module 803, wherein:

[0254] A heterogeneous graph acquisition module 801 is used to obtain a heterogeneous graph and attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing recommended content, wherein the plurality of user nodes include at least one hot user node, and the hot user node is a user node having an edge with at least one content node and at least one other user node;

[0255] A meta-path determination module 802 is configured to select at least one sample node from the heterogeneous graph, and for each sample node, determine at least one meta-path with the sample node as a central node from the heterogeneous graph, wherein all first-order neighbor nodes on a meta-path are user nodes or content nodes, and a meta-path with all first-order neighbor nodes being user nodes is a first meta-path, and a meta-path with all first-order neighbor nodes being content nodes is a second meta-path, wherein the at least one sample node includes at least one hot user node, and each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path;

[0256] The training module 803 is used to iteratively train the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path of each sample node to obtain the target feature extraction model and the target feature mapping function;

[0257] The total loss of the iterative training includes a first training loss of each hot user node, and the first training loss is used to characterize the difference between the target feature of the corresponding hot user node in each round of iteration and the mapping feature obtained by mapping the basic feature of the corresponding hot user node in each round of iteration through the initial feature mapping function;

[0258] The target feature is a node feature or an active feature; the initial feature extraction model is used to input the attribute information of the nodes on each meta-path of the sample node, and output the node feature of the sample node; if the meta-paths of the sample node include at least one first meta-path, the node feature includes the basic feature obtained according to the attribute information of the nodes on each first meta-path; if the meta-paths of the sample node include at least one second meta-path, the node feature includes the active feature obtained according to the attribute information of the nodes on each second meta-path.

[0259] The model training device of the embodiment of the present application can execute the model training method provided by the embodiment of the present application, and the implementation principle is similar. The actions performed by each module in the model training device of each embodiment of the present application correspond to the steps in the model training method of each embodiment of the present application. For the detailed functional description of each module of the model training device, please refer to the description in the corresponding model training method shown in the previous text, which will not be repeated here.

[0260] The present application embodiment provides a content recommendation device, such as Fig. 9 As shown, the content recommendation device includes a heterogeneous graph construction module 901, a meta-path screening module 902, a feature output module 903, a similarity calculation module 904 and a recommendation module 905. Specifically:

[0261] A heterogeneous graph construction module 901 is used to construct a heterogeneous graph and obtain attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing candidate recommended content; and the plurality of user nodes include a target user node representing a target user;

[0262] A meta-path screening module 902, configured to determine, in the heterogeneous graph, at least one third meta-path with a target user node as a central node, and at least one fourth meta-path with a content node of a candidate recommended content as a central node;

[0263] The feature output module 903 is used to input the attribute information of each third-dimensional path and the nodes on each third-dimensional path corresponding to the target user node into the target feature extraction model to obtain the node feature of the target user node, and input the attribute information of each fourth-dimensional path and the nodes on each fourth-dimensional path corresponding to each candidate recommended content into the target feature extraction model to obtain the node feature of each candidate recommended content;

[0264] A similarity calculation module 904 is used to determine that all third-dimensional paths of the target user are first-dimensional paths if all nodes connected to the target user node are content nodes, map the node features of the target user node through a target mapping function to obtain mapping features, and for each candidate recommended content, obtain the similarity between the target user and the candidate recommended content according to the mapping features and the node features of the candidate recommended content;

[0265] The recommendation module 905 is used to determine the target recommended content to be recommended to the target user from the candidate recommended content according to the similarity corresponding to each candidate recommended content;

[0266] Among them, the target feature extraction model and the target mapping function are trained according to the model training methods provided in the above embodiments.

[0267] The content recommendation device of the embodiment of the present application can execute the content recommendation method provided by the embodiment of the present application, and its implementation principle is similar. The actions performed by each module in the content recommendation device of each embodiment of the present application correspond to the steps in the content recommendation method of each embodiment of the present application. For the detailed functional description of each module of the content recommendation device, please refer to the description in the corresponding content recommendation method shown in the previous text, which will not be repeated here.

[0268] In an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of the above-mentioned model training method or content recommendation method. Compared with the related art, it can be achieved: by obtaining a heterogeneous graph, selecting at least one sample node from the heterogeneous graph, and for each sample node, determining at least one meta-path with the sample node as the central node from the heterogeneous graph, and dividing the meta-path into two categories, a first meta-path and a second meta-path, according to whether the first-order nodes in the meta-path are all user nodes or all content nodes. The hot user node has an edge with at least one content node and at least one other user node. Therefore, the node features output by the initial feature extraction model for the attribute information of the nodes on each meta-path of the hot user node include the basic features obtained according to the attribute information of the nodes on each first meta-path, and the basic features obtained according to the attribute information of the nodes on each second meta-path. The obtained active features are further mapped to the basic features through the initial feature mapping function to obtain the mapping features. The total loss of iterative training includes the first training loss of each hot user node. The first training loss is the difference between the target feature and the mapping feature. Therefore, when the model converges, it means that the initial feature mapping function has the ability to map the user's basic features to target features. When the target feature extraction model and the target feature mapping function are used for reasoning later, even if the user is a cold user of the behavior coefficient, after the node features of the cold user (including only the basic features) are extracted through the target feature extraction model, the mapping features obtained after mapping through the target feature mapping function accelerate the process of turning cold users into hot users and enhance the interest expression of cold users, thereby generating a more accurate and complete feature representation, which is naturally more accurate when recommending content based on the mapping features, enhancing the user's interest expression and laying the foundation for obtaining more accurate content push.

[0269] In an alternative embodiment, an electronic device is provided, such as Fig.10 As shown, Fig.10 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0270] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0271] The bus 4002 may include a path for transmitting information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 4002 is represented by only one thick line in the figure, but it does not mean that there is only one bus or one type of bus.

[0272] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0273] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.

[0274] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0275] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.

[0276] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0277] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0278] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A model training method, characterized in that: include: Obtaining a heterogeneous graph and attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an association relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing recommended content, wherein the plurality of user nodes include at least one hot user node, and the hot user node has an edge with at least one content node and at least one other user node; At least one sample node is selected from the heterogeneous graph, and for each sample node, at least one meta-path with the sample node as a central node is determined from the heterogeneous graph, wherein all first-order neighbor nodes on a meta-path are user nodes or content nodes, and a meta-path in which all first-order neighbor nodes are user nodes is a first meta-path, and a meta-path in which all first-order neighbor nodes are content nodes is a second meta-path, wherein the at least one sample node includes at least one hot user node, and each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path; Iteratively train the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path of each sample node to obtain the target feature extraction model and the target feature mapping function; The total loss of the iterative training includes a first training loss of each hot user node, and the first training loss is used to characterize the difference between the target feature of the corresponding hot user node in each round of iteration and the mapping feature obtained by the initial feature mapping function according to the basic feature mapping of the corresponding hot user node in each round of iteration; The target feature is a node feature or an active feature; the initial feature extraction model is used to input the attribute information of the nodes on each meta-path of the sample node, and output the node feature of the sample node; if the meta-paths of the sample node include at least one first meta-path, the node feature includes the basic feature obtained according to the attribute information of the nodes on each first meta-path; if the meta-paths of the sample node include at least one second meta-path, the node feature includes the active feature obtained according to the attribute information of the nodes on each second meta-path.

2. The method according to claim 1, characterized in that The at least one sample node also includes a content node; The total loss of the iterative training also includes the second training loss of each hot user node; In each round of iterative training, the second loss value of each hot user node is obtained in the following way: Selecting content nodes having edges connected to the hot user nodes from the heterogeneous graph as positive content nodes, and selecting content nodes having no edges connected to the hot user nodes from the heterogeneous graph as negative content nodes; Traversing each positive content node and each negative content node to obtain a plurality of content node pairs, each content node pair including a positive content node and a negative content node; For each content node pair, a first similarity between the hot user node and the positive content node in the content node pair is obtained according to the node features of the hot user node and the positive content node in the content node pair in this round of iteration; a second similarity between the hot user node and the negative content node in the content node pair is obtained according to the node features of the hot user node and the negative content node in the content node pair in this round of iteration; and a recommendation loss of the hot user node for the content node pair is obtained according to the negative value of the difference between the first similarity and the second similarity; The second training loss of the hot user node is obtained according to the sum of the recommendation losses of the hot user node to all content node pairs.

3. The method according to claim 1 or 2, characterized in that: The total loss of the iterative training also includes the third training loss of the user node in each sample node; The third training loss of the user node in each sample node is obtained by: For each round of iterative training, the central features of the cluster centers of each cluster in this round of iteration and the node features of each user node in this round of iteration are obtained, wherein the central features of the cluster centers of each cluster in the first round of clustering are preset values; For each user node, according to the node feature of the user node in this iteration and the center feature of each cluster center, the similarity between the user node and the corresponding cluster center is obtained; According to the similarity between each user node and each cluster center, the confidence that each user node belongs to each cluster cluster is obtained; For each user node, a third training loss of the user node is obtained according to a difference between a similarity between the user node and each cluster center and a confidence that the user node belongs to a corresponding cluster.

4. The method according to claim 3, characterized in that The first training loss of the hot user node is obtained as follows: According to the distances between each cluster center and the target feature of the hot user node in this round of iteration, the center features of each cluster center are weighted summed as the first reference feature, the target feature is enhanced according to the first reference feature to obtain the target feature after feature enhancement, and the target feature after feature enhancement is used as the hot feature of the hot user node in this round of iteration; According to the distances between each cluster center and the basic features of the hot user node in this round of iteration, the central features of each cluster center are weighted and summed as the second reference features, the basic features are feature enhanced according to the second reference features to obtain the basic features after feature enhancement, and the basic features after feature enhancement are mapped by the initial feature mapping function to obtain the mapping features of the hot user node in this round of iteration; According to the difference between the hot feature and the mapping feature of the hot user node in this round of iteration, the first training loss of the hot user node is obtained.

5. The method according to claim 3, characterized in that: The step of obtaining the confidence that each user node belongs to each cluster cluster according to the similarity between each user node and each cluster center includes: For each cluster center, the sum of the similarities between each sample user node and the cluster center is used as the convening degree of the cluster corresponding to the cluster center; For each user node, the relative influence of the user node in the cluster is obtained according to the similarity between the user node and a cluster center and the convening degree of the cluster corresponding to the cluster center; For each user node, the ratio of the relative influence of the user node in a cluster to the total relative influence of the user node in all clusters is used as the confidence that the user node belongs to the cluster.

6. The method according to claim 3, characterized in that: Each round of iterative training also includes: For each user node, the cluster center with the highest similarity corresponding to the user node is used as the target cluster center, and the cluster cluster corresponding to the target cluster center is used as the cluster cluster to which the user node belongs in the next iteration; For each cluster of the next iteration, the central feature of the corresponding cluster center is updated according to the total loss of the iterative training.

7. The method according to claim 1, characterized in that The plurality of user nodes include at least one cold user node, wherein the cold user node is a user node that has no edge with the content node; At least one sample node also includes a cold user node, the meta-paths of the cold user nodes are all first meta-paths, and the node features are basic features.

8. The method according to claim 7, characterized in that The basic features or active features of each sample node are obtained in the following way: Obtaining reference meta-paths from each meta-path with the sample node as the central node, wherein the reference meta-paths are all first meta-paths or all second meta-paths; For each reference meta-path, starting from the second highest-order node in the reference meta-path, according to the aggregation features of each higher-order neighboring node connected to the node and the attribute information of the node itself, the aggregation is gradually directed toward the central node until the aggregation features of the central node on the reference meta-path are obtained; wherein the aggregation features of the highest-order neighboring node are determined according to the attribute information of the highest-order neighboring node itself; Through the attention mechanism, the aggregated features of the sample nodes on each reference meta-path are aggregated with weights to obtain the features of the sample nodes corresponding to the reference meta-path. If the reference meta-path is the first meta-path, the corresponding features are basic features; if the reference meta-path is the second meta-path, the corresponding features are active features.

9. The method according to claim 8, characterized in that The steps of each stage of aggregation in the step-by-step aggregation to the central node include: For any node of the current order aggregation, obtaining the meta-features of the node according to the attribute information of the node; For any node of the current order aggregation, each higher-order neighbor node having an edge with the node is used as a reference node, and the aggregation feature of the reference node is obtained; For any node of the current order aggregation, the correlation between the node and each reference node is obtained according to the meta-feature of the node and the aggregation features of each reference node; For any node of the current order aggregation, the aggregation features of each reference node are weighted summed according to the corresponding correlation of each reference node, and the aggregation feature of the node is obtained according to the result of the weighted summation and the meta-feature of the node.

10. A content recommendation method, characterized in that: include: Constructing a heterogeneous graph and obtaining attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing candidate recommended content; and the plurality of user nodes include a target user node representing a target user; Determining in the heterogeneous graph at least one third-element path with a target user node as a central node, and at least one fourth-element path with a content node of the candidate recommended content as a central node; Inputting each third-dimensional path corresponding to the target user node and the attribute information of the nodes on each third-dimensional path into the target feature extraction model to obtain the node feature of the target user node, and inputting each fourth-dimensional path corresponding to each candidate recommended content and the attribute information of the nodes on each fourth-dimensional path into the target feature extraction model to obtain the node feature of each candidate recommended content; If all nodes connected to the target user node are content nodes, it is determined that all third-dimensional paths of the target user are first-dimensional paths, and the node features of the target user node are mapped by a target mapping function to obtain mapping features. For each candidate recommended content, the similarity between the target user and the candidate recommended content is obtained according to the mapping features and the node features of the candidate recommended content. Determine the target recommended content to be recommended to the target user from the candidate recommended content according to the similarity corresponding to each candidate recommended content; Wherein, the target feature extraction model and the target mapping function are trained according to the method described in any one of claims 1-9.

11. The method according to claim 10, characterized in that Also includes: If the nodes connected to the target user node include content nodes and user nodes, it is determined that each third meta-path of the target user includes a first meta-path and a second meta-path, and for each candidate recommended content, the similarity between the target user and the candidate recommended content is obtained based on the node features of the target user and the candidate recommended content.

12. A model training device, characterized in that: include: A heterogeneous graph acquisition module, used to obtain a heterogeneous graph and attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing recommended content, wherein the plurality of user nodes include at least one hot user node, and the hot user node is a user node having an edge with at least one content node and at least one other user node; a meta-path determination module, configured to select at least one sample node from the heterogeneous graph, and for each sample node, determine at least one meta-path with the sample node as a central node from the heterogeneous graph, wherein all first-order neighbor nodes on a meta-path are user nodes or content nodes, and a meta-path with all first-order neighbor nodes being user nodes is a first meta-path, and a meta-path with all first-order neighbor nodes being content nodes is a second meta-path, wherein the at least one sample node includes at least one hot user node, and each meta-path of the hot user node includes at least one first meta-path and at least one second meta-path; A training module, used for iteratively training the initial feature extraction model and the initial feature mapping function according to the attribute information of the nodes on each meta-path of each sample node, so as to obtain the target feature extraction model and the target feature mapping function; The total loss of the iterative training includes a first training loss of each hot user node, and the first training loss is used to characterize the difference between the target feature of the corresponding hot user node in each round of iteration and the mapping feature obtained by the initial feature mapping function according to the basic feature mapping of the corresponding hot user node in each round of iteration; The target feature is a node feature or an active feature; the initial feature extraction model is used to input the attribute information of the nodes on each meta-path of the sample node, and output the node feature of the sample node; if the meta-paths of the sample node include at least one first meta-path, the node feature includes the basic feature obtained according to the attribute information of the nodes on each first meta-path; if the meta-paths of the sample node include at least one second meta-path, the node feature includes the active feature obtained according to the attribute information of the nodes on each second meta-path.

13. A content recommendation device, characterized in that: include: A heterogeneous graph construction module, used to construct a heterogeneous graph and obtain attribute information of each node in the heterogeneous graph, wherein the heterogeneous graph includes a plurality of nodes and two nodes having an associated relationship have an edge between them, wherein the plurality of nodes include a plurality of user nodes representing users and a plurality of content nodes representing candidate recommended content; and the plurality of user nodes include a target user node representing a target user; A meta-path screening module, used to determine at least one third meta-path with a target user node as a central node and at least one fourth meta-path with a content node of a candidate recommended content as a central node in the heterogeneous graph; A feature output module, used to input the attribute information of each third-dimensional path and the nodes on each third-dimensional path corresponding to the target user node into a target feature extraction model to obtain the node feature of the target user node, and input the attribute information of each fourth-dimensional path and the nodes on each fourth-dimensional path corresponding to each candidate recommended content into the target feature extraction model to obtain the node feature of each candidate recommended content; A similarity calculation module, configured to determine that all third-dimensional paths of the target user are first-dimensional paths if all nodes connected to the target user node are content nodes, map the node features of the target user node through a target mapping function to obtain mapping features, and for each candidate recommended content, obtain the similarity between the target user and the candidate recommended content according to the mapping features and the node features of the candidate recommended content; A recommendation module, used to determine target recommended content to be recommended to a target user from among the candidate recommended content according to the similarities corresponding to the candidate recommended content; Wherein, the target feature extraction model and the target mapping function are trained according to the model training method according to any one of claims 1-9.

14. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 11.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Content recommendation method and device, equipment, medium and program product

    CN117216362A

  • Information recommendation method and device, electronic equipment and storage medium

    CN118364164A