Training method of resource recommendation model and resource recommendation method and device

By using feature extraction and weight prediction in the resource recommendation model, the long-tail effect is mitigated, and the diversity and accuracy of resource recommendations are improved.

CN121636799APending Publication Date: 2026-03-10BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In resource recommendation scenarios, a long-tail effect exists, resulting in overly concentrated recommended resources and a long time for users to obtain diverse resources.

Method used

A resource recommendation model is adopted, including a first feature extraction network, a second feature extraction network, and a gating network. Through feature extraction and weight prediction, the long-tail effect is mitigated.

Benefits of technology

It achieves automatic debiasing of different types of training samples, improves the prediction accuracy of resource recommendation models, and reduces the impact of long-tail effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636799A_ABST
    Figure CN121636799A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and particularly provides a training method of a resource recommendation model and a resource recommendation method and device.The resource recommendation model comprises a first feature extraction network, a second feature extraction network and a gating network, and the training method comprises the steps that after a training sample is obtained, sample attribute features are extracted through the first feature extraction network; extracting a sample identification feature through a second feature extraction network, and performing weighting processing on different weights allocated for the sample attribute feature and the sample identification feature by a gating network to obtain an interaction feature; iteratively training a resource recommendation model according to the interaction features and the interaction labels until a training ending condition is met; according to the method provided by the invention, gating learning is carried out by utilizing two key information causing the long-tail effect, namely the activeness information of the sample object and the popularity information of the sample resource, and automatic deviation removal of the training sample and the features is realized, so that the influence of the long-tail effect is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, in particular to a resource recommendation model training method and a resource recommendation method and device. BACKGROUND

[0002] In the resource recommendation scenario, there is a long tail effect, mainly reflected in the following three dimensions: first, the resource dimension, the resources involved in most of the training samples of the resource recommendation model are popular resources (i.e., resources with high popularity); second, the object activity level dimension, users with high activity level trigger more resources for interaction operations, providing more training samples for training resource recommendations, while the number of objects with low activity level involved in the training samples is less; third, the object interest dimension, i.e., there are more resources in the training samples that the object is interested in, and fewer resources that the object is less interested in. The long tail effect will lead to the recommendation of information predicted by the resource recommendation model, and the recommended resources will become more and more concentrated, resulting in a longer time for the object (user) to obtain diverse resources, which may require multiple searches. Therefore, how to alleviate the long tail effect in the resource recommendation scenario and the concentration of recommended resources is a technical problem that needs to be solved in related technologies. SUMMARY

[0003] Therefore, the present application proposes a resource recommendation model training method, a resource recommendation method and device to solve the problem of concentration of recommended resources caused by the long tail effect in the resource recommendation scenario in related technologies.

[0004] The embodiments of the present application are implemented by adopting the following technical solutions:

[0005] In a first aspect, the embodiments of the present application provide a resource recommendation model training method, the resource recommendation model comprising a first feature extraction network, a second feature extraction network and a gating network, the method comprising:

[0006] obtain a training sample, the training sample comprising object attribute information of a sample object, resource attribute information of a sample resource, an interaction resource sequence of the sample object, a resource identifier of the sample resource, activity information of the sample object, popularity information of the sample resource, and an interaction label between the sample object and the sample resource; perform feature extraction on the object attribute information and the resource attribute information by the first feature extraction network to obtain sample attribute features; perform feature extraction on the interaction resource sequence and the resource identifier by the second feature extraction network to obtain sample identifier features; predict and output a first weight and a second weight according to the activity information and the popularity information by the gating network, the first weight being negatively correlated with activity of a sample object and popularity of a sample resource, and the second weight being positively correlated with activity of a sample object and popularity of a sample resource; use the first weight as a weight of the sample attribute features, use the second weight as a weight of the sample identifier features, and perform weighted processing on the sample attribute features and the sample identifier features to obtain interaction features; and iteratively train the resource recommendation model according to the interaction features and the interaction label until a training end condition is reached.

[0007] In a second aspect, an embodiment of the present application provides a resource recommendation method, the method comprising:

[0008] obtain candidate resource attribute information and a candidate resource identifier of a candidate resource, a historical interaction resource sequence and recommendation object attribute information of a recommendation object, resource popularity information of the candidate resource, and activity information of the recommendation object; perform feature extraction on the candidate resource attribute information and the recommendation object attribute information by a first feature extraction network in a resource recommendation model to obtain reference attribute features; the resource recommendation model is trained according to the method in any one of claims 1 to 9; perform feature extraction on the candidate resource identifier and the historical interaction resource sequence by a second feature extraction network in the resource recommendation model to obtain reference identifier features; predict and output a first weight corresponding to the reference attribute features and a second weight corresponding to the reference identifier features according to the resource popularity information of the candidate resource and the activity information of the recommendation object by a gating network in the resource recommendation model; perform weighted processing on the reference attribute features and the reference identifier features according to the first weight corresponding to the reference attribute features and the second weight corresponding to the reference identifier features to obtain reference interaction features; and perform recommendation processing on the candidate resource to the recommendation object according to the reference interaction features.

[0009] In a third aspect, an embodiment of the present application provides a training device of a resource recommendation model, the resource recommendation model comprising a first feature extraction network, a second feature extraction network and a gating network; the training device comprising: a first acquisition module configured to acquire a training sample, the training sample comprising object attribute information of a sample object, resource attribute information of a sample resource, an interactive resource sequence of the sample object, a resource identifier of the sample resource, activity information of the sample object, popularity information of the sample resource, and an interaction label between the sample object and the sample resource; a first attribute feature extraction module configured to perform feature extraction on the object attribute information and the resource attribute information by the first feature extraction network to obtain sample attribute features; a first identifier feature extraction module configured to perform feature extraction on the interactive resource sequence and the resource identifier by the second feature extraction network to obtain sample identifier features; a weight first prediction module configured to predict a first weight and a second weight according to the activity information and the popularity information by the gating network, the first weight being negatively correlated with the activity of the sample object and the popularity of the sample resource, and the second weight being positively correlated with the activity of the sample object and the popularity of the sample resource; a first calculation module configured to take the first weight as a weight of the sample attribute features, take the second weight as a weight of the sample identifier features, and perform weighted processing on the sample attribute features and the sample identifier features to obtain interactive features; and a training module configured to iteratively train the resource recommendation model according to the interactive features and the interaction label until a training end condition is reached.

[0010] In some embodiments, the first feature extraction network comprises a first object feature extraction network and a first resource feature extraction network, and the sample attribute features comprise object attribute features and resource attribute features; the first attribute feature extraction module comprises a first object attribute feature extraction module configured to perform feature extraction on the object attribute information by the first object feature extraction network to obtain object attribute features, and a first resource attribute feature extraction module configured to perform feature extraction on the resource attribute information by the first resource feature extraction network to obtain resource attribute features.

[0011] In some embodiments, the second feature extraction network comprises a first identifier feature extraction network and a second identifier feature extraction network, and the sample identifier features comprise first identifier features and second identifier features; the first identifier feature extraction module comprises a first first identifier feature extraction module configured to perform feature extraction on the interactive resource sequence by the first identifier feature extraction network to obtain first identifier features, and a first second identifier feature extraction module configured to perform feature extraction on the resource identifier by the second identifier feature extraction network to obtain second identifier features.

[0012] In some embodiments, the gating network comprises an object gating network and a resource gating network, the first weight comprises a first object weight and a first resource weight, the second weight comprises a second object weight and a second resource weight; a weight first prediction module comprises an object weight first prediction module for predicting the first object weight and the second object weight according to the activity information by the object gating network, the first object weight being negatively correlated with the activity of the sample object, the second object weight being positively correlated with the activity of the sample object; a resource weight first prediction module for predicting the first resource weight and the second resource weight according to the heat information by the resource gating network, the first resource weight being negatively correlated with the heat of the sample resource, the second resource weight being positively correlated with the heat of the sample resource.

[0013] In some embodiments, the interaction feature comprises an object interaction feature and a resource interaction feature, the sample attribute feature comprises an object attribute feature extracted from the object attribute information and a resource attribute feature extracted from the resource attribute information; the sample identification feature comprises a first identification feature extracted from the interaction resource sequence and a second identification feature extracted from the resource identification; the first calculation module comprises an object calculation model for taking the first object weight as the weight of the object attribute feature, taking the second object weight as the weight of the first identification feature, and performing weighted processing on the object attribute feature and the first identification feature to obtain the object interaction feature; a resource calculation model for taking the first resource weight as the weight of the resource attribute feature, taking the second resource weight as the weight of the second identification feature, and performing weighted processing on the resource attribute feature and the second identification feature to obtain the resource interaction feature.

[0014] In some embodiments, the training module comprises a first interaction prediction module for predicting an interaction probability according to the interaction feature; a first loss calculation module for calculating a first loss according to the interaction probability and the interaction label; and a first adjustment module for adjusting the parameters of the resource recommendation model according to the first loss until a training end condition is reached.

[0015] In some implementations, the interaction tags include N sub-interaction tags corresponding to N types of interaction operations, and the gating network includes sub-gating networks corresponding to each of the N types of interaction operations, where N is a positive integer greater than 2. The first weight prediction module is used to input the activity information and the popularity information into the sub-gating networks corresponding to each of the N types of interaction operations to obtain a first weight and a second weight for each interaction operation. The first calculation module is used to, for the first weight and the second weight for the same interaction operation, use the first weight as the weight of the sample attribute feature and the second weight as the weight of the sample identifier feature, and... The sample attribute features and the sample identifier features are weighted to obtain interaction features for each interaction operation; the training module includes: a second interaction prediction module, used to predict the interaction probability based on the interaction features for each interaction operation to obtain the interaction probability of the sample object triggering the corresponding interaction operation on the sample resource; a second loss calculation module, used to determine the prediction loss based on the interaction probability of the sample object triggering each interaction operation on the sample resource and the sub-interaction label corresponding to each interaction operation; and a second adjustment module, used to adjust the parameters of the resource recommendation model based on the prediction loss until the training termination condition is met.

[0016] In some implementations, the second loss calculation module is used to calculate the sub-prediction loss corresponding to each interaction operation based on the interaction probability of the sample object triggering the interaction operation on the sample resource and the sub-interaction label corresponding to the interaction operation; and to obtain the prediction loss by weighting the sub-prediction losses corresponding to the N interaction operations.

