Recommended method and device and recommended model training method and device

By generating user interest and conformity representations and utilizing self-supervised learning, the problem of difficulty in mining the correlation attributes between user profiles and product profiles in recommendation systems is solved, thus achieving more accurate personalized recommendations.

CN117216357BActive Publication Date: 2026-06-12BEIJING DAJIA INTERNET INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2022-05-31
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing recommendation systems struggle to effectively uncover the correlation attributes between user profiles and product profiles, resulting in inaccurate recommendation performance.

Method used

By acquiring features of user accounts and candidate media resources, a recommendation model is used to generate interest representations and conformity representations, and recommendations are made based on these representations. A self-supervised contrastive learning auxiliary task is introduced to model user preferences on the observed data, thus solving the problem of data sparsity in causal representations.

🎯Benefits of technology

It improves the accuracy of recommendation systems, better models the distribution of users' personalized interests and herd mentality preferences, solves the sparsity problem of long-tail distribution, and enhances recommendation performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216357B_ABST
    Figure CN117216357B_ABST
Patent Text Reader

Abstract

A recommendation method and device and a training method and device of a recommendation model are provided. The recommendation method comprises: obtaining a user feature of a user account of to-be-recommended content, and candidate media resource features of a plurality of candidate media resources; based on the user feature, using a first module of the recommendation model to obtain an interest representation and a conformity representation of the user account; based on the candidate media resource features, using a second module of the recommendation model to obtain content representations and popularity representations of the plurality of candidate media resources respectively; based on the interest representation and the conformity representation of the user account and the content representations and the popularity representations of the plurality of candidate media resources, using a third module of the recommendation model to obtain recommendation information of each of the plurality of candidate media resources respectively; and recommending, to the user account, candidate media resources of the plurality of candidate media resources whose recommendation information satisfies a preset condition. The disclosure can more accurately recommend media resources to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence, and more particularly to a recommendation method and apparatus, as well as a training method and apparatus for a recommendation model. Background Technology

[0002] Recommendation systems are widely used in various business scenarios. For example, they can leverage e-commerce websites to provide customers with product information and suggestions, helping users decide what products to buy and simulating a salesperson to assist customers in completing the purchase process. Personalized recommendations recommend information and products that users are interested in based on their interests and purchasing behavior. Media resources that can be used for recommendations include products, advertisements, news, music, and more.

[0003] However, existing recommendation systems cannot effectively mine rich user profiles and product profiles, and it is also difficult to deeply mine the correlation attributes between them, resulting in inaccurate recommendation results. Summary of the Invention

[0004] This disclosure provides a recommendation method and apparatus, as well as a training method and apparatus for a recommendation model, to at least solve the aforementioned problems. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a recommendation method is provided, the recommendation method comprising the following steps: obtaining user characteristics of a user account of content to be recommended and candidate media resource characteristics of a plurality of candidate media resources; based on the user characteristics, using a first module of a recommendation model, obtaining an interest representation and a conformity representation of the user account; based on the candidate media resource characteristics, using a second module of the recommendation model, obtaining a content representation and a popularity representation of the plurality of candidate media resources respectively; based on the interest representation and conformity representation of the user account, and the content representation and popularity representation of the plurality of candidate media resources, using a third module of the recommendation model, obtaining recommendation information for each of the plurality of candidate media resources respectively; and recommending to the user account candidate media resources whose recommendation information satisfies preset conditions.

[0006] As one implementation method, based on the user characteristics, the first module of the recommendation model is used to obtain the interest representation and conformity representation of the user account. This may include: obtaining a historical media resource feature sequence of multiple historical media resources in which the user account has generated interactive behavior within a predetermined time period; and using the first module, based on the historical media resource feature sequence and the user characteristics, generating the interest representation and conformity representation of the user account.

[0007] As one implementation, generating the interest representation and conformity representation of the user account using the first module based on the historical media resource feature sequence and the user characteristics may include: obtaining a first weight and a second weight for the plurality of historical media resources using a fourth module in the first module based on the historical media resource feature sequence and the user characteristics; obtaining a first interest representation and a first conformity representation of the user account using a fifth module in the first module based on the historical media resource feature sequence, the first weight, and the second weight; obtaining a second interest representation and a second conformity representation of the user account using a sixth module in the first module based on the user characteristics; obtaining the interest representation of the user account based on the first interest representation and the second interest representation, and obtaining the conformity representation of the user account based on the first conformity representation and the second conformity representation.

[0008] As one implementation, obtaining the first interest representation and the first conformity representation of the user account based on the historical media resource feature sequence, the first weight, and the second weight, using the fifth module in the first module, may include: obtaining an embedding vector for the plurality of media resources based on the historical media resource feature sequence, using the seventh module in the fifth module; obtaining an interest representation vector and a conformity representation vector by applying the first weight and the second weight to the embedding vector; and encoding the interest representation vector and the conformity representation vector using the eighth module in the fifth module to obtain the first interest representation and the first conformity representation.

[0009] According to a second aspect of the present disclosure, a recommendation apparatus is provided, the recommendation apparatus comprising: an acquisition module configured to acquire user characteristics of a user account of content to be recommended and candidate media resource characteristics of a plurality of candidate media resources; and a recommendation module configured to: based on the user characteristics, use a first module of a recommendation model to obtain an interest representation and a conformity representation of the user account; based on the candidate media resource characteristics, use a second module of the recommendation model to obtain a content representation and a popularity representation of the plurality of candidate media resources; based on the user account's interest representation and conformity representation, and the content representation and popularity representation of the plurality of candidate media resources, use a third module of the recommendation model to obtain recommendation information for each of the plurality of candidate media resources; and recommend candidate media resources among the plurality of candidate media resources whose recommendation information satisfies preset conditions to the user account.

[0010] In one implementation, the acquisition module is configured to: acquire a sequence of historical media resource features of multiple historical media resources in which the user account has generated interactive behavior within a predetermined time period; the recommendation module is configured to: based on the sequence of historical media resource features and the user features, use the first module to generate the interest representation and the conformity representation of the user account.

[0011] In one implementation, the recommendation module is configured to: based on the historical media resource feature sequence and the user characteristics, use the fourth module in the first module to obtain a first weight and a second weight for the plurality of historical media resources; based on the historical media resource feature sequence, the first weight, and the second weight, use the fifth module in the first module to obtain a first interest representation and a first conformity representation for the user account; based on the user characteristics, use the sixth module in the first module to obtain a second interest representation and a second conformity representation for the user account; obtain the interest representation of the user account based on the first interest representation and the second interest representation, and obtain the conformity representation of the user account based on the first conformity representation and the second conformity representation.

[0012] As one implementation, the recommendation module is configured to: obtain an embedding vector for the plurality of media resources based on the historical media resource feature sequence using the seventh module of the fifth module; obtain an interest representation vector and a conformity representation vector by applying the first weight and the second weight to the embedding vector; and encode the interest representation vector and the conformity representation vector using the eighth module of the fifth module to obtain the first interest representation and the first conformity representation.

[0013] According to a third aspect of the present disclosure, a method for training a recommendation model is provided. The training method may include: acquiring training data, the training data including user characteristics of multiple sample user accounts, media resource characteristics of multiple sample media resources, and interaction behavior tags of each sample user account for each sample media resource; generating an interest representation and a conformity representation of the target account based on the target user characteristics of a target account among the multiple sample user accounts, using a first module of the recommendation model; and generating content representations of the target media resource and the other media resources based on the media resource characteristics of the target media resource and other media resources among the multiple sample media resources, using a second module of the recommendation model. The recommendation model uses a third module to predict the target account's interaction with the target media resource, based on the target account's interest and conformity representations, and the target media resource's content and popularity representations. The parameters of the first and second modules are trained by maximizing the differences between the target account's interest and conformity representations and the other media resource's content and popularity representations, respectively, and minimizing the difference between the predicted results and the corresponding interaction tags.

[0014] As one implementation method, acquiring training data may include: generating a sequence of historical media resource features of multiple historical media resources in which the target account generates interactive behavior within a predetermined time period from the multiple sample media resources.

[0015] As one implementation method, generating the interest representation and conformity representation of the target account may include: generating the interest representation and conformity representation of the target account using a first module of the recommendation model based on the historical media resource feature sequence and the target user features.

[0016] As one implementation, generating the interest representation and conformity representation of the target account using the first module, based on the historical media resource feature sequence and the target user characteristics, may include: obtaining a first weight and a second weight for the plurality of historical media resources using a fourth module in the first module based on the historical media resource feature sequence and the target user characteristics; obtaining a first interest representation and a first conformity representation of the target account using a fifth module in the first module based on the historical media resource feature sequence, the first weight, and the second weight; obtaining a second interest representation and a second conformity representation of the target account using a sixth module in the first module based on the target user characteristics; obtaining the interest representation of the target account based on the first interest representation and the second interest representation, and obtaining the conformity representation of the target account based on the first conformity representation and the second conformity representation.

[0017] As one implementation, obtaining the first interest representation and the first conformity representation of the target account based on the historical media resource feature sequence, the first weight, and the second weight, using the fifth module in the first module, may include: obtaining an embedding vector for the plurality of media resources based on the historical media resource feature sequence, using the seventh module in the fifth module; obtaining an interest representation vector and a conformity representation vector by applying the first weight and the second weight to the embedding vector; and encoding the interest representation vector and the conformity representation vector using the eighth module in the fifth module to obtain the first interest representation and the first conformity representation.

[0018] In one implementation, the target media resource is a media resource that interacts with the target account. The parameters for training the first and second modules of the recommendation model may include: training the parameters of the first and second modules of the recommendation model by minimizing the differences between the interest representation and the conformity representation of the target account and the content representation and the popularity representation of the target media resource, respectively.

[0019] As one implementation, training the parameters of the first and second modules of the recommendation model may include: constructing a main loss function based on the prediction results and corresponding interaction behavior tags; constructing at least one auxiliary loss function based on the interest representation and conformity representation of the target account, the content representation and popularity representation of the target media resource and the other media resources; and updating the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function.

