Content recommendation method, device, equipment, storage medium and program product
By constructing a content heterogeneous graph and integrating features extracted from homogeneous meta-paths and heterogeneous meta-paths, the problem of low accuracy of content recommendation in the existing technology is solved and more accurate content recommendation is achieved.
Patent Information
- Application Number
- CN202210153239.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-18
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-02-18
AI Technical Summary
The prior art only uses the content attribute information in content recommendation, resulting in low accuracy of recommendations and inability to effectively recommend content that matches user interests.
By constructing a content heterogeneous graph, using homogeneous meta-paths and heterogeneous meta-paths to extract features of target content nodes, integrating basic content features and attribute features to generate target content features, thereby making content recommendations.
It improves the accuracy of content recommendation, can consider the correlation between content and content attribute information at the same time, and recommends content that better meets user needs.
Smart Images

Figure CN116662637B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence, and in particular to a content recommendation method, apparatus, device, storage medium, and program product. Background Art
[0002] Currently, when users watch some content such as videos and articles, there is a content recommendation function to recommend content that users may be interested in for them to watch or browse.
[0003] In the related art, when content recommendation is performed, the relevance between contents is determined based on the attribute information of the contents, and then video recommendation is performed based on the relevance between the contents. However, when content recommendation is performed based only on the attribute information of the contents, only similar contents with the same attributes can be recommended, resulting in low accuracy of content recommendation. Summary of the invention
[0004] The embodiments of the present application provide a content recommendation method, apparatus, device, storage medium and program product, which are helpful to improve the accuracy of content recommendation. The technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides a content recommendation method, the method comprising:
[0006] Acquire a content heterogeneous graph, wherein the content heterogeneous graph includes homogeneous meta-paths and heterogeneous meta-paths, wherein the homogeneous meta-paths are composed of content nodes corresponding to the content, and the heterogeneous meta-paths are composed of the content nodes and attribute nodes corresponding to the content attributes;
[0007] Extracting features of a target content node based on the homogeneous meta-path to obtain basic content features, the target content node belonging to the content node;
[0008] Extracting features of the target content node based on the heterogeneous meta-path to obtain content attribute features;
[0009] Performing feature fusion on the content basic features and the content attribute features to obtain target content features of the target content node;
[0010] Content recommendation is performed based on the target content features.
[0011] On the other hand, an embodiment of the present application provides a content recommendation device, the device comprising:
[0012] An acquisition module, used for acquiring a content heterogeneous graph, wherein the content heterogeneous graph includes homogeneous meta-paths and heterogeneous meta-paths, wherein the homogeneous meta-paths are composed of content nodes corresponding to the content, and the heterogeneous meta-paths are composed of the content nodes and attribute nodes corresponding to the content attributes;
[0013] A first extraction module is used to extract features of a target content node based on the homogeneous meta-path to obtain basic content features, and the target content node belongs to the content node;
[0014] A second extraction module is used to extract features of the target content node based on the heterogeneous element path to obtain content attribute features;
[0015] A feature fusion module, used to fuse the basic content features and the content attribute features to obtain target content features of the target content node;
[0016] The content recommendation module is used to recommend content based on the target content features.
[0017] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the content recommendation method as described in the above aspects.
[0018] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the computer-readable storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the content recommendation method as described in the above aspects.
[0019] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the content recommendation method provided in the above aspect.
[0020] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0021] In the embodiment of the present application, the homogeneous meta-paths and heterogeneous meta-paths in the content heterogeneous graph are used to extract features of the target content nodes corresponding to the target content, and the obtained features are fused to obtain the target content features that ultimately represent the target content. The method provided in the embodiment of the present application can fuse the association relationship between the contents and the attribute information of the contents to determine the target content features, so that the target content features fuse multiple information, and improve the accuracy of the target content features in representing the target content, so that when recommending content based on the target content features, the association relationship between the contents and the attribute information corresponding to the contents can be considered at the same time for recommendation, which helps to improve the accuracy of content recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A schematic diagram showing the principle of the content recommendation method provided by an embodiment of the present application is shown;
[0024] Figure 2 A schematic diagram showing an implementation environment provided by an exemplary embodiment of the present application is shown;
[0025] Figure 3 A flowchart of a content recommendation method provided by an exemplary embodiment of the present application is shown;
[0026] Figure 4 A flowchart of a content recommendation method provided by another exemplary embodiment of the present application is shown;
[0027] Figure 5 A schematic diagram of an implementation of a feature extraction process provided by an exemplary embodiment of the present application is shown;
[0028] Figure 6 A flowchart of a content recommendation method provided by another exemplary embodiment of the present application is shown;
[0029] Figure 7 A schematic diagram of an implementation of a comparative learning process provided by an exemplary embodiment of the present application is shown;
[0030] Figure 8 A schematic diagram showing a framework of a content recommendation process provided by an exemplary embodiment of the present application is shown;
[0031] Fig. 9 is a structural block diagram of a content recommendation device provided by an exemplary embodiment of the present application;
[0032] Fig.10 A schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] 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.
[0034] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0035] In the related art, when performing content recommendation, the recommendation is performed based on the attribute information of the content. For example, the content with the same label is determined to be related, so the content with the same label is recommended. However, when performing content recommendation based on this method, there are certain limitations, which may cause the recommended content to not meet the user's needs, that is, the content recommendation is inaccurate. Therefore, in the embodiment of the present application, when performing content recommendation, the association information between the content and the attribute information of the content are used together to perform content recommendation, thereby improving the accuracy of content recommendation.
[0036] like Figure 1 As shown, it shows a schematic diagram of the principle of content recommendation provided by an embodiment of the present application. When performing content recommendation, the target content node can be feature extracted according to the homogeneous meta-path and the heterogeneous meta-path in the content heterogeneous graph 101, respectively, to obtain the content basic feature 102 and the content attribute feature 103, and the content basic feature 102 and the content attribute feature 103 are feature fused to obtain the target content feature 104, so that content recommendation can be performed based on the target content feature 104.
[0037] In the embodiment of the present application, since the association relationship between the target content and other content and the attribute information of the target content are taken into consideration simultaneously when determining the target content features of the target content, the accuracy of the target content features in representing the target content can be improved, thereby improving the accuracy of content recommendations when content recommendations are made based on the target content features.
[0038] The method provided in the embodiment of the present application can be applied to any content recommendation scenario. The application scenario of the content recommendation method provided in the embodiment of the present application is schematically described below.
[0039] 1. Applicable to video recommendation scenarios
[0040] When applied to the video recommendation scenario, the method provided in the embodiment of the present application can be applied to the background server of the video playback platform. The background server can extract features from the video based on the homogeneous element path in the video heterogeneous graph to obtain basic video features, and extract features from the video based on the heterogeneous element path to obtain video attribute features, and perform feature fusion of the basic video features with the video attribute features to obtain video features, thereby determining similar videos based on the video features of each video and performing video recommendation.
[0041] 2. Applicable to article recommendation scenarios
[0042] When applied to the article recommendation scenario, the method provided in the embodiment of the present application can be applied to the background server of the article browsing platform. The background server can extract features of the article based on the homogeneous meta-path in the article heterogeneous graph to obtain the basic features of the article, and extract features of the article based on the heterogeneous meta-path to obtain the article attribute features, and fuse the basic features of the article with the article attribute features to obtain the article features, thereby determining similar articles based on the article features of each article and performing article recommendation.
[0043] The above is only a schematic description of the application scenario as an example. The method provided in the embodiment of the present application can also be applied to other scenarios where content recommendation is required. The embodiment of the present application does not limit the actual application scenario.
[0044] Figure 2 A schematic diagram of an implementation environment provided by an exemplary embodiment of the present application is shown. The implementation environment includes a terminal 210 and a server 220. The terminal 210 and the server 220 perform data communication via a communication network. Optionally, the communication network may be a wired network or a wireless network, and the communication network may be at least one of a local area network, a metropolitan area network, and a wide area network.
[0045] The terminal 210 is an electronic device that provides a content recommendation function. The electronic device can be a mobile terminal such as a smart phone, a tablet computer, a laptop computer, or a desktop computer, a projection computer, a smart TV, a smart car terminal, etc., which is not limited in the present embodiment.
[0046] The server 220 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. In the embodiment of the present application, the server 220 is a background server that provides a content recommendation function client in the terminal 210. It can construct a content heterogeneous graph based on the association relationship between the contents and the attribute information of the contents, and extract features of each content based on the content heterogeneous graph to obtain the content features of each content, thereby recommending content based on the content features. In a possible implementation, when a user views the target content, the server 220 can obtain the target content at the terminal 210, thereby determining the recommended content corresponding to the target content, and sending the recommended content to the terminal 210 for display of the recommended content.
[0047] For the convenience of description, the following embodiments are described by taking the content recommendation method executed by a computer device as an example. The computer device may be Figure 2 The terminal or server shown. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0048] Please refer to Figure 3 , which shows a flow chart of a content recommendation method provided by an exemplary embodiment of the present application. This embodiment is described by taking the method used in a computer device as an example, and the method includes the following steps.
[0049] Step 301, obtaining a content heterogeneous graph, the content heterogeneous graph includes homogeneous meta-paths and heterogeneous meta-paths, the homogeneous meta-paths are composed of content nodes corresponding to the content, and the heterogeneous meta-paths are composed of content nodes and attribute nodes corresponding to content attributes.
[0050] Optionally, the graph is composed of a set of nodes (node) and edges (edge) connecting the nodes. A heterogeneous graph refers to a graph containing multiple types of nodes or multiple types of edges. A content heterogeneous graph is composed of content nodes corresponding to the content, attribute nodes of the content attributes, and edges connecting the nodes. Among them, different edges can be used to indicate different relationships between nodes. For example, when the content is video content, the content heterogeneous graph may contain video nodes corresponding to the video, and attribute nodes corresponding to the video attributes, such as label nodes corresponding to video labels, actor nodes corresponding to actors in the video, and director nodes corresponding to the video director.
[0051] In the embodiment of the present application, the content heterogeneous graph is a heterogeneous graph composed of homogeneous meta-paths and heterogeneous meta-paths. Wherein, a meta-path refers to a specific path pattern connecting two entities. A homogeneous meta-path refers to a meta-path composed of nodes of the same type. Taking video as an example, it is "video-video-video (III)", and the corresponding contents of the nodes connected in the homogeneous meta-path have an association relationship, and the association relationship is the same. For example, the association relationship may be that the video is watched by the same user, collected by the same user, liked or commented by the same user, etc. A heterogeneous meta-path refers to a meta-path composed of different types of nodes, including content nodes and attribute nodes. For example, "video-actor-video (IAI)". In the content heterogeneous graph, different types of heterogeneous meta-paths may be included to represent the relationship between content and different attributes. For example, multiple heterogeneous meta-paths such as "video-actor-video", "video-director-video (IDI)" and "video-label-video (ITI)" may be included.
[0052] Step 302: extract features of the target content node based on the homogeneous meta-path to obtain basic content features. The target content node belongs to the content node.
[0053] The target content node is one of the content nodes in the content heterogeneous graph.
[0054] In one possible implementation, since there is an association relationship between content nodes in a homogeneous meta-path, feature extraction of the target content node can be performed based on the homogeneous meta-path related to the target content node in the content heterogeneous graph to obtain basic content features, thereby learning the common features between the target content corresponding to the target content node and the content with which it has an association relationship.
[0055] Optionally, the basic feature of the content is a vector representation of the content in a low-dimensional space, which is an implicit representation and is expressed as a multi-dimensional vector.
[0056] Step 303: extract features of the target content node based on the heterogeneous meta-path to obtain content attribute features.
[0057] At the same time, based on the heterogeneous meta-paths related to the target content nodes, feature extraction is performed on the target content nodes. Since the heterogeneous meta-paths can indicate the attributes of the content, feature extraction of the target content nodes based on the heterogeneous meta-paths can learn the attribute characteristics of the target content.
[0058] Correspondingly, the content attribute feature is also a vector representation of the content in a low-dimensional space.
[0059] Moreover, in the content heterogeneous graph, different types of heterogeneous meta-paths are included. Correspondingly, the heterogeneous meta-paths related to the target content nodes also include different types. Therefore, when feature extraction is performed on the target content nodes based on the heterogeneous meta-paths, feature extraction is performed on the target content nodes based on different types of heterogeneous meta-paths respectively to obtain different content attribute features corresponding to different types of heterogeneous meta-paths.
[0060] For example, based on "video-actor-video", feature extraction is performed on the target video node corresponding to the target video to obtain the video actor attribute feature; based on "video-director-video", feature extraction is performed on the target video node to obtain the video director attribute feature; based on "video-label-video", feature extraction is performed on the target video node to obtain the video label attribute feature.
[0061] Step 304: perform feature fusion on the content basic features and the content attribute features to obtain target content features of the target content node.
[0062] In the embodiment of the present application, feature extraction is performed on the target content node based on the homogeneous meta-path and the heterogeneous meta-path, respectively, to obtain the content basic features and content attribute features of the target content in different dimensions, and the features obtained in different dimensions are feature fused to obtain the target content features of the final target content node, thereby using the target content features to represent the target content. Since the features learned based on the homogeneous meta-path and the heterogeneous meta-path are fused, the accuracy of the target content features in representing the target content is stronger, and since the feature learning of the target content is performed based on the correlation relationship between the contents and the attributes of the contents, the target content features can be made similar to the feature representations of the contents that have a strong correlation with the target content and the contents that have the same attributes, so that when content recommendation is performed based on the target content features, content that is more similar to the target content can be recommended.
[0063] Optionally, when performing feature fusion on content basic features and content attribute features, the features may be averaged or an attention mechanism may be used for feature fusion.
[0064] Step 305: Recommend content based on target content features.
[0065] After obtaining the target content features, the computer device may recommend related content based on the target content features.
[0066] In summary, in the embodiment of the present application, the homogeneous meta-paths and heterogeneous meta-paths in the content heterogeneous graph are used to extract features of the target content nodes corresponding to the target content, and the obtained features are fused to obtain the target content features that ultimately represent the target content. The method provided in the embodiment of the present application can fuse the association relationship between the contents and the attribute information of the contents to determine the target content features, so that the target content features fuse multiple information, and improve the accuracy of the target content features in representing the target content, so that when recommending content based on the target content features, the association relationship between the contents and the attribute information corresponding to the contents can be considered at the same time for recommendation, which helps to improve the accuracy of content recommendation.
[0067] Please refer to Figure 4 , which shows a flow chart of a content recommendation method provided by another exemplary embodiment of the present application. This embodiment is described by taking the method used in a computer device as an example, and the method includes the following steps.
[0068] Step 401: construct a homogeneous meta-path based on the association information between each content.
[0069] In a possible implementation, the computer device first constructs a content heterogeneity graph based on the acquired information, thereby extracting content features of the content of each node based on the content heterogeneity graph.
[0070] Optionally, the content may be any content that can be recommended, such as video content, article content (books, papers, journals, etc.), commodities, etc.
[0071] Optionally, the computer device constructs a homogeneous meta-path based on the association information between the contents. The association information is determined based on the user consumption behavior, such as the viewing, commenting, and collection of the contents. When the contents are viewed, commented, or collected by the same user, it is determined that there is an association relationship between the two contents. In this embodiment, when constructing a homogeneous meta-path based on the association information, the association information corresponding to the connected content nodes in the homogeneous meta-path is the same. For example, the contents corresponding to the connected content nodes in the homogeneous meta-path are contents that have been viewed by the same user.
[0072] And when obtaining related information, there may be cases where the information is invalid information. Therefore, the obtained information can be filtered to obtain valid related information. For example, when the related information is determined based on the user's viewing information, and the user may only watch the content for a short time, at this time, it cannot be considered that the user has watched the content, and it is determined to be invalid information. Therefore, when determining related information based on viewing information, invalid viewing is first filtered. When filtering, the filtering threshold can be pre-set. Different filtering thresholds can be set for different content. For example, when the content is a video, the filtering threshold can be a threshold corresponding to the viewing time ratio, for example, it can be 20%. When the ratio of viewing time to video time is greater than or equal to 20%, it is determined to be valid viewing information. When the content is an article, the filtering threshold can be a threshold corresponding to the viewing time, for example, 1 minute. When the viewing time is greater than 1 minute, it is determined to be valid viewing information.
[0073] Optionally, when constructing a homogeneous meta-path based on the association information between contents, the association between the contents needs to be determined according to the association information. When the association is strong, a path can be constructed between corresponding content nodes. This method may include the following steps 401a-401c (not shown in the figure):
[0074] Step 401a, based on the co-occurrence times between the contents, the mutual transfer probability between the contents is determined. The co-occurrence times are used to indicate the number of times the contents have the same associated information, and the mutual transfer probability is used to indicate the association between the contents.
[0075] The computer device determines the number of co-occurrences between the respective contents based on the acquired associated information. The number of co-occurrences indicates the number of times the contents have the same associated information. For example, if the contents are videos and the associated information is information viewed by the same user, the number of co-occurrences is the number of times the two contents have been viewed by the same user. After determining the number of co-occurrences between the contents, the mutual transfer probability between the respective contents can be determined based on the number of co-occurrences between the respective contents.
[0076] Take the determination of the mutual transfer probability between the first content and the second content as an example, wherein the transfer probability between the first content and the second content may be the ratio of the number of co-occurrences between the first content and the second content to the sum of the number of co-occurrences between the first content and the other content. If the correlation between the first content and the second content is determined based only on the transfer probability, there may be a deviation between the determined correlation and the actual correlation. In combination with the above example, when the first content is a popular video, the second content is a non-popular video, and the correlation between the first content and the second content is determined based on the transfer probability, since the first content is a popular video, the probability that it and other videos are viewed by the same user is relatively large, and the transfer probability is relatively large, and the correlation between the first content and the second content may be low, resulting in an inaccurate correlation determination. Therefore, in this embodiment, the correlation between the contents is determined by the mutual transfer probability between the first content and the second content. Among them, the mutual transfer probability between the contents is the product of the mutual transfer probabilities between the contents, that is, the product of the transfer probability between the first content and the second content and the transfer probability between the second content and the first content.
[0077] Step 401b, based on the mutual transfer probability between contents, co-occurring contents are determined, and the mutual transfer probability between co-occurring contents is higher than the mutual transfer probability between other contents.
[0078] After obtaining the mutual transfer probability between each content, the co-occurring content can be determined based on the mutual transfer probability. The mutual transfer probability and the correlation between the content are positively correlated. When the mutual transfer probability is higher, the correlation between the content is higher, and it can be determined as co-occurring content. It should be noted that the co-occurring content can be multiple pairs of content with higher corresponding mutual transfer probabilities. For example, for video A, the mutual transfer probability between it and other videos is sorted from high to low, and the top videos and video A are determined as co-occurring videos.
[0079] Step 401c, constructing homogeneous meta-paths based on co-occurring content.
[0080] After the co-occurring content is determined, a path can be constructed between the content nodes corresponding to the co-occurring content, thereby obtaining multiple homogeneous meta-paths and completing the construction of homogeneous meta-paths. For example, if video A and video B are co-occurring content, and video B and video C are co-occurring content, a homogeneous meta-path (I A -I B -I C ).
[0081] Step 402, based on the attribute information of each content, a heterogeneous meta-path is constructed, and the content nodes corresponding to the content in the same heterogeneous meta-path have the same attributes.
[0082] Accordingly, the computer device constructs a heterogeneous meta-path based on the attribute information of the content. In the same heterogeneous meta-path, the content nodes have the same attributes. For example, in the case of video content, when the heterogeneous meta-path is IDI, the two videos I in the path are directed by the same director.
[0083] In a possible implementation, when the contents are different, heterogeneous meta-paths may be constructed based on attribute information corresponding to the contents.
[0084] Optionally, when the content is video content, the content attributes include at least one of video tag, video starring actor, and video director; optionally, when the content is article content, the content attributes include at least one of article tag, article author, and article source; optionally, when the content is a product, the content attributes include at least one of product tag, product merchant, and product price.
[0085] The computer device constructs multiple homogeneous meta-paths and heterogeneous meta-paths through the acquired information to obtain a content heterogeneous graph, thereby representing the association relationship between contents and the subordinate relationship between contents and attributes.
[0086] It should be noted that this step and step 401 may be executed sequentially or simultaneously. This embodiment only illustrates the implementation method and does not limit the execution sequence.
[0087] Step 403: Obtain a content heterogeneity graph.
[0088] When extracting content features corresponding to content nodes, a pre-constructed content heterogeneous graph can be obtained, so as to extract features of content nodes based on multiple homogeneous meta-paths and multiple heterogeneous meta-paths in the content heterogeneous graph to obtain content node features corresponding to each node.
[0089] Step 404 , performing graph convolution on the target content nodes according to the homogeneous meta-path to obtain basic content features.
[0090] In the embodiment of the present application, the process of feature extraction is the process of graph convolution. The graph convolution is performed by the convolution layer in the graph neural network. The process of graph convolution is the process of aggregating the target node features corresponding to the target content node and the neighbor node features of its neighbor nodes. The node features of each node are preprocessed features, which are used to represent the corresponding nodes. For example, the node features of the content node may be some features of the node. Taking the video as an example, it may be the video subject, video length, etc.; and the node features of the attribute node may be some features of the attribute. The preprocessing process includes feature cleaning, feature encoding, and feature normalization. Feature cleaning is used to filter abnormal features, and feature encoding is the process of encoding the original features. It can be encoded according to the different properties of the features, and the encoded features can be normalized.
[0091] In the process of graph convolution, the process includes aggregating target node features and neighbor node features according to homogeneous meta-paths and aggregating target node features and neighbor node features according to heterogeneous meta-paths. In a possible implementation, the process of performing graph convolution on the target content node according to the homogeneous meta-path may include the following steps 404a-404b (not shown in the figure):
[0092] Step 404a: Based on the homogeneous meta-path, select at least one first-order neighbor content node corresponding to the target content node.
[0093] First, based on the homogeneous meta-paths in the content heterogeneous graph, with the target content node as the center, at least one first-order neighbor content node corresponding to the target content node is selected. Among them, the first-order neighbor content node of the target content node refers to the neighbor node directly connected to the target content node, and the second-order neighbor content node of the target content node refers to the neighbor node directly connected to the first-order neighbor node. By analogy, at least one first-order neighbor content node of the target content node can be selected.
[0094] Among them, the number of selected nodes can be preset for selecting neighbor nodes, for example, 10 neighbor nodes are selected for each selected node. Taking the selected at least first-order neighbor content node including first-order neighbor nodes and second-order neighbor nodes as an example, when the target content node is I0, according to the homogeneous element path, the selected first-order neighbor node is I1, and the second-order neighbor node is I2, that is, according to multiple homogeneous element paths I0-I1-I2, wherein, when selecting, 10 first-order neighbor nodes I1 of I0 are selected, and then based on each content node I1, 10 neighbor nodes I2 are selected, that is, 100 second-order neighbor nodes I2 of I0 are obtained.
[0095] Step 404b: perform feature aggregation on the neighbor node features of at least the first-order neighbor content node and the target node features of the target content node to obtain content basic features.
[0096] After selecting and obtaining at least one first-order neighbor content node, feature aggregation is performed on the neighbor node features of the at least one first-order neighbor content node and the target node features of the target content node to obtain content basic features of the target content.
[0097] Optionally, at least the first-order neighbor content node includes the first-order neighbor node and the second-order neighbor node of the target content node. Feature aggregation may include the following process:
[0098] Step 1: Perform feature aggregation on the node features of the first-order neighbor nodes and the node features of the second-order neighbor nodes to obtain neighbor aggregation features.
[0099] The computer device first performs feature aggregation on the node features of the second-order neighbor nodes and the node features of the first-order neighbor nodes. During the aggregation process, the node features of the second-order neighbor nodes are firstly fused to obtain the fused features of the second-order neighbor nodes, and the node features of the first-order neighbor nodes are feature fused to obtain the fused features of the first-order neighbor nodes. The fused features of the first-order neighbor nodes are then feature aggregated with the fused features of the second-order neighbor nodes to obtain the neighbor aggregation features.
[0100] like Figure 5 As shown, in the first layer 501 of the graph convolutional layer, the features of the second-order neighbor node I2 are aggregated to the first-order neighbor node I1 to obtain the neighbor aggregation features.
[0101] Step 2: Aggregate neighbor aggregation features and target node features to obtain content-based features.
[0102] After the neighbor aggregation features are obtained through aggregation, the neighbor aggregation features are then aggregated with the target node features to obtain the content basic features.
[0103] like Figure 5 As shown, in the second layer 502 of the graph convolution, the neighbor aggregation features and the target node features are aggregated to obtain the content basic features of I0.
[0104] Step 405 , perform graph convolution on the target content node according to the heterogeneous element path to obtain content attribute features.
[0105] The computer device simultaneously performs graph convolution on the target content node according to the heterogeneous meta-path. Among them, when performing graph convolution according to the heterogeneous meta-path, the process is the same as that of performing graph convolution according to the homogeneous meta-path. First, at least one first-order neighbor node of the target content node is selected based on the heterogeneous meta-path. It should be noted that at least one first-order neighbor node includes attribute nodes and content nodes. Taking the heterogeneous meta-path ITI as an example, when selecting according to the heterogeneous meta-path I0-T0-I1, first select the first-order neighbor node T0 of I0, and then select the neighbor node I1 based on each node T0 to obtain the second-order neighbor node I1 of I0.
[0106] like Figure 5 As shown, in the first layer 503 of the graph convolution layer, the features of the second-order neighbor node I1 are aggregated to the first-order neighbor node T0 to obtain the neighbor aggregation features. In the second layer 504 of the graph convolution layer, the neighbor aggregation features are aggregated with the node features of the target content node I0 to obtain the content attribute features.
[0107] Step 406: mask the content attribute features. The mask process is used to hide part of the content attribute features.
[0108] After obtaining the basic content features and content attribute features, the features are fused to obtain the target content features corresponding to the target content nodes extracted based on multiple dimensions. Schematically, the basic content features are obtained by performing graph convolution based on homogeneous meta-paths. Based on the heterogeneous meta-paths ITI, IAI, and IDI, graph convolution is performed to obtain the corresponding content attribute features. as well as Thus as well as Perform feature fusion and normalize the fusion to obtain the target video features of the target video (embedding).
[0109] Since some feature information corresponding to the content may be missing, such as the author information or tag information of the video, in a possible implementation, the content attribute features are masked before feature fusion, so as to hide some content attribute features with a certain probability.
[0110] The mask processing process is to multiply the mask matrix by the feature matrix corresponding to the content attribute feature to obtain the content attribute feature after mask processing.
[0111] Step 407 , feature fusion is performed on the basic content features and the content attribute features after mask processing to obtain target content features.
[0112] Since mask processing will hide some content attribute features, the basic content features are fused with the remaining unhidden content attribute features to reduce the impact of missing feature information on the extraction of target content features, which helps to improve the robustness of the model.
[0113] Step 408: Based on the target content feature, similar content features are determined in the content feature index, where the content feature index contains content features corresponding to each content.
[0114] Optionally, after determining the content features corresponding to each content, a content feature index can be established based on the content features, wherein the content feature index can be established based on the vector indexing engines Annoy and Faiss. Before establishing the content feature index, the content integrity or content characteristics of each content can be preliminarily screened to obtain candidate content, and then the content feature index can be established based on the content features (embedding) corresponding to each content in the candidate content. Schematically, when establishing a video index, the video can first be screened based on the video integrity, video playback source, and the category to which the video belongs within the preset category, for example, including (film, television, variety show, animation, children) and other factors to obtain candidate videos, and then a video feature index can be established based on the embedding of each video in the candidate video.
[0115] After establishing the content feature index, similar content of each content can be determined based on the content feature index. When determining similar content of the target content, similar content features can be determined in the content feature index based on the target content features. In a possible implementation, the feature distance between the target content features and the content features of each candidate content can be calculated to determine feature similarity, and the candidate content features can be ranked based on the feature similarity, and the features ranked first can be determined as similar content features. For example, the first five content features ranked first can be determined as similar content features.
[0116] Step 409: Recommend content based on similar content features.
[0117] After determining similar content features of the target content features, the content corresponding to the similar content features may be determined as content having a strong correlation with the target content, and when recommending similar content to the target content, the content corresponding to the similar content features may be recommended.
[0118] In this embodiment, the computer device performs graph convolution on the target content nodes based on the constructed homogeneous meta-paths and heterogeneous meta-paths, so that the final target content features are integrated with prior knowledge, i.e., content attribute information, and a posteriori knowledge, i.e., association information between contents, thereby improving the accuracy of target content feature extraction.
[0119] Furthermore, in this embodiment, when constructing homogeneous meta-paths, extraction is performed based on the mutual transfer probability between contents, thereby ensuring that there is a strong correlation between the connected contents in the homogeneous meta-paths, thereby helping to improve the accuracy of feature extraction.
[0120] In a possible implementation, the graph convolution process is performed by a convolution layer of a graph neural network. A graph neural network is a network trained based on sample content, and the training process of the graph neural network is schematically illustrated below.
[0121] Please refer to Figure 6, which shows a flowchart of a graph neural network training process provided by an exemplary embodiment of the present application. This embodiment is described by taking the method used in a computer device as an example, and the method includes the following steps.
[0122] Step 601, perform graph convolution on sample content nodes according to homogeneous meta-paths to obtain basic features of predicted content.
[0123] Optionally, the graph algorithm adopted by the graph neural network may be GraphSAGE, Graph Attention Network (GAT), DisenGCN, etc., which is not limited in this embodiment. Optionally, some content nodes in the content heterogeneous graph may be determined as sample content nodes. Graph convolution is performed on the sample content nodes according to homogeneous meta-paths to obtain the basic features of the predicted content, wherein the process of performing graph convolution on the sample content nodes according to the homogeneous meta-path can refer to the process of performing graph convolution on the target content nodes according to the homogeneous meta-path in the above step 404, which will not be repeated in this embodiment.
[0124] Step 602, perform graph convolution on the sample content nodes according to the heterogeneous element paths to obtain predicted content attribute features.
[0125] Similarly, graph convolution is performed on the sample content nodes according to each heterogeneous element path to obtain different predicted content attribute features. The process of performing graph convolution on the sample content nodes according to the heterogeneous element path can refer to the process of performing graph convolution on the target content nodes according to the heterogeneous element path in the above step 405, and will not be repeated in this embodiment.
[0126] Step 603: Fusing the predicted content basic features and the predicted content attribute features to obtain predicted content features.
[0127] The predicted content basic features and each predicted content attribute feature are fused to obtain the predicted content features corresponding to the sample content node.
[0128] Step 604: Update and train the graph neural network based on the predicted content basic features, predicted content attribute features, and predicted content features of each sample content node.
[0129] Through the above method, the predicted content basic features, predicted content attribute features and predicted content features after feature fusion corresponding to each sample content node can be obtained, so as to update and train the graph neural network based on each feature of each sample content node, wherein the training process may include the following steps 604a-604c (not shown in the figure):
[0130] Step 604a, determining the correlation loss based on the predicted content features of the positive sample content node pair and the negative sample content node pair, wherein the positive sample content node pair includes content nodes corresponding to two sample contents that have an associated relationship or have the same attributes, and the negative sample content node pair includes content nodes corresponding to two sample contents that have no associated relationship and do not have the same attributes.
[0131] First, based on the predicted content features of the sample content nodes, the correlation loss is determined, where the correlation is the correlation between the corresponding contents of two nodes in a node pair, which can be determined based on the predicted content features of the two nodes. The correlation between positive sample content node pairs is higher, which is positively correlated with the accuracy of the extracted content features, that is, the higher the correlation between positive sample content node pairs determined based on the predicted content features, the more accurate the corresponding predicted content features. The correlation between negative sample content nodes obtained based on the predicted content features is negatively correlated with the accuracy of the extracted content features. Therefore, the correlation between nodes in the positive sample content node pairs and the correlation between nodes in the negative sample content nodes can be used to determine the correlation loss, thereby updating the network parameters of the graph neural network.
[0132] Before determining the correlation loss, it is necessary to first determine the positive sample content node pairs and the negative sample content node pairs. The process may include the following steps:
[0133] Step 1: Determine two sample content nodes connected in the content heterogeneous graph as a positive sample content node pair.
[0134] First, sampling can be performed based on a content heterogeneous graph. In the content heterogeneous graph, there is an association relationship between two connected nodes, that is, the correlation between the corresponding contents of the two nodes is high. Therefore, the two connected sample content nodes in the content heterogeneous graph can be determined as a positive sample content node pair. Schematically, when sample content nodes I0 and I1 are connected in the content heterogeneous graph, I0 and I1 can be determined as a positive sample content node pair.
[0135] Step 2: Replace a single node in the positive sample content node pair with other content nodes to obtain a negative sample content node pair. The other content nodes are not connected to the unreplaced nodes in the positive sample content node pair in the content heterogeneous graph.
[0136] After determining the positive sample content node pair, a single node in the positive sample content node pair can be replaced by a content node that is not connected to the non-replaced content node in the positive sample content node pair, thereby obtaining a negative sample content node pair. For example, I1 in the positive sample content node pair I0 and I1 is replaced by I3, and I3 and I0 are not connected in the content heterogeneous graph, thereby obtaining a negative sample content node pair I0 and I3.
[0137] After determining the positive sample content node pairs and the negative sample content node pairs, the correlation loss may be determined based on the predicted content features of the nodes in each node pair, which may include the following steps:
[0138] Step 1: Calculate the positive correlation value between the predicted content features corresponding to the positive sample content node pairs.
[0139] Among them, the positive correlation value indicates the correlation between the corresponding predicted content features of the sample content nodes in the positive sample content node pair. The method is as follows:
[0140]
[0141] in, is the predicted content feature of i, is the predicted content feature of i′, where i and i′ represent two different sample content nodes in the positive sample content node pair.
[0142] Step 2: Calculate the negative correlation value between the predicted content features corresponding to the negative sample content node pairs.
[0143] The negative correlation value indicates the correlation between the corresponding predicted content features of the sample content nodes in the negative sample content node pair. The calculation method can be as shown in the above step 1.
[0144] Step 3: Determine the correlation loss based on the positive correlation value and the negative correlation value.
[0145] Among them, the method of determining the correlation loss can be as follows:
[0146]
[0147] Where k is the total number of samples, That is, it represents the negative correlation value corresponding to the nth negative sample content node pair.
[0148] Step 604b, determining the contrast loss based on the first content feature pair and the second content feature pair, wherein the first content feature pair is a feature pair composed of different types of prediction features corresponding to the same sample content node, and the different types of prediction features are prediction content basic features or prediction content attribute features, and the second content feature pair is a feature pair composed of different types of prediction features corresponding to different sample content nodes.
[0149] In this embodiment, in order to further increase the learning effect of the graph neural network, contrast loss is introduced. Among them, the contrast loss is determined based on the difference between the features obtained by the meta-paths constructed from different perspectives. Among them, the first content feature pair refers to the feature pair extracted from the same sample content node from different perspectives. For example, the feature pair composed of the predicted content basic features obtained by graph convolution according to a homogeneous meta-path and the predicted content attribute features obtained by graph convolution according to a heterogeneous meta-path is the first content feature pair, or the feature pair composed of two predicted content attribute features obtained by graph convolution according to two different heterogeneous meta-paths is also the first content feature pair. The second content feature pair is the feature pair extracted from different sample content nodes from different perspectives. For example, the feature pair composed of the predicted content basic features of sample content node one and the predicted content attribute features of sample content node two is the second content feature pair.
[0150] The contrast loss may be determined based on the correlation between features in the first content feature pair and the correlation between features in the second content feature pair. The process of determining the contrast loss may include the following steps:
[0151] Step 1: Calculate a first correlation value between first content feature pairs.
[0152] The first correlation value is used to indicate the correlation between the features of the first content feature pair. The calculation method is as follows:
[0153]
[0154] Where n represents the nth sample node, i and j represent different perspectives (different meta-paths), and h ni It refers to the embedding of sample node n from the perspective of i, that is, the predicted content basic features or predicted content attribute features obtained by graph convolution based on meta-path i, h nj That is, it refers to the embedding of sample node n from the perspective of j.
[0155] Step 2: Calculate the second correlation value between the second content feature pairs.
[0156] The second correlation value is used to indicate the correlation between the features of the second content feature pair. The calculation method is as follows:
[0157]
[0158] Here, n′ is a sample content node different from n.
[0159] Step three: based on each first correlation value and each second correlation value, determine the contrast loss, different first correlation values correspond to different first content feature pairs, and different second correlation values correspond to different second content feature pairs.
[0160] After obtaining the first correlation value of the first content feature pair and the second correlation value of the second content feature pair under the two viewing angles, the contrast loss under the two viewing angles may be determined as follows:
[0161]
[0162] Among them, l cl That is, it is the contrast loss of sample node n between viewing angles i and j, τ is the temperature coefficient, which is an adjustable constant, and N is the total number of sample nodes.
[0163] Since it may contain features extracted from multiple perspectives, the contrast loss of sample node n between two perspectives can be determined based on the above method, and the contrast losses of each sample node n can be summed to obtain the total contrast loss of the final sample node n. Since it contains N samples, the total contrast losses corresponding to each of the N samples can be summed to obtain the total contrast learning loss within a batch.
[0164] Indicative, such as Figure 7 As shown, for the features of the sample content node i1 obtained by performing graph convolution based on each meta-path and the features of the sample content node i2 obtained by performing graph convolution based on each meta-path, corresponding contrast losses are determined between each other.
[0165] Step 604c: Update the graph neural network training based on the correlation loss and the contrast loss.
[0166] After determining the correlation loss and contrast loss, the gradient descent method can be used to update the network parameters of the graph neural network until the correlation loss and contrast loss converge, thereby obtaining a trained graph neural network. In a possible implementation, taking video recommendation as an example, the graph representation learning framework in the recommendation process is as follows: Figure 8As shown, it includes a heterogeneous information acquisition module 801, a data preprocessing module 802, a graph representation learning module 803 and an evaluation and use module 804. The heterogeneous information acquisition module 801 includes the acquisition of node information, including videos, tags, directors and actors, etc., and the acquisition of relationships between nodes, including co-occurrence relationships and attribute relationships, wherein the co-occurrence relationship is used to construct a homogeneous meta-path, and the attribute relationship is used to construct a heterogeneous meta-path. After that, data preprocessing is performed, including data cleaning, feature processing and the construction process of a heterogeneous graph. After preprocessing, graph representation learning can be performed, wherein the graph representation learning module 803 includes a graph framework and a graph algorithm, wherein the graph framework refers to a graph neural network framework, a tool and platform for integrating and implementing graph algorithms, such as DGL (Deep Graph Library), Plato, etc., and a graph neural network can be constructed based on the graph framework and the graph algorithm, so as to use the graph neural network for graph convolution to obtain content video, and use various video features to determine the loss, so as to update and train the graph neural network, and finally use the graph neural network to extract the video features of each video. After obtaining the video features of each video, the evaluation and use module 804 may construct an index based on the features of each video, and determine a recommended video corresponding to each video based on the index.
[0167] In this embodiment, the graph neural network is updated and trained through correlation loss and contrast loss, that is, self-supervised learning and contrastive learning are used to suppress the embedding of noise information and enhance the learning effect of the graph neural network, thereby improving the accuracy of the graph neural network in extracting features corresponding to the target content.
[0168] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the user consumption behaviors involved in this application are all obtained with full authorization.
[0169] Fig. 9 : is a structural block diagram of a content recommendation device provided by an exemplary embodiment of the present application. As shown in the figure, the device includes:
[0170] The acquisition module 901 is used to acquire a content heterogeneous graph, wherein the content heterogeneous graph includes homogeneous meta-paths and heterogeneous meta-paths. The homogeneous meta-paths are composed of content nodes corresponding to the content, and the heterogeneous meta-paths are composed of the content nodes and attribute nodes corresponding to the content attributes.
[0171] The first extraction module 902 is used to extract features of a target content node based on the homogeneous meta-path to obtain basic content features, and the target content node belongs to the content node.
[0172] The second extraction module 903 is used to extract features of the target content node based on the heterogeneous element path to obtain content attribute features.
[0173] The first fusion module 904 is used to fuse the basic content features and the content attribute features to obtain the target content features of the target content node.
[0174] The content recommendation module 905 is used to recommend content based on the target content features.
[0175] Optionally, the first extraction module 902 is further used to:
[0176] Performing graph convolution on the target content node according to the homogeneous meta-path to obtain the basic content feature;
[0177] The second extraction module 903 is further used for:
[0178] Perform graph convolution on the target content node according to the heterogeneous element path to obtain the content attribute feature.
[0179] Optionally, the first extraction module 902 includes:
[0180] A node selection unit, configured to select at least one first-order neighbor content node corresponding to the target content node based on the homogeneous meta-path;
[0181] The feature aggregation unit is used to perform feature aggregation on the neighbor node features of the at least first-order neighbor content node and the target node features of the target content node to obtain the content basic features.
[0182] Optionally, the at least one first-order neighbor content node includes a first-order neighbor node and a second-order neighbor node of the target content node;
[0183] The feature aggregation unit is further used for:
[0184] Performing feature aggregation on the node features of the first-order neighbor nodes and the node features of the second-order neighbor nodes to obtain neighbor aggregation features;
[0185] The neighbor aggregation feature and the target node feature are aggregated to obtain the content basic feature.
[0186] Optionally, the graph convolution process is performed by a convolution layer in a graph neural network, and the device further includes:
[0187] A first convolution module, configured to perform graph convolution on sample content nodes according to the homogeneous meta-path to obtain basic features of predicted content;
[0188] A second convolution module, configured to perform graph convolution on the sample content nodes according to the heterogeneous element paths to obtain predicted content attribute features;
[0189] A second fusion module is used to fuse the predicted content basic features with the predicted content attribute features to obtain predicted content features;
[0190] A training module is used to update and train the graph neural network based on the predicted content basic features, the predicted content attribute features and the predicted content features of each sample content node.
[0191] Optionally, the training module includes:
[0192] A first determining unit is configured to determine the correlation loss based on the predicted content features of a positive sample content node pair and a negative sample content node pair, wherein the positive sample content node pair includes content nodes corresponding to two sample contents that have an associated relationship or have the same attributes, and the negative sample content node pair includes content nodes corresponding to two sample contents that have no associated relationship and do not have the same attributes;
[0193] A second determining unit is configured to determine the contrast loss based on a first content feature pair and a second content feature pair, wherein the first content feature pair is a feature pair consisting of different types of prediction features corresponding to the same sample content node, the different types of prediction features being the prediction content basic features or the prediction content attribute features, and the second content feature pair is a feature pair consisting of different types of prediction features corresponding to different sample content nodes;
[0194] A training unit is used to update and train the graph neural network based on the correlation loss and the contrast loss.
[0195] Optionally, the first determining unit is further configured to:
[0196] Calculating positive correlation values between predicted content features corresponding to the positive sample content node pairs;
[0197] Calculating negative correlation values between predicted content features corresponding to the negative sample content node pairs;
[0198] The correlation loss is determined based on the positive correlation value and the negative correlation value.
[0199] Optionally, the device further comprises:
[0200] A node determination module, configured to determine two sample content nodes connected in the content heterogeneous graph as the positive sample content node pair;
[0201] The node replacement module is used to replace a single node in the positive sample content node pair with other content nodes to obtain the negative sample content node pair, wherein the other content node is not connected to the unreplaced node in the positive sample content node pair in the content heterogeneous graph.
[0202] Optionally, the second determining unit is further configured to:
[0203] calculating a first correlation value between the first content feature pairs;
[0204] calculating a second correlation value between the second content feature pairs;
[0205] The contrast loss is determined based on each of the first correlation values and each of the second correlation values, where different first correlation values correspond to different first content feature pairs, and different second correlation values correspond to different second content feature pairs.
[0206] Optionally, the content attribute feature includes at least one content attribute feature corresponding to a content attribute;
[0207] The first fusion module 904 includes:
[0208] A mask processing unit, used for performing mask processing on the content attribute feature, wherein the mask processing is used for hiding part of the content attribute feature;
[0209] The fusion unit is used to perform feature fusion on the basic content feature and the content attribute feature after mask processing to obtain the target content feature.
[0210] Optionally, the device further comprises:
[0211] A first construction module, configured to construct the homogeneous meta-path based on association information between various contents;
[0212] The second construction module is used to construct the heterogeneous meta-path based on the attribute information of each content, and the content nodes corresponding to the content in the same heterogeneous meta-path have the same attributes.
[0213] Optionally, the first building block includes:
[0214] A third determining unit, configured to determine a mutual transfer probability between the contents based on a co-occurrence number between the contents, wherein the co-occurrence number is used to indicate a number of times the contents have the same association information, and the mutual transfer probability is used to indicate the association between the contents;
[0215] A fourth determining unit, configured to determine co-occurring content based on the mutual transition probability between the content, wherein the mutual transition probability between the co-occurring content is higher than the mutual transition probability between other content;
[0216] A construction unit is used to construct the homogeneous meta-path based on the co-occurrence content.
[0217] Optionally, the content recommendation module 905 includes:
[0218] A fifth determining unit, configured to determine similar content features in a content feature index based on the target content feature, wherein the content feature index includes content features corresponding to each content;
[0219] The content recommendation unit is used to recommend content based on the similar content features.
[0220] Optionally, when the content is video content, the content attribute includes at least one of a video tag, a video starring actor, and a video director;
[0221] When the content is article content, the content attribute includes at least one of article tag, article author, and article source;
[0222] When the content is a product, the content attribute includes at least one of a product label, a product merchant, and a product price.
[0223] In the embodiment of the present application, the homogeneous meta-paths and heterogeneous meta-paths in the content heterogeneous graph are used to extract features of the target content nodes corresponding to the target content, and the obtained features are fused to obtain the target content features that ultimately represent the target content. The method provided in the embodiment of the present application can fuse the association relationship between the contents and the attribute information of the contents to determine the target content features, so that the target content features fuse multiple information, and improve the accuracy of the target content features in representing the target content, so that when recommending content based on the target content features, the association relationship between the contents and the attribute information corresponding to the contents can be considered at the same time for recommendation, which helps to improve the accuracy of content recommendation.
[0224] Please refer to Fig.10, which shows a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application. Specifically, the computer device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including a random access memory 1002 and a read-only memory 1003, and a system bus 1005 connecting the system memory 1004 and the central processing unit 1001. The computer device 1000 also includes a basic input / output system (I / O system) 1006 that helps transmit information between various devices in the computer, and a large-capacity storage device 1007 for storing an operating system 1013, an application program 1014 and other program modules 1015.
[0225] In some embodiments, the basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009 such as a mouse and a keyboard for user inputting information. The display 1008 and the input device 1009 are connected to the central processing unit 1001 through an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may also include an input / output controller 1010 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, a printer, or other types of output devices.
[0226] The mass storage device 1007 is connected to the central processing unit 1001 through a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer readable medium provide non-volatile storage for the computer device 1000. That is, the mass storage device 1007 may include a computer readable medium (not shown) such as a hard disk or drive.
[0227] Without loss of generality, the computer readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include random access memory (RAM), read-only memory (ROM), flash memory or other solid-state storage technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, cassette, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1004 and mass storage device 1007 can be collectively referred to as memory.
[0228] The memory stores one or more programs, and the one or more programs are configured to be executed by one or more central processing units 1001. The one or more programs contain instructions for implementing the above-mentioned methods. The central processing unit 1001 executes the one or more programs to implement the methods provided by the above-mentioned various method embodiments.
[0229] According to various embodiments of the present application, the computer device 1000 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1000 can be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 can be used to connect to other types of networks or remote computer systems (not shown).
[0230] The memory also includes one or more programs, which are stored in the memory and include steps executed by a computer device in the method provided in the embodiment of the present application.
[0231] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the content recommendation method described in any of the above embodiments.
[0232] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the content recommendation method provided by the above aspect.
[0233] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, which can be a computer-readable storage medium contained in the memory in the above embodiments; or a computer-readable storage medium that exists independently and is not installed in the terminal. The computer-readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the content recommendation method described in any of the above method embodiments.
[0234] Optionally, the computer readable storage medium may include: ROM, RAM, solid state drives (SSD) or optical disks, etc. Among them, RAM may include resistance random access memory (ReRAM) and dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0235] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0236] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A content recommendation method, characterized in that: The method comprises: Based on the number of co-occurrences between the contents, determining the mutual transfer probability between the contents, the co-occurrence number is used to indicate the number of times the contents have the same associated information, and the mutual transfer probability is used to indicate the relevance between the contents; based on the mutual transfer probability between the contents, determining the co-occurring contents, the mutual transfer probability between the co-occurring contents is higher than the mutual transfer probability between other contents; based on the co-occurring contents, constructing a homogeneous meta-path; Based on the attribute information of each content, a heterogeneous meta-path is constructed, and the corresponding contents of the content nodes in the same heterogeneous meta-path have the same attributes; Acquire a content heterogeneous graph, wherein the content heterogeneous graph includes the homogeneous meta-path and the heterogeneous meta-path, wherein the homogeneous meta-path is composed of content nodes corresponding to the content, and the heterogeneous meta-path is composed of the content nodes and attribute nodes corresponding to the content attributes; Extracting features of a target content node based on the homogeneous meta-path to obtain basic content features, the target content node belonging to the content node; Extracting features of the target content node based on the heterogeneous meta-path to obtain content attribute features, wherein the content attribute features include content attribute features corresponding to at least one content attribute; Performing mask processing on the content attribute feature, wherein the mask processing is used to hide part of the content attribute feature; performing feature fusion on the content basic feature and the content attribute feature after the mask processing to obtain the target content feature; Content recommendation is performed based on the target content features.
2. The method according to claim 1, characterized in that The extracting features of the target content node based on the homogeneous meta-path to obtain basic content features includes: Performing graph convolution on the target content node according to the homogeneous meta-path to obtain the basic content feature; The extracting features of the target content node based on the heterogeneous meta-path to obtain content attribute features includes: Perform graph convolution on the target content node according to the heterogeneous element path to obtain the content attribute feature.
3. The method according to claim 2, characterized in that The performing graph convolution on the target content node according to the homogeneous meta-path to obtain the basic content feature includes: Based on the homogeneous meta-path, selecting at least one first-order neighbor content node corresponding to the target content node; Feature aggregation is performed on the neighbor node feature of the at least first-order neighbor content node and the target node feature of the target content node to obtain the content basic feature.
4. The method according to claim 3, characterized in that The at least one first-order neighbor content node includes the first-order neighbor nodes and the second-order neighbor nodes of the target content node; The step of performing feature aggregation on the neighbor node feature of the at least first-order neighbor content node and the target node feature of the target content node to obtain the content basic feature includes: Performing feature aggregation on the node features of the first-order neighbor nodes and the node features of the second-order neighbor nodes to obtain neighbor aggregation features; The neighbor aggregation feature and the target node feature are aggregated to obtain the content basic feature.
5. The method according to claim 2, characterized in that: The graph convolution process is performed by a convolution layer in a graph neural network, and the method further includes: Performing graph convolution on the sample content nodes according to the homogeneous meta-path to obtain basic features of the predicted content; Performing graph convolution on the sample content nodes according to the heterogeneous element paths to obtain predicted content attribute features; Performing feature fusion on the predicted content basic features and the predicted content attribute features to obtain predicted content features; The graph neural network is updated and trained based on the predicted content basic features, the predicted content attribute features and the predicted content features of each sample content node.
6. The method according to claim 5, characterized in that The updating and training of the graph neural network based on the predicted content basic features, the predicted content attribute features and the predicted content features of each sample content node includes: Determine the correlation loss based on the predicted content features of the positive sample content node pair and the negative sample content node pair, wherein the positive sample content node pair includes content nodes corresponding to two sample contents that have an associated relationship or have the same attributes, and the negative sample content node pair includes content nodes corresponding to two sample contents that have no associated relationship and do not have the same attributes; Determine the contrast loss based on a first content feature pair and a second content feature pair, wherein the first content feature pair is a feature pair consisting of different types of prediction features corresponding to the same sample content node, wherein the different types of prediction features are the prediction content basic features or the prediction content attribute features, and the second content feature pair is a feature pair consisting of different types of prediction features corresponding to different sample content nodes; Based on the correlation loss and the contrast loss, the graph neural network is updated and trained.
7. The method according to claim 6, characterized in that The determining of the correlation loss based on the predicted content features of the positive sample content node and the negative sample content node includes: Calculating positive correlation values between predicted content features corresponding to the positive sample content node pairs; Calculating negative correlation values between predicted content features corresponding to the negative sample content node pairs; The correlation loss is determined based on the positive correlation value and the negative correlation value.
8. The method according to claim 6, characterized in that The method further comprises: Determining two sample content nodes connected in the content heterogeneous graph as the positive sample content node pair; A single node in the positive sample content node pair is replaced with other content nodes to obtain the negative sample content node pair, wherein the other content nodes are not connected to the unreplaced nodes in the positive sample content node pair in the content heterogeneous graph.
9. The method according to claim 6, characterized in that The determining the contrast loss based on the first content feature pair and the second content feature pair includes: calculating a first correlation value between the first content feature pairs; calculating a second correlation value between the second content feature pairs; The contrast loss is determined based on each of the first correlation values and each of the second correlation values, where different first correlation values correspond to different first content feature pairs, and different second correlation values correspond to different second content feature pairs.
10. The method according to any one of claims 1 to 9, characterized in that: The performing content recommendation based on the target content feature includes: Based on the target content feature, determining similar content features in a content feature index, wherein the content feature index includes content features corresponding to each content; Based on the similar content features, content recommendation is performed.
11. The method according to any one of claims 1 to 9, characterized in that: When the content is video content, the content attribute includes at least one of a video tag, a video starring actor, and a video director; When the content is article content, the content attribute includes at least one of article tag, article author, and article source; When the content is a product, the content attribute includes at least one of a product label, a product merchant, and a product price.
12. A content recommendation device, characterized in that: The device comprises: The first construction module is used to determine the mutual transfer probability between the contents based on the number of co-occurrences between the contents, the number of co-occurrences is used to indicate the number of times the contents have the same associated information, and the mutual transfer probability is used to indicate the relevance between the contents; based on the mutual transfer probability between the contents, determine the co-occurring contents, the mutual transfer probability between the co-occurring contents is higher than the mutual transfer probability between other contents; and construct a homogeneous meta-path based on the co-occurring contents; The second construction module is used to construct a heterogeneous meta-path based on the attribute information of each content, and the content nodes corresponding to the content in the same heterogeneous meta-path have the same attributes; An acquisition module, used for acquiring a content heterogeneous graph, wherein the content heterogeneous graph includes the homogeneous meta-path and the heterogeneous meta-path, wherein the homogeneous meta-path is composed of content nodes corresponding to the content, and the heterogeneous meta-path is composed of the content nodes and attribute nodes corresponding to the content attributes; A first extraction module is used to extract features of a target content node based on the homogeneous meta-path to obtain basic content features, and the target content node belongs to the content node; A second extraction module is used to extract features of the target content node based on the heterogeneous meta-path to obtain content attribute features, wherein the content attribute features include content attribute features corresponding to at least one content attribute; A first fusion module is used to perform mask processing on the content attribute feature, wherein the mask processing is used to hide part of the content attribute feature; and perform feature fusion on the content basic feature and the content attribute feature after the mask processing to obtain a target content feature; The content recommendation module is used to recommend content based on the target content features.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the content recommendation method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the content recommendation method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the content recommendation method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Heterogeneous graph information extraction method and device based on meta-path subgraph
CN113569906A