[0017] In some implementations, the training apparatus for the resource recommendation model further includes a preprocessing module, used to determine the activity information of the sample object based on the sequence length of the interaction resource sequence of the sample object, wherein the activity of the sample object is positively correlated with the sequence length of the interaction resource sequence; and to determine the popularity information of the sample resource based on the sequence length of the interaction object sequence of the sample resource, wherein the popularity of the sample resource is positively correlated with the sequence length of the interaction object sequence.

[0018] Fourthly, embodiments of this application provide a resource recommendation device, the device comprising: a second acquisition module, configured to acquire candidate resource attribute information and candidate resource identifiers of candidate resources, historical interaction resource sequences and recommendation object attribute information of recommendation objects, resource popularity information of the candidate resources, and activity information of the recommendation objects; a second attribute feature extraction module, configured to extract features from the candidate resource attribute information and the recommendation object attribute information using a first feature extraction network in the resource recommendation model to obtain reference attribute features; the resource recommendation model is trained according to the aforementioned method; and a second identifier feature extraction module, configured to extract features from the candidate resource attribute information and the recommendation object attribute information using a second feature extraction network in the resource recommendation model to obtain reference attribute features; the resource recommendation model is trained according to the aforementioned method; and a second identifier feature extraction module, configured to extract features from the candidate resource attribute information and the recommendation object attribute information using a second feature extraction network in the resource recommendation model. The candidate resource identifier and the historical interaction resource sequence are used to extract features to obtain reference identifier features; the second prediction module is used by the gating network in the resource recommendation model to predict and output the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identifier feature based on the resource popularity information of the candidate resource and the activity information of the recommended object; the second calculation module is used to perform weighted processing on the reference attribute feature and the reference identifier feature based on the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identifier feature to obtain reference interaction features; the recommendation module is used to recommend the candidate resource to the recommended object based on the reference interaction features.

[0019] In some implementations, the recommendation module includes a prediction unit for predicting the interaction probability of the recommended object with the candidate resource based on the reference interaction features; and a recommendation unit for recommending the candidate resource to the recommended object if the interaction probability of the recommended object with the candidate resource exceeds a probability threshold.

[0020] Fifthly, embodiments of this application provide an electronic device, characterized in that it includes: a processor; a memory, wherein computer instructions are stored in the memory, and when the computer instructions are executed by the processor, the above-described method is implemented.

[0021] Sixthly, embodiments of this application provide a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the above-described method.

[0022] In a seventh aspect, embodiments of this application provide a computer program product, including computer instructions, characterized in that, when the computer instructions are executed by a processor, they implement the above-described method.

[0023] This application provides a training method, resource recommendation method, and apparatus for a resource recommendation model. The resource recommendation model includes a first feature extraction network, a second feature extraction network, and a gating network. The first feature extraction network extracts features from object attribute information and resource attribute information to obtain sample attribute features. The second feature extraction network extracts features from interactive resource sequences and resource identifiers to obtain sample identifier features. In this way, resource identifiers, which are directly affected by the long-tail effect, are assigned to the second feature extraction network for feature learning, while attribute information (object attribute information and resource attribute information) that is less affected by the long-tail effect is assigned to the first feature extraction network for feature learning. This achieves decoupling learning of different types of inputs to the resource recommendation model, which facilitates subsequent weighted fusion of the two types of features using different weights.

[0024] Furthermore, a gating network is added to the resource recommendation model. This gating network predicts and outputs a first weight and a second weight based on activity and popularity information. The first weight is negatively correlated with the activity of the sample object and the popularity of the sample resource, while the second weight is positively correlated with both. Thus, for training samples involving highly active sample objects or highly popular sample resources, the weight of the sample identifier feature (i.e., the second weight) is higher, while the weight of the sample attribute feature (i.e., the first weight) is lower. Therefore, in the interaction features obtained by weighted fusion of sample attribute features and sample identifier features, the interaction features are more significantly influenced by the sample identifier features, and the features expressed by the sample identifier features are also relatively rich and accurate. Conversely, for training samples involving low-activity sample objects or low-popularity sample resources, the weight of the sample identifier feature is lower, while the weight of the sample attribute feature is higher. In the interaction features obtained by weighted fusion of sample attribute features and sample identifier features, the interaction features are more significantly influenced by the sample attribute features, reducing the impact of insufficient learning or inaccurate feature representation of the sample identifier features on the interaction features in such cases. In this way, automatic bias removal is achieved. Whether the training samples are highly active or inactive, or popular or unpopular, the interaction features can be fully learned during the training process, thereby effectively mitigating the impact of the long-tail effect on the resource recommendation model and ensuring the prediction accuracy of the resource recommendation model after training.

[0025] In this application, the distribution of training samples is not changed. Instead, the activity information of the sample objects and the popularity information of the sample resources, which are two key information that cause the long-tail effect, are used to perform gating learning to automatically correct the bias of the training samples and features, thereby reducing the impact of the long-tail effect.

[0026] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 An application scenario diagram involving an embodiment of this application is shown.

[0029] Figure 2 A flowchart illustrating the training method of a resource recommendation model provided in an embodiment of this application is shown.

[0030] Figure 3 An embodiment of this application is shown. Figure 2 A flowchart of step S260.

[0031] Figure 4 The diagram illustrates the third step of the training method for a resource recommendation model provided in an embodiment of this application.

[0032] Figure 5 A schematic diagram of a resource recommendation model illustrated in one embodiment of this application is shown.

[0033] Figure 6 A schematic diagram of a resource recommendation model illustrated in another embodiment of this application is shown.

[0034] Figure 7 A flowchart illustrating a resource recommendation method provided in an embodiment of this application is shown.

[0035] Figure 8 An embodiment of this application is shown. Figure 7 A flowchart of step S860.

[0036] Figure 9 A schematic diagram of a training apparatus for a resource recommendation model provided in an embodiment of this application is shown.

[0037] Figure 10 A schematic diagram of a resource recommendation device provided in an embodiment of this application is shown.

[0038] Figure 11 A schematic diagram of an electronic device provided in one embodiment of this application is shown. Detailed Implementation

[0039] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0040] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0041] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0042] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0043] To facilitate understanding of this application, some terms will be explained below.

[0044] Resource recommendation model: refers to a neural network model used to predict the degree of interest or interest in a resource.

[0045] Feature extraction network: A neural network used to extract features from input.

[0046] Gated network: In this application, a gated network is used to predict the weights of the feature extraction network.

[0047] Long-tail effect: also known as long-tail distribution or power-law distribution, refers to the phenomenon that a small number of active users and popular resources provide a large number of training samples.

[0048] The long-tail effect is prevalent in resource recommendation scenarios, primarily manifested in three dimensions: First, the resource dimension, where most training samples of the resource recommendation model involve popular resources (i.e., resources with high popularity); second, the object activity dimension, where more active users trigger interactions with a greater number of resources, providing more training samples for resource recommendation, while the number of less active objects in the training samples is relatively small; and third, the object interest dimension, where the training samples contain more resources of high interest to the users, and fewer resources of low interest. This long-tail effect leads to an increasing concentration of recommended resources based on the information predicted by the resource recommendation model, resulting in longer processing times for users to access diverse resources, potentially requiring multiple search queries.

[0049] The long-tail effect is directly reflected in the distribution and characteristics of training samples. High-popularity resources occupy a large number of training samples, and the resource model frequently learns the features of these high-popularity resources during training. Conversely, low-popularity resources involve fewer training samples, resulting in insufficient feature learning during training. Furthermore, highly active objects (i.e., applications) have abundant resources that trigger interactive operations, leading to longer interaction resource sequences. Features representing object interests learned from these sequences are more accurate. Conversely, less active objects have fewer resources that trigger interactive operations, resulting in shorter or even empty interaction resource sequences. Therefore, resource recommendation models may not be able to learn features representing object interests from these interaction resource sequences during training.

[0050] Based on this, the method proposed in this application is proposed to alleviate the problem of concentrated recommended resources caused by the long-tail effect in resource recommendation scenarios.

[0051] Please see Figure 1 , Figure 1 The application scenario diagrams of the embodiments of this application are given, including an electronic device 10. The electronic device 10 can be a server, terminal or other device with computing capabilities. The electronic device 10 can be used to execute the method of this application. The electronic device 10 can be connected to the database 20 through a network, wherein the network can be a local area network or a wide area network, or a combination of both.

[0052] The electronic device 10 can be deployed with a resource recommendation model, which includes a first feature extraction network, a second feature extraction network, and a gating network; the database 20 can store multiple training samples, each training sample including object attribute information of the sample object, resource attribute information of the sample resource, interaction resource sequence of the sample object, resource identifier of the sample resource, activity information of the sample object, popularity information of the sample resource, and interaction tags between the sample object and the sample resource.

[0053] exist Figure 1 In the application scenario shown, the process of electronic device 10 executing the training method of the resource recommendation model provided in this application includes: electronic device 10 sends a request to database 20, database 20 returns training samples to electronic device 10, then electronic device 10 extracts features from object attribute information and resource attribute information through a deployed first feature extraction network to obtain sample attribute features; extracts features from interactive resource sequences and resource identifiers through a deployed second feature extraction network to obtain sample identifier features; predicts and outputs a first weight and a second weight based on activity information and popularity information through a deployed gating network, wherein the first weight is negatively correlated with the activity of the sample object and the popularity of the sample resource, and the second weight is positively correlated with the activity of the sample object and the popularity of the sample resource; finally, the first weight is used as the weight of the sample attribute features, the second weight is used as the weight of the sample identifier features, and the sample attribute features and sample identifier features are weighted to obtain interaction features; the resource recommendation model is iteratively trained based on the interaction features and interaction labels until the training termination condition is met.

[0054] After the resource recommendation model finishes training, the electronic device 10 can respond to the recommendation request sent by the terminal 30. Using the trained resource recommendation model, it predicts the probability that the target user is interested in each candidate resource, or predicts the target user's level of interest in the candidate resources. Based on the prediction results, it selects candidate resources from multiple candidate resources to be pushed to the target user, and then sends the determined candidate resources to the terminal 30 for display, thereby realizing the recommendation of candidate resources. Taking a smartphone as an example and video resources as candidate resources... Figure 1 The example provided is a schematic diagram of the interface of terminal 30 displaying video resources AA, BB and CC.

[0055] The terminal 30 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart TV, wearable device, smartwatch, virtual reality device, vehicle terminal, smart TV, etc., but is not limited to these.