[0020] As one implementation, constructing the at least one auxiliary loss function may include: generating multiple sub-media resource feature sequences based on the historical media resource feature sequence of the target account; forming positive sample pairs with the historical media resource feature sequences and the multiple sub-media resource feature sequences, and forming negative sample pairs with the historical media resource feature sequences of other accounts, wherein the other accounts are user accounts that are different from the target account among the multiple sample user accounts; obtaining interest representations corresponding to the multiple sub-media resource feature sequences based on the multiple sub-media resource feature sequences in the positive sample pairs; obtaining interest representations of the other accounts based on the historical media resource feature sequences of the other accounts in the negative sample pairs; and constructing a first auxiliary loss function based on the interest representation of the target account, the interest representations corresponding to the multiple sub-media resource feature sequences, and the interest representations of the other accounts.

[0021] In one implementation, constructing a first auxiliary loss function may include: constructing a first similarity function based on the interest representation of the target account and the interest representation corresponding to the feature sequences of the plurality of sub-media resources; constructing a second similarity function based on the interest representation of the target account and the interest representation of the other accounts; and constructing the first auxiliary loss function based on the first similarity function and the second similarity function. Updating the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function may include: updating the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the first similarity function and maximizing the result obtained by the second similarity function.

[0022] As one implementation, constructing the at least one auxiliary loss function may include: obtaining the popularity of the plurality of sample media resources; taking the media resources in the plurality of sample media resources where the target account generates interactive behavior as positive samples; taking the other media resources in the plurality of sample media resources as negative samples; obtaining the content representation of the media resources based on the media resources in the positive samples and the negative samples respectively; and constructing a second auxiliary loss function based on the interest representation of the target account, the content representation of the media resources, and the corresponding popularity.

[0023] As one implementation, constructing a second auxiliary loss function may include: constructing a third similarity function based on the interest representation of the target account and the content representation of media resources in the positive samples; constructing a fourth similarity function based on the interest representation of the target account and the content representation of media resources in the negative samples; and constructing the second auxiliary loss function according to the third similarity function, the fourth similarity function, and the corresponding popularity. Updating the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function may include: updating the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the third similarity function and maximizing the result obtained by the fourth similarity function.

[0024] In one implementation, constructing the at least one auxiliary loss function may include: obtaining the popularity of the plurality of sample media resources; taking the media resources from the plurality of sample media resources where the target account generates interactive behavior as positive samples; taking the other media resources from the plurality of sample media resources whose popularity is lower than that of the target media resource as negative samples; obtaining the popularity representation of the media resources based on the media resources in the positive samples and the negative samples respectively; and constructing a third auxiliary loss function based on the conformity representation of the target account, the popularity representation of the media resources, and the corresponding popularity.

[0025] As one implementation, constructing a third auxiliary loss function may include: constructing a fifth similarity function based on the conformity representation of the target account and the popularity representation of media resources in the positive samples; constructing a sixth similarity function based on the conformity representation of the target account and the popularity representation of media resources in the negative samples; and constructing the third auxiliary loss function according to the fifth similarity function, the sixth similarity function, and the corresponding popularity. The updating of the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function may include: updating the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the fifth similarity function and maximizing the result obtained by the sixth similarity function.

[0026] According to a fourth aspect of the present disclosure, a training apparatus for a recommendation model is provided. The training apparatus may include: a data acquisition module configured to acquire training data, the training data including user characteristics of multiple sample user accounts, media resource characteristics of multiple sample media resources, and interaction behavior tags of each sample user account to each sample media resource; and a model training module configured to: generate an interest representation and a conformity representation of the target account based on the target user characteristics of the target account among the multiple sample user accounts, using a first module of the recommendation model; and generate the target media resource and other media resource characteristics based on the media resource characteristics of the target media resource and other media resources among the multiple sample media resources, using a second module of the recommendation model. The recommendation model uses the third module to obtain a prediction result of the target account's interaction with the target media resource, based on the target account's interest representation and conformity representation, and the target media resource's content representation and popularity representation. The parameters of the first and second modules of the recommendation model are trained by maximizing the differences between the target account's interest representation and conformity representation and the other media resource's content representation and popularity representation, respectively, and minimizing the difference between the prediction result and the corresponding interaction behavior label.

[0027] In one implementation, the data acquisition module can be configured to generate a historical media resource feature sequence of multiple historical media resources in which the target account generates interactive behavior within a predetermined time period among the multiple sample media resources.

[0028] As one implementation, the model training module can be configured to: based on the historical media resource feature sequence and the target user features, use the first module of the recommendation model to generate the interest representation and the conformity representation of the target account.

[0029] In one implementation, the model training module can be configured to: obtain a first weight and a second weight for the plurality of historical media resources based on the historical media resource feature sequence and the target user features using the fourth module in the first module; obtain a first interest representation and a first conformity representation for the target account based on the historical media resource feature sequence, the first weight, and the second weight using the fifth module in the first module; obtain a second interest representation and a second conformity representation for the target account based on the target user features using the sixth module in the first module; obtain the interest representation of the target account based on the first interest representation and the second interest representation, and obtain the conformity representation of the target account based on the first conformity representation and the second conformity representation.

[0030] As one implementation, the model training module can be configured to: obtain embedding vectors for the plurality of media resources based on the historical media resource feature sequence using the seventh module in the fifth module; obtain interest representation vectors and conformity representation vectors by applying the first weight and the second weight to the embedding vectors; and encode the interest representation vectors and the conformity representation vectors using the eighth module in the fifth module to obtain the first interest representation and the first conformity representation.

[0031] In one implementation, the target media resource is a media resource that interacts with the target account, wherein the model training module can be configured to train the parameters of the first and second modules of the recommendation model by minimizing the differences between the interest representation and the conformity representation of the target account and the content representation and the popularity representation of the target media resource, respectively.

[0032] In one implementation, the model training module can be configured to: construct a main loss function based on the prediction results and the corresponding interaction behavior labels; construct at least one auxiliary loss function based on the interest representation and conformity representation of the target account, the content representation and popularity representation of the target media resource and the other media resources; and update the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function.

[0033] In one implementation, the model training module can be configured to: generate multiple sub-media resource feature sequences based on the historical media resource feature sequences of the target account; form positive sample pairs with the historical media resource feature sequences and the multiple sub-media resource feature sequences, and form negative sample pairs with the historical media resource feature sequences of other accounts, wherein the other accounts are user accounts that are different from the target account among the multiple sample user accounts; obtain interest representations corresponding to the multiple sub-media resource feature sequences based on the multiple sub-media resource feature sequences in the positive sample pairs; obtain interest representations of the other accounts based on the historical media resource feature sequences of the other accounts in the negative sample pairs; and construct a first auxiliary loss function based on the interest representations of the target account, the interest representations corresponding to the multiple sub-media resource feature sequences, and the interest representations of the other accounts.

[0034] In one implementation, the model training module can be configured to: construct a first similarity function based on the interest representation of the target account and the interest representation corresponding to the feature sequences of the plurality of sub-media resources; construct a second similarity function based on the interest representation of the target account and the interest representation of the other accounts; construct a first auxiliary loss function based on the first similarity function and the second similarity function; and update the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the first similarity function and maximizing the result obtained by the second similarity function.

[0035] In one implementation, the model training module can be configured to: obtain the popularity of the plurality of sample media resources; take the media resources in the plurality of sample media resources where the target account generates interactive behavior as positive samples; take the other media resources in the plurality of sample media resources as negative samples; obtain the content representation of the media resources based on the media resources in the positive samples and the negative samples respectively; and construct a second auxiliary loss function based on the interest representation of the target account, the content representation of the media resources and the corresponding popularity.

[0036] In one implementation, the model training module can be configured to: construct a third similarity function based on the interest representation of the target account and the content representation of media resources in the positive samples; construct a fourth similarity function based on the interest representation of the target account and the content representation of media resources in the negative samples; construct a second auxiliary loss function according to the third similarity function, the fourth similarity function and the corresponding popularity; and update the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the third similarity function and maximizing the result obtained by the fourth similarity function.

[0037] In one implementation, the model training module can be configured to: obtain the popularity of the plurality of sample media resources; take the media resources in the plurality of sample media resources where the target account generates interactive behavior as positive samples; take the other media resources in the plurality of sample media resources where the popularity is lower than that of the target media resource as negative samples; obtain the popularity representation of the media resources based on the media resources in the positive samples and the negative samples respectively; and construct a third auxiliary loss function based on the conformity representation of the target account, the popularity representation of the media resources, and the corresponding popularity.

[0038] In one implementation, the model training module can be configured to: construct a fifth similarity function based on the conformity representation of the target account and the popularity representation of media resources in the positive samples; construct a sixth similarity function based on the conformity representation of the target account and the popularity representation of media resources in the negative samples; construct a third auxiliary loss function based on the fifth similarity function, the sixth similarity function, and the corresponding popularity; and update the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the fifth similarity function and maximizing the result obtained by the sixth similarity function.

[0039] According to a fifth aspect of the present disclosure, an electronic device is provided, the electronic device including: at least one processor; at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform the recommended method and model training method as described above.

[0040] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided that stores instructions which, when executed by at least one processor, cause the at least one processor to perform the recommended method and model training method as described above.

[0041] According to a seventh aspect of the present disclosure, a computer program product is provided, wherein instructions in the computer program product are executed by at least one processor in an electronic device to perform the recommended method and model training method as described above.

[0042] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:

[0043] This disclosure enables direct training of causal decoupling representations on observed data, decoupling the user-media resource interaction intent causally into two types of representations (such as interest representations and conformity representations). Furthermore, by introducing a contrastive learning auxiliary task based on self-supervised modeling, it directly models user preference representations on observed data and learns the differences between user preference representations and media resource representations, solving the data sparsity problem of different causal representations, especially the long-tail distribution sparsity problem. In addition, by introducing user historical behavior data (such as historical media resource feature sequences), it better models the distribution of users' personalized representation preferences.

[0044] 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

[0045] 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.

[0046] Figure 1 This is a flowchart of a training method for a recommendation model according to an embodiment of the present disclosure;

[0047] Figure 2 This is a schematic flowchart illustrating the training of a recommendation model according to an embodiment of the present disclosure;

[0048] Figure 3 This is a flowchart of a recommended method according to embodiments of the present disclosure;

[0049] Figure 4 This is a block diagram of a recommended apparatus according to embodiments of the present disclosure;

[0050] Figure 5 This is a block diagram of a training apparatus for a recommended model according to an embodiment of the present disclosure;

[0051] Figure 6 This is a schematic diagram of the structure of a recommended device according to an embodiment of the present disclosure;

[0052] Figure 7 This is a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0053] 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.

