Recommended model training method, recommended method, device, equipment and storage medium
By constructing a heterogeneous graph of account resources and extracting features using a multi-head attention module, the problem of low accuracy in existing recommendation models is solved, and high accuracy in multimedia resource recommendation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-03
- Publication Date
- 2026-03-31
AI Technical Summary
Existing recommendation models have low accuracy in recommending multimedia resources and cannot effectively utilize the relationship between accounts and multimedia resources.
By acquiring a heterogeneous graph of account resources, sampling behavioral data sequences and multimedia resources of target accounts, extracting features using a multi-head attention module, and adjusting the model based on the loss value determined by similarity, a target recommendation model is constructed.
It improves the accuracy of multimedia resource recommendations by comprehensively considering the feature information from both the media resource side and the user side to obtain a recommendation model with better performance.
Smart Images

Figure CN116089834B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and in particular to recommendation model training methods, recommendation methods, devices, equipment and storage media. Background Technology
[0002] With the continuous development of internet technology, the amount of information on the internet has exploded. To alleviate information overload, recommendation technology has been widely applied in various fields, such as e-commerce, social networks, and video sharing platforms. Among these technologies, most multimedia resource recommendations are built around a user-centric model, but the accuracy of these recommendations is relatively low. Summary of the Invention
[0003] This disclosure provides a method for training a recommendation model, a recommendation method, an apparatus, a device, and a storage medium to at least address the problem of low recommendation accuracy in related technologies. The technical solution of this disclosure is as follows:
[0004] According to a first aspect of the present disclosure, a method for training a recommendation model is provided, comprising:
[0005] Obtain an account resource heterogeneity graph; the account resource heterogeneity graph is used to indicate the association between account behavioral data and multimedia resources;
[0006] The heterogeneous graph of account resources is sampled to obtain a target behavior data sequence corresponding to the target account and a first multimedia resource; the target behavior data sequence consists of the behavior data of the target account on the first multimedia resource, and the first multimedia resource is a sampled positive sample resource that has an interaction relationship with the target account;
[0007] The first resource data related to the first multimedia resource is input into the model to be trained to obtain the first multimedia resource features; and the second resource data related to the second multimedia resource is input into the model to be trained to obtain the second multimedia resource features; the second multimedia resource is a negative sample resource in the multimedia resource that has no interaction with the target account;
[0008] The target behavior data sequence and the first multimedia resource features are input into the model to be trained to obtain the target account features;
[0009] Based on the first similarity between the first multimedia resource feature and the target account feature, and the second similarity between the second multimedia resource feature and the target account feature, a loss value is determined; and the model to be trained is adjusted based on the loss value to obtain the target recommendation model.
[0010] Optionally, the model to be trained includes a first network structure and a second network structure;
[0011] The step of inputting first resource data related to the first multimedia resource into the model to be trained to obtain first multimedia resource features; and inputting second resource data related to the second multimedia resource into the model to be trained to obtain second multimedia resource features, includes:
[0012] The first resource data related to the first multimedia resource is input into the first network structure of the model to be trained to obtain the first multimedia resource features; and the second resource data related to the second multimedia resource is input into the first network structure to obtain the second multimedia resource features.
[0013] The step of inputting the target behavior data sequence and the first multimedia resource features into the model to be trained to obtain target account features includes:
[0014] The target behavior data sequence and the first multimedia resource features are input into the second network structure of the model to be trained to obtain the target account features.
[0015] Optionally, the step of inputting the target behavior data sequence and the first multimedia resource features into the second network structure of the model to be trained to obtain the target account features includes:
[0016] The target behavior data sequence and the first multimedia resource feature are input into the multi-head attention module of the second network structure; the multi-head attention module performs feature extraction on the first multimedia resource feature and the target behavior data sequence to obtain the target account feature.
[0017] Optionally, sampling the heterogeneous graph of account resources to obtain the target behavior data sequence corresponding to the target account includes:
[0018] The target account is identified from the accounts corresponding to the heterogeneous account resource graph;
[0019] Randomly sample the first behavior data of the target account in the heterogeneous account resource graph, and use the sampled second behavior data to form the target behavior data sequence;
[0020] Alternatively, in the first behavioral data of the target account in the heterogeneous account resource graph, a third behavioral data with an influence coefficient greater than a set value is selected. The third behavioral data is used to form the target behavioral data sequence, and the influence coefficient is used to indicate the importance of the first behavioral data.
[0021] Optionally, before the steps of inputting the first resource data related to the first multimedia resource into the model to be trained to obtain the first multimedia resource features; and inputting the second resource data related to the second multimedia resource into the model to be trained to obtain the second multimedia resource features, the method further includes:
[0022] The first resource data is determined, and the first resource data includes at least one of first identification data, first content data, and first attention data. The first identification data is used to distinguish the first resource data, and the first attention data is used to indicate the degree of attention the target account pays to the first multimedia resource.
[0023] The second resource data is determined, and the second resource data includes at least one of second identification data, second content data, and second attention data. The second identification data is used to distinguish the second resource data, and the second attention data is used to indicate the degree of attention the target account pays to the second multimedia resource.
[0024] Optionally, determining the loss value based on the first similarity between the first multimedia resource feature and the target account feature, and the second similarity between the second multimedia resource feature and the target account feature, includes:
[0025] The first similarity is determined by multiplying the first multimedia resource feature and the target account feature by a dot product.
[0026] The second similarity is determined by multiplying the second multimedia resource feature and the target account feature by a dot product.
[0027] The loss value is determined based on the difference between the first similarity and the second similarity.
[0028] Optionally, the method further includes:
[0029] Obtain real-time data of the account, including the account's latest behavioral data regarding the multimedia resources;
[0030] Based on the real-time data, the account resource heterogeneity graph is updated periodically.
[0031] According to a second aspect of the present disclosure, a multimedia resource recommendation method is provided, comprising:
[0032] Sampling is performed on the account resource heterogeneity graph to obtain the target behavior data sequence and target multimedia resources corresponding to the target account; the account resource heterogeneity graph is used to indicate the association between the account's behavior data and multimedia resources, and the target account is any one of the accounts; the target behavior data sequence is composed of the target account's behavior data on the target multimedia resources.
[0033] First resource data related to the target multimedia resource is input into the target recommendation model to obtain first multimedia resource features; second resource data related to the multimedia resource to be recommended is input into the target recommendation model to obtain second multimedia resource features.
[0034] The target behavior data sequence and the first multimedia resource features are input into the target recommendation model to obtain the target account features;
[0035] Based on the similarity between the second multimedia resource features and the target account features, target recommendation resources for recommendation to the target account are determined from the multimedia resources to be recommended.
[0036] According to a third aspect of the present disclosure, a recommendation model training apparatus is provided, comprising:
[0037] The relationship graph acquisition module is configured to acquire an account resource heterogeneity graph; the account resource heterogeneity graph is used to indicate the association between account behavioral data and multimedia resources.
[0038] The sequence determination module is configured to sample the heterogeneous graph of account resources to obtain a target behavior data sequence corresponding to the target account and a first multimedia resource; the target behavior data sequence consists of the behavior data of the target account on the first multimedia resource, and the first multimedia resource is a sampled positive sample resource that has an interaction relationship with the target account;
[0039] The first feature determination module is configured to input first resource data related to the first multimedia resource into the model to be trained to obtain first multimedia resource features; and input second resource data related to the second multimedia resource into the model to be trained to obtain second multimedia resource features; wherein the second multimedia resource is a negative sample resource in the multimedia resource that has no interaction with the target account;
[0040] The second feature determination module is configured to input the target behavior data sequence and the first multimedia resource feature into the model to be trained to obtain the target account feature;
[0041] The parameter adjustment module is configured to determine a loss value based on a first similarity between the first multimedia resource feature and the target account feature, and a second similarity between the second multimedia resource feature and the target account feature; and to adjust the model to be trained based on the loss value to obtain the target recommendation model.
[0042] Optionally, the model to be trained includes a first network structure and a second network structure;
[0043] The first feature determination module is further configured to input the first resource data related to the first multimedia resource into the first network structure of the model to be trained to obtain the first multimedia resource feature; and input the second resource data related to the second multimedia resource into the first network structure to obtain the second multimedia resource feature;
[0044] The second feature determination module is further configured to input the target behavior data sequence and the first multimedia resource feature into the second network structure of the model to be trained to obtain the target account feature.
[0045] Optionally, the second feature determination module is further configured to input the target behavior data sequence and the first multimedia resource feature into the multi-head attention module of the second network structure; the multi-head attention module performs feature extraction on the first multimedia resource feature and the target behavior data sequence to obtain the target account feature.
[0046] Optionally, the sequence determination module includes:
[0047] An account determination unit is used to determine the target account from the accounts corresponding to the account resource heterogeneity graph;
[0048] The sequence determination unit is used to randomly sample the first behavioral data of the target account in the heterogeneous account resource graph, and the sampled second behavioral data is used to form the target behavioral data sequence; or, in the first behavioral data of the target account in the heterogeneous account resource graph, a third behavioral data with an influence coefficient greater than a set value is selected, and the third behavioral data is used to form the target behavioral data sequence, and the influence coefficient is used to indicate the importance of the first behavioral data.
[0049] Optionally, the device further includes:
[0050] The first resource determination module is used to determine the first resource data. The first resource data includes at least one of first identification data, first content data, and first attention data. The first identification data is used to distinguish the first resource data, and the first attention data is used to indicate the degree of attention the target account pays to the first multimedia resource.
[0051] The second resource determination module is used to determine the second resource data, which includes at least one of second identification data, second content data, and second attention data. The second identification data is used to distinguish the second resource data, and the second attention data is used to indicate the degree of attention the target account pays to the second multimedia resource.
[0052] Optionally, the parameter adjustment module includes:
[0053] The first similarity determination unit is used to perform a dot product between the first multimedia resource feature and the target account feature to determine the first similarity;
[0054] The second similarity determination unit is used to perform a dot product between the second multimedia resource feature and the target account feature to determine the second similarity.
[0055] The loss value determination unit is used to determine the loss value based on the difference between the first similarity and the second similarity.
[0056] According to a fourth aspect of the present disclosure, a multimedia resource recommendation device is provided, comprising:
[0057] The sampling processing module is configured to sample the account resource heterogeneity graph to obtain the target behavior data sequence and target multimedia resources corresponding to the target account; the account resource heterogeneity graph is used to indicate the association between the account's behavior data and multimedia resources, and the target account is any one of the accounts; the target behavior data sequence consists of the target account's behavior data on the target multimedia resources.
[0058] The first input processing module is configured to input first resource data related to the target multimedia resource into the target recommendation model to obtain first multimedia resource features; and input second resource data related to the multimedia resource to be recommended into the target recommendation model to obtain second multimedia resource features.
[0059] The second input processing module is configured to input the target behavior data sequence and the first multimedia resource features into the target recommendation model to obtain target account features;
[0060] The recommended resource determination module is configured to determine the target recommended resource to be recommended to the target account from the multimedia resources to be recommended based on the similarity between the second multimedia resource features and the target account features.
[0061] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising:
[0062] processor;
[0063] Memory used to store the processor's executable instructions;
[0064] The processor is configured to execute the instructions to implement the recommendation model training method described above, or to implement the multimedia resource recommendation method described above.
[0065] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided that, when an instruction processor in the storage medium is executed, enables an electronic device to perform the recommendation model training method as described above, or enables the electronic device to perform the multimedia resource recommendation method as described above.
[0066] According to a seventh aspect of the present disclosure, a computer program product is provided, the computer program product including readable program code, which, when executed by a processor of an electronic device, enables the electronic device to perform the recommendation model training method as described above, or enables the electronic device to perform the multimedia resource recommendation method as described above.
[0067] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:
[0068] This disclosure obtains an account resource heterogeneity graph used to indicate the relationship between account behavior data and multimedia resources; then, it samples the account resource heterogeneity graph to determine the target account's target behavior data sequence and the first multimedia resource, wherein the target behavior data sequence consists of the target account's behavior data on the first multimedia resource, and the first multimedia resource is a sampled positive sample resource that interacts with the target account. This target behavior data sequence can well reflect the target account's interests. The first resource data related to the first multimedia resource is input into the model to be trained to obtain the first multimedia resource features. The second resource data related to the second multimedia resource is input into the model to be trained to obtain the second multimedia resource features. The second multimedia resource is a negative sample resource in the multimedia resources that does not interact with the target account. The obtained first multimedia resource features and second multimedia resource features can accurately express the feature information on the media resource side. Then, the target behavior data sequence and the first multimedia resource features are input into the model to be trained to obtain the target account features, which can accurately express the feature information on the user side. The first similarity between the first multimedia resource feature and the target account feature, and the second similarity between the second multimedia resource feature and the target account feature are further determined. A loss value is then determined based on the first and second similarities. This loss value is used to adjust the training model, resulting in a target recommendation model. The technical solution provided in this disclosure utilizes an account resource heterogeneity graph to mine the association between accounts and multimedia resources, obtaining target behavior data sequences that can characterize the implicit relationship between accounts and multimedia resources. Furthermore, during model construction, both the media resource side and the user side are considered together to determine the first and second multimedia resource features on the media resource side, and the target account features on the user side. By comprehensively considering the relationship between the first multimedia resource feature, the second multimedia resource feature, and the target account feature, a high-performance target recommendation model is obtained. This target recommendation model achieves high accuracy when recommending multimedia resources.
[0069] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0070] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0071] Figure 1 This is a flowchart illustrating a recommendation model training method according to an exemplary embodiment;
[0072] Figure 2This is a schematic diagram of an account resource heterogeneity graph in a recommendation model training method according to an exemplary embodiment;
[0073] Figure 3 This is a schematic diagram of the model structure in a recommendation model training method according to an exemplary embodiment;
[0074] Figure 4 This is a flowchart illustrating a multimedia resource recommendation method according to an exemplary embodiment;
[0075] Figure 5 This is a block diagram illustrating a recommendation model training apparatus according to an exemplary embodiment;
[0076] Figure 6 This is a block diagram illustrating a multimedia resource recommendation device according to an exemplary embodiment;
[0077] Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0078] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0079] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0080] Figure 1 This is a flowchart illustrating a recommendation model training method according to an exemplary embodiment. This method can be used in a server, which can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The method specifically includes the following steps.
[0081] In step S11, an account resource heterogeneity graph is obtained; the account resource heterogeneity graph is used to indicate the association between account behavior data and multimedia resources.
[0082] In this step, accounts correspond to users of the terminal, and there are several accounts. Multimedia resources include, but are not limited to, images, text, audio, video, and animation. Specifically, multimedia resources can be business objects recommended to users, such as advertisements, short videos, and news information. Account behavioral data refers to the historical interaction data between the account and multimedia resources, used to reflect the user's interests. Behavioral data includes, but is not limited to, clicks, favorites, likes, downloads, and purchases. After obtaining the account behavioral data, an account resource heterogeneity graph is obtained to indicate the relationship between the account behavioral data and multimedia resources.
[0083] In one possible application scenario, the multimedia resources are advertisements. Behavioral data of several accounts regarding several multimedia resources are collected over historical periods. Based on the collected behavioral data, an account resource heterogeneity graph is constructed, which can be a U2I (user to item) relationship graph.
[0084] For example, a heterogeneous graph of account resources contains multimedia resource nodes and account nodes, and the edges between multimedia resource nodes and account nodes represent interactive relationships. Figure 2 An example is shown in an account resource heterogeneous graph, where multimedia resource nodes are multimedia resources A to F, and account nodes are accounts 1 to 11. An edge between account 1 and multimedia resource A indicates that account 1 has interacted with multimedia resource A; an edge between account 1 and multimedia resource B indicates that account 1 has interacted with multimedia resource B; there are no edges between account 1 and multimedia resources C, D, E, and F, indicating that account 1 has not interacted with these resources (interactions could be clicks, favorites, or subscriptions). Similarly, this account resource heterogeneous graph can indicate the relationships between accounts 2 to 11 and multimedia resources A to F.
[0085] In one possible implementation, different behavioral data correspond to different interaction depths, and thus different weight coefficients. For example, the weight coefficient for a click is 0.3, and the weight coefficient for a favorite is 0.8. The weight coefficients are used to mark the edges in the account resource heterogeneity graph. For example, if account 1 favorites multimedia resource A, then there is an edge with a weight coefficient of 0.8 between account 1 and multimedia resource A. Thus, the account resource heterogeneity graph can clearly and intuitively indicate the relationship between each account and each multimedia resource. Through this account resource heterogeneity graph, more data relationships between accounts and multimedia resources can be discovered, which is beneficial for obtaining an accurate recommendation model.
[0086] In one embodiment, the method further includes: acquiring real-time data of the account, the real-time data including the latest behavioral data of the account regarding the multimedia resources; and periodically updating the account resource heterogeneity graph based on the real-time data. In this embodiment, the account resource heterogeneity graph is periodically updated using real-time data of the account. Specifically, an update cycle (e.g., one week) is preset. When the interval between the last update and the previous update is equal to the update cycle, the relationship graph is updated again based on the acquired real-time data, making the account resource heterogeneity graph real-time. After periodically updating the account resource heterogeneity graph, subsequent steps S12 to S15 are executed, which is beneficial for obtaining a real-time and accurate recommendation model.
[0087] In step S12, the heterogeneous graph of account resources is sampled to obtain the target behavior data sequence corresponding to the target account and the first multimedia resource; the target behavior data sequence consists of the behavior data of the target account on the first multimedia resource, and the first multimedia resource is a sampled positive sample resource that has an interaction relationship with the target account.
[0088] In this step, accounts are selected from those included in the heterogeneous account resource graph. The selected account is the target account. Behavioral data from the target account is then selected, and the multimedia resource corresponding to the selected behavioral data is designated as the first multimedia resource. Since the target account has behavioral data related to the first multimedia resource, it indicates an interaction between the first multimedia resource and the target account. Therefore, the first multimedia resource is a sampled positive sample resource that interacts with the target account. The selected behavioral data is used to form a target behavioral data sequence, meaning the target behavioral data sequence consists of the target account's behavioral data related to the first multimedia resource. Each data point in the target behavioral data sequence can be used to indicate the target account's point of interest in a specific scenario.
[0089] In some embodiments, step 12, sampling the account resource heterogeneity graph to obtain the target behavior data sequence corresponding to the target account, includes:
[0090] Step 121: Identify the target account from the accounts corresponding to the heterogeneous account resource graph;
[0091] Step 122: Randomly sample the first behavior data of the target account in the heterogeneous account resource graph, and use the sampled second behavior data to form the target behavior data sequence.
[0092] Specifically, the account resource heterogeneity graph includes several accounts. A target account is selected from among these accounts, and the first row of data for the target account in the account resource heterogeneity graph is determined. The first row of data is randomly sampled to obtain the second row of data, which is used to form the target behavior data sequence.
[0093] For example, for target account m, target account m clicked on 35 short videos within a certain period of time and saved 8 of them. In the obtained heterogeneous graph of account resources, there are 35 points connected to target account m, that is, there are 35 first-behavioral data (including 27 click behaviors and 8 click-plus-save behaviors). Randomly sample from the 35 first-behavioral data, such as sampling 3 second-behavioral data, that is, determine 3 points. Each point corresponds to one second-behavioral data and one first multimedia resource, resulting in a behavioral sequence composed of 3 second-behavioral data, i.e., I_seq={I_0,I_1,I_2}. It is equivalent to sampling the scene fragments corresponding to these 3 second-behavioral data to represent the target account's current interest points.
[0094] In this embodiment, by randomly sampling the first behavior data of the target account, the amount of data processing is effectively reduced. It is also beneficial to present the irregular and complex relationships between data. For example, the behavior data sequences corresponding to video clicks and favorites will present implicit relationships. Therefore, by sampling the heterogeneous graph of account resources, it is beneficial to present the deep and implicit relationships between node objects in the heterogeneous graph of account resources, which is beneficial to obtaining a more accurate recommendation model.
[0095] In some embodiments, step 12, sampling the account resource heterogeneity graph to obtain the target behavior data sequence corresponding to the target account, includes:
[0096] Step 121: Identify the target account from the accounts corresponding to the heterogeneous account resource graph;
[0097] Step 123: In the first behavioral data of the target account in the heterogeneous account resource graph, select the third behavioral data with an influence coefficient greater than a set value. The third behavioral data is used to form the target behavioral data sequence, and the influence coefficient is used to indicate the importance of the first behavioral data.
[0098] Specifically, the account resource heterogeneity graph includes several accounts. Sampling is performed on these accounts to identify the target account. The first row of data for this target account in the account resource heterogeneity graph is then determined. Weighted sampling is then applied to this first row of data, i.e., a pre-set value is used to select a third row of data whose influence coefficient is greater than the set value. This third row of data is used to form the target behavior data sequence. The influence coefficient indicates the importance of the first row of data; the larger the influence coefficient, the more important the first row of data is and the better it reflects the user's interests.
[0099] For example, for target account m, target account m clicked 35 short videos within a certain period of time, with a click weight of 0.3, and saved 8 of the 35 short videos, with a saving weight of 0.8. In the obtained heterogeneous graph of account resources, the points with a weight greater than 0.5 are sampled and processed. At this time, 8 third-line data will be sampled, that is, 8 points will be determined. Each point corresponds to one third-line data and one first multimedia resource, resulting in a behavior sequence composed of 8 third-line data, i.e., I_seq={I_0,I_1, …,I_7}. It is equivalent to using the scene fragments corresponding to the 8 sampled third-line data to represent the current interest points of the target account.
[0100] In this embodiment, weighted sampling can effectively reduce the amount of data processing and is also conducive to presenting the irregular and complex relationships between data. For example, the behavioral data sequences corresponding to video clicks and favorites will show implicit relationships. Therefore, by sampling the heterogeneous graph of account resources, it is beneficial to present the deep and implicit relationships between the node objects in the heterogeneous graph of account resources, which is conducive to obtaining a more accurate recommendation model.
[0101] In some embodiments, the method further includes:
[0102] Step S16: Determine the first resource data. The first resource data includes at least one of first identification data, first content data, and first attention data. The first identification data is used to distinguish the first resource data, and the first attention data is used to indicate the degree of attention the target account pays to the first multimedia resource.
[0103] Specifically, the first resource data corresponds to the first multimedia resource and is used to indicate resource information related to the first multimedia resource. The first resource data includes at least one of first identification data, first content data, and first attention data. The first identification information is used to distinguish different first multimedia resources; for example, it can be a first multimedia resource ID (identity). The first content data is used to characterize the content of the multimedia resource. This first content data can be a summary of the content of the first multimedia resource, such as "food," or it can be obtained by identifying the content of the first multimedia resource, determining the resource identification result, selecting from the resource identification results, and determining the first content data based on the selected resource identification result, such as "braised fish." This allows the first content data to accurately and precisely reflect the content of the first multimedia resource. The first attention data is used to indicate the degree of attention the target account pays to the first multimedia resource. Typically, the first attention data is closely related to behavioral data, such as user click time and viewing time length. Through diverse first resource data, the features of the first multimedia resource subsequently determined based on the first resource data can carry richer information, which is beneficial for obtaining an accurate target recommendation model.
[0104] Step S17: Determine the second resource data. The second resource data includes at least one of second identification data, second content data, and second attention data. The second identification data is used to distinguish the second resource data, and the second attention data is used to indicate the degree of attention the target account pays to the second multimedia resource.
[0105] Specifically, the second resource data corresponds to the second multimedia resource and is used to indicate resource information related to the second multimedia resource. The second resource data includes at least one of second identification data, second content data, and second attention data. The second identification information is used to distinguish different second multimedia resources; for example, it can be a second multimedia resource ID. The second content data is used to characterize the content of the multimedia resource. This second content data can be a summary of the content of the second multimedia resource, such as "food," or it can be obtained by identifying the content of the second multimedia resource, determining the resource identification result, selecting from the resource identification results, and determining the second content data based on the selected resource identification result, such as "braised fish." This allows the second content data to accurately and precisely reflect the content of the second multimedia resource. The second attention data is used to indicate the degree of attention the target account pays to the second multimedia resource. Typically, the second attention data is closely related to behavioral data, such as user click time and viewing time length. Because the second multimedia resource is a negative sample resource, the second attention data is often zero. Through diverse second resource data, the features of the subsequently determined second multimedia resource can carry richer information, which is beneficial for obtaining an accurate target recommendation model.
[0106] In step S13, the first resource data related to the first multimedia resource is input into the model to be trained to obtain the first multimedia resource features; and the second resource data related to the second multimedia resource is input into the model to be trained to obtain the second multimedia resource features; the second multimedia resource is a negative sample resource in the multimedia resource that has no interaction with the target account.
[0107] The training model is predetermined and is a mathematical model built before training. The first resource data is data related to the first multimedia resource. The second multimedia resource consists of negative sample resources within the multimedia resources that do not interact with the target account. The second resource data is data related to the second multimedia resource.
[0108] For example, consider multimedia resources A, B, and C. At a certain historical moment, multimedia resource A was recommended to target account 1, and multimedia resources B and C were recommended to target account 2. For target account 1, since target account 1 interacted with multimedia resource A but not with multimedia resources B and C, multimedia resource A is a positive sample resource, and multimedia resources B and C are negative sample resources. For account 2, multimedia resources B and C are positive sample resources, and multimedia resource A is a negative sample resource. In other words, for each target account, there exist corresponding positive and negative sample resources, and the number of both positive and negative sample resources can be at least one.
[0109] Specifically, after obtaining the first resource data related to the first multimedia resource and the second resource data related to the second multimedia resource, the first resource data is input into the model to be trained to obtain the first multimedia resource features, and the second resource data is input into the model to be trained to obtain the second multimedia resource features.
[0110] In one possible implementation, the first resource data includes three parts: first identifier data, first content data, and first attention data. Using the first resource data, a first multimedia resource feature carrying relatively rich information can be obtained. This first multimedia resource feature has strong expressive power and high accuracy, and can accurately reflect the feature information of the media resource side in scenarios where the user has no interest. The second resource data includes three parts: second identifier data, second content data, and second attention data. Using the second resource data, a second multimedia resource feature carrying relatively rich information can be obtained. This second multimedia resource feature has strong expressive power and high accuracy, and can accurately reflect the feature information of the media resource side in scenarios where the user has no interest.
[0111] In step S14, the target behavior data sequence and the first multimedia resource features are input into the model to be trained to obtain the target account features.
[0112] In this step, each behavioral data point in the target behavioral data sequence can reflect the user's interest points, and the first multimedia resource feature can reflect the media features of the multimedia resources that the user is interested in. The target behavioral data sequence and the first multimedia resource feature are input into the model to be trained to obtain the target account feature, which is used to reflect the account-side feature information of the target account.
[0113] In some embodiments, the model to be trained includes a first network structure and a second network structure; correspondingly, step S13 inputs first resource data related to the first multimedia resource into the model to be trained to obtain first multimedia resource features; and inputs second resource data related to the second multimedia resource into the model to be trained to obtain second multimedia resource features, including:
[0114] Step S131: Input the first resource data related to the first multimedia resource into the first network structure of the model to be trained to obtain the first multimedia resource features; and input the second resource data related to the second multimedia resource into the first network structure to obtain the second multimedia resource features.
[0115] Step S14 involves inputting the target behavior data sequence and the first multimedia resource features into the model to be trained to obtain target account features, including:
[0116] Step S141: Input the target behavior data sequence and the first multimedia resource features into the second network structure of the model to be trained to obtain the target account features.
[0117] Specifically, the model to be trained includes a first network structure and a second network structure. The first network structure is used to determine the feature information on the media resource side. Therefore, after acquiring the first resource data related to the first multimedia resource and the second resource data related to the second multimedia resource, the first resource data is input into the first network structure to obtain the first multimedia resource features, and the second resource data is input into the first network structure to obtain the second multimedia resource features. Since the target account has no interaction with the second multimedia resource, the second multimedia resource cannot be used to obtain the user-side feature information. Therefore, the first multimedia resource features output by the first network structure and the previously acquired target behavior data sequence are input into the second network structure to obtain the target account features. These target account features are the result of comprehensive learning of the first multimedia resource features and the target behavior data sequence, and have strong expressive power and high accuracy.
[0118] In some embodiments, step 141 inputs the target behavior data sequence and the first multimedia resource features into the second network structure of the model to be trained to obtain the target account features, including:
[0119] Step 1411: Input the target behavior data sequence and the first multimedia resource feature into the multi-head attention module of the second network structure; the multi-head attention module performs feature extraction on the first multimedia resource feature and the target behavior data sequence to obtain the target account feature.
[0120] In this embodiment, it is assumed that there is a correlation between the target behavior data sequence and the first multimedia resource feature. This correlation is obtained through an attention mechanism, specifically a multi-head attention module. The multi-head attention module can better capture sequence information, better solve the long-range dependency problem in samples, and can learn features of different dimensions, resulting in higher accuracy of the obtained target account features.
[0121] Specifically, the self-attention module consists of two parts: first, calculating the attention distribution over all input information; and second, calculating a weighted average of the input information based on the attention distribution. That is, initializing the weight matrix to obtain W. Q W K and W VThree weight matrices are used to calculate the query matrix Q, key matrix K, and value matrix V based on the input vector features. In one possible implementation, the first multimedia resource features can be used as the input to the query matrix Q, and the target behavior data sequence can be used as the input to the key matrix K and value matrix V. That is, the first multimedia resource features and W... Q Multiplying them yields the query matrix Q, and the target behavior data sequence is multiplied by W. K Multiply by W to obtain the key matrix K, then combine the target behavior data sequence with W. V Multiply the two matrices to obtain the value matrix V. Further, determine the attention score based on the query matrix Q and the key matrix K. Normalize the obtained attention score and multiply it with the value matrix V to obtain a weighted vector. Summate the weighted vector to obtain the output result.
[0122] The multi-head attention module comprises multiple attention modules, each implementing the self-attention mechanism described above. Multiple attention operations are performed across these modules, with each module maintaining independent query weight matrices, key weight matrices, and value weight matrices. The outputs of each attention module are concatenated to obtain the target user features. Because the multi-head attention module uses multiple attention modules, the weight matrices for each module are randomly initialized. After training, each weight matrix is used to project the input multimedia features and the target behavior data sequence into different representation subspaces, allowing relevant information to be learned in different representation subspaces. Therefore, the multi-head attention model has a strong ability to extract the expressive power of target user features.
[0123] For example, such as Figure 3 As shown, when the multimedia resource is an advertisement, the identified data is the advertisement ID, the first content data is the advertisement content, and the first attention data can include the click time, viewing time length, etc. Users can specify the content of the first attention data according to the actual application scenario. Input the above three parts... Figure 3 The first network structure on the right incorporates a fusion module (FusionLayer) that fuses three parts to obtain multimedia resource features, i.e., advertising features. These advertising features are fixed-length vector data, where the ad ID provides the personalization component and the ad content provides the relevance component. The fusion module in the first network structure can be a DNN model. By comprehensively considering attention data, identifier data, and content data, the obtained multimedia resource features are more accurate and expressive. These multimedia resource features include both first and second multimedia resource features.
[0124] Furthermore, the first multimedia resource features and target behavior data sequence are input. Figure 3 The second network structure on the left side utilizes the multi-head attention module within it for feature extraction to obtain the target account features. These target account features are fixed-length vectors that accurately reflect user-side feature information within the user's interest context.
[0125] In step S15, a loss value is determined based on the first similarity between the first multimedia resource feature and the target account feature, and the second similarity between the second multimedia resource feature and the target account feature; and the model to be trained is adjusted based on the loss value to obtain the target recommendation model.
[0126] In this step, considering that when recommending multimedia resources, the recommended media resources are those that users are interested in, the target account features of a target account are made as close as possible to the first multimedia resource features corresponding to the positive sample resources of the target account in the representation space, and as far away as possible from the second multimedia resource features corresponding to the negative sample resources of the target account in the representation space. Therefore, the target account features, the first multimedia resource features, and the second multimedia resource features can be used as constraints to determine the accurate loss value.
[0127] Specifically, after determining the first multimedia resource features, the second multimedia resource features, and the target account features, a first similarity is determined between the first multimedia resource features and the target account features, and a second similarity is determined between the second multimedia resource features and the target account features. Further, based on the first and second similarities, a loss value is determined. The training model is then adjusted according to this loss value to obtain the target recommendation model. This target recommendation model exhibits good performance, and the accuracy of multimedia resource recommendations using this model is high.
[0128] In some embodiments, step S15 determines a loss value based on a first similarity between the first multimedia resource feature and the target account feature, and a second similarity between the second multimedia resource feature and the target account feature, including:
[0129] S151, perform a dot product between the first multimedia resource feature and the target account feature to determine the first similarity.
[0130] S152, perform a dot product between the second multimedia resource feature and the target account feature to determine the second similarity.
[0131] S153, Based on the difference between the first similarity and the second similarity, determine the loss value.
[0132] In this embodiment, the first multimedia resource feature and the target account feature are multiplied by a dot product to accurately determine the first similarity. Similarly, the second multimedia resource feature and the target account feature are multiplied by a dot product to accurately determine the second similarity. After determining the first and second similarities, the difference between them is further determined. This difference is then substituted into a preset formula to determine the loss value. This loss value accurately reflects the distance between the first and second similarities in the representation space, which is beneficial for obtaining a target recommendation model with higher accuracy.
[0133] One approach is to use the Bayesian Personalized Ranking (BPR) loss function, which ensures that the target account feature and the first multimedia resource feature are close in representation space, while the target account feature and the second multimedia resource feature are far apart in representation space. The preset formula for this loss value is shown below:
[0134] ;
[0135] in, The first similarity is the similarity between the characteristics of the target account and the characteristics of the first multimedia resource. The second similarity is the similarity between the characteristics of the target account and the characteristics of the second multimedia resource. and The larger the difference, the closer the sigmoid value is to 1, and the smaller the loss value; otherwise, the larger the loss value is.
[0136] In the above embodiments, an account resource heterogeneity graph is obtained to indicate the relationship between account behavior data and multimedia resources. This graph is then sampled to determine the target account's target behavior data sequence and the first multimedia resource. The target behavior data sequence consists of the target account's behavior data towards the first multimedia resource, which is a sampled positive sample resource that interacts with the target account. This target behavior data sequence can effectively reflect the target account's interests. The first resource data related to the first multimedia resource is input into the model to be trained to obtain the first multimedia resource features. The second resource data related to the second multimedia resource is input into the model to be trained to obtain the second multimedia resource features. The second multimedia resource is a negative sample resource that does not interact with the target account. The obtained first and second multimedia resource features accurately express the feature information on the media resource side. Then, the target behavior data sequence and the first multimedia resource features are input into the model to be trained to obtain the target account features, which accurately express the feature information on the user side. The first similarity between the first multimedia resource feature and the target account feature, and the second similarity between the second multimedia resource feature and the target account feature are further determined. A loss value is then determined based on the first and second similarities. This loss value is used to adjust the training model, resulting in a target recommendation model. The technical solution provided in this disclosure utilizes an account resource heterogeneity graph to mine the association between accounts and multimedia resources, obtaining target behavior data sequences that can characterize the implicit relationship between accounts and multimedia resources. Furthermore, during model construction, both the media resource side and the user side are considered together to determine the first and second multimedia resource features on the media resource side, and the target account features on the user side. By comprehensively considering the relationship between the first multimedia resource feature, the second multimedia resource feature, and the target account feature, a high-performance target recommendation model is obtained. This target recommendation model achieves high accuracy when recommending multimedia resources.
[0137] Figure 4 This is a flowchart illustrating a multimedia resource recommendation method according to an exemplary embodiment, the method comprising:
[0138] In step S41, the account resource heterogeneity graph is sampled to obtain the target behavior data sequence and target multimedia resources corresponding to the target account; the account resource heterogeneity graph is used to indicate the association between the account's behavior data and multimedia resources, and the target account is any one of the accounts; the target behavior data sequence is composed of the target account's behavior data on the target multimedia resources.
[0139] In step S42, the first resource data related to the target multimedia resource is input into the target recommendation model to obtain the first multimedia resource features; the second resource data related to the multimedia resource to be recommended is input into the target recommendation model to obtain the second multimedia resource features.
[0140] In step S43, the target behavior data sequence and the first multimedia resource features are input into the target recommendation model to obtain the target account features.
[0141] In step S44, based on the similarity between the second multimedia resource features and the target account features, a target recommended resource for recommendation to the target account is determined from the multimedia resources to be recommended.
[0142] In this embodiment, an account resource heterogeneity graph is pre-constructed based on the behavioral data of several accounts regarding multimedia resources. This graph indicates the association between the account's behavioral data and the multimedia resources. The target account is any one of the accounts that needs to be recommended for multimedia resources. It should be noted that when multiple accounts need to be recommended for multimedia resources, each of these multiple accounts is the target account mentioned in this embodiment. The account resource heterogeneity graph is sampled to obtain the target behavioral data sequence and target multimedia resources corresponding to the target account. The target behavioral data sequence consists of the target account's behavioral data regarding the target multimedia resources, and each data point in the target behavioral data sequence can be used to indicate the target account's point of interest in a certain scenario. The first resource data related to the target multimedia resources is input into the target recommendation model to obtain the first multimedia resource feature. This first multimedia resource feature reflects the media resource-side feature information of the multimedia resources that the user is interested in. The second resource data related to the multimedia resources to be recommended is input into the target recommendation model to obtain the second multimedia resource feature. This second multimedia resource feature reflects the media resource-side feature information of the multimedia resources to be recommended. Then, the first multimedia resource feature and the target behavior data sequence are input into the target recommendation model to obtain the target account feature, which accurately reflects the user-side feature information. The target account feature is compared with the second multimedia resource feature to select the target multimedia resource feature from the second multimedia resource feature. Specifically, the similarity between the target account feature and each multimedia resource feature can be determined, and the second multimedia resource feature with the highest similarity value is selected as the target multimedia resource feature. The multimedia resource to be recommended corresponding to the target multimedia resource feature is determined as the target recommended resource to be recommended to the target account. This target recommendation is the result of comprehensively considering the user-side feature information and the media resource-side feature information, and the user is more likely to be interested in it; therefore, the accuracy of this recommendation is high.
[0143] Figure 5This is a block diagram illustrating a recommendation model training apparatus according to an exemplary embodiment. The apparatus includes a relationship graph acquisition module 51, a sequence determination module 52, a first feature determination module 53, a second feature determination module 54, and a parameter adjustment module 55.
[0144] The relationship graph acquisition module 51 is configured to acquire an account resource heterogeneity graph; the account resource heterogeneity graph is used to indicate the association between account behavior data and multimedia resources.
[0145] The sequence determination module 52 is configured to sample the account resource heterogeneity graph to obtain a target behavior data sequence corresponding to the target account and a first multimedia resource; the target behavior data sequence consists of the behavior data of the target account on the first multimedia resource, and the first multimedia resource is a sampled positive sample resource that has an interaction relationship with the target account;
[0146] The first feature determination module 53 is configured to input first resource data related to the first multimedia resource into the model to be trained to obtain first multimedia resource features; and input second resource data related to the second multimedia resource into the model to be trained to obtain second multimedia resource features; the second multimedia resource is a negative sample resource in the multimedia resource that has no interaction with the target account;
[0147] The second feature determination module 54 is configured to input the target behavior data sequence and the first multimedia resource feature into the model to be trained to obtain the target account feature;
[0148] The parameter adjustment module 55 is configured to determine a loss value based on a first similarity between the first multimedia resource feature and the target account feature, and a second similarity between the second multimedia resource feature and the target account feature; and to adjust the model to be trained based on the loss value to obtain a target recommendation model.
[0149] In an exemplary embodiment of this disclosure, the model to be trained includes a first network structure and a second network structure;
[0150] The first feature determination module is further configured to input the first resource data related to the first multimedia resource into the first network structure of the model to be trained to obtain the first multimedia resource feature; and input the second resource data related to the second multimedia resource into the first network structure to obtain the second multimedia resource feature;
[0151] The second feature determination module is further configured to input the target behavior data sequence and the first multimedia resource feature into the second network structure of the model to be trained to obtain the target account feature.
[0152] In an exemplary embodiment of this disclosure, the second feature determination module is further configured to input the target behavior data sequence and the first multimedia resource feature into the multi-head attention module of the second network structure; the multi-head attention module performs feature extraction on the first multimedia resource feature and the target behavior data sequence to obtain the target account feature.
[0153] In an exemplary embodiment of this disclosure, the sequence determination module includes:
[0154] An account determination unit is used to determine the target account from the accounts corresponding to the account resource heterogeneity graph;
[0155] The sequence determination unit is used to randomly sample the first behavioral data of the target account in the heterogeneous account resource graph, and the sampled second behavioral data is used to form the target behavioral data sequence; or, in the first behavioral data of the target account in the heterogeneous account resource graph, a third behavioral data with an influence coefficient greater than a set value is selected, and the third behavioral data is used to form the target behavioral data sequence, and the influence coefficient is used to indicate the importance of the first behavioral data.
[0156] In an exemplary embodiment of this disclosure, the apparatus further includes:
[0157] The first resource determination module is used to determine the first resource data. The first resource data includes at least one of first identification data, first content data, and first attention data. The first identification data is used to distinguish the first resource data, and the first attention data is used to indicate the degree of attention the target account pays to the first multimedia resource.
[0158] The second resource determination module is used to determine the second resource data, which includes at least one of second identification data, second content data, and second attention data. The second identification data is used to distinguish the second resource data, and the second attention data is used to indicate the degree of attention the target account pays to the second multimedia resource.
[0159] In an exemplary embodiment of this disclosure, the parameter adjustment module includes:
[0160] The first similarity determination unit is used to perform a dot product between the first multimedia resource feature and the target account feature to determine the first similarity;
[0161] The second similarity determination unit is used to perform a dot product between the second multimedia resource feature and the target account feature to determine the second similarity.
[0162] The loss value determination unit is used to determine the loss value based on the difference between the first similarity and the second similarity.
[0163] Figure 6 This is a block diagram illustrating a recommendation model training apparatus according to an exemplary embodiment. The apparatus includes a sampling processing module 61, a first input processing module 62, a second input processing module 63, and a recommendation object determination module 64.
[0164] The sampling processing module 61 is configured to sample the account resource heterogeneity graph to obtain the target behavior data sequence and target multimedia resources corresponding to the target account; the account resource heterogeneity graph is used to indicate the association between the account's behavior data and multimedia resources, and the target account is any one of the accounts; the target behavior data sequence is composed of the target account's behavior data on the target multimedia resources.
[0165] The first input processing module 62 is configured to input first resource data related to the target multimedia resource into the target recommendation model to obtain first multimedia resource features; and input second resource data related to the multimedia resource to be recommended into the target recommendation model to obtain second multimedia resource features.
[0166] The second input processing module 63 is configured to input the target behavior data sequence and the first multimedia resource features into the target recommendation model to obtain target account features;
[0167] The recommended resource determination module 64 is configured to determine, based on the similarity between the second multimedia resource features and the target account features, a target recommended resource to be recommended to the target account from the multimedia resources to be recommended.
[0168] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0169] Figure 7 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment. (Refer to...) Figure 7 The electronic device 700 includes a processing component 722, which further includes one or more processors, and memory resources represented by memory 732 for storing instructions, such as application programs, that can be executed by the processing component 722. The application programs stored in memory 732 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 722 is configured to execute instructions to perform the aforementioned implementation methods of recommendation model training or multimedia resource recommendation.
[0170] Electronic device 700 may also include a power supply component 726 configured to perform power management of electronic device 700, a wired or wireless network interface 750 configured to connect electronic device 700 to a network, and an input / output (I / O) interface 758. Electronic device 700 may operate on an operating system stored in memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0171] In an exemplary embodiment, a storage medium including instructions is also provided. When the instructions in the storage medium are executed by a processor of a server, the server is enabled to perform the recommendation model training method or the multimedia resource recommendation method as described in any of the above method embodiments. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0172] In an exemplary embodiment, a computer program product is also provided, comprising readable program code executable by a server's processor using the aforementioned recommendation model training method or multimedia resource recommendation method. Optionally, the program code may be stored in a storage medium of a terminal or server, which may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device. Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0173] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for training a recommendation model, characterized in that, The method comprises: acquiring an account resource heterogeneous graph; the account resource heterogeneous graph is used to indicate an association relationship between behavior data of an account and multimedia resources, the account resource heterogeneous graph comprises multimedia resource nodes and account nodes, and an edge between the multimedia resource nodes and the account nodes is used to represent that there is an interaction relationship between the account and the multimedia resources; the edge between the multimedia resource nodes and the account nodes is marked by a weight coefficient; the account resource heterogeneous graph is sampled to obtain target behavior data sequences corresponding to a target account and a first multimedia resource; the target behavior data sequences are composed of behavior data of the target account on the first multimedia resource, and the first multimedia resource is a positive sample resource that has an interaction relationship with the target account and is sampled out; first resource data related to the first multimedia resource is input into a first network structure of a to-be-trained model to obtain first multimedia resource features, and second resource data related to a second multimedia resource is input into the first network structure to obtain second multimedia resource features; the second multimedia resource is a negative sample resource that has no interaction with the target account in the multimedia resources; the target behavior data sequences and the first multimedia resource features are input into a second network structure of the to-be-trained model to obtain target account features; a loss value is determined based on a first similarity between the first multimedia resource features and the target account features and a second similarity between the second multimedia resource features and the target account features, and the to-be-trained model is adjusted based on the loss value to obtain a target recommendation model.
2. The method of claim 1, wherein, The target behavior data sequences and the first multimedia resource features are input into a multi-head attention module of the second network structure; the multi-head attention module performs feature extraction on the first multimedia resource features and the target behavior data sequences to obtain target account features. The account resource heterogeneous graph is sampled to obtain target behavior data sequences corresponding to a target account, which comprises:
3. The method of claim 1, wherein, determining the target account in an account corresponding to the account resource heterogeneous graph; randomly sampling first behavior data of the target account in the account resource heterogeneous graph, and second behavior data sampled out is used to compose the target behavior data sequences; or, selecting third behavior data with an influence coefficient greater than a set value from the first behavior data of the target account in the account resource heterogeneous graph, and the third behavior data is used to compose the target behavior data sequences, and the influence coefficient is used to indicate the importance of the first behavior data. The first resource data related to the first multimedia resource is input into a first network structure of a to-be-trained model to obtain first multimedia resource features; 4. The method of claim 1, wherein, and second resource data related to a second multimedia resource is input into the first network structure to obtain second multimedia resource features, the method further comprises: determining the first resource data, the first resource data comprising at least one of first identification data, first content data and first attention data, the first identification data being used to distinguish the first resource data, the first attention data being used to indicate a degree of attention of the target account to the first multimedia resource; determining the second resource data, the second resource data comprising at least one of second identification data, second content data and second attention data, the second identification data being used to distinguish the second resource data, the second attention data being used to indicate a degree of attention of the target account to the second multimedia resource.
5. The method of claim 1, wherein, determining a loss value based on a first similarity between the first multimedia resource feature and the target account feature, and a second similarity between the second multimedia resource feature and the target account feature, comprises: point-multiplying the first multimedia resource feature and the target account feature to determine the first similarity; point-multiplying the second multimedia resource feature and the target account feature to determine the second similarity; determining the loss value based on a difference result of the first similarity and the second similarity.
6. The method of claim 1, wherein, The method further comprises: obtaining real-time data of the account, the real-time data comprising latest behavior data of the account to the multimedia resource; periodically updating the account resource heterogeneous graph based on the real-time data.
7. A multimedia resource recommendation method, characterized by, The method comprises: sampling an account resource heterogeneous graph to obtain target behavior data sequence corresponding to a target account and a target multimedia resource; the account resource heterogeneous graph being used to indicate an association relationship between behavior data of an account and a multimedia resource, the account resource heterogeneous graph comprising a multimedia resource node and an account node, an edge between the multimedia resource node and the account node being used to represent an interaction relationship between the account and the multimedia resource; the edge between the multimedia resource node and the account node being marked by a weight coefficient; the target account being any one of the accounts; the target behavior data sequence being composed of behavior data of the target account to the target multimedia resource; inputting first resource data related to the target multimedia resource into a first network structure of a target recommendation model to obtain a first multimedia resource feature, and inputting second resource data related to a multimedia resource to be recommended into the first network structure to obtain a second multimedia resource feature; inputting the target behavior data sequence and the first multimedia resource feature into a second network structure of the target recommendation model to obtain a target account feature; determining a target recommendation resource to be recommended to the target account from the multimedia resource to be recommended based on a similarity between the second multimedia resource feature and the target account feature. 8.A device for training a recommendation model, characterized in that, The device comprises: The relationship graph obtaining module is configured to obtain an account resource heterogeneous graph; the account resource heterogeneous graph is used to indicate an association relationship between behavior data of an account and multimedia resources; the account resource heterogeneous graph comprises multimedia resource nodes and account nodes; edges between the multimedia resource nodes and the account nodes are used to represent that there is an interaction relationship between the account and the multimedia resources; and the edges between the multimedia resource nodes and the account nodes are marked by weight coefficients; The sequence determining module is configured to sample the account resource heterogeneous graph to obtain target behavior data sequence corresponding to a target account and a first multimedia resource; the target behavior data sequence is composed of behavior data of the first multimedia resource by the target account; and the first multimedia resource is a positive sample resource that has an interaction relationship with the target account; The first feature determining module is configured to input first resource data related to the first multimedia resource into a first network structure of a to-be-trained model to obtain first multimedia resource features; and input second resource data related to a second multimedia resource into the first network structure to obtain second multimedia resource features; the second multimedia resource is a negative sample resource that has no interaction with the target account in the multimedia resources; The second feature determining module is configured to input the target behavior data sequence and the first multimedia resource features into a second network structure of the to-be-trained model to obtain target account features; The parameter adjusting module is configured to determine a loss value based on a first similarity between the first multimedia resource features and the target account features and a second similarity between the second multimedia resource features and the target account features; and adjust the to-be-trained model based on the loss value to obtain a target recommendation model.
9. A multimedia resource recommendation apparatus, characterized by comprising: The device comprises: The sampling processing module is configured to sample an account resource heterogeneous graph to obtain target behavior data sequence corresponding to a target account and a target multimedia resource; the account resource heterogeneous graph is used to indicate an association relationship between behavior data of an account and multimedia resources; the account resource heterogeneous graph comprises multimedia resource nodes and account nodes; edges between the multimedia resource nodes and the account nodes are used to represent that there is an interaction relationship between the account and the multimedia resources; the edges between the multimedia resource nodes and the account nodes are marked by weight coefficients; the target account is any one of the accounts; and the target behavior data sequence is composed of behavior data of the target multimedia resource by the target account; The first input processing module is configured to input first resource data related to the target multimedia resource into a first network structure of a target recommendation model to obtain first multimedia resource features; and input second resource data related to to-be-recommended multimedia resources into the first network structure to obtain second multimedia resource features. input the first resource data related to the target multimedia resource into a target recommendation model to obtain first multimedia resource features; and input the second resource data related to the multimedia resource to be recommended into the target recommendation model to obtain second multimedia resource features; The second input processing module is configured to input the target behavior data sequence and the first multimedia resource features into a second network structure of the target recommendation model to obtain target account features; The recommendation resource determination module is configured to determine, based on a similarity between the second multimedia resource features and the target account features, a target recommendation resource for recommending to the target account from the multimedia resource to be recommended.
10. An electronic device, comprising: comprise: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 7.
11. A computer readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor, the electronic device is enabled to perform the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Target recommendation model training method, recommendation method and device, and electronic equipment
CN113901327A
Resource recommendation method and device, model training method and device, equipment, storage medium and program
CN114461824A
Multimedia resource recommendation method and device
CN115438203A
Multimedia resource classification and recommendation
US20230084466A1