[0056] A server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0057] The method provided in this application will be described below with reference to exemplary applications and implementations of the electronic device provided in the embodiments of this application.

[0058] Please see Figure 2 , Figure 2 A flowchart illustrating the training method of the resource recommendation model provided in this application embodiment is given. This method can be executed by an electronic device, such as a server. The resource recommendation model includes a first feature extraction network, a second feature extraction network, and a gating network. The training method of the resource recommendation model includes steps S210-S260:

[0059] S210. Obtain training samples, which include object attribute information of sample objects, resource attribute information of sample resources, interaction resource sequence of sample objects, resource identifier of sample resources, activity information of sample objects, popularity information of sample resources, and interaction tags between sample objects and sample resources.

[0060] The object attribute information of the sample object can include at least one attribute of the sample object. To ensure the effectiveness of the resource recommendation model, the object attribute information can include multiple attributes of the sample object. The attributes of the sample object are such as gender, age, and region. The sample object can be a user who has registered in the application. The object attribute information of the sample object can also be called the user profile of the sample object (i.e., the user).

[0061] Sample resources can include music, videos, articles, blogs, notes (text and image notes), emoticons, emoji images, products, advertisements, skins of virtual objects in virtual games, etc. It is worth noting that in this application, the sample resources used in training the resource recommendation model are of the same type as the resources that the resource recommendation model will recommend after training. For example, if the resource recommendation model is a neural network model used to recommend advertisements to users, then both the sample resources and the resources that the resource recommendation model will recommend after training are advertisements; if the resource recommendation model is a neural network model used to recommend videos to users, then both the sample resources and the resources that the resource recommendation model will recommend after training are videos.

[0062] The resource attribute information of a sample resource can include at least one attribute of the sample resource. Similarly, to ensure the effectiveness of the resource recommendation model, the resource attribute information can include multiple attributes of the sample resource. Attributes of a sample resource include, for example, its title / name and content tags. It is worth noting that the attributes can differ depending on the type of sample resource. For example, if the sample resource is a video, its attributes can include the video title, video duration, video content tags, video publication time, and video creator; if the sample resource is an advertisement, its attributes can include the advertisement's audience tags, the corresponding industry tags, the product name involved in the advertisement, the advertisement's duration, and the advertisement's name; if the sample resource is music, its attributes can include the singer, lyricist, composer, song title, the song's genre, and music type.

[0063] The interactive resource sequence of a sample object can include resource identifiers of multiple resources that trigger interactive operations. Interactive operations include, for example, playing a video, saving a video, forwarding a video, liking an article, entering an article details page, clicking an advertisement, and making a purchase triggered by a purchase link on an advertisement page. The interactive operations involved may differ depending on the type of resource or the platform on which the resource is provided. Generally, users only trigger interactive operations on resources when they are interested in them; therefore, the resource identifiers in the interactive resource sequence of a sample object can also be understood as resource identifiers of resources that the sample object is interested in.

[0064] The interactive resource sequence of the sample object may include resource identifiers of resources that trigger one interactive operation, or resource identifiers of resources that trigger multiple interactive operations. Taking a video as an example, the interactive resource sequence of the sample object may include at least two of the following: video identifier of the video that triggers a video playback operation, video identifier of the video that triggers a forwarding operation, video identifier of the video that triggers a like operation, and video identifier of the video that triggers a favorite operation.

[0065] In some implementations, a sequence formed by the resource identifiers of multiple resources that trigger the same interactive operation of the sample object can be used as an interactive sub-sequence. Then, the interactive sub-sequences for multiple interactive operations can be combined, and the combined sequence can be used as the interactive resource sequence of the sample object. Taking the video mentioned above as an example, the interactive resource sequence of the sample object may include a click sub-sequence formed by the video ID of the video that triggers the playback operation of the sample object, a collection sub-sequence formed by the video ID of the video that triggers the collection operation of the sample object, and so on.

[0066] As described above, the resource identifiers in the interaction resource sequence of the sample object are resource identifiers of resources that the sample object is interested in or has a high degree of interest in. Therefore, the interaction resource sequence of the sample object can reflect the sample object's resource preferences. In this application, features reflecting the sample object's resource preferences can be extracted from the interaction resource sequence of the sample object.

[0067] The resource identifier of a sample resource can uniquely identify that sample resource. For example, the resource identifier of a sample resource is the video ID of a video resource or the image ID of an image resource.

[0068] The activity information of a sample object refers to information used to reflect the activity level of the sample object. This information can be used to indicate the activity level of the sample object. Generally speaking, the more resources a user triggers interactive operations in the application, or the longer a user stays online in the application, the higher the user's activity level. In some embodiments, the activity level of a sample object can be calculated based on the number of resources that trigger interactive operations within a unit of time, and the activity level is positively correlated with the number of resources that trigger interactive operations within a unit of time.

[0069] For example, the activity level of a sample object can be determined by the number of resources that trigger interactive operations within a unit of time, or by multiplying the number of resources that trigger interactive operations within a unit of time by a specified coefficient. Alternatively, the activity level of a sample object can be determined based on the number of resource identifiers in its interactive resource sequence, for example, by using the number of resource identifiers in the interactive resource sequence as the activity level. For example, the activity level can also be determined by counting the online time of a sample object on a resource recommendation platform (application), where online time is positively correlated with activity level; for example, the activity level can be determined by multiplying the online time of a sample object on the resource recommendation platform (application) by a first coefficient (where the first coefficient is positive). Of course, in other embodiments, the activity level of a sample object can be determined by comprehensively considering at least two of the following: the number of resources that trigger interactive operations within a unit of time, the number of resource identifiers in the interactive resource sequence, and the online time of the sample object on the resource recommendation platform (application).

[0070] In some embodiments, prior to step S210, the activity information of the sample object can be determined as follows: the activity information of the sample object is determined based on the sequence length of the interaction resource sequence of the sample object, wherein the activity of the sample object is positively correlated with the sequence length of the interaction resource sequence.

[0071] In some embodiments, the sequence length of the interaction resource sequence of a sample object can be used as the activity information of the sample object.

[0072] In some implementations, if the interaction resource sequence of a sample object includes multiple interaction sub-sequences corresponding to various interaction operations, the number of resources that trigger each interaction behavior of the sample object can be counted based on the interaction resource sequence of the sample object, and the counted quantities can be combined as the activity information of the sample object.

[0073] In some embodiments, weights can be set for different interactive operations. The activity information can be obtained by weighting multiple interactive subsequences according to the weights corresponding to each interactive operation and the sequence lengths of the subsequences. The weight of each interactive operation is a positive number.

[0074] In some embodiments, the activity information of a sample object may include at least two of the following: the number of resources that trigger interactive operations by the sample object within a unit of time, the number of resource identifiers in the interactive resource sequence of the sample object, and the online time of the sample object in the resource recommendation platform (application). Subsequently, the gating network extracts features reflecting the activity of the sample object based on the activity information of the sample object.

[0075] The popularity information of a sample resource refers to information reflecting its popularity. This information can include the resource's overall popularity. Specifically, the popularity of a sample resource can be calculated based on the number of interactive actions triggered by that resource, and there is a positive correlation between the popularity and the number of interactive actions triggered. Taking a video as an example, the number of interactive actions triggered for a sample resource (i.e., the sample video) includes the number of times the video is played (i.e., the number of views), the number of times the video is liked (i.e., the number of likes), and the number of times the video is shared (i.e., the number of likes). The popularity of a sample resource can be calculated based on the number of one type of interactive action triggered, or it can be calculated based on the number of multiple interactive actions triggered. For example, weights can be assigned to different interactive actions, and then the number of multiple interactive actions triggered by the sample resource can be weighted according to the weights of the corresponding actions to obtain the popularity of the sample resource.

[0076] In some embodiments, the popularity information of a sample resource may include information reflecting the popularity of the sample resource in at least two dimensions, such as the number of times the sample resource is triggered by one or more interactive operations, the proportion of interactive operations triggered by the sample resource in the application (e.g., click-through rate), and the completion rate of the sample resource in the application. Subsequently, a gating network extracts features reflecting the popularity of the sample resource based on the popularity information. Taking video as an example again, the popularity information of a sample resource may be the number of sample objects that view the sample resource, the click-through rate of the sample resource, the completion rate, etc.; obviously, the more sample objects that view a sample resource, the higher the popularity of the sample resource.

[0077] In some embodiments, prior to step S210, the popularity information of the sample resource can be determined as follows: based on the sequence length of the interaction object sequence of the sample resource, the popularity message of the sample resource is determined, and the popularity of the sample resource is positively correlated with the sequence length of the interaction object sequence.

[0078] The sequence of interactive objects for the sample resource includes object identifiers of objects that trigger interactive operations on the sample resource. Similarly, it may include object identifiers of objects that trigger one type of interactive operation on the sample resource, or object identifiers of objects that trigger different interactive operations on the sample resource. For example, if the sample resource is a video, the sequence of interactive objects for the sample resource may include object identifiers of objects that trigger playback operations, object identifiers of objects that trigger forwarding operations, object identifiers of objects that trigger favorite operations, etc.

[0079] In some implementations, the sequence length of the interaction object sequence of the sample resource can be used as the popularity information of the sample resource.

[0080] In some implementations, if the object identifiers in the interaction object sequence of the sample resource are arranged in chronological order according to the time of triggering the interaction, the number of objects that triggered the interaction with the sample resource within multiple different statistical time periods can be counted based on the interaction object sequence. For example, the number of objects that clicked on the sample resource in the last day, the last three days, the last seven days, etc., can be counted. The number of objects that triggered the interaction with the sample resource within multiple different statistical time periods can all be used as the popularity information of the sample resource. Of course, if the interaction object sequence of the sample resource involves objects that trigger multiple interaction operations on the sample object, the number of objects that triggered each interaction operation on the sample resource within multiple different statistical time periods can also be counted, and all the counted numbers can be used as the popularity information of the sample resource.

[0081] In some embodiments, when counting the number of objects triggering various interactive operations on sample resources within multiple different statistical durations, weights can be assigned to each statistical dimension. The number of objects triggering a single interactive operation on the sample resource within one statistical duration is considered a statistical dimension. Then, based on the weights assigned to each statistical dimension, the counts across multiple statistical dimensions are weighted and the weighted result is used as the popularity information of the sample resource. The weights assigned to each statistical dimension are positive numbers.