[0054] The following description, provided with reference to the accompanying drawings, is intended to aid in a full understanding of embodiments of the present disclosure as defined by the claims and their equivalents. Various specific details are included to aid understanding, but these details are to be considered exemplary only. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Furthermore, for clarity and brevity, descriptions of well-known functions and structures are omitted.

[0055] The terms and words used in the following description and claims are not limited to their literal meaning, but are intended solely by the inventors to achieve a clear and consistent understanding of this disclosure. Therefore, it will be apparent to those skilled in the art that the following description of various embodiments of this disclosure is provided for illustrative purposes only and is not intended to limit the purpose of this disclosure as defined by the claims and their equivalents.

[0056] 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.

[0057] Currently, by using machine learning techniques, recommendation models can mine user preferences from user-item interaction data to make personalized recommendations. However, user-item interaction data is generated not only based on users' genuine interests but also on user conformity. For example, a user may be interested in Category A movies but not Category B movies, so this user will usually watch Category A movies. However, because a certain Category B movie is popular, this user will also follow the majority and watch this popular Category B movie. User conformity refers to users' tendency to consume popular media resources by following the choices of the majority. Therefore, from a causal inference perspective, user-item interaction data can be composed of these two reasons.

[0058] However, most current recommendation algorithms consider user herd mentality harmful because it interferes with the modeling of users' true interests and therefore needs to be eliminated. This is for two reasons: firstly, herd mentality leads users to interact with popular media resources even if these resources are not their actual interests, making it difficult for recommendation algorithms that model user interests based on interaction data; secondly, herd mentality causes popular media resources to receive more exposure and become even more popular (Pareto principle), which to some extent compresses the exposure space of mid-to-long-tail category media resources, hindering the long-term, healthy development of the business ecosystem. Existing solutions can be divided into three categories. The first category uses popularity correction methods to improve the accuracy of interest modeling, such as re-weighting algorithms represented by IPW (Inverse Bias Weighting), which weights low-popularity media resources and deweights high-popularity media resources, thereby balancing the impact of each popular media resource on the recommendation model. However, this type of algorithm, by uniformly and indiscriminately suppressing all highly popular media resources, harms the user experience. Furthermore, the variance of the bias scores is large, and training with this method is difficult to converge. The second type is based on causal effect reasoning, such as modeling the indirect effects of bias using counterfactual methods and mitigating the impact of these indirect effects through multi-objective modeling, or combining Bayesian theory for debiased reasoning. However, this type of method does not specifically analyze how popularity affects the modeling of users' true interests, nor does it address users' personalized conformity needs. The third type is based on causal decoupling representation algorithms: this type of method decomposes the model's representations to model different user intentions separately. However, this type of method requires different input data to train different representations and faces the problem of data sparsity.

[0059] Because user interests and conformity are intertwined in the observational data, and there is no signal to distinguish between them, directly training recommendation models using observational data is extremely difficult. While some recommendation algorithms partition the training data based on the relative popularity of items, resulting in different training datasets and training representations of different causal relationships, this partitioning easily introduces noise. Furthermore, the observational data suffers from two sparsity problems: sparse interaction data across different causal relationships, which hinders the learning of representations for different causal relationships; and after partitioning the dataset, the data distribution of long-tail items dominated by high-popularity items becomes even sparser, which is detrimental to the representation learning of long-tail items. Additionally, the distribution of user interests and conformity differs across different user-item interactions, and existing recommendation algorithms do not explicitly model the distribution of users' personalized interests and conformity preferences.

[0060] The inventors believe that user conformity is an intrinsic need of users, and directly eliminating or ignoring it will affect the user experience to some extent. In addition, the existence of conformity does make it difficult to model user interests. How to directly model user interests and conformity on the observation dataset and personalize the modeling of user interest and conformity preference distribution is the problem studied in this solution.

[0061] Therefore, this disclosure proposes a recommendation framework that directly models causal decoupled representations on the observed dataset based on contrastive learning. This disclosure causally decouples the user-media resource interaction intent into user interest preferences and user conformity preferences, and directly models interest and conformity representations on the observed data by introducing a contrastive learning auxiliary task. Furthermore, this disclosure incorporates user historical behavior to address the personalized distribution of user interests and conformity preferences, thereby better modeling the causal distribution of the user's current interaction. This disclosure not only allows for direct training of causal decoupled representations on the observed dataset but also effectively addresses the sparsity problem of causal data, particularly the long-tail sparsity problem, thereby obtaining personalized user interest and conformity preference distributions.

[0062] In the following, the methods and apparatus of this disclosure will be described in detail with reference to the accompanying drawings, according to various embodiments of this disclosure.

[0063] Figure 1 This is a flowchart of a training method for a recommended model according to embodiments of the present disclosure. The training method according to embodiments of the present disclosure can be implemented in any electronic device with data processing capabilities. The electronic device may include at least one of the following: for example, a smartphone, a tablet PC, a mobile phone, a video phone, an e-book reader, a desktop PC, a laptop PC, a netbook computer, a workstation, a server, a personal digital assistant (PDA), a portable multimedia player (PMP), a video player, a wearable device, and a server, etc.

[0064] According to embodiments of this disclosure, the recommendation model can be implemented by any neural network.

[0065] Reference Figure 1 In step S101, training data is acquired. The training data may include user characteristics of multiple sample user accounts, media resource characteristics of multiple sample media resources, and interaction behavior tags of sample user accounts on sample media resources. User accounts may refer to electronic accounts registered by users on devices or applications, reflecting user behavior. Media resources may refer to items, projects, videos, links, etc. Interaction behavior may include, for example, user accounts clicking, liking, commenting, and sharing media resources.

[0066] Training data can be extracted by collecting user-media resource interaction pairs from multiple user accounts with different media resources, along with their corresponding labels. Here, the label indicates whether a user account has interacted with a particular media resource; for example, a label value of 1 indicates that the user account has interacted with the media resource, while a label value of 0 indicates that the user account has not interacted with the media resource.

[0067] As an example, user characteristics (such as user ID, user profile characteristics (such as user gender, interests)) and media resource characteristics (such as media resource ID, media resource profile characteristics) corresponding to user accounts and media resource characteristics (such as media resource ID, media resource profile characteristics) can be extracted from user-media resource interaction data.

[0068] Several user accounts can be selected as target accounts from a pool of acquired user accounts, and several media resources can be selected as target media resources from a pool of acquired media resources. These selections are then used to predict the interaction results between the target accounts and the target media resources. The target accounts and target media resources can be interaction pairs that have interacted with each other or interaction pairs that have not interacted with each other. The selected target accounts and target media resources can be used to predict whether the target accounts have interacted with the target media resources using the recommendation model disclosed herein.

[0069] Furthermore, according to embodiments of this disclosure, a historical media resource feature sequence (also referred to as a user behavior sequence) can be generated based on the acquired sample data, representing multiple historical media resources in which a user account has interacted within a predetermined time period. For example, media resource features of several interactive media resources that have been interacted with recently can be selected according to the interaction time of the user account, and these media resource features constitute the historical media resource feature sequence of the user account. For instance, if a user account has interacted with m media resources in the past week, the media resource features of the m media resources can be arranged in the order of interaction time to form the historical media resource feature sequence of the user account. Therefore, according to embodiments of this disclosure, the training data may also include the historical media resource feature sequence of the target account.

[0070] Furthermore, according to embodiments of this disclosure, popularity information of media resources can also be obtained.

[0071] The training process described below uses the prediction of the interaction behavior between a target account and a target media resource as an example.

[0072] In step S102, based on the target user characteristics, the first module of the recommendation model is used to generate an interest representation and a conformity representation for the target account. The interest representation is a vector representing the user account's interests, and the conformity representation is a vector representing the user account's conformity.

[0073] According to embodiments of this disclosure, the recommendation model may consist of multiple neural network layers. A first module may be implemented by at least one embedding layer. For example, the first module may be implemented by an embedding layer including two vocabularies for extracting interest representations and conformity representations. The user ID and user profile features of the target account can be input into the embedding layer, and feature queries can be performed using these two vocabularies to obtain the interest representations and conformity representations of the target account.

[0074] According to another embodiment of this disclosure, in order to better model the interests and conformity preferences of user accounts, a historical media resource feature sequence can be introduced, and a causal sequence encoder can be used to obtain the causal distribution of interactive behaviors generated for each media resource in the historical media resource feature sequence, so that the current interactive interests and conformity distribution of user accounts can be modeled based on the historical causal distribution of user accounts.

[0075] When using historical media resource feature sequences, the user account's interest representation can consist of two parts: an interest representation based on user features and an interest representation based on historical media resource feature sequences. Similarly, the user account's conformity representation can consist of two parts: a conformity representation based on user features and a conformity representation based on historical media resource feature sequences. In this case, the first module may include multiple modules / network layers. For example, the first module may include a fourth module for calculating preference representation weights, a fifth module for generating a first interest representation (i.e., a part of the user interest representation) and a first conformity representation (i.e., a part of the user conformity representation) based on historical media resource feature sequences, and a sixth module for generating a second interest representation (another part of the user interest representation) and a second conformity representation (another part of the user conformity representation) based on target user features.

[0076] As an example, the fourth module can be implemented using a gating network, for instance, by at least two fully connected layers. The target account's characteristics and the media resource characteristics of each media resource in the historical media resource feature sequence can be input into the fourth module to obtain the target account's first and second weights for each historical media resource. Here, the first weight can represent an interest weight, and the second weight can represent a conformity weight. By outputting the conformity weights of the historical behavior sequence through the gating network, the user's interest preferences and overall preference distribution can be modeled in a personalized way.

[0077] The conformity weight can be calculated according to the following equation (1):

[0078]

[0079] Among them, w t E represents the herd mentality weight of the target account for the t-th media resource in the historical media resource feature sequence.u and Let F represent the media resource features of the t-th media resource in the target user feature sequence and the historical media resource feature sequence, respectively. Let concat represent the feature merging function and F represent two fully connected layers.

[0080] The fifth module may include at least one embedding layer (i.e., the seventh module) and an encoder (i.e., the eighth module). Historical media resource feature sequences can be input into the embedding layer to obtain embedding vectors for these sequences. Interest weights and conformity weights are then applied to these embedding vectors to obtain interest representation vectors and conformity representation vectors. The encoder encodes these vectors to obtain first interest representations and first conformity representations. By encoding these vectors, the feature dimensions of the encoded interest and conformity representations are made consistent with those obtained based on the target account features.

