Method, device, equipment, storage medium and program product for selecting recommended content
By constructing input structure diagrams and interaction prediction models, generating fusion vectors, and selecting recommended content with high diversity, the problem of poor diversity in the video recommendation system is solved, and the correlation and diversity balance between recommended content and users is achieved.
Patent Information
- Application Number
- CN202111374350.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-11-19
AI Technical Summary
In the prior art, video recommendations are poor, and the recommended videos in the related art are highly similar, which cannot meet the diverse content needs of users.
By constructing an input structure chart, a fusion vector between users and content nodes is generated, the interaction possibility between users and content is determined based on the interaction prediction model, and the recommended content is selected based on the diversity indicators of recommended content nodes, and the correlation and diversity are comprehensively considered.
It improves the diversity of recommended content while maintaining relevance with users, improving the effectiveness of the recommendation system.
Smart Images

Figure CN116150425B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the fields of artificial intelligence and Internet technology, and in particular to a method, apparatus, device, storage medium, and program product for selecting recommended content. Background Art
[0002] With the development of artificial intelligence technology, recommendation systems can select content that users are interested in from massive amounts of information and recommend it to users to meet their needs.
[0003] Taking the video recommendation scenario as an example, the relevant technology maps the unique identification codes corresponding to users and videos to a certain space through matrix decomposition, obtains the word embedding vector corresponding to the user and the word embedding vector corresponding to the video, and then uses the inner product between the word embedding vector corresponding to the user and the word embedding vector corresponding to the video to predict the possibility of interaction between the user and the video, and then recommends videos with high interaction possibility to the user.
[0004] However, the similarity between the videos recommended in the related art is high, and the diversity of video recommendations is poor. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, device, storage medium, and program product for selecting recommended content, which can ensure that the recommended content is relevant to the user while increasing the diversity of the recommended content. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for selecting recommended content is provided, the method comprising:
[0007] Acquire an input structure graph, wherein the input structure graph includes a plurality of user nodes and a plurality of content nodes, and the input structure graph is used to represent the relationship between the user nodes and the content nodes;
[0008] According to the input structure graph, generating fusion vectors corresponding to respective nodes in the input structure graph; wherein, for a target node among the respective nodes, the fusion vector corresponding to the target node integrates feature information of the target node and feature information of nodes associated with the target node;
[0009] For a target user node among the multiple user nodes, determining interaction prediction values between the target user node and the multiple content nodes based on a fusion vector corresponding to the target user node and fusion vectors corresponding to the multiple content nodes, the interaction prediction values being used to represent the likelihood of interaction between the target user node and the content nodes;
[0010] A recommended content node is selected from the multiple content nodes based on the interaction prediction values between the target user node and the multiple content nodes, and the diversity index of the recommended content node set; wherein the content corresponding to the recommended content node is recommended content for providing to the target user corresponding to the target user node, and the recommended content node set includes the recommended content node.
[0011] According to one aspect of an embodiment of the present application, a method for training an interaction prediction model is provided, the method comprising:
[0012] Acquire training data for an interaction prediction model; wherein the training data includes multiple sets of historical interaction information, the historical interaction information being used to describe the interaction history between the user and the content;
[0013] Based on the multiple sets of historical interaction information, a first training structure graph and a second training structure graph are constructed; wherein the first training structure graph includes multiple user nodes and multiple content nodes, and the first training structure graph is used to represent the relationship between the user nodes and the content nodes; the second training structure graph includes multiple content nodes, and the second training structure graph is used to represent the relationship between the content nodes;
[0014] Obtaining, through the interactive prediction model, a fusion vector corresponding to each node in the first training structure graph and a fusion vector corresponding to each node in the second training structure graph; wherein, for a target node, the fusion vector of the target node integrates feature information of the target node and feature information of nodes associated with the target node;
[0015] Determining the training loss of the interactive prediction model based on the fusion vectors corresponding to the respective nodes in the first training structure graph and the fusion vectors corresponding to the respective nodes in the second training structure graph;
[0016] The interaction prediction model is trained based on the training loss to obtain a trained interaction prediction model.
[0017] According to one aspect of an embodiment of the present application, a device for selecting recommended content is provided, the device comprising:
[0018] A structure graph acquisition module is used to acquire an input structure graph, wherein the input structure graph includes a plurality of user nodes and a plurality of content nodes, and the input structure graph is used to represent the relationship between the user nodes and the content nodes;
[0019] a fusion vector generation module, configured to generate, based on the input structure graph, fusion vectors corresponding to respective nodes in the input structure graph; wherein, for a target node among the respective nodes, the fusion vector corresponding to the target node integrates feature information of the target node and feature information of nodes associated with the target node;
[0020] a prediction value acquisition module, configured to determine, for a target user node among the multiple user nodes, interaction prediction values between the target user node and the multiple content nodes based on a fusion vector corresponding to the target user node and fusion vectors corresponding to the multiple content nodes, the interaction prediction values being used to represent the likelihood of interaction between the target user node and the content nodes;
[0021] A recommended content selection module is configured to select a recommended content node from the multiple content nodes based on the interaction prediction values between the target user node and the multiple content nodes, and the diversity index of the recommended content node set; wherein the content corresponding to the recommended content node is recommended content for providing to the target user corresponding to the target user node, and the recommended content node set includes the recommended content node.
[0022] In an exemplary embodiment, the recommended content selection module includes:
[0023] a candidate set acquisition submodule, configured to select a first number of candidate content nodes from the plurality of content nodes according to the interaction prediction value, and obtain a candidate content node set corresponding to the target user node;
[0024] The recommended content selection submodule is configured to select, based on the diversity index of the recommended content node set, a second number of candidate content nodes from the candidate content node set by exclusion, as the recommended content nodes; wherein the second number is smaller than the first number.
[0025] In an exemplary embodiment, the recommended content selection submodule is configured to:
[0026] For the j-th candidate content node in the candidate content node set, if the degree of decrease in the diversity index of the recommended content node set after adding the j-th candidate content node is less than the degree of decrease in the diversity index of the recommended content node set after adding other candidate content nodes in the candidate content node set, then the j-th candidate content node is used as the recommended content node, where j is a positive integer;
[0027] Adding the j-th candidate content node to the recommended content node set;
[0028] Eliminating the j-th candidate content node from the candidate content node set to obtain an adjusted candidate content node set;
[0029] When the number of recommended content nodes in the recommended content node set is less than the second number, continue to select the recommended content node from the adjusted candidate content node set;
[0030] When the number of recommended content nodes in the recommended content node set is equal to the second number, selection of the recommended content nodes is stopped.
[0031] In an exemplary embodiment, the candidate set acquisition submodule is configured to:
[0032] sorting the plurality of content nodes in descending order of the interaction prediction values to obtain a content node sequence;
[0033] A first number of content nodes are selected from the content node sequence to obtain the candidate content node set.
[0034] In an exemplary embodiment, the fusion vector generation module includes:
[0035] An initial vector generation submodule is used to obtain the word embedding vector corresponding to each node in the input structure graph;
[0036] an aggregation vector generation submodule, configured to perform feature aggregation on the word embedding vector corresponding to the target node among the nodes according to the input structure graph to obtain an aggregation vector corresponding to the target node; wherein the aggregation vector corresponding to the target node is used to aggregate feature information of the target node and feature information of directly connected nodes of the target node;
[0037] a stacking vector generation submodule, configured to perform feature stacking on the aggregation vector corresponding to the target node according to the input structure graph to obtain a stacking vector corresponding to the target node; wherein the stacking vector corresponding to the target node is used to stack feature information of the target node and feature information of nodes associated with the target node;
[0038] The fusion vector generation submodule is used to generate a fusion vector corresponding to the target node based on the word embedding vector, aggregation vector and stacking vector corresponding to the target node.
[0039] In an exemplary embodiment, the aggregation vector generation submodule is configured to:
[0040] Determine, according to the input structure graph, a set of directly connected nodes corresponding to the target node;
[0041] For a target directly connected node in the directly connected node set, performing element-wise multiplication on a word embedding vector corresponding to the target node and a word embedding vector corresponding to the directly connected node to obtain a first intermediate vector;
[0042] Performing a weighted summation on the first intermediate vector and the word embedding vector corresponding to the directly connected node to obtain a second intermediate vector corresponding to the target directly connected node;
[0043] Summing the second intermediate vectors corresponding to the respective directly connected nodes in the directly connected node set to obtain a third intermediate vector;
[0044] Feature aggregation is performed on the word embedding vector corresponding to the target node and the third intermediate vector to obtain an aggregated vector corresponding to the target node.
[0045] In an exemplary embodiment, the stacked vector includes an m-order stacked vector, where m is a positive integer greater than 1; and the fused vector generating submodule is configured to:
[0046] Determine, according to the input structure graph, a set of directly connected nodes corresponding to the target node;
[0047] For the p-th order stacking vector in the m-order stacking vectors, when p is equal to 2, feature stacking is performed on the aggregation vector corresponding to the target node and the aggregation vectors corresponding to each directly connected node in the directly connected node set to obtain a second-order stacking vector corresponding to the target node; where p is a positive integer less than or equal to m;
[0048] When p is greater than 2, feature stacking is performed on the p-1th order stacking vector corresponding to the target node and the p-1th order stacking vectors corresponding to each directly connected node to obtain the p-th order stacking vector corresponding to the target node.
[0049] In an exemplary embodiment, the predicted value acquisition module is configured to:
[0050] Calculating the inner product between the fusion vector corresponding to the target user node and the fusion vector corresponding to the target content node;
[0051] An interaction prediction value between the target user node and the target content node is determined according to the inner product.
[0052] According to one aspect of an embodiment of the present application, a training device for an interaction prediction model is provided, the device comprising:
[0053] A training data acquisition module, configured to acquire training data for an interaction prediction model; wherein the training data includes multiple sets of historical interaction information, wherein the historical interaction information is used to describe the interaction history between a user and content;
[0054] a structure graph construction module, configured to construct a first training structure graph and a second training structure graph based on the multiple sets of historical interaction information; wherein the first training structure graph includes a plurality of user nodes and a plurality of content nodes, and is used to represent the relationship between the user nodes and the content nodes; and the second training structure graph includes a plurality of content nodes, and is used to represent the relationship between the content nodes;
[0055] a fusion vector acquisition module, configured to acquire, through the interactive prediction model, a fusion vector corresponding to each node in the first training structure diagram and a fusion vector corresponding to each node in the second training structure diagram; wherein, for a target node, the fusion vector of the target node integrates feature information of the target node and feature information of nodes associated with the target node;
[0056] a training loss acquisition module, configured to determine the training loss of the interactive prediction model based on the fusion vectors corresponding to the respective nodes in the first training structure graph and the fusion vectors corresponding to the respective nodes in the second training structure graph;
[0057] The prediction model training module is used to train the interaction prediction model based on the training loss to obtain a trained interaction prediction model.
[0058] In an exemplary embodiment, the training loss acquisition module includes:
[0059] A first loss acquisition submodule, configured to obtain a first training loss based on the fusion vectors corresponding to the respective nodes in the first training structure graph; wherein the first training loss is used to increase the distance between the user node and content nodes that have no interaction relationship with the user node;
[0060] A second loss acquisition submodule, configured to obtain a second training loss based on the fusion vectors corresponding to the respective nodes in the second training structure graph; wherein the second training loss is used to shorten the distance between the content node and the directly connected content node corresponding to the content node;
[0061] A training loss acquisition submodule is used to determine the training loss of the interactive prediction model based on the first training loss and the second training loss.
[0062] In an exemplary embodiment, the first loss acquisition submodule is configured to:
[0063] For a first user node in the first training structure graph, determining a first interaction set and a second interaction set corresponding to the first user node; wherein, in each user-content pair in the first interaction set, there is an interaction relationship between the content node and the first user node, and in each user-content pair in the second interaction set, there is no interaction relationship between the content node and the first user node;
[0064] Determining, based on the fusion vectors corresponding to the respective nodes in the first training structure graph, an interaction prediction value corresponding to each user-content pair in the first interaction set and an interaction prediction value corresponding to each user-content pair in the second interaction set;
[0065] For a target user-content pair in the first interaction set, determining an intermediate loss corresponding to the target user-content pair based on an interaction prediction value corresponding to the target user-content pair and an interaction prediction value corresponding to each group of user-content pairs in the second interaction set; wherein the intermediate loss corresponding to the target user-content pair is used to represent the total degree of difference between the target user-content pair and each group of user-content pairs in the second interaction set;
[0066] Obtaining a first sub-training loss corresponding to the first user node based on a sum of intermediate loss values corresponding to each group of user-content pairs in the first interaction set;
[0067] The first sub-training losses corresponding to the plurality of user nodes in the first training structure graph are summed to obtain the first training loss.
[0068] In an exemplary embodiment, the first loss acquisition submodule is further configured to:
[0069] determining, based on differences between the interaction prediction value corresponding to the target user-content pair and the interaction prediction values corresponding to each group of user-content pairs in the second interaction set, a sub-intermediate loss between the target user-content pair and each group of user-content pairs in the second interaction set;
[0070] The sub-intermediate losses between the target user-content pair and each group of user-content pairs in the second interaction set are summed to obtain the intermediate loss corresponding to the target user-content pair.
[0071] In an exemplary embodiment, the second loss acquisition submodule is configured to:
[0072] For a first content node in the second training structure diagram, determining a set of directly connected content nodes of the first content node;
[0073] For a target directly-connected content node in the directly-connected content node set, determining a fourth intermediate vector corresponding to the target directly-connected content node based on a difference between a fusion vector corresponding to the first content node and a fusion vector corresponding to the target directly-connected content node;
[0074] Summing the fourth intermediate vectors corresponding to the respective directly connected content nodes in the directly connected content node set to obtain a second sub-training loss corresponding to the first content node;
[0075] The second sub-training losses corresponding to the content nodes in the second training structure graph are summed to obtain the second training loss.
[0076] According to one aspect of an embodiment of the present application, a computer device is provided, comprising 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 above-mentioned method for selecting recommended content or the above-mentioned information fusion method.
[0077] The computer device is a terminal or a server.
[0078] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-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 a processor to implement the above-mentioned method for selecting recommended content or the above-mentioned information fusion method.
[0079] According to one aspect of an embodiment of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned method for selecting recommended content or the aforementioned method for information fusion.
[0080] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0081] By combining the interaction prediction value between user nodes and content nodes and the diversity index of the set composed of recommended content nodes, recommended content nodes are selected from multiple content nodes. The correlation between recommended content nodes and user nodes and the diversity of recommended content nodes are comprehensively considered, so that the recommended content is relevant to the user while improving the diversity of the recommended content. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.
[0083] Figure 1 This is a schematic diagram of an implementation environment for a solution provided by an embodiment of the present application;
[0084] Figure 2 This is a flowchart of a method for selecting recommended content provided by an embodiment of the present application;
[0085] Figure 3 This is a flowchart of a method for obtaining a fusion vector provided by an embodiment of the present application;
[0086] Figure 4 This is a flowchart of a method for selecting a recommended content node provided by an embodiment of the present application;
[0087] Figure 5 This is a flowchart of a training method for an interactive prediction model provided by one embodiment of the present application;
[0088] Figure 6 This is a flowchart of a method for obtaining the training loss of an interactive prediction model provided by one embodiment of the present application;
[0089] Figure 7 This is a block diagram of a device for selecting recommended content provided by one embodiment of the present application;
[0090] Figure 8 is a block diagram of a device for selecting recommended content provided by another embodiment of the present application;
[0091] Figure 9 This is a block diagram of a training device for a push interaction prediction model provided by one embodiment of the present application;
[0092] Figure 10 This is a block diagram of a training device for a push interaction prediction model provided by another embodiment of the present application;
[0093] Figure 11 This is a block diagram of a computer device provided by one embodiment of the present application. DETAILED DESCRIPTION
[0094] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0095] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0096] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0097] Computer vision (CV) is the science of making machines "see." Specifically, it refers to using cameras and computers to replace the human eye in identifying and measuring objects, and then further processing the images to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, aiming to build artificial intelligence systems that can extract information from images or multidimensional data. Computer vision technologies generally include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / action recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0098] The technical solution provided in the embodiments of the present application involves artificial intelligence computer vision technology, which uses computer vision technology to train an interaction prediction model and predicts the possibility of interaction between users and content based on the trained interaction prediction model.
[0099] In the methods provided in the embodiments of the present application, the execution entity of each step may be a computer device, which refers to an electronic device with data computing, processing, and storage capabilities. The computer device may be a terminal such as a PC (Personal Computer), a tablet computer, a smartphone, a wearable device, an intelligent robot, or a server. The server may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0100] The technical solutions provided by the embodiments of this application are applicable to any scenario requiring content recommendation, such as recommendation systems, content recommendation scenarios, content retrieval scenarios, content recall scenarios, etc. The content may include items, videos, information, news, etc. The technical solutions provided by the embodiments of this application can ensure that the recommended content is relevant to the user while increasing the diversity of the recommended content.
[0101] In one example, if Figure 1 As shown, taking a recommendation system as an example, the system may include a terminal 10 and a server 20 .
[0102] Terminal 10 may be an electronic device such as a mobile phone, digital camera, tablet computer, PC, wearable device, or the like. A client for a target application may be installed in terminal 10, and a user may use the client to perform operations such as content retrieval, content browsing, and content recall. The target application may be a content recommendation application, a shopping application, a browser application, an entertainment application, or the like, and this embodiment of the present application does not limit this.
[0103] The server 20 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. The server 20 is used to provide backend services for the client of the target application in the terminal 10. For example, the server 20 may be the backend server of the target application (e.g., a content recommendation application).
[0104] The terminal 10 and the server 20 can communicate with each other via the network 30 .
[0105] For example, taking the content as a video, a user browses the video in the client of the target application. The client sends historical interaction information between the user and the video to the server 20. Based on the historical interaction information, the server 20 determines the relevance between the user and the video (for example, through a trained interaction prediction model), selects the video based on the relevance between the user and the video and the diversity of the video, and then recommends the selected video to the user through the client.
[0106] Of course, in some other examples, the video selection process can also be executed in the terminal 10, such as in the client of the target application described above. For example, the client can directly obtain the relevance between the user and the video based on historical interaction information between the user and the video, and then select the video based on the relevance between the user and the video and the diversity of the video. This embodiment of the present application is not limited to this.
[0107] Please refer to Figure 2 , which shows a flowchart of a method for selecting recommended content provided by an embodiment of the present application. The execution subject of each step of the method can be Figure 1 In the terminal 10 or server 20 in the implementation environment of the solution shown, the method may include the following steps (201-204).
[0108] Step 201: Acquire an input structure graph, where the input structure graph includes a plurality of user nodes and a plurality of content nodes. The input structure graph is used to represent the association between the user nodes and the content nodes.
[0109] A structural graph refers to a graph model in graph theory that can divide the nodes in a graph into two non-overlapping subsets. The structural graph may also be referred to as a bipartite graph, a binary graph, a bipartite graph, etc. In an embodiment of the present application, the input graph structure refers to a structural graph with user nodes as one subset and content nodes as another subset. Among them, user nodes and content nodes can be connected across subsets through connecting edges. The input graph structure can be used to describe the interactive relationship between users and content. User nodes are used to represent users, and the user nodes can be identified based on the user's identification information, attribute information, etc. The content nodes are used to represent content, and the content nodes can be identified based on the content's identification information, attribute information, etc.
[0110] The input structure graph can explicitly describe the potential association between each node in the input structure graph. For example, take the content as an example. For user node 1 among multiple user nodes, there is an interactive relationship between user node 1 and video node 1 and video node 2 (that is, video node 1 and video node 2 are directly connected nodes of user node 1). At the same time, there is an interactive relationship between user node 2 and video node 1. It can be considered that user node 2 has a potential association with user node 1 (that is, user node 2 is the collaborative signal corresponding to user node 1). Among them, other nodes that are connected to the node by only one connecting edge are the directly connected nodes of the node.
[0111] Optionally, the input structure diagram can be constructed based on historical interaction information between users and content. The historical interaction information can refer to historical interaction information between users and content in any application. The content can include items, videos, music, news, information, etc., and the present embodiment does not limit the content.
[0112] For example, taking the content as video as an example, the construction process of the input structure is explained, and its specific content can be as follows: obtain the historical interaction information between users and videos in the video viewing application. The user can refer to all users in the video viewing application, and the video can refer to all videos in the video viewing application that have an interactive relationship with the user. Based on the historical interaction information, determine the user set and video set, and then generate the user node set and video node set based on the user set and video set. Among them, the user node is identified by the user's unique identification code in the video viewing application, and the video node is identified by the video's unique identification code in the video viewing application. Finally, based on the historical interaction information, determine the connection edge between the user node and the video node, so as to generate the input structure graph corresponding to the video viewing application.
[0113] Step 202 : Generate fusion vectors corresponding to the nodes in the input structure graph according to the input structure graph; wherein, for the target node in each node, the fusion vector corresponding to the target node integrates the feature information of the target node and the feature information of the nodes associated with the target node.
[0114] The various nodes refer to various user nodes and various content nodes, that is, the fusion vectors corresponding to the various user nodes in the input structure diagram and the fusion vectors corresponding to the various content nodes are generated. Among them, the above-mentioned target node can refer to any node among the various nodes (including user nodes and content nodes). The fusion vector of the target node is fused with the feature information of the nodes that are potentially associated with the target node. The nodes that are potentially associated with the target node may include user nodes and content nodes, that is, the nodes that can be connected to the target node through connecting edges can be determined as nodes that are potentially associated with the target node. Exemplarily, based on the above example, the fusion vector of user node 1 can be fused with: the feature information of video node 1 and video node 2 (directly connected nodes), the feature information of user node 2 (potentially associated node), and the feature information of user node 1 itself.
[0115] In one example, the specific process of obtaining the fusion vector may include the following sub-steps (2021-2024):
[0116] Step 2021: Obtain the word embedding vector corresponding to each node in the input structure graph.
[0117] Word embedding vectors can be used to represent nodes. For example, the word embedding vector of a user node represents the unique identification information corresponding to the user node in the form of a digital vector. For example, a d-dimensional word embedding vector can be used to project each user node and each video node into a d-dimensional vector space to represent each user node and each video node. In this way, a word embedding vector lookup table E corresponding to the input structure graph can be obtained. E can be expressed as follows:
[0118]
[0119] in, is the word embedding vector corresponding to the user node, is the word embedding vector corresponding to the content node, is the word embedding vector corresponding to the nth user node, is the word embedding vector corresponding to the mth content node. d is a hyperparameter that can be set based on developer experience. Generally speaking, the higher the value of d, the more feature information of the node is retained. However, high-dimensional word embedding vectors are relatively computationally complex, so developers need to balance these two aspects to determine the value of d.
[0120] In step 2022, for the target node in each node, feature aggregation is performed on the word embedding vector corresponding to the target node according to the input structure diagram to obtain an aggregation vector corresponding to the target node; wherein the aggregation vector corresponding to the target node is used to aggregate the feature information of the target node and the feature information of the directly connected nodes of the target node.
[0121] An aggregate vector is a vector obtained by aggregating the word embedding vector corresponding to a node and the word embedding vector corresponding to the node's directly connected nodes (also called first-order neighbor nodes). For example, based on the above example, the aggregate vector corresponding to user node 1 is a vector obtained by aggregating the word embedding vector (i.e., feature information) corresponding to user node 1, the word embedding vector corresponding to video node 1 (a directly connected node), and the word embedding vector corresponding to video node 2 (a directly connected node). Through feature aggregation, the feature information of a node's directly connected nodes can be injected into the node's word embedding vector, thereby associating the node with its directly connected nodes.
[0122] In one example, the specific acquisition process of the aggregate vector can be as follows: according to the input structure diagram, determine the set of directly connected nodes corresponding to the target node; for the target directly connected node in the directly connected node set, perform element-wise multiplication of the word embedding vector corresponding to the target node and the word embedding vector corresponding to the directly connected node to obtain a first intermediate vector; perform weighted summation of the first intermediate vector and the word embedding vector corresponding to the directly connected node to obtain a second intermediate vector corresponding to the target directly connected node; sum the second intermediate vectors corresponding to each directly connected node in the directly connected node set to obtain a third intermediate vector; perform feature aggregation on the word embedding vector corresponding to the target node and the third intermediate vector to obtain an aggregate vector corresponding to the target node.
[0123] The method for obtaining the aggregation vector corresponding to the user node is the same as that for the content node. The following takes the user node as an example. The process of obtaining the aggregation vector corresponding to the user node can also be expressed by the following formula:
[0124]
[0125] in, is the aggregation vector corresponding to the user node u, LeakyReLU is the activation function, W1 and W2 are the trainable weight parameters corresponding to the aggregation vector, which are used to extract effective feature information, W1 and W2 are d′×d matrices, the value of d is the same as the dimension of the above word embedding vector, d′ is the size of d after conversion (i.e., the conversion dimension), e u is the word embedding vector corresponding to the user node u, N u is the set of directly connected nodes of user node u, e c is the word embedding vector corresponding to the cth directly connected node in the directly connected node set of user node u, N c is the set of directly connected nodes of the cth directly connected node of user node u. c ⊙e u Indicates e c and e u Performing element-wise multiplication can be used to characterize the similarity between the user node u and the directly connected node c. That is, this formula can aggregate more information similar to and related to the user node u into the fusion vector of the user node u.
[0126] Step 2023: Feature stacking is performed on the aggregation vector corresponding to the target node according to the input structure graph to obtain a stacking vector corresponding to the target node; wherein the stacking vector corresponding to the target node is used to stack feature information of the target node and feature information of nodes associated with the target node.
[0127] A stacked vector is a vector obtained by stacking the stacked vector corresponding to a node with the stacked vectors of its directly connected nodes. This feature stacking allows you to inject feature information from nodes potentially associated with a node into the word embedding vector of that node, thereby associating nodes potentially associated with that node with the node.
[0128] Optionally, the stacking vector includes an m-order stacking vector, where m is a positive integer greater than 1. The above-mentioned aggregated vector can also be called the first-order stacking vector corresponding to the node. Based on the first-order stacking vector of the node's directly connected node, the second-order stacking vector of the node can be obtained. Based on the second-order stacking vector of the node's directly connected node, the third-order stacking vector of the node can be obtained. By analogy, the m-th order stacking vector of the node can be obtained. Among them, the first-order stacking vector aggregates the word embedding vector (feature information) of the node's directly connected node (first-order neighbor node), the second-order stacking vector aggregates the first stacking vector of the first-order neighbor node, and the first stacking vector of the first-order neighbor node aggregates the word embedding vector of the first-order neighbor node's directly connected node (corresponding to the node's second-order neighbor node). The second-order neighbor node is connected to the node through two connecting edges, which can be described as: node-connecting edge-first-order neighbor node-connecting edge-second-order neighbor node. Similarly, the m-th order stacking vector aggregates the word embedding vector of the node's m-order neighbor node. In this way, through feature stacking, the feature information of the node's m-order neighbor nodes can be injected into the word embedding vector of the node, thereby associating the node with the node's m-order neighbor nodes.
[0129] In one example, the process of obtaining the stacking vector can be as follows: according to the input structure diagram, determine the set of directly connected nodes corresponding to the target node; for the p-th order stacking vector in the m-order stacking vector, when p is equal to 2, perform feature stacking on the aggregation vector corresponding to the target node and the aggregation vectors corresponding to each directly connected node in the directly connected node set to obtain the 2-th order stacking vector corresponding to the target node; where p is a positive integer less than or equal to m; when p is greater than 2, perform feature stacking on the p-1-th order stacking vector corresponding to the target node and the p-1-th order stacking vector corresponding to each directly connected node to obtain the p-th order stacking vector corresponding to the target node.
[0130] For example, based on the above example, after obtaining the aggregation vector (i.e., the first-order stacking vector) corresponding to user node 1, the aggregation vector corresponding to video node 1, the aggregation vector corresponding to video node 2, and the aggregation vector corresponding to user node 2, the aggregation vector corresponding to user node 1, the aggregation vector corresponding to video node 1, and the aggregation vector corresponding to video node 2 are feature stacked to obtain the second-order stacking vector corresponding to user node 1. Using the same method, based on the aggregation vector corresponding to video node 1 and the aggregation vector corresponding to the first-order neighbor node of video node 1, the second-order stacking vector corresponding to video node 1 is obtained. Based on the aggregation vector corresponding to video node 2 and the aggregation vector corresponding to the first-order neighbor node of video node 2, the second-order stacking vector corresponding to video node 2 is obtained. Then, feature stacking is performed on the second-order stacking vector corresponding to user node 1, the second-order stacking vector corresponding to video node 1, and the second-order stacking vector corresponding to video node 2 to obtain the third-order stacking vector corresponding to user node 1.
[0131] The method for obtaining the stacking vector of the user node is the same as that of the content node. The following takes the user node as an example. The process of obtaining the p-th order stacking vector of the user node can also be expressed by the following formula:
[0132]
[0133] Among them, e u (p) is the p-th order stacked vector corresponding to the user node u, p is an integer greater than 1, LeakyReLU is the activation function, W1 (p) and W2 (p) is the trainable weight parameter corresponding to the p-th order stacked vector, used to extract effective feature information, W1 (p) and W2 (p) is a d′×d matrix, where the value of d is the same as the dimension of the above word embedding vector, d′ is the size of d after transformation (i.e., the transformation dimension), and e u (p-1) is the p-1th order stacking vector corresponding to user node u, N u is the set of directly connected nodes of user node u, e c (p-1) is the p-1th order stacking vector of the cth directly connected node in the directly connected node set of user node u, N c is the set of directly connected nodes of the cth directly connected node of user node u. c (p-1) ⊙e u (p-1) Indicates e c (p-1) and e u (p-1)Perform element-wise multiplication. This formula can aggregate the feature information of the multi-order neighbor nodes of the user node into the stacked vector corresponding to the user node u.
[0134] In one example, the process of obtaining the p-th order stacking vector of the node may also be converted into a matrix form, which may be expressed as follows:
[0135]
[0136] Among them, E (p) is the matrix form of the p-th order stacking vector of nodes (including user nodes and content nodes), which can be recorded as U is the user node set, C is the content node set, d p is the length of the stack. is the Laplace matrix, we have D is a diagonal matrix, and the diagonal elements of D are the row sums and / or column sums of A. R is the interaction matrix between user nodes and content nodes. For example, if R uc =1, it means that there is interaction between user node u and content node c. If R uc = 0, it means that there is no observed interaction between user node u and content node c. T is the transpose of R, I is the identity matrix, 0 is the all-zero matrix, E (p-1) is the matrix form of the p-1th order stacking vector of the node, W1 (p) and W2 (p) is the trainable weight parameter corresponding to the p-th order stacked vector.
[0137] Step 2024: Generate a fusion vector corresponding to the target node based on the word embedding vector, aggregation vector, and stacking vector corresponding to the target node.
[0138] Optionally, the fusion vector corresponding to the target node can be obtained by concatenating the word embedding vector, the aggregation vector, and the m-order stacking vector corresponding to the target node.
[0139] For example, by adopting the stacking vector acquisition method in matrix form, after performing m-order feature stacking on the target node, the matrix representation of each order stacking vector can be obtained: E (1) , E (2) ,…,E (m) , where E (1) It can be understood as the matrix representation of the aggregation vector corresponding to the target node, then the stacking vectors of each order corresponding to the target node are: e (1) , e (2) ,…,e (m) , for e (0) ,e (1) ,e(2) ,…,e (m) By connecting them in series, we can get the fusion vector corresponding to the target node. (0) It can be understood as the word embedding vector corresponding to the target node, e (1) It can be understood as the aggregation vector corresponding to the target node. The fusion vector corresponding to the target node is: e * =e (0) ||...||e (m) .
[0140] For user nodes and content nodes, there are in, is the fusion vector corresponding to user node u, e u (m) The m-th order stacked vector corresponding to the user node u, is the fusion vector corresponding to the content node c, e c (m) The m-th order stacking vector corresponding to content node c.
[0141] Step 203: For a target user node among the multiple user nodes, based on the fusion vector corresponding to the target user node and the fusion vectors corresponding to the multiple content nodes, determine the interaction prediction values between the target user node and the multiple content nodes respectively. The interaction prediction values are used to characterize the interaction possibility between the target user node and the content nodes.
[0142] The target user node may refer to any user node among the user nodes. The target content node described below may refer to any content node among the content nodes.
[0143] In one example, for a target content node among multiple content nodes, the process of obtaining the interaction prediction value between the target user node and the target content node can be as follows: calculating the inner product between the fusion vector corresponding to the target user node and the fusion vector corresponding to the target content node; and determining the interaction prediction value between the target user node and the target content node based on the inner product.
[0144] Optionally, the inner product can be directly used as the interaction prediction value between the target user node and the target content node, or the interaction prediction value between the target user node and the target content node can be calculated based on the inner product. This embodiment of the present application does not limit this. The inner product can be positively correlated with the interaction prediction value. The larger the inner product, the larger the interaction prediction value, that is, the greater the possibility of interaction between the target user node and the target content node (the higher the correlation between the target user node and the target content node).
[0145] For user node u and content node c, the interaction prediction value between user node u and content node c can be recorded as:
[0146] In some possible designs, the above-mentioned word embedding vectors, aggregation vectors, stacking vectors, and fusion vectors can all be obtained through a neural network model (such as the interaction prediction model described below). For example, the interaction prediction model can be used to obtain the word embedding vectors, aggregation vectors, stacking vectors, and fusion vectors corresponding to each user node and each content node in the input structure graph based on the input structure graph, and then obtain the interaction prediction value between the user node and the content node to select the content node. The interaction prediction model will be described in detail below and will not be repeated here.
[0147] Step 204 , selecting a recommended content node from the multiple content nodes based on the interaction prediction values between the target user node and the multiple content nodes, and the diversity index of the recommended content node set; wherein the content corresponding to the recommended content node is recommended content for providing to the target user corresponding to the target user node, and the recommended content node set includes the recommended content node.
[0148] The diversity index is used to characterize the diversity of a node set. For example, the diversity index of a recommended content node set is used to characterize the diversity of the recommended content node set. Alternatively, the diversity index of the recommended content node set can be obtained based on the determinant of a semi-positive definite matrix formed based on the recommended content node set.
[0149] In one example, the process of obtaining the recommended content node may include the following sub-steps (2041-2042):
[0150] Step 2041 : Select a first number of candidate content nodes from a plurality of content nodes according to the interaction prediction value, and obtain a set of candidate content nodes corresponding to the target user node.
[0151] The first number is smaller than the total number of content nodes and larger than the required number of recommended content nodes (hereinafter referred to as the second number), which can be set according to actual usage requirements. In one example, assuming the second number is a, the first number can be set to N*a, where N is a positive integer and a is much smaller than the total number of content nodes.
[0152] In one example, multiple content nodes can be sorted in descending order of interaction prediction values to obtain a content node sequence; then, the first number of content nodes can be selected from the content node sequence to obtain a candidate content node set. For example, the first N*a content nodes in the content node sequence are used as candidate content nodes to obtain a candidate content node set. The candidate content node set for the target user node u can be recorded as: Z u ={c1, c2, ..., c na}.
[0153] Optionally, before selecting candidate content nodes from the content node sequence, content nodes that interact with the target user node in the content node sequence may be removed, and then the first N*a content nodes are selected from the adjusted content node sequence.
[0154] Step 2042 : Select a second number of candidate content nodes from the candidate content node set as recommended content nodes based on the diversity index of the recommended content node set, by exclusion; wherein the second number is smaller than the first number.
[0155] Optionally, the initial state of the recommended content node set is empty, the final state of the recommended content node set includes a second number of recommended content nodes, and the diversity index of the final state of the recommended content node set is the lowest in the case of the same order of magnitude.
[0156] In one example, the selection process of the recommended content node may be as follows: for the j-th candidate content node in the candidate content node set, if the degree of decrease in the diversity index of the recommended content node set after adding the j-th candidate content node is less than the degree of decrease in the diversity index of the recommended content node set after adding other candidate content nodes in the candidate content node set, then the j-th candidate content node is used as the recommended content node; the j-th candidate content node is added to the recommended content node set, where j is a positive integer; the j-th candidate content node is removed from the candidate content node set to obtain an adjusted candidate content node set; if the number of recommended content nodes in the recommended content node set is less than the second number, continue to select recommended content nodes from the adjusted candidate content node set; if the number of recommended content nodes in the recommended content node set is equal to the second number, stop selecting recommended content nodes.
[0157] The degree of decrease in the diversity index refers to the degree of decrease in the diversity index of the original recommended content node set after a candidate content node is added to the original recommended content node set relative to the diversity index of the original recommended content node set, which can be represented by the difference between the two.
[0158] For example, the selection of each recommended content node needs to satisfy the following formula:
[0159]
[0160] Among them, s is the recommended content node, S is the recommended content node set, and j is the candidate content node set Z u The jth candidate content node in L S is the semi-positive definite matrix composed of the recommended content node set S, det(L s ) is the determinant of the recommended content node set S (i.e., diversity index), which is used to characterize the diversity of the recommended content node set S.S∪{j} is the semi-positive definite matrix composed of the recommended content node set S after adding the j-th candidate content node, det(L S∪{j} ) is the determinant (i.e., diversity index) of the recommended content node set S after the j-th candidate content node is added, and is used to characterize the diversity level of the recommended content node set S after the j-th candidate content node is added.
[0161] Optionally, det(Ls ) The larger the value, the more diverse the recommended content nodes in the recommended content node set S are, and the more recommended content nodes there are in the recommended content node set S, the greater the value of det(L s ) is smaller, that is, det(L S∪{j} ) is a non-increasing function of the number of recommended content nodes in the recommended content node set S.
[0162] According to the above formula, in each selection process of recommended content nodes, we can select u Find out the new candidate content node that can make the diversity index of the new set composed of the new candidate content node and S decrease the least. The new candidate content node is the recommended content node in this selection process.
[0163] Alternatively, the semi-positive definite matrix L can be calculated as follows:
[0164]
[0165] in, is the unit matrix, which can ensure that det(L)≤1, so that L conforms to the definition of a probability model, B u is a matrix composed of the recommended content node set corresponding to the target user node u (i.e. the recommended content node set S mentioned above), For B u The transpose of .
[0166] Optionally, through the above method, the recommended content node set corresponding to each user node can be obtained first, and for the target user node, the recommended content node set corresponding to the target user node can be determined therefrom, thereby determining the recommended content corresponding to the target user based on the recommended content node set corresponding to the target user node.
[0167] In summary, the technical solution provided in the embodiments of the present application selects recommended content nodes from multiple content nodes by combining the interaction prediction value between user nodes and content nodes and the diversity index of the set composed of recommended content nodes, and comprehensively considers the correlation between recommended content nodes and user nodes and the diversity of recommended content nodes, so that the recommended content is relevant to the user while improving the diversity of the recommended content.
[0168] In addition, the embodiment of the present application selects a first number of candidate content nodes before the interaction prediction value from multiple content nodes, and then selects a second number (less than the first number) of recommended content nodes from the candidate content nodes, so that the recommended content nodes themselves have a higher correlation with the target user nodes, without forcibly reducing the correlation between the recommended content nodes and the target user nodes, thereby ensuring the relevance of the recommended content to the user.
[0169] In addition, after users browse enough similar content, they will experience aesthetic fatigue and stop browsing similar content, and then develop a demand for other different types of content. However, related technologies will still recommend similar content to users, resulting in a de facto overfitting of recommendations. Users will also experience aesthetic fatigue, which will affect their browsing experience and may even discourage them from browsing. The technical solution provided by the embodiments of this application can, to a certain extent, recommend diverse content, thereby effectively alleviating the aesthetic fatigue caused by users browsing similar content for a long time, improving user experience, and thus achieving the effect of increasing user stay time.
[0170] Please refer to Figure 5 , which shows a flow chart of a training method for an interactive prediction model provided by an embodiment of the present application. The execution subject of each step of the method can be Figure 1 In the terminal 10 or server 20 in the implementation environment of the solution shown, the method may include the following steps (501-505).
[0171] Step 501 : Acquire training data for an interaction prediction model; wherein the training data includes multiple sets of historical interaction information, and the historical interaction information is used to describe the interaction history between the user and the content.
[0172] In the embodiments of this application, the interaction prediction model is a model used to predict the likelihood of interaction between users and content. Alternatively, the interaction prediction model can be a graph neural network model, such as a graph convolutional network model, a graph attention network model, or a graph autoencoder model. The user, content, and historical interaction information are the same as those described in the previous embodiments and will not be further elaborated here.
[0173] Optionally, for different applications, training data may be obtained from the different applications, and the interaction prediction model may be trained using the training data, thereby obtaining interaction prediction models corresponding to the different applications.
[0174] Step 502: construct a first training structure diagram and a second training structure diagram based on multiple sets of historical interaction information; wherein the first training structure diagram includes multiple user nodes and multiple content nodes, and the first training structure diagram is used to represent the relationship between the user nodes and the content nodes; the second training structure diagram includes multiple content nodes, and the second training structure diagram is used to represent the relationship between the content nodes.
[0175] In the embodiment of the present application, the first training structure diagram refers to a structure diagram with user nodes as one subset and content nodes as another subset. The first training structure diagram is the same as the input structure diagram in the above embodiment, and will not be repeated here.
[0176] The second training structure graph may refer to a unary graph of content node elements, which can explicitly describe the potential associations between content nodes. Each node in the second training structure graph is the content node in the first training structure graph. The content nodes are connected by connecting edges, and the number of connecting edges can be used to characterize the correlation and similarity between the content nodes. Optionally, the potential associations between content nodes can be determined based on the first training structure graph, or historical interaction information, or an interaction matrix between user nodes and content nodes, thereby constructing the second training structure graph.
[0177] Exemplarily, based on the above example, if video node 1 and video node 2 in the first training graph are connected to user node 1, then video node 2 can be determined as a directly connected node (i.e., a first-order neighbor node) of video node 1. If video node 2 is connected to user node 3, and user node 3 is connected to video node 3, then video node 3 can be determined as a second-order neighbor node of video node 1.
[0178] Step 503: Obtain, through the interactive prediction model, the fusion vectors corresponding to the respective nodes in the first training structure diagram and the fusion vectors corresponding to the respective nodes in the second training structure diagram; wherein, for the target node, the fusion vector of the target node integrates the feature information of the target node and the feature information of the nodes associated with the target node.
[0179] The target node may be any node among the nodes in the first training structure diagram, or may be any node among the nodes in the second training structure diagram.
[0180] Optionally, the interaction prediction model can be divided into four layers: a word embedding layer, a feature aggregation layer, a feature stacking layer, and a feature fusion layer. The word embedding vectors corresponding to each node in the first training structure graph and the word embedding vectors corresponding to each node in the second training structure graph are obtained through the embedding layer.
[0181] The feature aggregation layer is based on the word embedding vectors corresponding to each node in the first training structure diagram to obtain the aggregation vectors corresponding to each node in the first training structure diagram, and the feature aggregation layer is based on the word embedding vectors corresponding to each node in the second training structure diagram to obtain the aggregation vectors corresponding to each node in the second training structure diagram.
[0182] The stacking vectors corresponding to the respective nodes in the first training structure diagram are obtained through the feature stacking layer based on the aggregation vectors corresponding to the respective nodes in the first training structure diagram, and the stacking vectors corresponding to the respective nodes in the second training structure diagram are obtained through the feature stacking layer based on the aggregation vectors corresponding to the respective nodes in the second training structure diagram.
[0183] The word embedding vectors, aggregation vectors and stacking vectors corresponding to each node in the first training structure diagram are concatenated through the feature fusion layer to obtain the fusion vectors corresponding to each node in the first training structure diagram, and the word embedding vectors, aggregation vectors and stacking vectors corresponding to each node in the second training structure diagram are concatenated through the feature fusion layer to obtain the stacking vectors corresponding to each node in the second training structure diagram.
[0184] The aggregation vectors, stacking vectors, and fusion vectors corresponding to the nodes in the first training structure diagram are the same as those described in the above embodiment and are not repeated here. The method for obtaining the aggregation vectors, stacking vectors, and fusion vectors corresponding to the nodes in the second training structure diagram is the same as the method for obtaining the aggregation vectors, stacking vectors, and fusion vectors corresponding to the nodes in the first training structure diagram, but the calculated network parameters are different. The specific description can be as follows:
[0185] The word embedding vectors corresponding to each node in the second training structure diagram are the same as the word embedding vectors corresponding to each content node in the first training structure diagram, which can be recorded as is the word embedding vector corresponding to the mth node in the second training structure graph.
[0186] Since the structure of the second training structure diagram is different from that of the first training structure diagram, the aggregation vectors corresponding to each node in the second training structure diagram are different from the aggregation vectors corresponding to each content node in the first training structure diagram, the stacking vectors corresponding to each node in the second training structure diagram are different from the stacking vectors corresponding to each content node in the first training structure diagram, and the fusion vectors corresponding to each node in the second training structure diagram are different from the fusion vectors corresponding to each content node in the first training structure diagram.
[0187] Optionally, the aggregation vectors corresponding to the nodes in the second training structure diagram are expressed as:
[0188]
[0189] in, is the aggregation vector corresponding to the node in the second training structure diagram, LeakyReLU is the activation function, and is the trainable weight parameter of the corresponding aggregation vector in the second training structure diagram, and is a matrix of d′×d, d is the same as d in the above embodiment, e x is the word embedding vector corresponding to node x in the second training structure graph, N x is the set of directly connected nodes of node x, e y is the word embedding vector corresponding to the yth directly connected node in the directly connected node set of node x, N y is the set of directly connected nodes of the yth directly connected node of node x. y ⊙e x Indicates e y and e x Performing element-wise multiplication can be used to characterize the similarity between node x and its directly connected node y. This means that this formula can aggregate more information similar to and related to node x into the fusion vector for node x. Alternatively, the aggregate vector corresponding to the node in the second training structure graph can be understood as the first-order stacked vector corresponding to the node in the second training structure graph.
[0190] Optionally, the matrix form of the stacked vectors corresponding to each node in the second training structure diagram is expressed as:
[0191]
[0192] Among them, E C(p) is the matrix form of the p-th (p is greater than 1) order stacked vector corresponding to the node in the second training structure graph, which can be recorded as C is the content node set, d p is the length of the stack. is the Laplace matrix corresponding to the second training structure diagram, A C =R C , D C is the diagonal matrix corresponding to the second training structure graph, D C The diagonal elements of A C . R C is the interaction matrix between content nodes. I is the identity matrix, E C(p -1)is the matrix form of the p-1th order stacked vector corresponding to the node in the second training structure graph, and is the trainable weight parameter corresponding to the p-th order stacked vector corresponding to the node in the second training structure graph.
[0193] Alternatively, the matrix of the m-order stacked vectors corresponding to the nodes in the second training structure diagram can be expressed as: E C (1) , E C(2) ,…,E C(m) , where E C(1) It can be understood as the matrix representation of the aggregate vector corresponding to the node in the second training structure diagram. Then the m-order stacked vectors corresponding to the nodes in the second training structure diagram are: e C(1) , e C(2) ,…,e C(m) , for e C(0) , e C(1) , e C(2) ,…,e C(m) By connecting them in series, we can get the fusion vector corresponding to the node in the second training structure diagram. C(0) It can be understood as the word embedding vector corresponding to the node in the second training structure diagram, e C(1) It can be understood as the aggregation vector corresponding to the node in the second training structure diagram. The fusion vector corresponding to the node in the second training structure diagram is recorded as: e C* =e C(0) ||...||e C(m) .
[0194] Step 504 : Determine the training loss of the interactive prediction model based on the fusion vectors corresponding to the nodes in the first training structure graph and the fusion vectors corresponding to the nodes in the second training structure graph.
[0195] Optionally, the process of obtaining the training loss of the interactive prediction model may include the following sub-steps (5041-5043):
[0196] Step 5041: Obtain a first training loss based on the fusion vectors corresponding to the nodes in the first training structure graph. The first training loss is used to increase the distance between the user node and the content nodes that have no interaction relationship with the user node.
[0197] Optionally, the process of obtaining the first training loss can be as follows:
[0198] 1. For the first user node in the first training structure diagram, determine the first interaction set and the second interaction set corresponding to the first user node; wherein, in each group of user-content pairs in the first interaction set, there is an interaction relationship between the content node and the first user node, and in each group of user-content pairs in the second interaction set, there is no interaction relationship between the content node and the first user node.
[0199] Optionally, a user-content pair refers to a set consisting of a user node and a content node. For example, a user-content pair of a first user node may refer to a set consisting of the first user node and any content node.
[0200] For example, based on the above example, for user node 1, the user content pair consisting of user node 1 and video node 1 and the user content pair consisting of user node 1 and video node 2 can be added to the first interaction set. The user content pair consisting of user node 1 and video node 3 can be added to the second interaction set.
[0201] 2. Based on the fusion vectors corresponding to the nodes in the first training structure diagram, determine the interaction prediction value corresponding to each user-content pair in the first interaction set and the interaction prediction value corresponding to each user-content pair in the second interaction set.
[0202] For a target user-content pair, an interaction prediction value corresponding to the target user-content pair is determined based on the inner product between the fusion vector corresponding to the first user node and the fusion vector corresponding to the content node in the target user-content pair. The target user-content pair can be any user-content pair in the first interaction set or any user-content pair in the second interaction set.
[0203] 3. For the target user-content pairs in the first interaction set, determine the intermediate loss corresponding to the target user-content pairs based on the interaction prediction value corresponding to the target user-content pairs and the interaction prediction values corresponding to each group of user-content pairs in the second interaction set; wherein, the intermediate loss corresponding to the target user-content pairs is used to characterize the total degree of difference between the target user-content pairs and each group of user-content pairs in the second interaction set.
[0204] Optionally, the process of obtaining the intermediate loss can be as follows: based on the interaction prediction value corresponding to the target user content pair and the difference between the interaction prediction values corresponding to each group of user content pairs in the second interaction set, determine the sub-intermediate losses between the target user content pair and each group of user content pairs in the second interaction set; sum the sub-intermediate losses between the target user content pair and each group of user content pairs in the second interaction set to obtain the intermediate loss corresponding to the target user content pair.
[0205] The sub-intermediate loss between the target user content pair and the user content pair in the second interaction set can be determined based on the difference between the interaction prediction value corresponding to the target user content pair and the interaction prediction value corresponding to the user content pair in the second interaction set.
[0206] 4. Based on the sum of the intermediate loss values corresponding to each group of user-content pairs in the first interaction set, obtain the first sub-training loss corresponding to the first user node.
[0207] 5. Sum the first sub-training losses corresponding to multiple user nodes in the first training structure graph to obtain the first training loss.
[0208] Exemplarily, the first training loss can be expressed as follows:
[0209]
[0210] Where O={(u,c i , c j )|(u,c i )∈R + ,(u,c j )∈R -}, R + For user node u and content node c i There are interactions between the set (ie, the first interaction set), R - For user node u and content node c j There is no interaction between the set (ie, the second interaction set), c i and c j The total number of is the total number of content nodes in the first training structure graph, σ(·) is an activation function, such as Sigmoid function, For user node u and content node c i The interaction prediction value between For user node u and content node c j The interaction prediction value between .
[0211] 5042. A second training loss is obtained based on the fusion vectors corresponding to the respective nodes in the second training structure graph. The second training loss is used to shorten the distance between the content node and the directly connected content node corresponding to the content node.
[0212] Optionally, the process of obtaining the second training loss can be as follows: for the first content node in the second training structure diagram, determine the set of directly connected content nodes of the first content node; for the target directly connected content node in the directly connected content node set, based on the difference between the fusion vector corresponding to the first content node and the fusion vector corresponding to the target directly connected content node, determine the fourth intermediate vector corresponding to the target directly connected content node; sum the fourth intermediate vectors corresponding to each directly connected content node in the directly connected content node set to obtain the second sub-training loss corresponding to the first content node; sum the second sub-training losses corresponding to each content node in the second training structure diagram to obtain the second training loss.
[0213] Exemplarily, the second training loss can be expressed as follows:
[0214]
[0215] Where C is the content node set in the second training structure graph (i.e., including all nodes in the second training structure graph), N t is the set of directly connected nodes of the content node t in the second training structure graph, is the fusion vector of the content node t in the second training structure graph, is the fusion vector of the content node v in the directly connected node set of the content node t in the second training structure graph, and ||·||2 is the 2-norm of the vector.
[0216] 5043. Determine a training loss of the interactive prediction model based on the first training loss and the second training loss.
[0217] Optionally, the first training loss and the second training loss may be summed to obtain the training loss of the interactive prediction model. The training loss of the interactive prediction model may be expressed as follows:
[0218]
[0219] Step 505: Train the interaction prediction model based on the training loss to obtain a trained interaction prediction model.
[0220] Optionally, the training loss of the interactive prediction model is back-propagated using an optimizer to optimize the model parameters of the interactive prediction model to obtain the trained model parameters: the parameters of the word embedding layer, the parameters in the feature aggregation layer (such as W1, W2, and ) and the parameters in the feature stacking layer (such as W1 (p) 、W2 (p) 、 and ), etc., p = 1, 2, ..., m. Based on the trained model parameters, the model parameters of the interactive prediction model are adjusted to obtain a trained interactive prediction model.
[0221] The trained interaction prediction model can obtain the word embedding vectors, aggregation vectors, stacking vectors and fusion vectors corresponding to user nodes and content nodes, and then obtain the interaction prediction value between user nodes and content nodes to select content nodes.
[0222] In summary, the technical solution provided by the embodiments of the present application trains the interaction prediction model by explicitly considering the potential correlation between content nodes and content nodes on the basis of explicitly considering the potential correlation between user nodes and content nodes in the process of training the interaction prediction model. This allows the interaction prediction model to more accurately capture the correlation between user nodes and content nodes, thereby improving the prediction accuracy of the interaction prediction model.
[0223] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0224] refer to Figure 7 , which shows a block diagram of a device for selecting recommended content provided by an embodiment of the present application. The device has the function of implementing the above method example, and the function can be implemented by hardware or by hardware executing corresponding software. The device can be the computer device described above, or it can be set in a computer device. Figure 7 As shown, the apparatus 700 includes: a structure diagram acquisition module 701 , a fusion vector generation module 702 , a prediction value acquisition module 703 and a recommended content selection module 704 .
[0225] The structure graph acquisition module 701 is used to acquire an input structure graph, where the input structure graph includes a plurality of user nodes and a plurality of content nodes. The input structure graph is used to represent the relationship between the user nodes and the content nodes.
[0226] The fusion vector generation module 702 is used to generate, based on the input structure graph, fusion vectors corresponding to each node in the input structure graph; wherein, for a target node among the nodes, the fusion vector corresponding to the target node integrates feature information of the target node and feature information of nodes associated with the target node.
[0227] The prediction value acquisition module 703 is used to determine, for a target user node among the multiple user nodes, interaction prediction values between the target user node and the multiple content nodes based on the fusion vector corresponding to the target user node and the fusion vectors corresponding to the multiple content nodes, respectively. The interaction prediction values are used to characterize the possibility of interaction between the target user node and the content nodes.
[0228] The recommended content selection module 704 is used to select a recommended content node from the multiple content nodes based on the interaction prediction values between the target user node and the multiple content nodes, and the diversity index of the recommended content node set; wherein the content corresponding to the recommended content node is recommended content for providing to the target user corresponding to the target user node, and the recommended content node set includes the recommended content node.
[0229] In an exemplary embodiment, Figure 8 As shown, the recommended content selection module 704 includes a candidate set acquisition submodule 704a and a recommended content selection submodule 704b.
[0230] The candidate set acquisition submodule 704a is configured to select a first number of candidate content nodes from the plurality of content nodes according to the interaction prediction value, and obtain a candidate content node set corresponding to the target user node.
[0231] The recommended content selection submodule 704b is configured to select, based on the diversity index of the recommended content node set, a second number of candidate content nodes from the candidate content node set as the recommended content nodes by exclusion; wherein the second number is smaller than the first number.
[0232] In an exemplary embodiment, the recommended content selection submodule 704b is configured to:
[0233] For the j-th candidate content node in the candidate content node set, if the degree of decrease in the diversity index of the recommended content node set after adding the j-th candidate content node is less than the degree of decrease in the diversity index of the recommended content node set after adding other candidate content nodes in the candidate content node set, then the j-th candidate content node is used as the recommended content node, where j is a positive integer;
[0234] Adding the j-th candidate content node to the recommended content node set;
[0235] Eliminating the j-th candidate content node from the candidate content node set to obtain an adjusted candidate content node set;
[0236] When the number of recommended content nodes in the recommended content node set is less than the second number, continue to select the recommended content node from the adjusted candidate content node set;
[0237] When the number of recommended content nodes in the recommended content node set is equal to the second number, selection of the recommended content nodes is stopped.
[0238] In an exemplary embodiment, the candidate set acquisition submodule 704a is configured to:
[0239] sorting the plurality of content nodes in descending order of the interaction prediction values to obtain a content node sequence;
[0240] A first number of content nodes are selected from the content node sequence to obtain the candidate content node set.
[0241] In an exemplary embodiment, Figure 8 As shown, the fused vector generating module 702 includes: an initial vector generating submodule 702a, an aggregated vector generating submodule 702b, a stacked vector generating submodule 702c and a fused vector generating submodule 702d.
[0242] The initial vector generation submodule 702a is used to obtain the word embedding vector corresponding to each node in the input structure graph.
[0243] The aggregation vector generation submodule 702b is used to perform feature aggregation on the word embedding vector corresponding to the target node among the nodes according to the input structure diagram to obtain the aggregation vector corresponding to the target node; wherein the aggregation vector corresponding to the target node is used to aggregate the feature information of the target node and the feature information of the directly connected nodes of the target node.
[0244] The stacking vector generation submodule 702c is used to perform feature stacking on the aggregation vector corresponding to the target node according to the input structure diagram to obtain the stacking vector corresponding to the target node; wherein the stacking vector corresponding to the target node is used to stack the feature information of the target node and the feature information of the node associated with the target node.
[0245] The fusion vector generation submodule 702d is used to generate a fusion vector corresponding to the target node based on the word embedding vector, the aggregation vector and the stacking vector corresponding to the target node.
[0246] In an exemplary embodiment, the aggregate vector generating submodule 702b is configured to:
[0247] Determine, according to the input structure graph, a set of directly connected nodes corresponding to the target node;
[0248] For a target directly connected node in the directly connected node set, performing element-wise multiplication on a word embedding vector corresponding to the target node and a word embedding vector corresponding to the directly connected node to obtain a first intermediate vector;
[0249] Performing a weighted summation on the first intermediate vector and the word embedding vector corresponding to the directly connected node to obtain a second intermediate vector corresponding to the target directly connected node;
[0250] Summing the second intermediate vectors corresponding to the respective directly connected nodes in the directly connected node set to obtain a third intermediate vector;
[0251] Feature aggregation is performed on the word embedding vector corresponding to the target node and the third intermediate vector to obtain an aggregated vector corresponding to the target node.
[0252] In an exemplary embodiment, the stacked vector includes an m-order stacked vector, where m is a positive integer greater than 1; the fused vector generating submodule 702d is configured to:
[0253] Determine, according to the input structure graph, a set of directly connected nodes corresponding to the target node;
[0254] For the p-th order stacking vector in the m-order stacking vectors, when p is equal to 2, feature stacking is performed on the aggregation vector corresponding to the target node and the aggregation vectors corresponding to each directly connected node in the directly connected node set to obtain a second-order stacking vector corresponding to the target node; where p is a positive integer less than or equal to m;
[0255] When p is greater than 2, feature stacking is performed on the p-1th order stacking vector corresponding to the target node and the p-1th order stacking vectors corresponding to each directly connected node to obtain the p-th order stacking vector corresponding to the target node.
[0256] In an exemplary embodiment, the predicted value acquisition module 703 is configured to:
[0257] Calculating the inner product between the fusion vector corresponding to the target user node and the fusion vector corresponding to the target content node;
[0258] An interaction prediction value between the target user node and the target content node is determined according to the inner product.
[0259] In summary, the technical solution provided in the embodiments of the present application selects recommended content nodes from multiple content nodes by combining the interaction prediction value between user nodes and content nodes and the diversity index of the set composed of recommended content nodes, and comprehensively considers the correlation between recommended content nodes and user nodes and the diversity of recommended content nodes, so that the recommended content is relevant to the user while improving the diversity of the recommended content.
[0260] refer to Figure 9 , which shows a block diagram of a training device for an interactive prediction model provided by an embodiment of the present application. The device has the function of implementing the above method example, and the function can be implemented by hardware or by hardware executing corresponding software. The device can be the computer device described above, or it can be set in a computer device. Figure 9 As shown, the device 900 includes: a training data acquisition module 901, a structure diagram construction module 902, a fusion vector acquisition module 903, a training loss acquisition module 904 and a prediction model training module 905.
[0261] The training data acquisition module 901 is used to acquire training data for the interaction prediction model; wherein the training data includes multiple sets of historical interaction information, and the historical interaction information is used to describe the interaction history between the user and the content.
[0262] The structure diagram construction module 902 is used to construct a first training structure diagram and a second training structure diagram based on the multiple sets of historical interaction information; wherein the first training structure diagram includes multiple user nodes and multiple content nodes, and the first training structure diagram is used to represent the relationship between the user nodes and the content nodes; the second training structure diagram includes multiple content nodes, and the second training structure diagram is used to represent the relationship between the content nodes.
[0263] The fusion vector acquisition module 903 is used to obtain the fusion vectors corresponding to each node in the first training structure diagram and the fusion vectors corresponding to each node in the second training structure diagram through the interactive prediction model; wherein, for the target node, the fusion vector of the target node integrates the feature information of the target node and the feature information of the nodes associated with the target node.
[0264] The training loss acquisition module 904 is used to determine the training loss of the interactive prediction model based on the fusion vectors corresponding to the nodes in the first training structure diagram and the fusion vectors corresponding to the nodes in the second training structure diagram.
[0265] The prediction model training module 905 is used to train the interaction prediction model based on the training loss to obtain a trained interaction prediction model.
[0266] In an exemplary embodiment, Figure 10 As shown, the training loss acquisition module 904 includes: a first loss acquisition submodule 904a, a second loss acquisition submodule 904b and a training loss acquisition submodule 904c.
[0267] The first loss acquisition submodule 904a is used to obtain a first training loss based on the fusion vectors corresponding to each node in the first training structure diagram; wherein the first training loss is used to increase the distance between the user node and the content node that has no interactive relationship with the user node.
[0268] The second loss acquisition submodule 904b is used to obtain a second training loss based on the fusion vectors corresponding to each node in the second training structure diagram; wherein the second training loss is used to shorten the distance between the content node and the directly connected content node corresponding to the content node.
[0269] The training loss acquisition submodule 904c is used to determine the training loss of the interactive prediction model based on the first training loss and the second training loss.
[0270] In an exemplary embodiment, the first loss acquisition submodule 904a is configured to:
[0271] For a first user node in the first training structure graph, determining a first interaction set and a second interaction set corresponding to the first user node; wherein, in each user-content pair in the first interaction set, there is an interaction relationship between the content node and the first user node, and in each user-content pair in the second interaction set, there is no interaction relationship between the content node and the first user node;
[0272] Determining, based on the fusion vectors corresponding to the respective nodes in the first training structure graph, an interaction prediction value corresponding to each user-content pair in the first interaction set and an interaction prediction value corresponding to each user-content pair in the second interaction set;
[0273] For a target user-content pair in the first interaction set, determining an intermediate loss corresponding to the target user-content pair based on an interaction prediction value corresponding to the target user-content pair and an interaction prediction value corresponding to each group of user-content pairs in the second interaction set; wherein the intermediate loss corresponding to the target user-content pair is used to represent the total degree of difference between the target user-content pair and each group of user-content pairs in the second interaction set;
[0274] Obtaining a first sub-training loss corresponding to the first user node based on a sum of intermediate loss values corresponding to each group of user-content pairs in the first interaction set;
[0275] The first sub-training losses corresponding to the plurality of user nodes in the first training structure graph are summed to obtain the first training loss.
[0276] In an exemplary embodiment, the first loss acquisition submodule 904a is further configured to:
[0277] determining, based on differences between the interaction prediction value corresponding to the target user-content pair and the interaction prediction values corresponding to each group of user-content pairs in the second interaction set, a sub-intermediate loss between the target user-content pair and each group of user-content pairs in the second interaction set;
[0278] The sub-intermediate losses between the target user-content pair and each group of user-content pairs in the second interaction set are summed to obtain the intermediate loss corresponding to the target user-content pair.
[0279] In an exemplary embodiment, the second loss obtaining submodule 904b is configured to:
[0280] For a first content node in the second training structure diagram, determining a set of directly connected content nodes of the first content node;
[0281] For a target directly-connected content node in the directly-connected content node set, determining a fourth intermediate vector corresponding to the target directly-connected content node based on a difference between a fusion vector corresponding to the first content node and a fusion vector corresponding to the target directly-connected content node;
[0282] Summing the fourth intermediate vectors corresponding to the respective directly connected content nodes in the directly connected content node set to obtain a second sub-training loss corresponding to the first content node;
[0283] The second sub-training losses corresponding to the content nodes in the second training structure graph are summed to obtain the second training loss.
[0284] In summary, the technical solution provided by the embodiments of the present application trains the interaction prediction model by explicitly considering the potential correlation between content nodes and content nodes on the basis of explicitly considering the potential correlation between user nodes and content nodes in the process of training the interaction prediction model. This allows the interaction prediction model to more accurately capture the correlation between user nodes and content nodes, thereby improving the prediction accuracy of the interaction prediction model.
[0285] It should be noted that the apparatus provided in the above embodiments, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0286] Please refer to Figure 11 , which shows a block diagram of the structure of a computer device provided in one embodiment of the present application. The computer device can be used to implement the method for selecting recommended content or the method for training an interactive prediction model provided in the above embodiments. Specifically, the following contents may be included.
[0287] The computer device 1100 includes a central processing unit (CPU, central processing unit), GPU (graphics processing unit), and FPGA (field programmable gate array) 1101, a system memory 1104 including RAM (random-access memory) 1102 and ROM (read-only memory) 1103, and a system bus 1105 connecting the system memory 1104 and the central processing unit 1101. The computer device 1100 also includes a basic input / output system (I / O system) 1106 for facilitating information transmission between various components within the server, and a mass storage device 1107 for storing an operating system 1113, application programs 1114, and other program modules 1115.
[0288] The basic input / output system 1106 includes a display 1108 for displaying information and an input device 1109 such as a mouse and keyboard for user input. Both the display 1108 and the input device 1109 are connected to the central processing unit 1101 via an input / output controller 1110 connected to the system bus 1105. The basic input / output system 1106 may also include an input / output controller 1110 for receiving and processing input from a variety of other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1110 also provides output to a display screen, printer, or other types of output devices.
[0289] The mass storage device 1107 is connected to the central processing unit 1101 via a mass storage controller (not shown) connected to the system bus 1105. The mass storage device 1107 and its associated computer-readable media provide non-volatile storage for the computer device 1100. In other words, the mass storage device 1107 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0290] 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 RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technology, CD-ROM, DVD (Digital Video Disc) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the above-mentioned ones. The above-mentioned system memory 1104 and mass storage device 1107 can be collectively referred to as memory.
[0291] According to an embodiment of the present application, the computer device 1100 can also be connected to a remote computer on a network such as the Internet for operation. That is, the computer device 1100 can be connected to the network 1112 via the network interface unit 1111 connected to the system bus 1105. Alternatively, the network interface unit 1111 can be used to connect to other types of networks or remote computer systems (not shown).
[0292] The memory also includes at least one instruction, at least one program, code set or instruction set, which is stored in the memory and configured to be executed by one or more processors to implement the above-mentioned method for selecting recommended content or training method for interactive prediction model.
[0293] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, and when the at least one instruction, at least one program, code set or instruction set is executed by a processor, it implements the above-mentioned method for selecting recommended content or the method for training an interactive prediction model.
[0294] Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives), or an optical disk, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0295] In one exemplary embodiment, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned method for selecting recommended content or the method for training an interactive prediction model.
[0296] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application do not limit this.
[0297] The above description is merely an exemplary 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 scope of protection of the present application.
Claims
1. A method for selecting recommended content, characterized in that: The method comprises: Acquire an input structure graph, wherein the input structure graph includes a plurality of user nodes and a plurality of content nodes, and the input structure graph is used to represent the relationship between the user nodes and the content nodes; Obtain word embedding vectors corresponding to each node in the input structure graph; For a target node among the nodes, perform feature aggregation on the word embedding vector corresponding to the target node according to the input structure graph to obtain an aggregated vector corresponding to the target node; wherein the aggregated vector corresponding to the target node is used to aggregate feature information of the target node and feature information of directly connected nodes of the target node; Performing feature stacking on the aggregation vector corresponding to the target node according to the input structure graph to obtain a stacking vector corresponding to the target node; wherein the stacking vector corresponding to the target node is used to stack feature information of the target node and feature information of nodes associated with the target node; Generate a fusion vector corresponding to the target node according to the word embedding vector, the aggregation vector, and the stacking vector corresponding to the target node, where the fusion vector corresponding to the target node integrates feature information of the target node and feature information of nodes associated with the target node; For a target user node among the multiple user nodes, determining interaction prediction values between the target user node and the multiple content nodes based on a fusion vector corresponding to the target user node and fusion vectors corresponding to the multiple content nodes, the interaction prediction values being used to represent the likelihood of interaction between the target user node and the content nodes; A recommended content node is selected from the multiple content nodes based on the interaction prediction values between the target user node and the multiple content nodes, and the diversity index of the recommended content node set; wherein the content corresponding to the recommended content node is recommended content for providing to the target user corresponding to the target user node, and the recommended content node set includes the recommended content node.
2. The method according to claim 1, characterized in that The selecting a recommended content node from the plurality of content nodes according to the interaction prediction values between the target user node and the plurality of content nodes, and the diversity index of the recommended content node set, includes: selecting a first number of candidate content nodes from the plurality of content nodes according to the interaction prediction value, to obtain a set of candidate content nodes corresponding to the target user node; A second number of candidate content nodes are selected from the candidate content node set in an exclusionary manner according to the diversity index of the recommended content node set as the recommended content nodes; wherein the second number is smaller than the first number.
3. The method according to claim 2, characterized in that The step of selecting, based on the diversity index of the recommended content node set, a second number of candidate content nodes from the candidate content node set by exclusion as the recommended content nodes includes: For the j-th candidate content node in the candidate content node set, if the degree of decrease in the diversity index of the recommended content node set after adding the j-th candidate content node is less than the degree of decrease in the diversity index of the recommended content node set after adding other candidate content nodes in the candidate content node set, then the j-th candidate content node is used as the recommended content node, where j is a positive integer; Adding the j-th candidate content node to the recommended content node set; Eliminating the j-th candidate content node from the candidate content node set to obtain an adjusted candidate content node set; When the number of recommended content nodes in the recommended content node set is less than the second number, continue to select the recommended content node from the adjusted candidate content node set; When the number of recommended content nodes in the recommended content node set is equal to the second number, selection of the recommended content nodes is stopped.
4. The method according to claim 2, characterized in that The step of selecting a first number of candidate content nodes from the plurality of content nodes according to the interaction prediction value to obtain a set of candidate content nodes corresponding to the target user node includes: sorting the plurality of content nodes in descending order of the interaction prediction values to obtain a content node sequence; A first number of content nodes are selected from the content node sequence to obtain the candidate content node set.
5. The method according to claim 1, wherein The performing feature aggregation on the word embedding vector corresponding to the target node according to the input structure graph to obtain the aggregated vector corresponding to the target node includes: Determine, according to the input structure graph, a set of directly connected nodes corresponding to the target node; For a target directly connected node in the directly connected node set, performing element-wise multiplication on a word embedding vector corresponding to the target node and a word embedding vector corresponding to the directly connected node to obtain a first intermediate vector; Performing a weighted summation on the first intermediate vector and the word embedding vector corresponding to the directly connected node to obtain a second intermediate vector corresponding to the target directly connected node; Summing the second intermediate vectors corresponding to the respective directly connected nodes in the directly connected node set to obtain a third intermediate vector; Feature aggregation is performed on the word embedding vector corresponding to the target node and the third intermediate vector to obtain an aggregated vector corresponding to the target node.
6. The method according to claim 1, characterized in that The stacking vector includes an m-order stacking vector, where m is a positive integer greater than 1; The performing feature stacking on the aggregation vector corresponding to the target node according to the input structure graph to obtain the stacked vector corresponding to the target node includes: Determine, according to the input structure graph, a set of directly connected nodes corresponding to the target node; For the p-th order stacking vector in the m-order stacking vectors, when p is equal to 2, feature stacking is performed on the aggregation vector corresponding to the target node and the aggregation vectors corresponding to each directly connected node in the directly connected node set to obtain a second-order stacking vector corresponding to the target node; where p is a positive integer less than or equal to m; When p is greater than 2, feature stacking is performed on the p-1th order stacking vector corresponding to the target node and the p-1th order stacking vectors corresponding to each directly connected node to obtain the p-th order stacking vector corresponding to the target node.
7. The method according to any one of claims 1 to 6, characterized in that The determining, based on the fusion vector corresponding to the target user node and the fusion vectors corresponding to the multiple content nodes, interaction prediction values between the target user node and the multiple content nodes respectively includes: For a target content node among the multiple content nodes, calculating an inner product between a fusion vector corresponding to the target user node and a fusion vector corresponding to the target content node; An interaction prediction value between the target user node and the target content node is determined according to the inner product.
8. A training method for an interactive prediction model, characterized in that: The method comprises: Acquire training data for an interaction prediction model; wherein the training data includes multiple sets of historical interaction information, the historical interaction information being used to describe the interaction history between the user and the content; Based on the multiple sets of historical interaction information, a first training structure graph and a second training structure graph are constructed; wherein the first training structure graph includes multiple user nodes and multiple content nodes, and the first training structure graph is used to represent the relationship between the user nodes and the content nodes; the second training structure graph includes multiple content nodes, and the second training structure graph is used to represent the relationship between the content nodes; Through the interactive prediction model, obtain the fusion vectors corresponding to each node in the first training structure diagram and the fusion vectors corresponding to each node in the second training structure diagram; wherein, for the target node, the fusion vector of the target node integrates the feature information of the target node and the feature information of the node associated with the target node, and the fusion vector of the target node is generated according to the word embedding vector, aggregation vector and stacking vector corresponding to the target node, and the stacking vector is obtained by feature stacking the aggregation vector according to the training structure diagram corresponding to the target node, and the stacking vector is used to stack the feature information of the target node and the feature information of the node associated with the target node, and the aggregation vector is obtained by feature aggregation of the word embedding vector corresponding to the target node according to the training structure diagram corresponding to the target node, and the aggregation vector is used to aggregate the feature information of the target node and the feature information of the directly connected nodes of the target node; Determining the training loss of the interactive prediction model based on the fusion vectors corresponding to the respective nodes in the first training structure graph and the fusion vectors corresponding to the respective nodes in the second training structure graph; The interaction prediction model is trained based on the training loss to obtain a trained interaction prediction model.
9. The method according to claim 8, characterized in that The determining the training loss of the interactive prediction model based on the fusion vectors corresponding to the respective nodes in the first training structure graph and the fusion vectors corresponding to the respective nodes in the second training structure graph includes: Obtaining a first training loss based on the fusion vectors corresponding to the respective nodes in the first training structure graph; wherein the first training loss is used to increase the distance between the user node and content nodes that have no interaction relationship with the user node; Obtaining a second training loss based on the fusion vectors corresponding to the respective nodes in the second training structure graph; wherein the second training loss is used to shorten the distance between the content node and the directly connected content node corresponding to the content node; Based on the first training loss and the second training loss, a training loss of the interaction prediction model is determined.
10. The method according to claim 9, characterized in that The obtaining of a first training loss based on the fusion vectors corresponding to the respective nodes in the first training structure graph includes: For a first user node in the first training structure graph, determining a first interaction set and a second interaction set corresponding to the first user node; wherein, in each user-content pair in the first interaction set, there is an interaction relationship between the content node and the first user node, and in each user-content pair in the second interaction set, there is no interaction relationship between the content node and the first user node; Determining, based on the fusion vectors corresponding to the respective nodes in the first training structure graph, an interaction prediction value corresponding to each user-content pair in the first interaction set and an interaction prediction value corresponding to each user-content pair in the second interaction set; For a target user-content pair in the first interaction set, determining an intermediate loss corresponding to the target user-content pair based on an interaction prediction value corresponding to the target user-content pair and an interaction prediction value corresponding to each group of user-content pairs in the second interaction set; wherein the intermediate loss corresponding to the target user-content pair is used to represent the total degree of difference between the target user-content pair and each group of user-content pairs in the second interaction set; Obtaining a first sub-training loss corresponding to the first user node based on a sum of intermediate loss values corresponding to each group of user-content pairs in the first interaction set; The first sub-training losses corresponding to the plurality of user nodes in the first training structure graph are summed to obtain the first training loss.
11. The method according to claim 10, characterized in that The determining the intermediate loss corresponding to the target user-content pair based on the interaction prediction value corresponding to the target user-content pair and the interaction prediction values corresponding to each group of user-content pairs in the second interaction set includes: determining, based on differences between the interaction prediction value corresponding to the target user-content pair and the interaction prediction values corresponding to each group of user-content pairs in the second interaction set, a sub-intermediate loss between the target user-content pair and each group of user-content pairs in the second interaction set; The sub-intermediate losses between the target user-content pair and each group of user-content pairs in the second interaction set are summed to obtain the intermediate loss corresponding to the target user-content pair.
12. The method according to claim 9, characterized in that The obtaining of the second training loss based on the fusion vectors corresponding to the respective nodes in the second training structure graph includes: For a first content node in the second training structure diagram, determining a set of directly connected content nodes of the first content node; For a target directly-connected content node in the directly-connected content node set, determining a fourth intermediate vector corresponding to the target directly-connected content node based on a difference between a fusion vector corresponding to the first content node and a fusion vector corresponding to the target directly-connected content node; Summing the fourth intermediate vectors corresponding to the respective directly connected content nodes in the directly connected content node set to obtain a second sub-training loss corresponding to the first content node; The second sub-training losses corresponding to the content nodes in the second training structure graph are summed to obtain the second training loss.
13. A device for selecting recommended content, characterized in that: The device comprises: A structure graph acquisition module is used to acquire an input structure graph, wherein the input structure graph includes a plurality of user nodes and a plurality of content nodes, and the input structure graph is used to represent the relationship between the user nodes and the content nodes; A fusion vector generation module is used to obtain the word embedding vectors corresponding to each node in the input structure graph; for a target node among the nodes, feature aggregation is performed on the word embedding vectors corresponding to the target node according to the input structure graph to obtain an aggregation vector corresponding to the target node; wherein the aggregation vector corresponding to the target node is used to aggregate the feature information of the target node and the feature information of the directly connected nodes of the target node; feature stacking is performed on the aggregation vector corresponding to the target node according to the input structure graph to obtain a stacking vector corresponding to the target node; wherein the stacking vector corresponding to the target node is used to stack the feature information of the target node and the feature information of the nodes associated with the target node; based on the word embedding vector, aggregation vector and stacking vector corresponding to the target node, a fusion vector corresponding to the target node is generated, and the fusion vector corresponding to the target node integrates the feature information of the target node and the feature information of the nodes associated with the target node; a prediction value acquisition module, configured to determine, for a target user node among the multiple user nodes, interaction prediction values between the target user node and the multiple content nodes based on a fusion vector corresponding to the target user node and fusion vectors corresponding to the multiple content nodes, the interaction prediction values being used to represent the likelihood of interaction between the target user node and the content nodes; A recommended content selection module is configured to select a recommended content node from the multiple content nodes based on the interaction prediction values between the target user node and the multiple content nodes, and the diversity index of the recommended content node set; wherein the content corresponding to the recommended content node is recommended content for providing to the target user corresponding to the target user node, and the recommended content node set includes the recommended content node.
14. A training device for an interactive prediction model, characterized in that: The device comprises: A training data acquisition module, configured to acquire training data for an interaction prediction model; wherein the training data includes multiple sets of historical interaction information, wherein the historical interaction information is used to describe the interaction history between a user and content; a structure graph construction module, configured to construct a first training structure graph and a second training structure graph based on the multiple sets of historical interaction information; wherein the first training structure graph includes a plurality of user nodes and a plurality of content nodes, and is used to represent the relationship between the user nodes and the content nodes; and the second training structure graph includes a plurality of content nodes, and is used to represent the relationship between the content nodes; A fusion vector acquisition module is used to obtain, through the interactive prediction model, the fusion vectors corresponding to each node in the first training structure diagram and the fusion vectors corresponding to each node in the second training structure diagram; wherein, for the target node, the fusion vector of the target node integrates the feature information of the target node and the feature information of the node associated with the target node, and the fusion vector of the target node is generated according to the word embedding vector, aggregation vector and stacking vector corresponding to the target node, and the stacking vector is obtained by feature stacking the aggregation vector according to the training structure diagram corresponding to the target node, and the stacking vector is used to stack the feature information of the target node and the feature information of the node associated with the target node, and the aggregation vector is obtained by feature aggregation of the word embedding vector corresponding to the target node according to the training structure diagram corresponding to the target node, and the aggregation vector is used to aggregate the feature information of the target node and the feature information of the directly connected nodes of the target node; a training loss acquisition module, configured to determine the training loss of the interactive prediction model based on the fusion vectors corresponding to the respective nodes in the first training structure graph and the fusion vectors corresponding to the respective nodes in the second training structure graph; The prediction model training module is used to train the interaction prediction model based on the training loss to obtain a trained interaction prediction model.
15. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for selecting recommended content as described in any one of claims 1 to 7, or the method for training an interactive prediction model as described in any one of claims 8 to 12.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction, which is loaded and executed by the processor to implement the method for selecting recommended content as described in any one of claims 1 to 7, or the method for training an interactive prediction model as described in any one of claims 8 to 12.
17. A computer program product, characterized in that The computer program product includes computer instructions, which are executed by a processor to implement the method for selecting recommended content according to any one of claims 1 to 7, or the method for training an interactive prediction model according to any one of claims 8 to 12.
Citation Information
Patent Citations
Short video recommendation method based on graph model, intelligent terminal and storage medium
CN111382309A