[0082] The interaction tags between sample objects and sample resources are used to indicate whether the sample object triggers an interaction with the sample resource. Correspondingly, the interaction tags include at least the tag indicating that the sample object did not trigger an interaction with the sample resource and the tag indicating that the sample object triggered an interaction with the sample resource.

[0083] It is worth mentioning that, in order to ensure the training effect of the resource recommendation model, the training samples used to train the resource recommendation model include positive samples and negative samples. Positive samples are training samples in which the interaction label indicates that the sample object triggers an interaction behavior with the sample resource, while negative samples are training samples in which the interaction label indicates that the sample object does not trigger an interaction behavior with the sample resource.

[0084] S220. The first feature extraction network extracts features from the object attribute information and resource attribute information to obtain sample attribute features.

[0085] In this application, the feature extraction network used to extract attribute features is referred to as the first feature extraction network. The first feature extraction network can be constructed from a neural network capable of extracting features from a sequence, for example, the first feature extraction network can be constructed from a recurrent neural network, a fully connected network, a pooling network, etc.

[0086] Among them, the sample attribute features can include object attribute features and resource attribute features. Object attribute features refer to the features related to the attributes of the sample object extracted from the object attribute information of the sample object; resource attribute features are the features related to the attributes of the sample resource extracted from the resource attribute information of the sample resource.

[0087] Sample attribute features (object attribute features, resource attribute features) are generalized features, which are features that feature extraction networks can learn and are broadly applicable to new data. Generalized features are abstract features that reflect general patterns in data (such as object attribute information and resource attribute information). From this perspective, taking object attribute features as an example, they are deep, abstract features extracted by the feature extraction network from multiple attributes of a sample object, reflecting the commonalities (or general patterns) among multiple attributes.

[0088] The generalization features of different objects may be the same. For example, if two different users are of the same gender, then the gender-related features learned in the sample attribute features will be the same. The generalization features of different resources may also be the same. For example, if two different resources belong to the same resource category, then the resource category-related features learned in the resource attribute features will be the same. Therefore, when learning generalization features, the resource recommendation model will generalize between different objects and different resources, thus producing generalization.

[0089] In some implementations, object attribute information and resource attribute information can be combined to obtain combined attribute information, and a first feature extraction network can extract features from the combined attribute information to output sample attribute features.

[0090] In other embodiments, the first feature extraction network may include a first object feature extraction network and a first resource feature extraction network, the sample attribute features may include object attribute features and resource attribute features, and step S220 may specifically include step one and step two:

[0091] Step 1: The first object feature extraction network extracts features from the object attribute information to obtain object attribute features.

[0092] Step 2: The first resource feature extraction network extracts features from the resource attribute information to obtain resource attribute features.

[0093] In this embodiment, the neural network used for feature extraction of object attribute information is called the first object feature extraction network, and the neural network used for feature extraction of resource attribute information is called the first resource feature extraction network. Different neural networks are used to extract object attribute features and resource attribute features respectively. This ensures that during training, the first object feature extraction network focuses on learning to extract object attribute features from object attribute information, and the first resource feature extraction network focuses on learning to extract resource attribute features from resource attribute information, thereby guaranteeing the accuracy of the extracted object attribute features and resource attribute features after training.

[0094] In a specific embodiment, it may be necessary to first embed the object attribute information and resource attribute information to obtain the corresponding embedding vector. Then, the embedding vector is input into the first feature extraction network, which extracts features from the embedding vector to obtain the sample attribute features. The object attribute information and resource attribute information may share the same embedding layer for embedding processing, or they may be embedded using different embedding layers.

[0095] S230. The second feature extraction network extracts features from the interactive resource sequence and resource identifier to obtain sample identifier features.

[0096] In this application, the feature extraction network used to extract identifier features is referred to as the second feature extraction network. The second feature extraction network can be constructed from a neural network capable of extracting features from sequence data; for example, the second feature extraction network can be constructed from recurrent neural networks, fully connected networks, pooling networks, etc.

[0097] The sample identifier features may include a first identifier feature corresponding to the interactive resource sequence and a second identifier feature corresponding to the resource identifier of the sample resource. That is, the first identifier feature includes the identifier features of each resource identifier in the interactive resource sequence; the second identifier feature refers to the identifier feature of the resource identifier of the sample resource.

[0098] In a specific embodiment, before inputting the resource identifiers of the interactive resource sequence and the sample resources into the second feature extraction network, the resource identifiers in the interactive resource sequence and the sample resources can be embedded to obtain embedding vectors for each resource identifier. Then, the embedding vector sequence formed by the embedding vectors of the resource identifiers in the interactive resource sequence and the embedding vectors of the resource identifiers of the sample resources are input into the second feature extraction network, which outputs the sample identifier features. In this process, the embedding vectors of the resource identifiers are transformed into a unified feature space, resulting in vector representations of each resource identifier in that unified feature space. That is, the identifier features of each resource identifier in the interactive resource sequence included in the first identifier feature are vector representations of each resource identifier in the interactive resource sequence in a unified feature space, and the second identifier feature is the vector representation of the resource identifiers of the sample resources in the unified feature space.

[0099] Because resource identifiers are used to uniquely identify the corresponding resource, they are unique, meaning that different resources have different resource identifiers. The feature of a resource identifier is a memory-type feature. In other words, if a resource identifier is frequently input into a resource recommendation model, such as the resource identifier of a popular resource (or the embedding vector of the resource identifier of a popular resource), the resource recommendation model will learn the features of the resource identifier of popular resources (i.e., resources with high popularity) more frequently during the training (learning) process, thus generating memory.

[0100] In some implementations, the interactive resource sequence and resource identifiers can be combined to obtain a combined identifier sequence. A second feature extraction network then extracts features from the combined identifier sequence to obtain sample identifier features. Similarly, each resource identifier in the combined identifier sequence can be embedded first, and then the resulting embedding vector sequence can be input into the second feature extraction network for feature extraction.

[0101] In other embodiments, the second feature extraction network includes a first identifier feature extraction network and a second identifier feature extraction network, and the sample identifier features include the first identifier feature and the second identifier feature; step S230 specifically includes: extracting features from the interactive resource sequence by the first identifier feature extraction network to obtain the first identifier feature; and extracting features from the resource identifier by the second identifier feature extraction network to obtain the second identifier feature.

[0102] Understandably, for highly active sample objects, there are more resources that trigger interactive operations, and the interaction resource sequence is longer. Therefore, more features can be learned through the interaction resource sequence. On the other hand, for low-activity sample objects, there are fewer interactive resources, and the interaction resource sequence is shorter. Therefore, only fewer features can be learned through the interaction resource sequence.

[0103] Furthermore, for highly active sample objects, there are more resources that trigger interactive operations, and the interactive resource sequences contain more resource identifiers. Conversely, for low-activity sample objects, the interactive resource sequences contain fewer resource identifiers. For resource identifiers that frequently appear in multiple training samples, the second feature extraction network will frequently learn the features of the resource identifier during learning, thus developing memorization. However, for resource identifiers that appear less frequently in multiple training samples, the features that the second feature extraction network can learn are relatively limited. Therefore, the second feature extraction network can frequently learn the features of resource identifiers of popular resources, but it learns fewer features or cannot accurately learn the features of resource identifiers of less popular resources.

[0104] S240. The gating network predicts and outputs a first weight and a second weight based on activity information and popularity information. The first weight is negatively correlated with the activity of the sample object and the popularity of the sample resource, while the second weight is positively correlated with the activity of the sample object and the popularity of the sample resource.

[0105] A gating network is a neural network that controls the flow of information according to a gating mechanism. A gating network can be constructed using gated recurrent units, recurrent neural networks, or variants of recurrent neural networks (such as long short-term memory networks). In this application, the gating network is used to predict the weights of the outputs of a first feature extraction network and a second feature extraction network. The first weight is used as the weight of the output of the first feature extraction network (i.e., sample attribute features), and the second weight is used as the weight of the output of the second feature extraction network (i.e., sample identification features). The sum of the first and second weights output by the gating network for the same training sample is 1. Of course, in specific embodiments, during the weight prediction process based on activity and popularity information, the gating network may focus on predicting only one of the first and second weights, and then subtract the predicted weight from 1 to obtain the other weight.

[0106] In some implementations, the object attribute features and resource attribute features in the sample attribute features can share the same first weight, and the first identification feature and the second identification feature in the sample identification features can share the same second weight. It is worth mentioning that the sum of the first weight of the object attribute feature and the second weight of the first identification feature determined for the same training sample is 1, and correspondingly, the sum of the first weight of the resource attribute feature and the second weight of the second identification feature determined for the same training sample is 1.

[0107] In other embodiments, the gating network may include an object gating network and a resource gating network, the first weight includes a first object weight and a first resource weight, and the second weight includes a second object weight and a second resource weight. Based on this, step S240 may include:

[0108] The object gating network predicts and outputs the weights of the first object and the second object based on the activity information. The weights of the first object are negatively correlated with the activity of the sample object, and the weights of the second object are positively correlated with the activity of the sample object.

[0109] The resource gating network predicts and outputs the first resource weight and the second resource weight based on the popularity information. The first resource weight is negatively correlated with the popularity of the sample resource, and the second resource weight is positively correlated with the popularity of the sample resource.

[0110] In this system, the first object weight serves as the weight of the object attribute feature, and the second object weight serves as the weight of the first identifier feature. The first object weight is negatively correlated with the activity level of the sample object, while the second object weight is positively correlated with the activity level of the sample object. Thus, during the subsequent fusion of the object attribute feature and the first identifier feature, for sample objects with high activity levels, the second object weight is larger, and the fusion process tends to select the first identifier feature; for sample objects with low activity levels, the first object weight is larger, and the fusion process tends to select the object attribute feature rather than the first identifier feature, which has insufficient feature representation.

[0111] Similarly, the first resource weight serves as the weight for the resource attribute feature, and the second resource weight serves as the weight for the second identifier feature. The first resource weight is negatively correlated with the popularity of the sample resource, while the second resource weight is positively correlated with the popularity of the sample resource. Thus, during the subsequent fusion of resource attribute features and the second identifier feature, for highly active sample resources, the second resource weight is larger, and the fusion process tends to select the second identifier feature; for low-activity sample resources, the first resource weight is larger, and the fusion process tends to select the resource attribute feature rather than the potentially inaccurate second identifier feature. This achieves automatic bias correction and mitigates the impact of the long-tail effect.