[0081] For example, after obtaining the conformity weight of each historical media resource in the historical media resource feature sequence using the above equation (1), the conformity weight sequence w can be obtained. conf ={w1, w2, ..., w n} and interest weight sequence w int ={1-w1, 1-w2, ..., 1-w n}, where n represents the sequence length of the historical media resource feature sequence. Then, the following equation (2) can be used to obtain the conformity representation and interest representation based on the historical media resource feature sequence:

[0082]

[0083]

[0084] Among them, E seq Encoder represents the embedding vector of a sequence of features related to historical media resources. seq This indicates sequence encoding operations.

[0085] The sixth module may include at least one embedding layer. The user ID and user profile features of the target account can be input into the embedding layer of the sixth module to obtain a second interest representation and a second conformity representation of the target account. For example, this embedding layer includes two vocabularies for extracting the interest representation and conformity representation; by looking up the vocabularies on the input user features, interest representation and conformity representation based on user features are obtained.

[0086] Next, the first interest representation obtained using Module 5 and the second interest representation obtained using Module 6 can be merged (e.g., by bitwise addition) to obtain the interest representation of the target account. The first conformity representation obtained using Module 5 and the second conformity representation obtained using Module 6 can also be merged (e.g., by bitwise addition) to obtain the conformity representation of the target account.

[0087] According to embodiments of this disclosure, user-media resource interaction intentions can be decoupled into two causes (i.e., interest and conformity) directly on the observation dataset based on causal analysis, and conformity is considered to be a user's consumption need rather than a harmful bias, thereby better modeling the user's interest representation and conformity representation.

[0088] In step S103, based on the characteristics of the target media resource, the second module of the recommendation model is used to generate a content representation and a popularity representation of the target media resource. Here, the content representation can refer to a vector representing the content of the media resource, and the popularity representation can refer to a vector representing the popularity of the media resource.

[0089] The second module may include at least one embedding layer. The media resource ID and media resource profile features of the target media resource can be input into the embedding layer of the second module. The embedding layer includes two vocabularies for extracting content representation and popularity representation. By using these two vocabularies to perform feature queries, the content representation and popularity representation of the target media resource can be obtained.

[0090] In this disclosure, decoupled causal representations can be directly obtained based on observational data, namely, user-side interest representations and conformity representations, and media resource-side content representations and popularity representations. When historical behavior sequences are introduced, user-side interest representations can be constructed by adding interest representations based on historical behavior sequences and interest representations based on user characteristics; similarly, user-side conformity representations can be constructed by adding conformity representations based on historical behavior sequences and conformity representations based on user characteristics. Media resource-side content and popularity representations can be directly obtained based on two sets of embedding vectors mapped from media resource features.

[0091] In step S104, based on the target account's interest and conformity representations, and the target media resource's content and popularity representations, the third module of the recommendation model is used to obtain the prediction results of the target account's interactive behavior towards the target media resource.

[0092] As an example, the third module can be implemented using a neural network layer. The interest and conformity representations of the target account can be merged (e.g., through concatenation) to obtain user-side features, and the content and popularity representations of the target media resource can be merged (e.g., through concatenation) to obtain media resource-side features. These user-side and media resource-side features are then input into the third module to predict the target account's interaction with the target media resource. For example, the inner product of the user-side and media resource-side features can be used to obtain a prediction score, which can then be used to infer whether the target account has interacted with the target media resource.

[0093] In step S105, the parameters of the first and second modules of the recommendation model are trained by maximizing the differences between the target account's interest representation and conformity representation and the content representation and popularity representation of other media resources (other media resources are those that have not interacted with the target account), and minimizing the difference between the prediction result and the corresponding interaction behavior label. Here, the content representation and popularity representation of other media resources can be obtained using the second module.

[0094] When the target media resource is a media resource that generates interaction with the target account, the parameters of the first and second modules of the recommendation model can be trained by minimizing the differences between the target account's interest representation and conformity representation and the target media resource's content representation and popularity representation, respectively.

[0095] According to embodiments of this disclosure, in order to solve the problem of data sparsity with different causal relationships, especially the sparsity of long-tail distribution, a contrastive learning auxiliary task based on self-supervised modeling can be introduced. Different auxiliary tasks can respectively augment interest and conformity data into similar or different perspectives. Positive and negative training samples for interest and conformity can be constructed for the corresponding tasks respectively, and media resource popularity information is incorporated into the contrastive learning loss function as a supervision signal, thereby better learning the preference representation of the corresponding causal relationship.

[0096] As an example, for the main task "whether an interactive behavior occurs," a loss function related to the predicted result and the corresponding actual interactive behavior label can be constructed as the main loss function. Furthermore, for contrastive learning auxiliary tasks based on user historical behavior and / or contrastive learning auxiliary tasks based on user-media resource interaction, at least one of the following loss functions can be constructed as auxiliary loss functions: a loss function related to the target account's interest representation, a loss function related to the target account's conformity representation, a loss function related to the target account's interest representation and the media resource's content representation, a loss function related to the target account's interest representation and the media resource's popularity representation, a loss function related to the target account's conformity representation and the media resource's content representation, and a loss function related to the target account's conformity representation and the media resource's popularity representation. The parameters of the recommendation model are updated by minimizing the loss calculated by the main loss function and the auxiliary loss functions.

[0097] For contrastive learning-assisted tasks based on user historical behavior, the main focus can be on learning user-side interest representations and conformity representations. The following description uses the construction of a loss function related to the interest representation of the target account as an example.

[0098] Subsequences can be obtained from the original sequence by randomly cropping the user behavior sequence to augment the sample. For example, the historical media resource feature sequence of the target account can be combined with multiple cropped sub-media resource feature sequences to form positive sample pairs, and these historical media resource feature sequences can be combined with the historical media resource feature sequences of other accounts to form negative sample pairs. The other accounts are multiple sample user accounts that differ from the target account.

[0099] The sizes of the pruned sequences can be inconsistent because both the pruned subsequences and the original sequences can be encoded to obtain interest representations of the same dimension.

[0100] Next, based on the feature sequences of multiple sub-media resources in the positive sample pair, interest representations corresponding to the feature sequences of multiple sub-media resources can be obtained, and based on the historical media resource feature sequences of other accounts in the negative sample pair, interest representations of other accounts can be obtained. Then, based on the interest representations of the target account, the interest representations corresponding to the multiple sub-media resource feature sequences, and the interest representations of other accounts, a first auxiliary loss function is constructed. For example, for each feature sequence in the cropped sub-media resource feature sequence and the historical media resource feature sequences of other accounts, based on the feature sequence and the corresponding account features, the fourth module in the first module can be used to obtain the interest weight for the feature sequence. Then, based on the feature sequence and the interest weight, the fifth module in the first module can be used to obtain the first interest representation of the corresponding user account, which serves as the interest representation corresponding to the feature sequence.

[0101] For example, the first auxiliary loss function may include: a first similarity function constructed based on the interest representation of the target account and the interest representation corresponding to the feature sequences of multiple sub-media resources, and a second similarity function constructed based on the interest representation of the target account and the interest representation of other accounts. The network parameters of the recommendation model can be updated by minimizing the result obtained by the first similarity function and maximizing the result obtained by the second similarity function.

[0102] This contrastive loss updates model parameters by minimizing the difference between the same user behavior sequence and the augmented sequence, and maximizing the difference between the user behavior sequence and the user behavior sequences of other user accounts in the training data, thereby learning interest representations with the powerful representation learning capabilities of contrastive learning. For example, the loss function for interest representations can be constructed using the following equation (3):

[0103]

[0104] Where S represents the similarity function, which calculates the correlation between two vectors, and E... + int and E - int E represents the interest representations of the augmented positive and negative samples, respectively. int This represents the interest profile of the target account.

[0105] Furthermore, the loss function for the representation of conformity can be constructed in the same way as the loss function for the representation of interest described above, which will not be elaborated on here.

[0106] For contrastive learning-assisted tasks based on user-media resource interaction, the causal relationship between user interest representations and media resource content representations can be modeled.

[0107] As an example, media resources from multiple sample media resources that interact with the target account can be used as positive samples, and other media resources (i.e., those that do not interact with the target account) can be used as negative samples. Content representations of the media resources are obtained based on the positive and negative samples, respectively. Then, a second auxiliary loss function is constructed based on the target account's interest representation, the media resource's content representation, and its corresponding popularity. The content representations of other media resources can be obtained using a second module. The second auxiliary loss function may include: a third similarity function constructed based on the target account's interest representation and the content representations of media resources in the positive samples, and a fourth similarity function constructed based on the target account's interest representation and the content representations of media resources in the negative samples. The network parameters of the recommendation model can be updated by minimizing the result obtained by the third similarity function and maximizing the result obtained by the fourth similarity function.

[0108] For example, media resources interacted by the same user (such as the target account) can be used as positive samples, and other media resources in the training data can be used as negative samples to augment the samples. This contrastive loss can update the model parameters by minimizing the difference between the interest representation of the same user account and the content representation of the media resources that have been interacted with, and maximizing the difference between the interest representation of the user account and the content representation of other media resources that the user account has not interacted with in the training data, thereby better contrastively learning the relationship between user interest representation and media resource content representation. In addition, the popularity of media resources can be introduced into the second auxiliary loss function as supervision information for this contrastive learning to ensure that the user's interaction with low-popularity media resources is mainly based on user interests. The second auxiliary loss function can be constructed using the following equation (4):

[0109]

[0110] Where Pop represents the popularity of media resources, S represents the similarity function that calculates the correlation between two vectors, and E represents the similarity function. + cont and E - cont E represents the content representation of the augmented positive and negative samples, respectively. int This represents the target account's interest profile. The weight of exp(-pop) for high-popularity media resources is exp(-1) instead of 0, ensuring that interactions with high-popularity media resources also have an interest weight rather than being entirely based on user conformity. Optionally, the popularity information of media resources can be ignored in the second auxiliary loss function.

[0111] In addition, the loss function between the user's interest representation and the media resource popularity representation can be constructed in the same way as the second auxiliary loss function described above, which will not be elaborated on here.

[0112] For contrastive learning-assisted tasks based on user-media resource interaction, it is also possible to model the causal relationship between users' conformity representation and media resource popularity representation.

[0113] As an example, media resources from multiple sample media resources where the target account interacts can be considered positive samples, and other media resources from the multiple sample media resources with lower popularity than the target media resource can be considered negative samples. Popularity representations of media resources are obtained based on the positive and negative samples. These popularity representations can be obtained using the second module. Then, a third auxiliary loss function is constructed based on the target account's conformity representation, the popularity representations of media resources in the third positive and third negative samples, and their corresponding popularity. The third auxiliary loss function may include: a fifth similarity function constructed based on the target account's conformity representation and the popularity representations of media resources in the positive samples, and a sixth similarity function constructed based on the target account's conformity representation and the popularity representations of media resources in the negative samples. The network parameters of the recommendation model can be updated by minimizing the result obtained by the fifth similarity function and maximizing the result obtained by the sixth similarity function.

[0114] For example, media resources interacted with by the same user account (such as the target account) can be used as positive samples, while other media resources in the training data that the user account has not interacted with and whose popularity is lower than that of the target media resource can be used as negative samples for sample augmentation. This contrastive loss can update the model parameters by minimizing the difference between the conformity representation of the same user account and the popularity representation of the media resource, and maximizing the difference between the conformity representation of the user account and the popularity representation of other media resources in the training data that the user account has not interacted with and whose popularity is lower than that of the target media resource, thereby better learning the user conformity representation and the media resource popularity representation. In addition, the popularity of the media resource can be introduced into the third auxiliary loss function as the supervision information for this contrastive learning to ensure that the interaction between the user account and the high-popularity media resource is mainly based on user conformity. The third auxiliary loss function can be constructed using the following equation (5):

[0115]

[0116] Where Pop represents the popularity of media resources, S represents the similarity function that calculates the correlation between two vectors, and E represents the similarity function. + pop and E - pop E represents the popularity of the augmented positive and negative samples, respectively. conf This represents the herd mentality of the target account. Optionally, the popularity information of media resources may not be considered in the third auxiliary loss function.

[0117] In addition, the loss function between the user's conformity representation and the media resource's content representation can be constructed in the same way as the third auxiliary loss function described above, which will not be elaborated on here.

[0118] When training the model with an auxiliary task, the total loss function can be constructed using the following equation (6):

[0119]

[0120] in, α is the main loss function of the recommendation model, and β are hyperparameters that control the influence of auxiliary tasks on model training.

[0121] The total loss function can optimize model parameters based on the main task (whether an interaction occurs) and also optimize the corresponding representations based on the auxiliary main tasks (such as the three contrastive loss functions constructed above), thereby improving the overall generalization of the model. Equation (6) is only an example; other auxiliary loss functions can be added or a certain auxiliary loss function can be reduced according to design requirements. The recommendation model can be optimized by minimizing the loss obtained from the total loss function.

[0122] Figure 2 This is a flowchart illustrating the training of a recommendation model according to embodiments of the present disclosure. The present disclosure aims to argue that conformity is a user need, not a harmful bias, and, combining causal mechanisms, considers user conformity and interest as two reasons for user interaction. Therefore, it proposes a general causal decoupling representation framework based on contrastive learning, such as... Figure 2 As shown, the contrastive learning-based augmentation method directly trains interest and conformity representations on the observed dataset. This not only effectively addresses the data sparsity problem across different causal groups, especially the long-tail data sparsity problem, but also allows for personalized modeling of user interest and conformity preference distributions, thereby improving the generalization and interpretability of the recommendation model.

[0123] According to embodiments of this disclosure, user-side interest representations and conformity representations can be obtained based on two parts: user historical behavior sequences and user characteristics. The weights of the conformity representations of user historical behavior sequences can be output by a gating network, allowing for personalized modeling of user interest and conformity preference distributions. Finally, the decoupled causal representations can be modeled through three contrastive learning-assisted tasks.

[0124] First, sample data needs to be obtained for training the recommendation model. This sample data may include interaction data between user accounts and media resources, interaction tags indicating whether a user account has interacted with a media resource, and the popularity information of the media resource. The obtained sample data may include multiple sample user accounts and multiple sample media resources. Here, media resources can refer to items, projects, videos, links, etc. User accounts can refer to electronic accounts registered by users on the application or device.

[0125] Training data can be generated based on various features extracted from sample data. For example, training data may include user features corresponding to a user account (such as user ID, user profile features (such as user gender, interests), media resource features of media resources (such as media resource ID, media resource profile features), and a sequence of historical media resource features of multiple historical media resources from which the user account has interacted within a predetermined time period (e.g., selecting media resource features of several media resources recently interacted with based on the user account's interaction time, with these media resource features constituting the user account's historical media resource feature sequence). See below for reference. Figure 2 The training process of the recommendation model is explained in detail using a user account as an example.

[0126] exist Figure 2 In this context, "User historical behavior" refers to the sequence of historical media resource characteristics of the target account, where b1, b2, and b... n-1 …b n These represent the media resource characteristics of n media resources for which the target account has recently interacted. "User id" and "User profile" represent the user ID and user profile characteristics of the target account, respectively, while "Item id" and "Item profile" represent the media resource ID and media resource profile characteristics of the target media resource, respectively. This indicates element-wise multiplication. This indicates element-wise addition. E + / - Indicates positive and negative samples.

[0127] Historical media resource feature sequences, user features, and media resource features are input into different embedding layers to obtain embedding vectors corresponding to the historical media resource feature sequences. seq ), and embedding vectors corresponding to user features (User Emb) and media resource features (Item Emb).

[0128] By performing causal sequence encoding (i.e., Seq Encoder) on the embedding vectors (Eseq) corresponding to the historical media resource feature sequence, the conformity representation and interest representation of the target account for each media resource in the historical media resource feature sequence can be obtained. For example, the ID features and profile features of each media resource in the historical media resource feature sequence can be merged with the ID features and profile features of the target account (e.g., using a concat method), and then the merged result can be used as the input to a gating network. Here, the gating network can be used to calculate the conformity weight of the target account for each media resource in the historical media resource feature sequence. (See reference...) Figure 2 The gating network 201 may include an embedding layer and a neural layer. The conformity weight of the target account for each historical media resource can be calculated according to equation (1) above. Figure 2 In the middle, w conf The weight sequence representing user conformity, 1-w conf A weighted sequence representing user interests. The embedding vector (Eseq) corresponding to the feature sequence of historical media resources is multiplied by the weighted sequence w of user conformity. conf This yields a conformity representation vector, which is then multiplied by the embedding vector (Eseq) corresponding to the historical media resource feature sequence by the user interest weight sequence 1-w. conf The interest representation vector is obtained. Then, causal sequence encoding is performed on the conformity representation vector and the interest representation vector respectively to obtain the conformity representation and interest representation based on historical user behavior. The conformity representation and interest representation based on historical user behavior can be calculated according to the above equation (2). Since Figure 2 The embedding vectors corresponding to user features (User Emb) and media resource features (Item Emb) represent a user account and a media resource, respectively. The embedding vectors corresponding to user historical behavior sequences represent multiple historical media resources. Therefore, by encoding the embedding vectors based on user historical behavior sequences, the dimensions of the representation based on user historical behavior sequences can be made consistent with the dimensions of the representation based on user features and the representation based on media resource features.

[0129] The user-side interest representation can be obtained by adding two parts. The interest representation based on the user's historical behavior sequence and the interest representation based on user characteristics can be added bit-by-bit to obtain the user-side interest representation (i.e., the Interest Emb). The conformity representation based on the user's historical behavior sequence and the conformity representation based on user characteristics can be added bit-by-bit to obtain the user-side conformity representation (i.e., the Conformity Emb).

[0130] Content Emb and popularity Emb on the media resource side can be directly obtained from two sets of embedding vectors mapped from media resource features.

[0131] A contrastive learning auxiliary task based on user historical behavior sequences can be constructed, primarily learning user interest representations. Sample augmentation can be performed by randomly pruning user historical behavior sequences, resulting in subsequences of the original sequence. Subsequences pruned from the same user account are used as positive samples, and positive sample pairs are formed by the historical behavior sequences of the same user account and the pruned subsequences. Historical behavior sequences of other user accounts within the training data are used as negative samples, and negative sample pairs are formed by the historical behavior sequences of these user accounts and those of other user accounts. Interest representations corresponding to multiple sub-media resource feature sequences in the positive sample pairs are obtained, and interest representations for other accounts are obtained based on the historical media resource feature sequences of other accounts in the negative sample pairs. The sequence sizes of the positive and negative samples can be inconsistent; the final representation used is the sequence-encoded representation. This contrastive loss updates model parameters by minimizing the difference between the same user behavior sequence and the augmented sequence, and maximizing the difference between the sequence and the sequences of other users within the training data, leveraging the powerful representation learning capabilities of contrastive learning to learn user interest representations.

[0132] For each subsequence obtained from the cropping, the subsequence can be input into the embedding layer to obtain the embedding vector of the subsequence. Based on the subsequence and the user characteristics of the user account, the interest weight of each media resource in the subsequence is calculated using a gating network. The subsequence is multiplied by the corresponding interest weight sequence to obtain the interest representation vector. Sequence encoding is performed on the interest representation vector to obtain the interest representation based on the subsequence. The interest representation based on the subsequence is added bitwise to the interest representation based on the user characteristics to obtain the augmented interest representation (i.e., Augmented Interest Emb). For example, the above equation (3) can be used to construct the loss function based on the user's historical behavior sequence.

[0133] A contrastive learning auxiliary task based on user-media resource interaction can be constructed, mainly modeling the interest representation of the target account and the content representation of media resources. Media resources interacted with by the same user are used as positive samples, and other media resources not interacted with are used as negative samples. This contrastive loss can update the model parameters by minimizing the difference between the interest representation of the same user and the content representation of the interacted media resources, and maximizing the difference between the content representation of other media resources not interacted with by the user, thereby better learning the interest representation and content representation. In addition, the popularity of media resources can be introduced into the loss function as the supervision information for this contrastive learning to ensure that the user's interaction with low-popularity media resources is mainly based on the user's interests. For example, the above equation (4) can be used to construct a loss function based on user interest representation and media resource content representation.

[0134] Another contrastive learning auxiliary task based on user-media resource interaction can be constructed, mainly modeling the conformity representation of the target account and the popularity representation of the media resource. Media resources interacted with by the same user are used as positive samples, and other media resources in the training data that have not been interacted with and whose popularity is lower than that of the target media resource are used as negative samples. This contrastive loss can update the model parameters by minimizing the difference between the conformity representation of the same user account and the popularity representation of the media resources that have been interacted with, and maximizing the difference between the popularity representation of other media resources in the training data that have not been interacted with by the user account and whose popularity is lower than that of the target media resource, thereby better learning the conformity representation and popularity representation. Similarly, the popularity of media resources can be introduced into the loss function as the supervision information for this contrastive learning to ensure that the user's interaction with high-popularity media resources is mainly based on user conformity. For example, the above equation (5) can be used to construct a loss function based on user interest representation and media resource content representation.