[0112] S250. The first weight is used as the weight of the sample attribute feature, the second weight is used as the weight of the sample identification feature, and the sample attribute feature and sample identification feature are weighted to obtain the interaction feature.

[0113] Clearly, since the first weight is negatively correlated with the activity level of the sample object and the popularity of the sample resource, while the second weight is positively correlated with both, for training samples involving highly active sample objects or highly popular sample resources, the weight of the sample identifier feature (i.e., the second weight) is higher, and the weight of the sample attribute feature (i.e., the first weight) is lower. Thus, in the interaction features obtained by weighted fusion of sample attribute features and sample identifier features, the interaction features are more significantly influenced by the sample identifier features. Moreover, in this case, the features expressed by the sample identifier features are relatively rich and accurate. Conversely, for training samples involving low-activity sample objects or low-popularity sample resources, the weight of the sample identifier feature is lower, and the weight of the sample attribute feature is higher. In the interaction features obtained by weighted fusion of sample attribute features and sample identifier features, the interaction features are more significantly influenced by the sample attribute features, reducing the impact of insufficient learning or inaccurate feature representation of the sample identifier features on the interaction features in this case. In this way, automatic bias removal is achieved. Whether the training samples are highly active or inactive, popular or unpopular, they can all learn more accurate interaction features during the training process, thereby effectively mitigating the long-tail effect.

[0114] In some implementations, when the first weight includes a first object weight and a first resource weight, the second weight includes a second object weight and a second resource weight; the sample attribute features include object attribute features extracted from object attribute information and resource attribute features extracted from resource attribute information; and the sample identification features include a first identification feature extracted from the interaction resource sequence and a second identification feature extracted from the resource identification, the interaction features may include object interaction features and resource interaction features. In this case, step S250 may specifically include:

[0115] The weight of the first object is used as the weight of the object attribute feature, the weight of the second object is used as the weight of the first identifier feature, and the object attribute feature and the first identifier feature are weighted to obtain the object interaction feature.

[0116] The first resource weight is used as the weight of the resource attribute feature, the second resource weight is used as the weight of the second identifier feature, and the resource attribute feature and the second identifier feature are weighted to obtain the resource interaction feature.

[0117] The interaction resource sequence of a sample object can reflect the characteristics of the resources preferred by the sample object to a certain extent. That is, the first identifier feature extracted from the interaction resource sequence can reflect the interests of the sample object. By weighting the object attribute features and the first identifier features, the object interaction features are obtained. These object interaction features are the interest features that comprehensively reflect the interests (resources of interest) of the sample object.

[0118] Similarly, resource interaction features are obtained by combining resource attribute features and first identifier features, and reflect the characteristics of sample resources.

[0119] For highly active sample objects, their corresponding interaction resource sequences are relatively long. Sufficiently long interaction resource sequences allow for the learning of enough sample identifier features, accurately reflecting the sample object's interests (i.e., information about resources of interest). Weighted fusion of object attribute features and first identifier features using a larger second object weight and a smaller first object weight makes the object interaction features more significantly influenced by the first identifier features. Furthermore, in this case, the first identifier features accurately and richly express the sample object's interests. Conversely, for low-activity sample objects, their corresponding interaction resource sequences are relatively short. The first identifier features learned from these sequences cannot accurately express the sample object's interests. Therefore, weighted fusion using a smaller second object weight and a larger first object weight makes the object interaction features more significantly influenced by object attribute features. This reduces the impact of the first identifier features' inability to accurately express the sample object's interests on the accuracy of the sample object's feature representation.

[0120] Similarly, for popular sample resources, their resource identifiers are frequently learned, resulting in second identifier features that accurately represent the characteristics of the sample resource. Therefore, a weighted fusion of resource attribute features and second identifier features using a larger second resource weight and a smaller first resource weight ensures that resource interaction features are more significantly influenced by the second identifier feature. For low-popularity sample resources, their resource identifiers appear less frequently and are learned less often by the resource recommendation model. The second identifier features extracted from these resource identifiers may not accurately represent the characteristics of the sample resource. Therefore, a weighted fusion of resource attribute features and second identifier features using a larger first resource weight and a smaller second resource weight ensures that resource interaction features are more significantly influenced by resource attribute features and less influenced by the first identifier feature. This avoids the inaccuracy of the first identifier feature affecting the accuracy of resource interaction features.

[0121] S260. Based on interaction features and interaction labels, iteratively train the resource recommendation model until the training termination condition is met. (See also...) Figure 3 , Figure 3 It shows Figure 2 A flowchart of step S260 is shown. Step S260 includes:

[0122] S410. Based on the interaction features, predict the interaction probability to obtain the interaction probability.

[0123] Interaction probability reflects the probability that a sample object in the training sample is interested in a sample resource, or the degree of interest of the sample object in the sample resource, or the probability that the sample object will trigger an interaction operation with the sample resource.

[0124] In some implementations, the resource recommendation model may include a classification layer, which may be constructed by one or more fully connected networks. The classification layer may input interaction features and output interaction probabilities.

[0125] In other implementations, based on the interaction features including object interaction features and resource interaction features, the feature similarity between object interaction features and resource interaction features can be calculated, and the calculated feature similarity result can be used as the interaction probability; wherein, the feature similarity between object interaction features and resource interaction features can be determined by means of cosine similarity or Euclidean distance, etc.

[0126] S420. Calculate the first loss based on the interaction probability and interaction label.

[0127] Specifically, the first loss between the interaction probability and the interaction label is calculated using a loss function, such as the absolute value loss function, the mean squared error loss function, or the cross-entropy loss function.

[0128] S430. Based on the first loss, adjust the parameters of the resource recommendation model until the training termination condition is met.

[0129] Specifically, based on the first loss, the parameters of the resource recommendation model are adjusted to minimize the first loss. Then, the above training steps are repeated until the training termination condition is met. The training termination condition can be either that the first loss is less than a preset loss threshold, or that the number of training iterations reaches a preset threshold.

[0130] In this application, the first feature extraction network extracts features from the object attribute information and the resource attribute information to obtain sample attribute features; the second feature extraction network extracts features from the interactive resource sequence and the resource identifier to obtain sample identifier features. In this way, the resource identifier, which is directly affected by the long-tail effect, is handed over to the second feature extraction network for feature learning, while the attribute information (object attribute information and resource attribute information) which is less affected by the long-tail effect is handed over to the first feature extraction network for feature learning. This achieves decoupling learning of different types of inputs to the resource recommendation model, which facilitates the subsequent weighted fusion of the two types of features with different weights.

[0131] Furthermore, a gating network is added to the resource recommendation model. Based on the activity and popularity information, the gating network predicts and outputs a first weight and a second weight. The first weight is negatively correlated with the activity of the sample object and the popularity of the sample resource, while the second weight is positively correlated with both. Thus, for training samples involving highly active sample objects or highly popular sample resources, the weight of the sample identifier feature (i.e., the second weight) is higher, and the weight of the sample attribute feature (i.e., the first weight) is lower. Therefore, in the interaction features obtained by weighted fusion of sample attribute features and sample identifier features, the interaction features are more significantly influenced by the sample identifier features, and the features expressed by the sample identifier features are also relatively rich and accurate. Conversely, for training samples involving low-activity sample objects or low-popularity sample resources, the weight of the sample identifier feature is lower, and the weight of the sample attribute feature is higher. In the interaction features obtained by weighted fusion of sample attribute features and sample identifier features, the interaction features are more significantly influenced by the sample attribute features, reducing the impact of insufficient learning or inaccurate feature representation of the sample identifier features on the interaction features in such cases. In this way, automatic bias removal is achieved. Whether the training samples are highly active or inactive, or popular or unpopular, the interaction features can be fully learned during the training process, thereby effectively mitigating the impact of the long-tail effect on the resource recommendation model and ensuring the prediction accuracy of the resource recommendation model after training.

[0132] In this application, the distribution of training samples is not changed. Instead, the activity information of the sample objects and the popularity information of the sample resources, which are two key information that cause the long-tail effect, are used to perform gating learning to automatically correct the bias of the training samples and features, thereby reducing the impact of the long-tail effect.

[0133] In some implementations, the resource recommendation model can be a multi-objective resource recommendation model, where the interaction labels include N sub-interaction labels corresponding to N interaction operations, and the gating network includes a sub-gating network corresponding to each of the N interaction operations, where N is a positive integer greater than 2; please refer to [link to relevant documentation]. Figure 4 , Figure 4 The third flowchart of the training method for the resource recommendation model provided in this application embodiment is shown. The training method for the resource recommendation model includes steps S510-S580:

[0134] S510. Obtain training samples, which include object attribute information of sample objects, resource attribute information of sample resources, interaction resource sequence of sample objects, resource identifier of sample resources, activity information of sample objects, popularity information of sample resources, and interaction tags between sample objects and sample resources.

[0135] S520. The first feature extraction network extracts features from the object attribute information and resource attribute information to obtain sample attribute features.

[0136] S530. The second feature extraction network extracts features from the interactive resource sequence and resource identifier to obtain sample identifier features.

[0137] Steps S510-S530 are the same as steps S210-S230 in the previous embodiments. For a detailed description of steps S510-S530, please refer to the detailed description of steps S210-S230 in the previous embodiments, which will not be repeated here.

[0138] S540. Input the activity information and popularity information into the sub-gated network corresponding to each of the N interactive operations to obtain the first weight and the second weight for each interactive operation.

[0139] It is understandable that the inputs to the sub-gated networks corresponding to different interaction operations are the same, but the first and second weights of the output can be the same or different. Similarly, the sum of the first and second weights output by the same sub-network for the same training sample is 1. A sub-gated network corresponding to an interaction operation is used to predict the weights of different types of features (sample attribute features and sample identifier features) in the prediction task for that interaction operation. One interaction operation corresponds to one prediction task, where the task content of a prediction task corresponding to one interaction operation is: predicting the probability that an object triggers the interaction operation on a resource.

[0140] It should be noted that for each interactive operation, the first weight of the corresponding gating network output is negatively correlated with the activity level of the sample object and the popularity of the sample resource, and the second weight is positively correlated with the activity level of the sample object and the popularity of the sample resource.