[0135] In model training, the loss function in equation (6) above can be used to optimize the model parameters. The total loss function can optimize the model parameters based on the main task (whether an interaction occurs) and also assist the main task in optimizing the corresponding causal representation based on the three contrastive loss functions, thereby improving the overall generalization of the model. The main loss function can be constructed using user-side representations and media resource-side representations. For example, user-side interest representations and conformity representations can be merged, and media resource-side content representations and popularity representations can be merged. The merged user-side representations and media resource-side representations can be used to construct the main loss function L. main The model parameters are optimized by minimizing the loss obtained from the total loss function.

[0136] Figure 2 The network framework shown is a general framework, therefore, it can be applied to various models and loss functions.

[0137] Figure 3 This is a flowchart of a recommended method according to embodiments of the present disclosure. The recommended method according to embodiments of the present disclosure can be implemented in any electronic device with data processing capabilities. The electronic device may include at least one of the following: for example, a smartphone, a tablet PC, a mobile phone, a video phone, an e-bookreader, a desktop PC, a laptop PC, a netbook computer, a workstation, a server, a personal digital assistant (PDA), a portable multimedia player (PMP), a video player, a camera, and a wearable device, etc.

[0138] Reference Figure 3In step S301, the user characteristics of the user account of the content to be recommended and the candidate media resource characteristics of multiple candidate media resources are obtained. When preparing to recommend media resources to the target account, the ID characteristics and profile characteristics of the target account, as well as the ID characteristics and profile characteristics of the media resources to be recommended (i.e., candidate media resources) can be obtained.

[0139] According to embodiments of this disclosure, a sequence of historical media resource features can also be obtained from multiple historical media resources in which the user account has generated interactive behavior within a predetermined time period. For example, the ID features and profile features of media resources in which the target account has generated interactive behavior in the most recent period (such as one week ago) can be used to generate a user representation of the target account.

[0140] In step S302, based on user characteristics, the first module of the recommendation model is used to obtain the user account's interest representation and conformity representation of the content to be recommended.

[0141] For example, the first module may include an embedding layer. This embedding layer may be implemented using two matrices or vocabularies, one for extracting user interests and the other for extracting user conformity. By inputting user features into this embedding layer, interest representations and conformity representations of the user account can be obtained.

[0142] Furthermore, given the acquisition of historical media resource feature sequences, the first module can be used to generate user account interest representations and conformity representations based on these sequences and user characteristics. In this case, the first module can consist of multiple modules. The user account interest representation can be composed of two parts: an interest representation based on historical media resource feature sequences and an interest representation based on user characteristics. Similarly, the user account conformity representation can be composed of two parts: a conformity representation based on historical media resource feature sequences and a conformity representation based on user characteristics.

[0143] For example, based on the historical media resource feature sequence and user characteristics, the fourth module in the first module can be used to obtain the first weight and the second weight for multiple historical media resources. Based on the historical media resource feature sequence, the first weight, and the second weight, the fifth module in the first module can be used to obtain the first interest representation and the first conformity representation of the user account. Based on the user characteristics, the sixth module in the first module can be used to obtain the second interest representation and the second conformity representation of the user account. The user account's interest representation is obtained based on the first interest representation and the second interest representation, and the user account's conformity representation is obtained based on the first conformity representation and the second conformity representation.

[0144] When generating the first interest representation and the first conformity representation of a user account based on the feature sequence of historical media resources, the seventh module in the fifth module can be used to obtain the embedding vector for multiple media resources based on the feature sequence of historical media resources. By applying the first weight and the second weight to the embedding vector, the interest representation vector and the conformity representation vector are obtained. The interest representation vector and the conformity representation vector are encoded by using the eighth module in the fifth module to obtain the first interest representation and the first conformity representation.

[0145] In step S303, based on the features of the candidate media resources, the second module of the recommendation model is used to obtain the content representation and popularity representation of multiple candidate media resources. For example, the second module can be implemented by two sets of embedded vocabularies, and the content representation and popularity representation of the candidate media resources are obtained by querying the corresponding vocabularies through the corresponding features.

[0146] The second module may include an embedding layer. This embedding layer can be implemented using two matrices or vocabularies, one for extracting resource content and the other for extracting resource popularity. By inputting the candidate media resource features of each candidate media resource into this embedding layer, the content representation and popularity representation of each candidate media resource can be obtained.

[0147] In step S304, based on the user account's interest and conformity representations of the content to be recommended, and the content and popularity representations of multiple candidate media resources, the third module of the recommendation model is used to obtain the recommendation information for each candidate media resource. For example, the user account's interest and conformity representations can be concatenated to obtain the user account's final user-side representation. For each candidate media resource, the candidate media resource's content and popularity representations are concatenated to obtain the media resource's final media resource-side representation. The inner product of the final user-side representation and the final media resource-side representation is used to obtain a recommendation score, which can be used as the final interaction probability between the user account and the candidate media resource.

[0148] In step S305, candidate media resources whose predicted recommendation information meets preset conditions are recommended to the user account of the content to be recommended.

[0149] The recommendation model can sort candidate media resources from highest to lowest based on their recommendation scores, and recommend the top ten media resources to the target account. Alternatively, a pre-set recommendation score threshold can be used to recommend candidate media resources that meet that threshold to the target account.

[0150] Figure 4 This is a block diagram of a recommended apparatus according to embodiments of the present disclosure.

[0151] Reference Figure 4The recommendation device 400 may include an acquisition module 401 and a recommendation module 402. Each module in the recommendation device 400 may be implemented by one or more modules, and the names of the corresponding modules may vary depending on the type of module. In various embodiments, some modules in the recommendation device 400 may be omitted, or additional modules may be included. Furthermore, modules / elements according to various embodiments of this disclosure may be combined to form a single entity, and thus perform the functions of the respective modules / elements before combination.

[0152] The acquisition module 401 can acquire user characteristics of the user account of the content to be recommended and candidate media resource characteristics of multiple candidate media resources.

[0153] The recommendation module 402 can obtain the user account's interest representation and conformity representation based on user characteristics using the first module of the recommendation model; obtain the content representation and popularity representation of multiple candidate media resources based on candidate media resource characteristics using the second module of the recommendation model; obtain the recommendation information of each candidate media resource among the multiple candidate media resources based on the user account's interest representation and conformity representation, the content representation and popularity representation of multiple candidate media resources using the third module of the recommendation model; and recommend candidate media resources among the multiple candidate media resources whose recommendation information meets preset conditions to the user account.

[0154] As one implementation method, the acquisition module 401 can acquire the historical media resource feature sequence of multiple historical media resources in which the user account has generated interactive behavior within a predetermined time period.

[0155] In this case, recommendation module 402 can use the first module to generate interest representations and conformity representations of user accounts based on historical media resource feature sequences and user characteristics.

[0156] In one implementation, the recommendation module 402 may, based on the historical media resource feature sequence and user characteristics, use the fourth module in the first module to obtain a first weight and a second weight for multiple historical media resources; based on the historical media resource feature sequence, the first weight, and the second weight, use the fifth module in the first module to obtain a first interest representation and a first conformity representation for the user account; based on the user characteristics, use the sixth module in the first module to obtain a second interest representation and a second conformity representation for the user account; obtain the user account's interest representation based on the first interest representation and the second interest representation, and obtain the user account's conformity representation based on the first conformity representation and the second conformity representation.

[0157] As one implementation, the recommendation module 402 can obtain embedding vectors for multiple media resources based on the historical media resource feature sequence and using the seventh module in the fifth module; by applying the first weight and the second weight to the embedding vectors, interest representation vectors and conformity representation vectors are obtained; by using the eighth module in the fifth module, the interest representation vectors and conformity representation vectors are encoded to obtain the first interest representation and the first conformity representation.

[0158] According to another embodiment of this disclosure, the recommendation model can be obtained using the training method according to the embodiments of this disclosure, and then the trained recommendation model can be used to predict the recommendation score of candidate media resources.

[0159] The above has been referenced Figure 3 The recommendation process has been described in detail, so I won't go into it again here.

[0160] Figure 5 This is a block diagram of a training apparatus for a recommended model according to an embodiment of the present disclosure.

[0161] Reference Figure 5 The training device 500 may include a data acquisition module 501 and a model training module 502. Each module in the training device 500 may be implemented by one or more modules, and the names of the corresponding modules may vary depending on the type of module. In various embodiments, some modules in the training device 500 may be omitted, or additional modules may be included. Furthermore, modules / elements according to various embodiments of this disclosure may be combined to form a single entity, and thus perform the functions of the respective modules / elements before combination.

[0162] The data acquisition module 501 can acquire training data. The training data may include user characteristics of multiple sample user accounts, media resource characteristics of multiple sample media resources, and interaction behavior labels of each sample user account for each sample media resource.

[0163] The model training module 502 can generate interest representations and conformity representations of the target account based on the target user characteristics of the target account among multiple sample user accounts, using the first module of the recommendation model; based on the media resource characteristics of the target media resource and other media resources among multiple sample media resources, it can generate content representations and popularity representations of the target media resource and other media resources respectively using the second module of the recommendation model, where other media resources are media resources that have not interacted with the target account; based on the interest representations and conformity representations of the target account, and the content representations and popularity representations of the target media resources, it can obtain the prediction results of the target account's interaction with the target media resources using the third module of the recommendation model; by maximizing the differences between the interest representations and conformity representations of the target account and the content representations and popularity representations of other media resources respectively, and minimizing the differences between the prediction results and the corresponding interaction behavior labels, the parameters of the first and second modules of the recommendation model are trained.

[0164] As one implementation method, the data acquisition module 501 can generate a historical media resource feature sequence of multiple historical media resources in which the target account in multiple sample media resources generates interactive behavior within a predetermined time period.

[0165] In this case, the model training module 502 can generate interest representations and conformity representations of the target account based on the historical media resource feature sequence and target user features, using the first module of the recommendation model.

[0166] In one implementation, the model training module 502 can obtain a first weight and a second weight for multiple historical media resources based on the historical media resource feature sequence and target user features, using the fourth module in the first module; based on the historical media resource feature sequence, the first weight, and the second weight, it can obtain a first interest representation and a first conformity representation for the target account using the fifth module in the first module; based on the target user features, it can obtain a second interest representation and a second conformity representation for the target account using the sixth module in the first module; the interest representation of the target account is obtained based on the first interest representation and the second interest representation, and the conformity representation of the target account is obtained based on the first conformity representation and the second conformity representation.

[0167] As one implementation, the model training module 502 can obtain embedding vectors for multiple media resources based on the feature sequence of historical media resources using the seventh module in the fifth module; by applying the first weight and the second weight to the embedding vectors, interest representation vectors and conformity representation vectors are obtained; by using the eighth module in the fifth module, the interest representation vectors and conformity representation vectors are encoded to obtain the first interest representation and the first conformity representation.

[0168] In one implementation, when the target media resource is a media resource that interacts with the target account, the model training module 502 can train the parameters of the first and second modules of the recommendation model by minimizing the differences between the target account's interest representation and conformity representation and the target media resource's content representation and popularity representation, respectively.

[0169] As one implementation, the model training module 502 can construct a main loss function based on the prediction results and the corresponding interaction behavior labels; construct at least one auxiliary loss function based on the interest representation and conformity representation of the target account, the content representation and popularity representation of the target media resources and other media resources; and update the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and at least one auxiliary loss function.

[0170] As an example, the model training module 502 can construct a main loss function related to the prediction result and the corresponding true label; construct at least one of the following auxiliary loss functions: an auxiliary loss function related to the target account's interest representation, an auxiliary loss function related to the target account's conformity representation, an auxiliary loss function related to the target account's interest representation and the media resource's content representation, an auxiliary loss function related to the target account's interest representation and the media resource's popularity representation, an auxiliary loss function related to the target account's conformity representation and the media resource's content representation, and an auxiliary loss function related to the target account's conformity representation and the media resource's popularity representation; and update the parameters of the recommendation model by minimizing the loss calculated by the main loss function and at least one auxiliary loss function.

[0171] In one implementation, the model training module 502 can generate multiple sub-media resource feature sequences based on the historical media resource feature sequences of the target account; form positive sample pairs with the historical media resource feature sequences and multiple sub-media resource feature sequences, and form negative sample pairs with the historical media resource feature sequences of other accounts, wherein the other accounts are user accounts that are different from the target account among the multiple sample user accounts; obtain interest representations corresponding to the multiple sub-media resource feature sequences based on the multiple sub-media resource feature sequences in the positive sample pairs; obtain interest representations of other accounts based on the historical media resource feature sequences of other accounts in the negative sample pairs; and construct a first auxiliary loss function based on the interest representations of the target account, the interest representations corresponding to the multiple sub-media resource feature sequences, and the interest representations of other accounts.

[0172] In one implementation, when constructing the first auxiliary loss function, a first similarity function can be constructed based on the interest representation of the target account and the interest representation corresponding to the feature sequences of multiple sub-media resources; a second similarity function can be constructed based on the interest representation of the target account and the interest representation of other accounts; and the first auxiliary loss function can be constructed based on the first and second similarity functions. Then, the model training module 502 can update the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the first similarity function and maximizing the result obtained by the second similarity function.

[0173] As one implementation method, the model training module 502 can obtain the popularity of multiple sample media resources; take the media resources in which the target account generates interactive behavior as positive samples; take other media resources in the multiple sample media resources as negative samples; obtain the content representation of the media resources based on the media resources in the positive and negative samples respectively; and construct a second auxiliary loss function based on the interest representation of the target account, the content representation of the media resources and the corresponding popularity.

[0174] As one implementation method, when constructing the second auxiliary loss function, a third similarity function can be constructed based on the interest representation of the target account and the content representation of media resources in positive samples; a fourth similarity function can be constructed based on the interest representation of the target account and the content representation of media resources in negative samples; and a second auxiliary loss function can be constructed based on the third similarity function, the fourth similarity function, and the corresponding popularity. The model training module 502 can update the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the third similarity function and maximizing the result obtained by the fourth similarity function.

[0175] In one implementation, the model training module 502 can obtain the popularity of multiple sample media resources; take the media resources in which the target account generates interactive behavior as positive samples; take the other media resources in the multiple sample media resources whose popularity is lower than that of the target media resource as negative samples; obtain the popularity representation of the media resources based on the media resources in the positive and negative samples respectively; and construct a third auxiliary loss function based on the conformity representation of the target account, the popularity representation of the media resources and the corresponding popularity.

[0176] As one implementation method, when constructing the third auxiliary loss function, a fifth similarity function can be constructed based on the conformity representation of the target account and the popularity representation of media resources in positive samples; a sixth similarity function can be constructed based on the conformity representation of the target account and the popularity representation of media resources in negative samples; and a third auxiliary loss function can be constructed based on the fifth similarity function, the sixth similarity function, and the corresponding popularity. The model training module 502 can update the parameters of the first and second modules of the recommendation model by minimizing the result obtained by the fifth similarity function and maximizing the result obtained by the sixth similarity function.

[0177] The above has been referenced Figure 1 and Figure 2 The model training process has been described in detail, so I will not repeat it here.

[0178] Figure 6 This is a schematic diagram of the structure of a recommended device in the hardware operating environment of this disclosure embodiment. Here, the recommended device 600 can realize the above-mentioned function of effectively recommending media resources.

[0179] like Figure 6 As shown, the recommended device 600 may include: a processing component 601, a communication bus 602, a network interface 603, an input / output interface 604, a memory 605, and a power supply component 606. The communication bus 602 is used to establish communication signals between these components. The input / output interface 604 may include a video display (such as a liquid crystal display), a microphone and speaker, and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). Optionally, the input / output interface 604 may also include a standard wired interface or a wireless interface. The network interface 603 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 605 may be a high-speed random access memory or a stable non-volatile memory. The memory 605 may also optionally be a storage device independent of the aforementioned processing component 601.

[0180] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the recommended device 600, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0181] like Figure 6 As shown, the memory 605, which serves as a storage medium, may include an operating system (such as a MAC operating system), a data storage module, a network communication module, a user interface module, a recommendation program, a model training program, and a database.

[0182] exist Figure 6In the recommended device 600 shown, the network interface 603 is mainly used for data communication with external devices / terminals; the input / output interface 604 is mainly used for data interaction with users; the processing component 601 and the memory 605 in the recommended device 600 can be set in the recommended device 600. The recommended device 600 calls the recommendation program, model training program and various APIs provided by the operating system stored in the memory 605 through the processing component 601 to execute the recommendation method, model training method and other methods provided in the embodiments of this disclosure.

[0183] Processing component 601 may include at least one processor, and memory 605 stores a set of computer-executable instructions. When the set of computer-executable instructions is executed by at least one processor, it performs the recommendation method and / or model training method according to embodiments of this disclosure. Furthermore, processing component 601 may perform the model training process, media resource recommendation process, etc., as described above. However, the above examples are merely exemplary, and this disclosure is not limited thereto.

[0184] In addition, the processing component 601 can receive a trained recommendation model from an external device and use the recommendation model to recommend appropriate media resource information to the user account.

[0185] As an example, the recommended device 600 may be a PC, tablet, personal digital assistant, smartphone, or other device capable of executing the aforementioned set of instructions. Here, the recommended device 600 is not necessarily a single electronic device, but may be any collection of devices or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. The recommended device 600 may also be part of an integrated control system or system manager, or may be configured to interconnect with a portable electronic device locally or remotely (e.g., via wireless transmission) through an interface.

[0186] In the recommended device 600, the processing component 601 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, the processing component 601 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0187] Processing component 601 can execute instructions or code stored in memory, wherein memory 605 can also store data. Instructions and data can also be sent and received over a network via network interface 603, wherein network interface 603 can employ any known transport protocol.

[0188] The memory 605 can be integrated with the processor, for example, by placing RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 605 can include a separate device, such as an external disk drive, a storage array, or other storage device that can be used by any database system. The memory and processor can be operatively coupled, or can communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor to read files stored in the memory.

[0189] According to embodiments of this disclosure, an electronic device may be provided. Figure 7 This is a block diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 700 may include at least one memory 702 and at least one processor 701. The at least one memory 702 stores a set of computer-executable instructions. When the set of computer-executable instructions is executed by the at least one processor 701, a recommended method or model training method according to an embodiment of the present disclosure is executed.

[0190] Processor 701 may include a central processing unit (CPU), an audio processor, a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor 701 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0191] The memory 702, which serves as a storage medium, may include an operating system (e.g., a MAC operating system), a data storage module, a network communication module, a user interface module, a recommendation module, and a database.

[0192] The memory 702 can be integrated with the processor 701; for example, RAM or flash memory can be arranged within an integrated circuit microprocessor. Alternatively, the memory 702 can include a separate device, such as an external disk drive, a storage array, or other storage device that can be used by any database system. The memory 702 and the processor 701 can be operatively coupled, or can communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 701 to read files stored in the memory 702.

[0193] In addition, the electronic device 700 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device 700 can be interconnected via a bus and / or network.

[0194] As an example, electronic device 700 may be a PC, tablet, personal digital assistant, smartphone, or other device capable of executing the aforementioned set of instructions. Here, electronic device 700 is not necessarily a single electronic device, but may be a collection of any devices or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. Electronic device 700 may also be part of an integrated control system or system manager, or may be configured to interconnect with a portable electronic device locally or remotely (e.g., via wireless transmission) through an interface.

[0195] As will be understood by those skilled in the art, Figure 7 The structure shown does not constitute a limitation on the structure and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0196] According to embodiments of this disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, they cause at least one processor to perform the recommended method and model training method according to this disclosure. Examples of computer-readable storage media herein include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the aforementioned computer-readable storage medium can run in an environment deployed in computer devices such as clients, hosts, agent devices, servers, etc. Furthermore, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner through one or more processors or computers.

[0197] According to embodiments of this disclosure, a computer program product may also be provided, wherein the instructions in the computer program product can be executed by a processor of a computer device to complete the above-described recommended method and model training method.