[0141] S550. For the first weight and the second weight for the same interactive operation, the first weight is used as the weight of the sample attribute feature and the second weight is used as the weight of the sample identification feature. The sample attribute feature and the sample identification feature are weighted to obtain the interactive feature for each interactive operation.

[0142] In step S550, for each interactive operation, the corresponding sample attribute features and sample identifier features need to be weighted to obtain the interactive features for that interactive operation.

[0143] In some embodiments, an interactive operation can correspond to a sub-gated network. Subsequently, during the feature fusion process, the object attribute features and resource attribute features in the sample attribute features can share the first weight output by the same sub-gated network, and the first identifier feature and the second identifier feature in the sample identifier features can share the first weight output by the same sub-gated network.

[0144] In other embodiments, to ensure that the feature fusion is more targeted, an interaction operation can correspond to two sub-gating networks (such as the object gating network and resource gating network mentioned above). The object gating network predicts and outputs the first object weight and the second object weight of the prediction task corresponding to the interaction operation based on activity information. The first object weight is used as the weight of the object attribute feature, and the second object weight is used as the weight of the first identifier feature. The object attribute feature and the first identifier feature are then weighted to obtain the object interaction feature of the corresponding prediction task. Similarly, the resource gating network predicts and outputs the first resource weight and the second resource weight of the prediction task corresponding to the interaction operation based on popularity information. The first resource weight is negatively correlated with the popularity of the sample resource, and the second resource weight is positively correlated with the popularity of the sample resource. The first resource weight is used as the weight of the resource attribute feature, and the second resource weight is used as the weight of the second identifier feature. The resource attribute feature and the second identifier feature are then weighted to obtain the resource interaction feature of the corresponding prediction task.

[0145] S560. Based on the interaction characteristics of each interactive operation, perform interaction probability prediction to obtain the interaction probability of the sample object triggering the corresponding interactive operation on the sample resource.

[0146] In some implementations, the interaction features can be input into the classification layer, and the classification layer can output the interaction probability. It should be noted that the interaction features of each interaction operation can share the same classification layer or different classification layers can be used.

[0147] S570. Determine the prediction loss based on the interaction probability of the sample object triggering each interactive operation on the sample resource and the sub-interaction label of each interactive operation.

[0148] The interaction label includes a sub-interaction label for each interaction operation. The sub-interaction label corresponding to an interaction operation is used to indicate whether the sample object in the training sample triggers the interaction operation for the sample resource in the training sample.

[0149] Specifically, step S570 may include:

[0150] For each interactive operation, the sub-prediction loss corresponding to the interactive operation is calculated based on the interaction probability of the sample object triggering the interactive operation on the sample resource and the sub-interaction label of the corresponding interactive operation.

[0151] The prediction loss is obtained by weighting the sub-prediction losses corresponding to the N interaction operations.

[0152] S580. Adjust the parameters of the resource recommendation model based on the predicted loss until the training termination condition is met.

[0153] Specifically, based on the prediction loss, the parameters of the resource recommendation model are adjusted to minimize the prediction loss. Then, the above training steps are repeated until the training termination condition is met.

[0154] The training termination condition can be either the predicted loss being less than a preset loss threshold or the number of training iterations reaching a preset number threshold.

[0155] Different interactive operations represent different prediction tasks. By setting different gating networks for different interactive operations, weight prediction is performed specifically for each prediction task. This ensures the adaptability of the resulting interactive features to the prediction task by weighting and fusing the two types of features based on the weights predicted for each prediction task. This, in turn, guarantees the accuracy of the subsequent interaction probabilities output based on the interactive features. Thus, the resource recommendation model provided in this application can be applied to various prediction tasks. Moreover, it does not require adding new feature extraction networks; it shares the first and second feature extraction networks. By adding gating networks corresponding to the prediction tasks, the structure of the resource recommendation model does not become overly complex when new prediction tasks are added.

[0156] In some implementations, please refer to Figure 5 , Figure 5 This is a schematic diagram of a resource recommendation model according to an embodiment of the present application. The resource recommendation model includes a first feature extraction network, a second feature extraction network, a gating network 1, a first embedding layer, a second embedding layer, and a classification layer.

[0157] After obtaining the training samples, the first embedding layer is used to embed the attribute information of the sample objects and the attribute information of the sample resources to obtain the attribute embedding vector. The attribute embedding vector is then input into the first feature extraction network for feature extraction to obtain the sample attribute features. The second embedding layer is used to embed the interaction resource sequence of the sample objects and the resource identifier of the sample resources to obtain the identifier embedding vector. The identifier embedding vector is then input into the second feature extraction network for feature extraction to obtain the sample identifier features.

[0158] In some embodiments, the first feature extraction network and the second feature extraction network can be two expert networks, one of which serves as the first feature extraction network for learning generalized features (i.e., attribute features mentioned above), and the other expert network serves as the second feature extraction network for learning memory-based features (i.e., label features mentioned above).

[0159] In some embodiments, the expert network can be MMoE (Multi-gate Mixture-of-Experts) or PLE (Progressive Layered Extraction), and this application does not impose any restrictions.

[0160] The activity information of the sample objects and the popularity information of the sample resources are input into the gating network 1, which performs weight prediction and outputs the first weight and the second weight.

[0161] The first weight is used as the weight of the sample attribute feature, the second weight is used as the weight of the sample identification feature, and the sample attribute feature and sample identification feature are weighted to obtain the interaction feature.

[0162] Finally, the interaction features are input into the classification layer, which outputs the interaction probabilities.

[0163] In some implementations, please refer to Figure 6 , Figure 6 This is a schematic diagram of a resource recommendation model according to another embodiment of this application. The resource recommendation model includes a third embedding layer, a fourth embedding layer, a first feature extraction network (including a first object feature extraction network and a first resource feature extraction network), a second feature extraction network (including a first identifier feature extraction network and a second identifier feature extraction network), a transformer network (e.g., a transformer model) (in some embodiments, the transformer network can be integrated into the first identifier feature extraction network and regarded as part of the first identifier feature extraction network), an object gating network, and a resource gating network.

[0164] Among them, the first object feature extraction network, the first resource feature extraction network, the first identifier feature extraction network, and the second identifier feature extraction network can all be expert networks.

[0165] in, Figure 7 The resource recommendation model shown can be used to implement two prediction tasks (e.g., click prediction and purchase prediction), with each prediction task corresponding to a specific interaction. Correspondingly, object gating networks and resource gating networks are deployed for each prediction task, for example... Figure 7 In the above, object gating network 1 and resource gating network 1 correspond to one prediction task 1, and object gating network 2 and resource gating network 2 correspond to another prediction task 2.

[0166] After obtaining the training samples, for each sample object, the third embedding layer is used to embed the attribute information and the interaction resource sequence of the sample object to obtain the object attribute embedding vector and the first identifier embedding vector. Then, the object embedding vector is input into the first object feature extraction network for feature extraction to obtain the object attribute features. The first identifier embedding vector is input into the transformer model for processing, and the processed feature vector is input into the first identifier feature extraction network for feature extraction to obtain the first identifier features.

[0167] For the sample resources, the fourth embedding layer is used to embed the attribute information and resource identifier of the sample resources respectively to obtain the resource attribute vector and the resource identifier vector. Then, the resource attribute vector is input into the first resource feature extraction network to obtain the resource attribute features; the resource identifier vector is input into the second identifier feature extraction network to obtain the second identifier features.

[0168] For prediction task 1, the activity information of the sample objects is input into object gating network 1. Object gating network 1 outputs the first weight of the object attribute features under prediction task 1 and the second weight of the first identification feature under prediction task 1. Then, the object attribute features and the first identification feature are weighted to obtain the object interaction features under prediction task 1.

[0169] Similarly, the heat information of the sample resources is input into the resource gating network 1, and the resource gating network 1 outputs the first weight of the resource attribute features under prediction task 1, and the second weight of the second identifier features under prediction task 1. Then, the resource attribute features and the second identifier features are weighted to obtain the resource interaction features under prediction task 1.

[0170] Finally, the similarity between object interaction features and resource interaction features is calculated, and the similarity is used as the interaction probability 1 of the resource recommendation model under prediction task 1.

[0171] For prediction task 2, the activity information of the sample objects is input into object gating network 2. Object gating network 2 outputs the first weight of the object attribute features under prediction task 2 and the second weight of the first identification feature under prediction task 2. Then, the object attribute features and the first identification feature are weighted to obtain the object interaction features under prediction task 2.

[0172] Similarly, the heat information of the sample resources is input into the resource gating network 2, and the resource gating network 2 outputs the first weight of the resource attribute features under prediction task 2, and the second weight of the second identifier features under prediction task 2. Then, the resource attribute features and the second identifier features are weighted to obtain the resource interaction features under prediction task 2.

[0173] Finally, the similarity between object interaction features and resource interaction features is calculated, and the similarity is used as the interaction probability 2 of the resource recommendation model in prediction task 2.

[0174] The resource recommendation model provided in this application can be applied to the recall process, fine ranking process and coarse ranking process in resource recommendation scenarios. For example, in the recall process, based on the interaction probability of an object with each resource predicted by the resource recommendation model, multiple resources whose interaction probability exceeds the probability threshold can be recalled from the candidate resource set, and the recalled resources can be pushed to the object in the future.

[0175] In either the fine ranking or coarse ranking process, multiple candidate resources can be sorted according to the interaction probability of an object with each resource predicted by the resource recommendation model, and then the resources with the highest ranking can be selected and pushed to the object.

[0176] Based on the training method of the resource recommendation model provided in the foregoing embodiments, this application also provides a resource recommendation method. Please refer to [link to relevant documentation]. Figure 7 , Figure 7 A flowchart illustrating a resource recommendation method provided in an embodiment of this application is given. The resource recommendation method includes steps S810-S860:

[0177] S810. Obtain candidate resource attribute information and candidate resource identifier, historical interaction resource sequence of recommended object and attribute information of recommended object, resource popularity information of candidate resource and activity information of recommended object.

[0178] S820. The first feature extraction network in the resource recommendation model extracts features from the candidate resource attribute information and the recommended object attribute information to obtain reference attribute features.

[0179] S830. The second feature extraction network in the resource recommendation model extracts features from the candidate resource identifier and the historical interaction resource sequence to obtain the reference identifier features.

[0180] S840. The gating network in the resource recommendation model predicts and outputs the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identifier feature based on the resource popularity information of the candidate resource and the activity information of the recommended object.