[0198] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed 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 examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0199] 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 recommendation method, characterized in that, The recommendation method includes: The system obtains user characteristics of the user account of the content to be recommended, historical media resource feature sequences of multiple historical media resources in which the user account has generated interactive behavior within a predetermined time period, and candidate media resource features of multiple candidate media resources. Based on the historical media resource feature sequence and the user features, the first module of the recommendation model is used to obtain the interest representation and conformity representation of the user account. Based on the characteristics of the candidate media resources, the second module of the recommendation model is used to obtain the content representation and popularity representation of the multiple candidate media resources respectively. Based on the user account's interest and conformity representations, and the content and popularity representations of the multiple candidate media resources, the third module of the recommendation model is used to obtain recommendation information for each candidate media resource among the multiple candidate media resources. Recommend candidate media resources among the multiple candidate media resources whose recommendation information meets preset conditions to the user account. Specifically, based on the historical media resource feature sequence and the user features, the first module of the recommendation model is used to obtain the user account's interest representation and conformity representation, including: Based on the historical media resource feature sequence and the user features, the fourth module in the first module is used to obtain the first weight and the second weight for the multiple historical media resources. Based on the historical media resource feature sequence, the first weight, and the second weight, the fifth module in the first module is used to obtain the first interest representation and the first conformity representation of the user account. Based on the user characteristics, the sixth module in the first module is used to obtain the second interest representation and the second conformity representation of the user account; The user account's interest representation is obtained based on the first interest representation and the second interest representation, and the user account's conformity representation is obtained based on the first conformity representation and the second conformity representation.

2. The recommended method according to claim 1, characterized in that, Based on the historical media resource feature sequence, the first weight, and the second weight, the fifth module in the first module is used to obtain the first interest representation and the first conformity representation of the user account, including: Based on the historical media resource feature sequence, the seventh module in the fifth module is used to obtain the embedding vectors for multiple media resources; By applying the first weight and the second weight to the embedding vector, an interest representation vector and a conformity representation vector are obtained. By using the eighth module in the fifth module, the interest representation vector and the conformity representation vector are encoded to obtain the first interest representation and the first conformity representation.

3. A method for training a recommendation model, characterized in that, The training method includes: Acquire training data, which includes user characteristics of multiple sample user accounts, media resource characteristics of multiple sample media resources, and interaction behavior labels of each sample user account for each sample media resource. Based on the target user characteristics of the target account among the multiple sample user accounts, the first module of the recommendation model is used to generate the interest representation and conformity representation of the target account. Based on the media resource characteristics of the target media resource and other media resources among the multiple sample media resources, the second module of the recommendation model is used to generate content representations and popularity representations of the target media resource and the other media resources, respectively, wherein the other media resources are media resources that have not interacted with the target account; Based on the interest representation and conformity representation of the target account, and the content representation and popularity representation of the target media resource, the third module of the recommendation model is used to obtain the prediction results of the target account's interaction behavior with the target media resource. The parameters of the first and second modules of the recommendation model are trained by maximizing the differences between the interest representation and the conformity representation of the target account and the content representation and the popularity representation of the other media resources, respectively, and minimizing the differences between the prediction results and the corresponding interactive behavior tags.

4. The training method according to claim 3, characterized in that, The target media resource is the media resource that interacts with the target account. The parameters for training the first and second modules of the recommendation model include: The parameters of the first and second modules of the recommendation model are trained by minimizing the differences between the interest representation and the conformity representation of the target account and the content representation and the popularity representation of the target media resource, respectively.

5. The training method according to claim 3, characterized in that, Obtain training data, including: Generate a historical media resource feature sequence of multiple historical media resources in which the target account generates interactive behavior within a predetermined time period from the multiple sample media resources; The generation of the target account's interest representation and conformity representation includes: Based on the historical media resource feature sequence and the target user features, the first module of the recommendation model is used to generate the interest representation and the conformity representation of the target account.

6. The training method according to any one of claims 3-5, characterized in that, The parameters for training the first and second modules of the recommendation model include: Based on the prediction results and the corresponding interaction behavior labels, a main loss function is constructed; Based on the interest representation and conformity representation of the target account, the content representation and popularity representation of the target media resource and the other media resources, at least one auxiliary loss function is constructed; The parameters of the first and second modules of the recommendation model are updated by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function.

7. The training method according to claim 6, characterized in that, Constructing the at least one auxiliary loss function includes: Based on the historical media resource feature sequence of the target account, multiple sub-media resource feature sequences are generated; The historical media resource feature sequence is paired with the plurality of sub-media resource feature sequences to form a positive sample pair, and the historical media resource feature sequence is paired with the historical media resource feature sequences of other accounts to form a negative sample pair, wherein the other accounts are user accounts that are different from the target account among the plurality of sample user accounts; Based on the feature sequences of the multiple sub-media resources in the positive sample pair, interest representations corresponding to the feature sequences of the multiple sub-media resources are obtained respectively. Based on the historical media resource feature sequences of other accounts in the negative sample pair, the interest representation of the other accounts is obtained; Based on the interest representation of the target account, the interest representation corresponding to the feature sequences of the multiple sub-media resources, and the interest representation of the other accounts, a first auxiliary loss function is constructed.

8. The training method according to claim 7, characterized in that, Constructing the first auxiliary loss function includes: Based on the interest representation of the target account and the interest representation corresponding to the feature sequences of the multiple sub-media resources, a first similarity function is constructed; Based on the interest representation of the target account and the interest representation of the other accounts, a second similarity function is constructed; The first auxiliary loss function is constructed based on the first similarity function and the second similarity function; The process of updating the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function includes: The parameters of the first and second modules of the recommendation model are updated by minimizing the result obtained by the first similarity function and maximizing the result obtained by the second similarity function.

9. The training method according to claim 6, characterized in that, Constructing the at least one auxiliary loss function includes: Obtain the popularity of the multiple sample media resources; The media resources from which the target account generates interactive behavior among the multiple sample media resources are used as positive samples; The other media resources among the multiple sample media resources are used as negative samples; Based on the media resources in the positive and negative samples, the content representations of the media resources are obtained respectively; Based on the interest representation of the target account, the content representation of the media resource, and the corresponding popularity, a second auxiliary loss function is constructed.

10. The training method according to claim 9, characterized in that, Constructing the second auxiliary loss function includes: Based on the interest representation of the target account and the content representation of the media resources in the positive samples, a third similarity function is constructed. Based on the interest representation of the target account and the content representation of the media resources in the negative samples, a fourth similarity function is constructed. Based on the third similarity function, the fourth similarity function, and the corresponding popularity, construct the second auxiliary loss function; The process of updating the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function includes: The parameters of the first and second modules of the recommendation model are updated by minimizing the result obtained by the third similarity function and maximizing the result obtained by the fourth similarity function.

11. The training method according to claim 6, characterized in that, Constructing the at least one auxiliary loss function includes: Obtain the popularity of the multiple sample media resources; The media resources from which the target account generates interactive behavior among the multiple sample media resources are used as positive samples; Media resources among the other media resources in the plurality of sample media resources that have a lower popularity than the target media resource are designated as negative samples; Based on the media resources in the positive and negative samples, the popularity representation of the media resources is obtained respectively; a third auxiliary loss function is constructed based on the conformity representation of the target account, the popularity representation of the media resources, and the corresponding popularity.

12. The training method according to claim 11, characterized in that, Constructing the third auxiliary loss function includes: Based on the conformity representation of the target account and the popularity representation of media resources in the positive samples, a fifth similarity function is constructed. Based on the conformity representation of the target account and the popularity representation of media resources in the negative samples, a sixth similarity function is constructed. Based on the fifth similarity function, the sixth similarity function, and the corresponding popularity, the third auxiliary loss function is constructed; The process of updating the parameters of the first and second modules of the recommendation model by minimizing the loss calculated by the main loss function and the at least one auxiliary loss function includes: The parameters of the first and second modules of the recommendation model are updated by minimizing the result obtained by the fifth similarity function and maximizing the result obtained by the sixth similarity function.

13. A recommendation device, characterized in that, The recommendation device includes: The acquisition module is configured to acquire user characteristics of the user account of the content to be recommended, historical media resource feature sequences of multiple historical media resources in which the user account has generated interactive behavior within a predetermined time period, and candidate media resource features of multiple candidate media resources. The recommendation module is configured as follows: Based on the historical media resource feature sequence and the user features, the first module of the recommendation model is used to obtain the interest representation and conformity representation of the user account. Based on the characteristics of the candidate media resources, the second module of the recommendation model is used to obtain the content representation and popularity representation of the multiple candidate media resources respectively. Based on the user account's interest and conformity representations, and the content and popularity representations of the multiple candidate media resources, the third module of the recommendation model is used to obtain recommendation information for each candidate media resource among the multiple candidate media resources. Recommend candidate media resources among the multiple candidate media resources whose recommendation information meets preset conditions to the user account. The recommendation module is configured as follows: Based on the historical media resource feature sequence and the user features, the fourth module in the first module is used to obtain the first weight and the second weight for the multiple historical media resources. Based on the historical media resource feature sequence, the first weight, and the second weight, the fifth module in the first module is used to obtain the first interest representation and the first conformity representation of the user account. Based on the user characteristics, the sixth module in the first module is used to obtain the second interest representation and the second conformity representation of the user account; The user account's interest representation is obtained based on the first interest representation and the second interest representation, and the user account's conformity representation is obtained based on the first conformity representation and the second conformity representation.

14. A training device for a recommendation model, characterized in that, The training device includes: The data acquisition module is configured to acquire training data, which includes user characteristics of multiple sample user accounts, media resource characteristics of multiple sample media resources, and interaction behavior tags of each sample user account for each sample media resource. The model training module is configured as follows: Based on the target user characteristics of the target account among the multiple sample user accounts, the first module of the recommendation model is used to generate the interest representation and conformity representation of the target account. Based on the media resource characteristics of the target media resource and other media resources among the multiple sample media resources, the second module of the recommendation model is used to generate content representations and popularity representations of the target media resource and the other media resources, respectively, wherein the other media resources are media resources that have not interacted with the target account; Based on the interest representation and conformity representation of the target account, and the content representation and popularity representation of the target media resource, the third module of the recommendation model is used to obtain the prediction results of the target account's interaction behavior with the target media resource. The parameters of the first and second modules of the recommendation model are trained by maximizing the differences between the interest representation and the conformity representation of the target account and the content representation and the popularity representation of the other media resources, respectively, and minimizing the differences between the prediction results and the corresponding interactive behavior tags.

15. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions. The processor is configured to execute the instructions to implement the method as described in any one of claims 1-12.

16. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method as described in any one of claims 1-12.

17. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method described in any one of claims 1-12.