[0181] S850. Based on the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identifier feature, the reference attribute feature and the reference identifier feature are weighted to obtain the reference interaction feature.

[0182] For S820-S850, please refer to the implementation details of the corresponding steps in the training process, which will not be repeated here.

[0183] S860. Based on the reference interaction features, the candidate resources are recommended to the recommendation objects.

[0184] The resource recommendation model is trained using the training method for the resource recommendation model provided in the aforementioned embodiments.

[0185] In some embodiments, such as Figure 8 As shown, step S860 includes steps S910-S920:

[0186] S910. Based on the reference interaction features, predict the interaction probability of the recommended object with the candidate resource.

[0187] S920. If the probability of the recommended object interacting with the candidate resource exceeds the probability threshold, recommend the candidate resource to the recommended object.

[0188] In some implementations, a recommendation limit can be set. If the number of candidate resources with an interaction probability exceeding the probability threshold does not exceed the recommendation limit, candidate resources are recommended to the recommendation object. If the number of candidate resources with an interaction probability exceeding the probability threshold exceeds the recommendation limit, the recommended number of candidate resources is selected and recommended to the recommendation object in descending order of interaction probability.

[0189] In other embodiments, multiple candidate resources in the candidate resource set can be sorted according to the interaction probability of the recommended object with the candidate resources, for example, sorted in descending order of interaction probability, and then the top P resources in the sorted list can be selected and pushed to the recommended object.

[0190] Please see Figure 9 , Figure 9 A schematic diagram of a training device for a resource recommendation model according to an embodiment of this application is provided. The resource recommendation model includes a first feature extraction network, a second feature extraction network, and a gating network. The training device 1000 for the resource recommendation model includes:

[0191] The first acquisition module 1010 is used to acquire training samples. The training samples include object attribute information of sample objects, resource attribute information of sample resources, interaction resource sequence of sample objects, resource identifier of sample resources, activity information of sample objects, popularity information of sample resources, and interaction tags between sample objects and sample resources.

[0192] The first attribute feature extraction module 1020 is used to extract features from object attribute information and resource attribute information by the first feature extraction network to obtain sample attribute features;

[0193] The first identifier feature extraction module 1030 is used to extract features from the interactive resource sequence and resource identifier by the second feature extraction network to obtain sample identifier features;

[0194] The first prediction module 1040 is used by the gated network to predict and output the first weight and the second weight based on the activity information and the popularity information. The first weight is negatively correlated with the activity of the sample object and the popularity of the sample resource, and the second weight is positively correlated with the activity of the sample object and the popularity of the sample resource.

[0195] The first calculation module 1050 is used to use the first weight as the weight of the sample attribute feature, the second weight as the weight of the sample identification feature, and to perform weighted processing on the sample attribute feature and the sample identification feature to obtain the interaction feature.

[0196] Training module 1060 is used to iteratively train the resource recommendation model based on interaction features and interaction labels until the training termination condition is met.

[0197] In some implementations, the first feature extraction network includes a first object feature extraction network and a first resource feature extraction network, and the sample attribute features include object attribute features and resource attribute features; the first attribute feature extraction module 1020 includes a first object attribute feature extraction module, used to extract features from object attribute information by the first object feature extraction network to obtain object attribute features; and a first resource attribute feature extraction module, used to extract features from resource attribute information by the first resource feature extraction network to obtain resource attribute features.

[0198] In some implementations, the second feature extraction network includes a first identifier feature extraction network and a second identifier feature extraction network, and the sample identifier features include the first identifier feature and the second identifier feature; the first identifier feature extraction module 1030 includes a first identifier feature extraction module, used to extract features from the interactive resource sequence by the first identifier feature extraction network to obtain the first identifier feature; and a first second identifier feature extraction module, used to extract features from the resource identifier by the second identifier feature extraction network to obtain the second identifier feature.

[0199] In some implementations, the gating network includes an object gating network and a resource gating network. The first weight includes a first object weight and a first resource weight, and the second weight includes a second object weight and a second resource weight. The weight first prediction module 1040 includes an object weight first prediction module, used by the object gating network to predict and output a first object weight and a second object weight based on activity information. The first object weight is negatively correlated with the activity of the sample object, and the second object weight is positively correlated with the activity of the sample object. The resource weight first prediction module is used by the resource gating network to predict and output a first resource weight and a second resource weight based on popularity information. The first resource weight is negatively correlated with the popularity of the sample resource, and the second resource weight is positively correlated with the popularity of the sample resource.

[0200] In some implementations, the interaction features include object interaction features and resource interaction features; the sample attribute features include object attribute features extracted from object attribute information and resource attribute features extracted from resource attribute information; the sample identification features include a first identification feature extracted from the interaction resource sequence and a second identification feature extracted from the resource identification; the first calculation module 1050 includes an object calculation module, used to use a first object weight as the weight of the object attribute features, a second object weight as the weight of the first identification feature, and perform weighted processing on the object attribute features and the first identification feature to obtain object interaction features; and a resource calculation module, used to use a first resource weight as the weight of the resource attribute features, a second resource weight as the weight of the second identification feature, and perform weighted processing on the resource attribute features and the second identification feature to obtain resource interaction features.

[0201] In some implementations, the training module 1060 includes a first interaction prediction module for predicting interaction probabilities based on interaction features to obtain interaction probabilities; a first loss calculation module for calculating a first loss based on the interaction probabilities and interaction labels; and a first adjustment module for adjusting the parameters of the resource recommendation model based on the first loss until the training termination condition is met.

[0202] In some implementations, the interaction tags include N sub-interaction tags corresponding to N types of interaction operations, and the gating network includes sub-gating networks corresponding to each interaction operation among the N types of interaction operations, where N is a positive integer greater than 2; the first weight prediction module 1040 is used to input activity information and popularity information into the sub-gating networks corresponding to each interaction operation among the N types of interaction operations to obtain the first weight and the second weight for each interaction operation; the first calculation module 1050 is used to use the first weight as the weight of the sample attribute feature and the second weight as the weight of the sample identification feature for the first weight and the second weight for the same interaction operation, and to perform weighted processing on the sample attribute feature and the sample identification feature to obtain the interaction feature for each interaction operation; the training module 1060 includes a second interaction prediction module, used to predict the interaction probability based on the interaction feature for each interaction operation to obtain the interaction probability of the sample object triggering the corresponding interaction operation on the sample resource; a second loss calculation module, used to determine the prediction loss based on the interaction probability of the sample object triggering each interaction operation on the sample resource and the sub-interaction tags corresponding to each interaction operation; and a second adjustment module, used to adjust the parameters of the resource recommendation model based on the prediction loss until the training termination condition is met.

[0203] In some implementations, the second loss calculation module is used to calculate the sub-prediction loss corresponding to each interaction operation based on the interaction probability of the sample object triggering the interaction operation on the sample resource and the sub-interaction label of the corresponding interaction operation; and to obtain the prediction loss by weighting the sub-prediction losses corresponding to the N interaction operations.

[0204] In some implementations, the training device 1000 for the resource recommendation model further includes a preprocessing module for determining the activity information of the sample object based on the sequence length of the interaction resource sequence of the sample object, wherein the activity of the sample object is positively correlated with the sequence length of the interaction resource sequence; and determining the popularity information of the sample resource based on the sequence length of the interaction object sequence of the sample resource, wherein the popularity of the sample resource is positively correlated with the sequence length of the interaction object sequence.

[0205] Please see Figure 10 , Figure 10 A schematic diagram of a resource recommendation device according to an embodiment of this application is provided. The resource recommendation device 1100 includes:

[0206] The second acquisition module 1110 is used to acquire candidate resource attribute information and candidate resource identifier, historical interaction resource sequence of recommended object and attribute information of recommended object, resource popularity information of candidate resource and activity information of recommended object;

[0207] The second attribute feature extraction module 1120 is used to extract features from the candidate resource attribute information and the recommended object attribute information by the first feature extraction network in the resource recommendation model to obtain reference attribute features; the resource recommendation model is trained according to the aforementioned resource recommendation model training method;

[0208] The second identifier feature extraction module 1130 is used to extract features from candidate resource identifiers and historical interaction resource sequences by the second feature extraction network in the resource recommendation model to obtain reference identifier features;

[0209] The second prediction module 1140 is used by the gating network in the resource recommendation model to predict and output the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identifier feature based on the resource popularity information of the candidate resource and the activity information of the recommended object.

[0210] The second calculation module 1150 is used to perform weighted processing on the reference attribute features and the reference identifier features according to the first weight corresponding to the reference attribute features and the second weight corresponding to the reference identifier features to obtain the reference interaction features.

[0211] The recommendation module 1160 is used to recommend candidate resources to the recommendation object based on reference interaction features.

[0212] In some implementations, the recommendation module 1160 includes a prediction unit for predicting the interaction probability of a recommended object with a candidate resource based on reference interaction features; and a recommendation unit for recommending a candidate resource to the recommended object if the interaction probability of the recommended object with a candidate resource exceeds a probability threshold.

[0213] Figure 11 A schematic diagram of a computer system suitable for implementing an electronic device according to embodiments of this application is shown. This electronic device can be a server as described above, used to implement the training method or resource recommendation method of the resource recommendation model provided in this application. It should be noted that... Figure 11 The computer system 1300 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0214] like Figure 11 As shown, the computer system 1300 includes a Central Processing Unit (CPU).

[0215] CPU 1301 can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a program stored in read-only memory (ROM) 1302 or a program loaded from storage section 1308 into random access memory (RAM) 1303. RAM 1303 also stores various programs and data required for system operation. CPU 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Input / output (I / O) interface 1305 is also connected to bus 1304.

[0216] The following components are connected to I / O interface 1305: an input section 1306 including a keyboard, mouse, microphone, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), and speakers, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to I / O interface 1305 as needed. Removable media 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1310 as needed so that computer instructions read from them can be loaded into storage section 1308 as needed.

[0217] In particular, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising computer instructions. When these computer instructions are executed by the central processing unit (CPU) 1301, various functions defined in the system of this application are performed.

[0218] This application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the methods described in any of the above method embodiments.

[0219] It should be noted that the computer-readable storage medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0220] In the embodiments of this application, the terms "module" or "unit" refer to computer instructions or a portion of computer instructions that have a predetermined function and work together with other related parts to achieve a predetermined goal. These instructions can be implemented, wholly or partially, using software, hardware (e.g., processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that functions as a whole.

[0221] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.

Claims

1. A training method for a resource recommendation model, characterized in that, The resource recommendation model comprises a first feature extraction network, a second feature extraction network and a gating network; the method comprises: obtaining a training sample, the training sample comprising object attribute information of a sample object, resource attribute information of a sample resource, an interaction resource sequence of the sample object, a resource identifier of the sample resource, activity information of the sample object, popularity information of the sample resource, and an interaction label between the sample object and the sample resource; performing feature extraction on the object attribute information and the resource attribute information by the first feature extraction network to obtain sample attribute features; performing feature extraction on the interaction resource sequence and the resource identifier by the second feature extraction network to obtain sample identifier features; outputting a first weight and a second weight according to the activity information and the popularity information by the gating network, the first weight being negatively correlated with the activity of a sample object and the popularity of a sample resource, and the second weight being positively correlated with the activity of a sample object and the popularity of a sample resource; using the first weight as a weight of the sample attribute features, using the second weight as a weight of the sample identifier features, and performing weighted processing on the sample attribute features and the sample identifier features to obtain interaction features; iteratively training the resource recommendation model according to the interaction features and the interaction label until a training end condition is reached.

2. The method of claim 1, wherein, The first feature extraction network comprises a first object feature extraction network and a first resource feature extraction network, and the sample attribute features comprise object attribute features and resource attribute features; the feature extraction on the object attribute information and the resource attribute information by the first feature extraction network to obtain sample attribute features comprises: performing feature extraction on the object attribute information by the first object feature extraction network to obtain object attribute features; performing feature extraction on the resource attribute information by the first resource feature extraction network to obtain resource attribute features.

3. The method of claim 1, wherein, The second feature extraction network comprises a first identifier feature extraction network and a second identifier feature extraction network, and the sample identifier features comprise first identifier features and second identifier features; the feature extraction on the interaction resource sequence and the resource identifier by the second feature extraction network to obtain sample identifier features comprises: performing feature extraction on the interaction resource sequence by the first identifier feature extraction network to obtain first identifier features; performing feature extraction on the resource identifier by the second identifier feature extraction network to obtain second identifier features.

4. The method of claim 1, wherein, The gating network comprises an object gating network and a resource gating network, the first weight comprises a first object weight and a first resource weight, and the second weight comprises a second object weight and a second resource weight; the outputting of the first weight and the second weight according to the activity information and the popularity information by the gating network comprises: predicting, by the object gating network, a first object weight and a second object weight according to the activity information, the first object weight being negatively correlated with the activity of the sample object, and the second object weight being positively correlated with the activity of the sample object; predicting, by the resource gating network, a first resource weight and a second resource weight according to the heat information, the first resource weight being negatively correlated with the heat of the sample resource, and the second resource weight being positively correlated with the heat of the sample resource.

5. The method of claim 4, wherein, The interaction feature includes an object interaction feature and a resource interaction feature, the sample attribute feature includes an object attribute feature extracted from the object attribute information and a resource attribute feature extracted from the resource attribute information, the sample identification feature includes a first identification feature extracted from the interaction resource sequence and a second identification feature extracted from the resource identification, and the weighting processing of the sample attribute feature and the sample identification feature by taking the first weight as the weight of the sample attribute feature and taking the second weight as the weight of the sample identification feature obtains the interaction feature, which includes: taking the first object weight as the weight of the object attribute feature, taking the second object weight as the weight of the first identification feature, and performing the weighting processing on the object attribute feature and the first identification feature to obtain the object interaction feature; taking the first resource weight as the weight of the resource attribute feature, taking the second resource weight as the weight of the second identification feature, and performing the weighting processing on the resource attribute feature and the second identification feature to obtain the resource interaction feature.

6. The method according to any one of claims 1 to 5, characterized in that, The iterative training of the resource recommendation model according to the interaction feature and the interaction label until a training end condition is reached includes: performing interaction probability prediction according to the interaction feature to obtain an interaction probability; calculating a first loss according to the interaction probability and the interaction label; adjusting the parameters of the resource recommendation model according to the first loss until the training end condition is reached.

7. The method of claim 1, wherein, The interaction label includes N sub-interaction labels corresponding to N interaction operations, the gating network includes a sub-gating network corresponding to each interaction operation in the N interaction operations, and N is a positive integer greater than 2. The predicting, by the gating network, of the first weight and the second weight according to the activity information and the heat information includes: inputting the activity information and the heat information into the sub-gating network corresponding to each interaction operation in the N interaction operations to obtain the first weight and the second weight for each interaction operation. The weighting processing of the sample attribute feature and the sample identification feature by taking the first weight as the weight of the sample attribute feature and taking the second weight as the weight of the sample identification feature to obtain the interaction feature includes: For the first weight and the second weight for the same interaction operation, the first weight is taken as a weight of the sample attribute feature, the second weight is taken as a weight of the sample identification feature, and the sample attribute feature and the sample identification feature are weighted to obtain an interaction feature for each interaction operation; The iterative training of the resource recommendation model according to the interaction feature and the interaction label until a training end condition is reached, comprising: According to the interaction probability of the sample object triggering the corresponding interaction operation of the sample resource, and the sub-interaction label corresponding to each interaction operation, a prediction loss is determined. According to the prediction loss, the parameters of the resource recommendation model are adjusted until the training end condition is reached. According to the interaction probability of the sample object triggering the corresponding interaction operation of the sample resource, and the sub-interaction label corresponding to each interaction operation, a prediction loss is determined.

8. The method of claim 7, wherein, For each interaction operation, according to the interaction probability of the sample object triggering the interaction operation of the sample resource, and the sub-interaction label corresponding to the interaction operation, the sub-prediction loss corresponding to the interaction operation is calculated. The N interaction operation corresponding sub-prediction loss is weighted to obtain the prediction loss. Before the training sample is obtained, the method further comprises:

9. The method of claim 1, wherein, Based on the sequence length of the interaction resource sequence of the sample object, the activity information of the sample object is determined, and the activity of the sample object is positively correlated with the sequence length of the interaction resource sequence. Based on the sequence length of the interaction object sequence of the sample resource, the heat information of the sample resource is determined, and the heat of the sample resource is positively correlated with the sequence length of the interaction object sequence. Comprising:

10. A resource recommendation method characterized by comprising: Obtaining candidate resource attribute information and candidate resource identification of candidate resource, historical interaction resource sequence and recommendation object attribute information of recommendation object, resource heat information of the candidate resource and activity information of the recommendation object; The first feature extraction network in the resource recommendation model is used to extract features from the candidate resource attribute information and the recommendation object attribute information to obtain reference attribute features; the resource recommendation model is trained according to the method in any one of claims 1 to 9; The second feature extraction network in the resource recommendation model is used to extract features from the candidate resource identification and the historical interaction resource sequence to obtain reference identification features; The gating network in the resource recommendation model is used to predict and output the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identification feature according to the resource heat information of the candidate resource and the activity information of the recommendation object; According to the first weight corresponding to the reference attribute feature and the second weight corresponding to the reference identification feature, the reference attribute feature and the reference identification feature are weighted to obtain reference interaction features; According to the reference interaction features, the candidate resource is recommended to the recommendation object. ​ 11. The method of claim 10, wherein, The recommending the candidate resource to the recommendation object according to the reference interaction feature comprises: predicting an interaction probability of the recommendation object to the candidate resource according to the reference interaction feature; if the interaction probability of the recommendation object to the candidate resource exceeds a probability threshold, recommending the candidate resource to the recommendation object.

12. A training device for a resource recommendation model, characterized in that, The resource recommendation model comprises a first feature extraction network, a second feature extraction network and a gating network; and the training device of the resource recommendation model comprises: a first acquisition module configured to acquire a training sample, the training sample comprising object attribute information of a sample object, resource attribute information of a sample resource, an interaction resource sequence of the sample object, a resource identifier of the sample resource, activity information of the sample object, popularity information of the sample resource, and an interaction label between the sample object and the sample resource; a first attribute feature extraction module configured to perform feature extraction on the object attribute information and the resource attribute information by the first feature extraction network to obtain sample attribute features; a first identifier feature extraction module configured to perform feature extraction on the interaction resource sequence and the resource identifier by the second feature extraction network to obtain sample identifier features; a weight first prediction module configured to predict output of a first weight and a second weight according to the activity information and the popularity information by the gating network, the first weight being negatively related to activity of a sample object and to popularity of a sample resource, and the second weight being positively related to activity of a sample object and to popularity of a sample resource; a first calculation module configured to take the first weight as a weight of the sample attribute features, take the second weight as a weight of the sample identifier features, and perform weighted processing on the sample attribute features and the sample identifier features to obtain an interaction feature; a training module configured to iteratively train the resource recommendation model according to the interaction feature and the interaction label until a training end condition is reached.

13. A resource recommendation apparatus, characterized by comprising: The resource recommendation device comprises: a second acquisition module configured to acquire candidate resource attribute information and a candidate resource identifier of a candidate resource, a historical interaction resource sequence and recommendation object attribute information of a recommendation object, resource popularity information of the candidate resource, and activity information of the recommendation object; a second attribute feature extraction module configured to perform feature extraction on the candidate resource attribute information and the recommendation object attribute information by the first feature extraction network in the resource recommendation model to obtain reference attribute features; the resource recommendation model being trained according to the method in any one of claims 1 to 9; a second identifier feature extraction module configured to perform feature extraction on the candidate resource identifier and the historical interaction resource sequence by the second feature extraction network in the resource recommendation model to obtain reference identifier features; a weight second prediction module configured to predict output of a first weight corresponding to the reference attribute features and a second weight corresponding to the reference identifier features by the gating network in the resource recommendation model according to the resource popularity information of the candidate resource and the activity information of the recommendation object. The second computing module is configured to perform weighting processing on the reference attribute feature and the reference identification feature according to a first weight corresponding to the reference attribute feature and a second weight corresponding to the reference identification feature, to obtain a reference interaction feature; The recommendation module is configured to perform recommendation processing on the candidate resource to the recommendation object according to the reference interaction feature.

14. An electronic device, comprising: The method comprises: A processor; A memory, wherein the memory stores computer instructions, and the computer instructions are executed by the processor to implement the method in any one of claims 1-9 or 10-11.

15. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are executed by the processor to implement the method in any one of claims 1-9 or 10-11.