Content recommendation method, content recommendation model training method and device
By extracting features from the global and scene feature layers of the content recommendation model and generating recommendation metrics using the group prototype attention layer, the performance problem in non-overlapping user scenarios in cross-scene content recommendation is solved, achieving more efficient cross-scene content recommendation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2022-06-29
- Publication Date
- 2026-05-08
AI Technical Summary
Existing cross-scenario content recommendation methods struggle to achieve good performance in non-overlapping user scenarios because they require paired input content sequences, while in reality, content sequences in different scenarios are often independent and mismatched.
By extracting features from historical interaction content and candidate content through the global feature layer, scene feature layer, global sequence encoder, scene sequence encoder and group prototype attention layer in the content recommendation model, and processing these features through the information determination unit to generate recommendation index information, the cross-scene content recommendation is realized.
It achieves high efficiency and multi-scenario compatibility in cross-scenario content recommendation in non-overlapping user scenarios, and improves the quality of recommended content.
Smart Images

Figure CN115203543B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a content recommendation method, a training method for a content recommendation model, an apparatus, an electronic device, a storage medium, and a program product. Background Technology
[0002] With the development of new media technologies, research on how to provide users with higher-quality information and services through terminals has become a hot topic in the field of computer science. Currently, most new media applications have multiple scenarios / channels for recommending content to users to meet their diverse interests. For example, on short video platforms, there may be scenarios for recommending local content, content they follow, featured content, and live streaming content. The amount of sample interaction data for the same user may differ in different scenarios. Therefore, to improve the quality of recommended content, it is necessary to conduct content recommendations across different scenarios.
[0003] Current methods for cross-scenario content recommendation are mostly based on bidirectional learning mechanisms, which iteratively transfer information between two related scenarios until the learning process stabilizes. However, this method requires a user to interact with both scenarios simultaneously, meaning it needs paired content from both scenarios as input. In reality, requiring paired content sequences from both scenarios as input is unreasonable, because while the content sequences belong to the same user, they are often independent. Therefore, theoretically, this bidirectional learning mechanism, which mixes content sequences from two scenarios, is unlikely to produce good performance in non-overlapping user scenarios. Summary of the Invention
[0004] This disclosure provides a content recommendation method, a training method for a content recommendation model, an apparatus, an electronic device, a storage medium, and a program product, to at least address the problem that cross-scenario content recommendation methods in related technologies struggle to achieve good performance in non-overlapping user scenarios. The technical solution of this disclosure is as follows:
[0005] According to a first aspect of the present disclosure, a content recommendation method is provided, comprising:
[0006] Obtain the historical interaction content sequence and candidate content of the object to be recommended in the target scenario; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommended content;
[0007] The historical interaction content sequence and the candidate content are feature extracted by the global feature layer and the scene feature layer in the content recommendation model, respectively, to obtain the scene features and global features of the historical interaction content and the candidate content; the scene features represent the features that affect the interaction between the recommended object and the candidate content in the target scene, and the global features represent the features that affect the interaction between the recommended object and the candidate content in multiple scenes.
[0008] The scene features and global features of the historical interaction content are encoded by the global sequence encoder and scene sequence encoder in the content recommendation model to obtain the scene sequence features and global sequence features of the historical interaction content sequence.
[0009] By using the group prototype attention layer in the content recommendation model, the scene sequence features of the historical interaction content sequence are extracted to obtain the group features of the object to be recommended.
[0010] The information determination unit in the content recommendation model processes the group features, the scene sequence features, the global sequence features, and the scene and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene.
[0011] Based on the recommendation metric information, target recommendation content for the object to be recommended is determined from the candidate content.
[0012] In an exemplary embodiment, the step of extracting features from the scene sequence features of the historical interaction content sequence to obtain the group features of the object to be recommended includes:
[0013] Obtain prototype features from multiple predetermined group prototypes;
[0014] The scene sequence features are compared with the prototype features of the multiple group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype.
[0015] Based on the group similarity and the prototype features of each group prototype, the group features of the object to be recommended are obtained.
[0016] In an exemplary embodiment, obtaining the group characteristics of the object to be recommended based on the group similarity and the prototype characteristics of each group prototype includes:
[0017] By using the group similarity, the prototype features of each group prototype are weighted to obtain the weighted features of each group prototype.
[0018] The weighted features of each group prototype are averaged to obtain the group features of the object to be recommended.
[0019] In an exemplary embodiment, the information determination unit includes a first information determination unit and a second information determination unit; the step of processing the group features, the scene sequence features, the global sequence features, and the scene features and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene includes:
[0020] The first information determining unit processes the group characteristics, the scene sequence characteristics, and the scene characteristics of the candidate content to obtain the scene recommendation index information of the candidate content.
[0021] The second information determination unit processes the global sequence features and the global features of the candidate content to obtain the global recommendation index information of the candidate content.
[0022] Based on the scenario recommendation index information and the global recommendation index information, the recommendation index information of the candidate content in the target scenario is obtained.
[0023] In an exemplary embodiment, before processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content, the method further includes:
[0024] By using the content similarity attention enhancement feature layer in the content recommendation model, and based on the global and scene features of the candidate content, the scene features and global features of the historical interaction content are enhanced to obtain the enhanced features of the historical interaction content.
[0025] The process of processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content includes:
[0026] The group characteristics, the scene sequence characteristics, the scene characteristics of the candidate content, and the enhanced features of the historical interaction content are processed to obtain the scene recommendation index information.
[0027] In an exemplary embodiment, the step of enhancing the scene features and global features of the historical interaction content based on the global features and scene features of the candidate content to obtain enhanced features of the historical interaction content includes:
[0028] The global features and scene features of the candidate content are fused to obtain the fused features of the candidate content; and the scene features and global features of the historical interaction content are fused to obtain the fused features of the historical interaction content.
[0029] The fusion features of the historical interaction content are compared with the fusion features of the candidate content to obtain the content similarity between the historical interaction content and the candidate content.
[0030] By weighting the fusion features of the historical interaction content based on the content similarity, the enhanced features of the historical interaction content are obtained.
[0031] In an exemplary embodiment, before processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content, the method further includes:
[0032] The sequence fusion attention layer in the content recommendation model is used to fuse the scene sequence features and the global sequence features to obtain fused sequence features.
[0033] The step of processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content further includes:
[0034] The group features, the scene sequence features, the scene features of the candidate content, and the fused sequence features are processed to obtain the scene recommendation index information.
[0035] According to a second aspect of the present disclosure, a method for training a content recommendation model is provided, comprising:
[0036] The interaction information between a sample object and multiple sample contents in a target scenario is obtained; the multiple sample contents include target sample content and a sequence of historical sample content; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommendation content; the interaction time between the target sample content and the sample object is later than the interaction time between the historical sample content and the sample object.
[0037] By using the global feature layer and scene feature layer in the content recommendation model to be trained corresponding to the target scene, features are extracted from the target sample content and the historical sample content sequence, respectively, to obtain scene features and global features of the historical sample content and the target sample content; the scene features represent the features that affect the interaction between the sample object and the sample content in the target scene, and the global features represent the features that affect the interaction between the sample object and the sample content in multiple scenes.
[0038] The scene features and global features of the historical sample content are encoded by the global sequence encoder and scene sequence encoder in the content recommendation model to be trained, respectively, to obtain the scene sequence features and global sequence features of the historical sample content sequence.
[0039] By using the group prototype attention layer in the content recommendation model to be trained, the scene sequence features of the historical sample content sequence are extracted to obtain the group features of the sample object;
[0040] The information determination unit in the content recommendation model to be trained processes the group features, the scene sequence features, the global sequence features, and the scene features and global features of the target sample content to obtain the recommendation index information of the target sample content in the target scene.
[0041] Based on the recommendation metric information and the interaction information between the sample object and the target sample content, the content recommendation model to be trained is trained to obtain the content recommendation model corresponding to the target scenario.
[0042] In an exemplary embodiment, processing the historical sample content sequence to obtain the group characteristics of the sample objects includes:
[0043] Obtain prototype features from multiple predetermined group prototypes;
[0044] The scene sequence features are compared with the prototype features of the multiple group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype.
[0045] Based on the group similarity and the prototype features of each group prototype, the group features of the sample objects are obtained.
[0046] In an exemplary embodiment, the prototype characteristics of the plurality of group prototypes are determined in the following manner:
[0047] Obtain scene sequence features of sample content sequences of interactions between multiple sample objects in multiple sample scenarios, and obtain multiple scene sequence features;
[0048] Determine the current scene sequence feature and the current prototype feature of multiple preset group prototypes among the multiple scene sequence features;
[0049] Based on the current scene sequence features, the current prototype features of multiple preset group prototypes are adjusted to obtain the adjusted prototype features of each group prototype.
[0050] The process involves obtaining the difference information between the adjusted prototype features of each pair of group prototypes. When the difference information does not meet the preset conditions, the process involves determining the next scene sequence feature among the multiple scene sequence features as the new scene sequence feature, and determining the adjusted prototype feature as the new prototype feature. The process then returns to the step of adjusting the current prototype features of the preset multiple group prototypes based on the current scene sequence features, until the difference information between the current prototype features of each pair of group prototypes meets the preset conditions, thus obtaining the prototype features of each group prototype.
[0051] In an exemplary embodiment, training the content recommendation model to be trained based on the recommendation metric information and the interaction information between the sample object and the target sample content to obtain the content recommendation model corresponding to the target scenario includes:
[0052] Based on the interaction information between the sample object and the target sample content, the sample type of the target sample content is determined; the sample type includes positive sample content and negative sample content, where positive sample content represents the content for which the sample object has provided positive feedback, and negative sample content represents the content for which the sample object has provided negative feedback;
[0053] Obtain the loss value between the recommendation metrics of positive sample content and the recommendation metrics of negative sample content;
[0054] The content recommendation model to be trained is trained based on the loss value until a preset number of training iterations are reached or the loss value converges, thereby obtaining the content recommendation model corresponding to the target scenario.
[0055] According to a third aspect of the present disclosure, a content recommendation apparatus is provided, comprising:
[0056] The acquisition unit is configured to acquire the historical interaction content sequence and candidate content of the object to be recommended in the target scenario; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommended content;
[0057] The content feature extraction unit is configured to perform feature extraction on the historical interaction content sequence and the candidate content through the global feature layer and the scene feature layer in the content recommendation model, respectively, to obtain scene features and global features of the historical interaction content and the candidate content; the scene features represent the features that affect the interaction between the object to be recommended and the candidate content in the target scene, and the global features represent the features that affect the interaction between the object to be recommended and the candidate content in multiple scenes;
[0058] The encoding unit is configured to execute the global sequence encoder and the scene sequence encoder in the content recommendation model to encode the scene features and global features of the historical interaction content respectively, so as to obtain the scene sequence features and global sequence features of the historical interaction content sequence.
[0059] The group feature extraction unit is configured to perform feature extraction on the scene sequence features of the historical interaction content sequence through the group prototype attention layer in the content recommendation model to obtain the group features of the object to be recommended;
[0060] The recommendation index determination unit is configured to execute the information determination unit in the content recommendation model to process the group features, the scene sequence features, the global sequence features, and the scene features and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene.
[0061] The recommendation unit is configured to determine target recommendation content for the object to be recommended from the candidate content based on the recommendation metric information.
[0062] In an exemplary embodiment, the group feature extraction unit is further configured to perform the following operations: acquiring prototype features of a plurality of predetermined group prototypes; comparing the scene sequence features with the prototype features of the plurality of group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype; and obtaining the group features of the object to be recommended based on the group similarity and the prototype features of each group prototype.
[0063] In an exemplary embodiment, the group feature extraction unit is further configured to perform weighted summation of the prototype features of each group prototype based on the group similarity to obtain weighted features of each group prototype; and to average the weighted features of each group prototype to obtain the group features of the object to be recommended.
[0064] In an exemplary embodiment, the information determining unit includes a first information determining unit and a second information determining unit; the recommendation index determining unit is further configured to perform the following operations: processing the group features, the scene sequence features, and the scene features of the candidate content through the first information determining unit to obtain scene recommendation index information of the candidate content; processing the global sequence features and the global features of the candidate content through the second information determining unit to obtain global recommendation index information of the candidate content; and obtaining recommendation index information of the candidate content in the target scene based on the scene recommendation index information and the global recommendation index information.
[0065] In one exemplary embodiment, the apparatus further includes an enhancement processing unit configured to perform a content similarity attention enhancement feature layer in the content recommendation model, and to enhance the scene features and global features of the historical interaction content based on the global features and scene features of the candidate content, to obtain enhanced features of the historical interaction content;
[0066] The recommendation index determination unit is further configured to process the group features, the scene sequence features, the scene features of the candidate content, and the enhanced features of the historical interaction content to obtain the scene recommendation index information.
[0067] In an exemplary embodiment, the enhancement processing unit is further configured to perform fusion processing on the global features and scene features of the candidate content to obtain fused features of the candidate content, and to perform fusion processing on the scene features and global features of the historical interaction content to obtain fused features of the historical interaction content; compare the fused features of the historical interaction content with the fused features of the candidate content to obtain the content similarity between the historical interaction content and the candidate content; and perform weighted processing on the fused features of the historical interaction content based on the content similarity to obtain enhanced features of the historical interaction content.
[0068] In one exemplary embodiment, the apparatus further includes a fusion unit configured to perform fusion processing on the scene sequence features and the global sequence features through a sequence fusion attention layer in the content recommendation model to obtain fused sequence features;
[0069] The recommendation index determination unit is further configured to process the group features, the scene sequence features, the scene features of the candidate content, and the fusion sequence features to obtain the scene recommendation index information.
[0070] According to a fourth aspect of the present disclosure, a training apparatus for a content recommendation model is provided, comprising:
[0071] The sample acquisition unit is configured to acquire interaction information between a sample object and multiple sample contents in a target scenario; the multiple sample contents include target sample content and a sequence of historical sample content; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommendation content; the interaction time between the target sample content and the sample object is later than the interaction time between the historical sample content and the sample object.
[0072] The content feature extraction unit is configured to perform feature extraction on the target sample content and the historical sample content sequence through the global feature layer and scene feature layer in the content recommendation model to be trained corresponding to the target scene, respectively, to obtain scene features and global features of the historical sample content and the target sample content; the scene features represent the features that affect the interaction between the sample object and the sample content in the target scene, and the global features represent the features that affect the interaction between the sample object and the sample content in multiple scenes;
[0073] The encoding unit is configured to encode the scene features and global features of the historical sample content respectively through the global sequence encoder and scene sequence encoder in the content recommendation model to be trained, so as to obtain the scene sequence features and global sequence features of the historical sample content sequence.
[0074] The group feature extraction unit is configured to perform feature extraction on the scene sequence features of the historical sample content sequence through the group prototype attention layer in the content recommendation model to be trained, so as to obtain the group features of the sample object;
[0075] The recommendation metric determination unit is configured to execute the information determination unit in the content recommendation model to be trained, and process the group features, the scene sequence features, the global sequence features, and the scene features and global features of the target sample content to obtain the recommendation metric information of the target sample content in the target scene.
[0076] The model training unit is configured to train the content recommendation model to be trained based on the recommendation metric information and the interaction information between the sample object and the target sample content, so as to obtain the content recommendation model corresponding to the target scenario.
[0077] In an exemplary embodiment, the group feature extraction unit is further configured to perform the following operations: acquiring prototype features of a plurality of predetermined group prototypes; comparing the scene sequence features with the prototype features of the plurality of group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype; and obtaining the group features of the sample object based on the group similarity and the prototype features of each group prototype.
[0078] In an exemplary embodiment, the apparatus further includes a prototype feature determination unit, configured to perform the following steps: acquiring scene sequence features of sample content sequences of interactions between multiple sample objects in multiple sample scenarios to obtain multiple scene sequence features; determining the current scene sequence feature among the multiple scene sequence features and the current prototype features of a preset multiple group prototypes; adjusting the current prototype features of the preset multiple group prototypes according to the current scene sequence features to obtain adjusted prototype features of each group prototype; acquiring difference information between the adjusted prototype features of each pair of group prototypes; when the difference information does not meet a preset condition, determining the next scene sequence feature among the multiple scene sequence features as a new scene sequence feature, and determining the adjusted prototype feature as a new prototype feature, and returning to the step of adjusting the current prototype features of the preset multiple group prototypes according to the current scene sequence features, until the difference information between the current prototype features of each pair of group prototypes meets the preset condition, thereby obtaining the prototype features of each group prototype.
[0079] In an exemplary embodiment, the model training unit is configured to perform the following: determine the sample type of the target sample content based on the interaction information between the sample object and the target sample content; the sample type includes positive sample content and negative sample content, wherein positive sample content represents content for which the sample object provides positive feedback, and negative sample content represents content for which the sample object provides negative feedback; obtain the loss value between the recommendation index information of the positive sample content and the recommendation index information of the negative sample content; and train the content recommendation model to be trained based on the loss value until a preset number of training iterations is reached or the loss value converges, thereby obtaining the content recommendation model corresponding to the target scenario.
[0080] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising:
[0081] processor;
[0082] Memory used to store the processor's executable instructions;
[0083] The processor is configured to execute the instructions to implement the method as described in any of the preceding methods.
[0084] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided such that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in any of the preceding claims.
[0085] According to a seventh aspect of the present disclosure, a computer program product is provided, the computer program product including instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the method as described in any of the preceding claims.
[0086] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0087] This method, on the one hand, utilizes the proposed concept of group features to obtain the group characteristics of sample objects when processing predicted sample content and known sample content sequences. This enables the sharing of user intent at the group level, allowing for the sharing of common intent among different users across scenarios without relying on overlapping users. On the other hand, in terms of content representation, it uses scene features in specific scenarios and global features across multiple scenarios to represent content, achieving cross-scenario sharing of content features and exhibiting better multi-scenario compatibility. The content recommendation model trained based on this method demonstrates better performance and can improve the quality of recommended content across scenarios.
[0088] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0089] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0090] Figure 1 This is a schematic diagram illustrating an existing cross-scenario recommendation scheme according to an exemplary embodiment.
[0091] Figure 2 This is a flowchart illustrating a content recommendation method according to an exemplary embodiment.
[0092] Figure 3 This is a schematic diagram illustrating the model structure of a content recommendation model according to an exemplary embodiment.
[0093] Figure 4 This is a flowchart illustrating a training method for a content recommendation model according to an exemplary embodiment.
[0094] Figure 5 This is a complete flowchart illustrating a training method for a content recommendation model according to another exemplary embodiment.
[0095] Figure 6 This is a structural block diagram illustrating a content recommendation device according to an exemplary embodiment.
[0096] Figure 7 This is a structural block diagram illustrating a training device for a content recommendation model according to an exemplary embodiment.
[0097] Figure 8 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0098] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0099] It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims. It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0100] refer to Figure 1 This diagram illustrates an existing solution for cross-scene recommendation based on a bidirectional learning mechanism. This mechanism iteratively transfers information between two related scenes simultaneously until the learning process stabilizes. The Dual Self-Attention Learning (DASL) model consists of two novel components: bidirectional features and bidirectional attention. Together, they establish a two-stage learning process: first, bidirectional latent features are constructed, simultaneously extracting user preferences in both scenes; then, the extracted latent item features are matched with candidate item features through the bidirectional attention learning mechanism, thereby providing cross-scene recommendations.
[0101] However, existing solutions heavily rely on completely overlapping users and require paired inputs from two scenarios. But requiring item sequences from two scenarios as paired inputs is unreasonable, because while the item sequences belong to the same user, they are often independent of each other. Therefore, this bidirectional attention mechanism, which mixes sequence features from two scenarios, theoretically will not produce good performance in non-overlapping user scenarios. Furthermore, the generation of item sequences in the two scenarios is not necessarily synchronous, and existing solutions also suffer from parallel synchronization problems.
[0102] Therefore, in order to solve the above problems, this disclosure provides a cross-scene user sequence modeling method based on hybrid attention. This method does not rely on specific overlapping user IDs, and transfers cross-scene information from three higher levels: item representation, sequence pattern, and user group. It achieves training decoupling and information interaction between different scenes through local modules (single scene) and global modules (across multiple scenes), which has higher practical significance and multi-scene compatibility.
[0103] refer to Figure 2 This is a flowchart illustrating a content recommendation method according to an exemplary embodiment. This embodiment uses the application of the method to a terminal as an example for illustration. It is understood that the method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. In this embodiment, the method includes the following steps:
[0104] In step S210, the historical interaction content sequence and candidate content of the object to be recommended in the target scenario are obtained; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommended content.
[0105] The target scenario can be any one of multiple recommendation scenarios used to provide recommended content. For example, the target scenario could be a local recommendation scenario, a followed content recommendation scenario, a featured content recommendation scenario, or a live streaming content recommendation scenario, etc.
[0106] The recommended content can take the form of videos, text, images, etc.
[0107] The associated attribute information of the recommended content can include information that characterizes the attributes of the recommended content, such as its publication location, type, duration, and number of views. For example, the publication location of the recommended content can lead to local recommendation scenarios, the type of the recommended content can lead to job search scenarios or pet-related content scenarios, and the number of views can lead to scenarios where many people are watching, and so on.
[0108] In specific implementation, multiple interaction contents that the object to be recommended has interacted with in the target scenario can be obtained, and a sequence of historical interaction contents can be formed according to the order of interaction time. Multiple contents that are prepared to be recommended to the object to be recommended can be obtained as candidate contents. For each candidate content, the recommendation index information of each candidate content is determined according to the following steps S220 to S250, so as to determine the target content to be recommended to the object to be recommended based on the recommendation index information.
[0109] In step S220, the global feature layer and scene feature layer in the content recommendation model are used to extract features from the historical interaction content sequence and candidate content, respectively, to obtain the scene features and global features of the historical interaction content and candidate content.
[0110] Contextual features represent the characteristics that influence the interaction between the recommended object and candidate content within the target context. For example, taking recommended content as video, in a long video context, the video's length has little impact on whether a user watches the video; even if it's long, the user will still watch it, so length is not a contextual feature for long videos. However, in other recommendation scenarios (such as city-based recommendations), the video's length has a greater impact on whether a user watches it, making length a contextual feature for that scenario.
[0111] Among them, global feature representation affects the characteristics of the interaction between the object to be recommended and the candidate content in multiple scenarios.
[0112] It's understandable that users and recommended content differ across scenarios; therefore, the content recommendation models trained for different scenarios will also differ, specifically in their model parameters, although the model architecture remains the same. For example, refer to... Figure 3 The diagram illustrates the model structure of the content recommendation model. While the architectures of the content recommendation models for scenarios A and B are identical, the model parameters trained based on scenarios A and B may differ. Therefore, different content recommendation models will correspond to different scenarios. For ease of description, this embodiment uses the target scenario as an example to illustrate the content recommendation method provided in this disclosure.
[0113] In specific implementation, such as Figure 3As shown, taking scenario A as an example, the historical interaction content sequence and candidate content can be input into the global feature layer and scenario feature layer of the content recommendation model, respectively. The global feature layer extracts global features from each historical interaction content in the candidate content and historical interaction content sequence to obtain the global features of each historical interaction content and the global features of the candidate content. Similarly, the scenario feature layer extracts scenario features from each historical interaction content in the candidate content and historical interaction content sequence to obtain the scenario features of each historical interaction content and the scenario features of the candidate content.
[0114] In step S230, the scene features and global features of the historical interaction content are encoded by the global sequence encoder and scene sequence encoder in the content recommendation model to obtain the scene sequence features and global sequence features of the historical interaction content sequence.
[0115] Among them, scene sequence features can be the transfer features between content that are unique to the target scene. For example, in scene A, interacting with content E will grant the right to content F. Therefore, the transfer probability from E to F will be higher than the transfer probability from E to other content. This feature may not hold true in other scenes, so it is a sequence feature unique to scene A.
[0116] Among them, global sequence features can represent the transfer features between content that exist in multiple recommendation scenarios.
[0117] In the specific implementation, refer to Figure 3 After inputting the historical interaction content sequence into the global feature layer and the scene feature layer, the global features of each historical interaction content obtained through the global feature layer are input into the global encoder, which encodes the historical interaction content sequence to obtain the global sequence features. Simultaneously, the scene features of each historical interaction content obtained through the scene feature layer are input into the scene encoder, which encodes the historical interaction content sequence to obtain the scene sequence features.
[0118] In step S240, the scene sequence features of the historical interaction content sequence are extracted through the group prototype attention layer in the content recommendation model to obtain the group features of the object to be recommended.
[0119] Among them, group characteristics can represent the personalized features of the objects to be recommended.
[0120] In the specific implementation, refer to Figure 3 After obtaining the scene sequence features of the historical interaction content sequence through the scene encoder, the scene sequence features will be input into the group prototype attention layer in the content recommendation model. The group prototype attention layer will extract features from the scene sequence features of the historical interaction content sequence to obtain the personalized group features of the object to be recommended.
[0121] More specifically, in the group prototype attention layer, the scene sequence features are first compared with the prototype features of multiple preset group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype. Based on the group similarity and the prototype features of each group prototype, the group features of the object to be recommended are obtained.
[0122] In step S250, the information determination unit in the content recommendation model processes the group features, scene sequence features, global sequence features, and the scene and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene.
[0123] Among them, the recommendation index information is used to characterize the degree of recommendation of candidate content to the object to be recommended. For example, the recommendation index information can be the recommendation probability.
[0124] In practice, after obtaining the group characteristics of the object to be recommended, the scene sequence characteristics and global sequence characteristics of the historical interaction content sequence, as well as the scene characteristics and global characteristics of the candidate content, these characteristics can be processed by the information determination unit of the content recommendation model to predict the recommendation index information of the candidate content in the target scene.
[0125] More specifically, the information determination unit may include a first information determination unit and a second information determination unit. When processing group features, scene sequence features, global sequence features, and the scene and global features of candidate content, the features at the scene dimension and the features at the global dimension can be processed separately. That is, the first information determination unit processes the group features, scene sequence features, and scene features of candidate content to obtain scene recommendation index information for the candidate content. The second information determination unit processes the global sequence features and global features of candidate content to obtain global recommendation index information for the candidate content. Based on the scene recommendation index information and the global recommendation index information, the recommendation index information for the candidate content in the target scene is obtained.
[0126] In step S260, based on the recommendation index information, the target recommendation content for the object to be recommended is determined from the candidate content.
[0127] In practice, there can be multiple candidate contents. After obtaining the recommendation index information for each candidate content, the top one or more candidate contents with higher recommendation degree can be determined from the candidate contents according to the recommendation degree represented by the recommendation index information from high to low, and then pushed to the target recommendation object.
[0128] In the aforementioned content recommendation method, features are first extracted from the historical interaction content sequence and candidate content through the global feature layer and scene feature layer of the content recommendation model, respectively, to obtain scene features and global features of the historical interaction content and candidate content. Then, the scene features and global features of the historical interaction content are encoded through the global sequence encoder and scene sequence encoder, respectively, to obtain scene sequence features and global sequence features of the historical interaction content sequence. Through the group prototype attention layer, the scene sequence features of the historical interaction content sequence are extracted to obtain the group features of the object to be recommended. Through the information determination unit, the group features, scene sequence features, global sequence features, and the scene features and global features of the candidate content are processed to obtain the recommendation index information of the candidate content in the target scene. Finally, based on the recommendation index information, the target recommended content for the object to be recommended is determined from the candidate content. This method, on the one hand, by proposing the concept of group features, obtains the group features of the object to be recommended by processing the scene sequence features of the historical interaction content sequence through the group prototype attention layer during content recommendation, realizing the sharing of other users' intentions at the group level. Thus, it can achieve the sharing of common intentions of different users across scenes without relying on overlapping users. On the other hand, in terms of content representation, the content is represented by scene features in a specific scenario and global features in multiple scenarios, which enables the sharing of content features across scenarios, has better multi-scenario compatibility, and can improve the quality of the determined recommended content.
[0129] In an exemplary embodiment, in step S230, feature extraction is performed on the scene sequence features of the historical interaction content sequence to obtain the group features of the objects to be recommended. This can be achieved through the following steps:
[0130] Step S230a: Obtain prototype features of multiple predetermined group prototypes;
[0131] Step S230b: Compare the scene sequence features with the prototype features of multiple group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype.
[0132] Step S230c: Based on group similarity and prototype features of each group prototype, obtain the group features of the object to be recommended.
[0133] In the specific implementation, after obtaining the scene sequence features of the historical interaction content sequence, the scene sequence features can be pooled first. Through a fully connected layer, the pooled features corresponding to the scene sequence features and the prototype features of each group prototype are processed to obtain the group similarity between the scene sequence features and the prototype features of each group prototype. The personalized group features of the object to be recommended are obtained through the group similarity corresponding to each group prototype and the prototype features of each group prototype.
[0134] Furthermore, in an exemplary embodiment, the process of obtaining the group features of the object to be recommended based on group similarity and the prototype features of each group prototype in step S230c can be implemented as follows: by weighting the prototype features of each group prototype through group similarity, the weighted features of each group prototype are obtained; and by averaging the weighted features of each group prototype, the group features of the object to be recommended are obtained.
[0135] Specifically, after obtaining the group similarity corresponding to each group prototype, the group similarity can be used as the weight corresponding to each group prototype. Therefore, the prototype features of each group prototype can be weighted by the group similarity to obtain the weighted features of each group prototype. The weighted features of each group prototype can then be averaged to obtain the averaged features, which can be used as the personalized group features of the object to be recommended.
[0136] In this embodiment, by setting up a group prototype, it is possible to share user intent at the group level, thereby enabling the sharing of common intent among different users across scenarios without relying on overlapping users.
[0137] In an exemplary embodiment, the information determination unit includes a first information determination unit and a second information determination unit; in step S250, the group features, scene sequence features, global sequence features, and scene features and global features of the candidate content are processed to obtain the recommendation index information of the candidate content in the target scene, which can be specifically implemented through the following steps:
[0138] Step S250a: The first information determination unit processes the group characteristics, scene sequence characteristics, and scene characteristics of the candidate content to obtain the scene recommendation index information of the candidate content.
[0139] Step S250b: The second information determination unit processes the global sequence features and the global features of the candidate content to obtain the global recommendation index information of the candidate content.
[0140] Step S250c: Based on the scene recommendation index information and the global recommendation index information, obtain the recommendation index information of the candidate content in the target scene.
[0141] In practice, to improve the accuracy of the recommended indicator information of the determined candidate content in the target scenario, the features of the scenario dimension and the features of the global dimension can be processed separately. That is, a first information determination unit is constructed to determine the scenario recommendation indicator information, a second information determination unit is constructed to predict the global recommendation indicator information, and finally, the final recommendation indicator information is determined based on the scenario recommendation indicator information and the global recommendation indicator information.
[0142] More specifically, the scene-dimensional features include group features, scene sequence features, and scene features of candidate content. These three features are input into the first information determination unit to obtain the scene recommendation index information of the candidate content. The global-dimensional features include global sequence features and global features of candidate content. These two features are input into the second information determination unit to obtain the global recommendation index information of the candidate content. Furthermore, the scene recommendation index information and the global recommendation index information can be added together to obtain the recommendation index information of the candidate content.
[0143] In this embodiment, candidate content is predicted in both global and local dimensions. Based on the predicted scene recommendation index information and global recommendation index information, the recommendation index information of the candidate content in the target scene is then determined. This method combines the scene recommendation index information in the target scene with the global recommendation index information across scenes to jointly determine the final recommendation index information, thereby greatly improving the accuracy of the determined recommendation index information.
[0144] In an exemplary embodiment, before processing the group features, scene sequence features, and scene features of candidate content in step S250a to obtain scene recommendation index information of candidate content, the method further includes:
[0145] Step S241: Enhance the scene features and global features of historical interaction content by using the content similarity attention enhancement feature layer in the content recommendation model, as well as the global features and scene features based on candidate content, to obtain the enhanced features of historical interaction content.
[0146] Step S250a further includes: processing the group features, scene sequence features, scene features of candidate content, and enhanced features of historical interaction content to obtain scene recommendation index information.
[0147] In specific implementation, the scene-dimensional features, in addition to group features, scene sequence features, and scene features of candidate content, may also include enhanced features of each historical interaction content in the historical interaction content sequence. After extracting the scene features and global features of each historical interaction content and candidate content through the scene feature layer and global feature layer, the scene features and global features of each historical interaction content are fused to obtain the fused features of each historical interaction content. Similarly, the scene features and global features of candidate content are fused to obtain the fused features of candidate content. Furthermore, the fused features of each historical interaction content are enhanced using the fused features of candidate content to obtain enhanced features of each historical interaction content. Thus, the group features, scene sequence features, scene features of candidate content, and enhanced features of each historical interaction content are input into the first information determination unit in the content recommendation model for processing to obtain the scene recommendation index information of the candidate content.
[0148] In this embodiment, the scene features and global features of each historical interaction content are enhanced by using the global features and scene features of the candidate content to obtain the enhanced features of each historical interaction content. Based on the group features, scene sequence features, and scene features of the candidate content, the enhanced features of each historical interaction content are combined to determine the scene recommendation index information of the candidate content, which can improve the accuracy of the determined scene recommendation index information.
[0149] Furthermore, in an exemplary embodiment, in step S241 above, the scene features and global features of historical interaction content are enhanced based on the global features and scene features of the candidate content to obtain enhanced features of each historical interaction content. This can be achieved through the following steps:
[0150] Step S241a: The global features and scene features of the candidate content are fused to obtain the fused features of the candidate content; and the scene features and global features of the historical interaction content are fused to obtain the fused features of the historical interaction content.
[0151] Step S241b: Compare the fusion features of historical interaction content with the fusion features of candidate content to obtain the content similarity between historical interaction content and candidate content.
[0152] Step S241c: The fusion features of historical interaction content are weighted by content similarity to obtain the enhanced features of historical interaction content.
[0153] In the specific implementation, refer to Figure 3 The diagram illustrates the model structure of the content recommendation model. The content similarity attention enhancement feature layer is an attention layer used to determine the enhancement features of each historical interaction content. As shown, after processing the historical interaction content sequence and candidate content in the scene feature layer and global feature layer, the scene features and global features of each historical interaction content and candidate content are input into the content similarity attention enhancement feature layer. In this layer, the global features and scene features of the candidate content are first fused to obtain the fused features of the candidate content. Similarly, the scene features and global features of each historical interaction content are fused to obtain the fused features of each historical interaction content. Then, the fused features of each historical interaction content are compared with the fused features of the candidate content to obtain the content similarity between each historical interaction content and the candidate content. This content similarity is used as a weight, and the fused features of each historical interaction content are weighted according to their respective weights. The weighted features of each historical interaction content are then used as the enhancement features of that historical interaction content.
[0154] In this embodiment, the fusion features of each historical interaction content are enhanced by the similarity between the candidate content and each historical interaction content, thereby improving the accuracy of the feature representation of each historical interaction content and thus improving the accuracy of the scene recommendation index information predicted based on the enhanced features.
[0155] In an exemplary embodiment, before processing the group features, scene sequence features, and scene features of candidate content in step S250a to obtain scene recommendation index information of candidate content, the method further includes: fusing scene sequence features and global sequence features through a sequence fusion attention layer in the content recommendation model to obtain fused sequence features;
[0156] Step S250a further includes: processing the group features, scene sequence features, scene features of candidate content, and fusion sequence features to obtain scene recommendation index information.
[0157] Furthermore, in an exemplary embodiment, step S250a may further include: processing the group features, scene sequence features, scene features of candidate content, fusion sequence features, and enhanced features of each historical interaction content to obtain scene recommendation index information.
[0158] In practical implementation, scene-dimensional features, in addition to group features, scene sequence features, scene features of candidate content, and enhanced features of each historical interaction content, may also include fused sequence features obtained by fusing scene sequence features and global sequence features. (Reference) Figure 3 The sequence fusion attention layer in the figure is an attention layer used to fuse scene sequence features and global sequence features. As shown in the figure, for the input historical interaction content sequence and candidate content in scenario A, they are first processed by the scene feature layer and the global feature layer to obtain the scene features and global features of each historical interaction content. Then, the scene features of each historical interaction content are input into the scene encoder to obtain the scene sequence features of the historical interaction content sequence. The global features of each historical interaction content are input into the global encoder to obtain the global sequence features of the historical interaction content sequence. Further, the scene sequence features and global sequence features are input into the sequence fusion attention layer, which fuses the scene sequence features and global sequence features to obtain the fused sequence features.
[0159] Furthermore, the enhanced features of each historical interaction content output by the content similarity attention enhancement feature layer ( Figure 3 e Ai ), the fused sequence features output by the sequence fusion attention layer ( Figure 3 s in As The group characteristics of the sample objects output by the group prototype attention layer. Figure 3g in Au ), and scene sequence features of the historical interaction content sequence output by the scene encoder ( Figure 3 s in A ), and the scene features of the candidate content output by the scene feature layer ( Figure 3 In Together, they are input into the first information determination unit ( Figure 3 The first MLP (Multilayer Perceptron) in the model processes these five types of features by the first information determination unit to obtain scene recommendation index information for candidate content.
[0160] In this embodiment, before determining the scene recommendation index information, the scene sequence features and global sequence features are fused to obtain a fused sequence feature that retains the characteristics of the target scene while taking into account global information. Then, this fused sequence feature is introduced together with the group features, scene sequence features, scene features of candidate content, and enhanced features of each historical interaction content to determine the scene recommendation index information of the candidate content, so as to improve the accuracy of the determined scene recommendation index information.
[0161] refer to Figure 4 This is a flowchart illustrating a training method for a content recommendation model according to an exemplary embodiment. This embodiment uses the application of this method to a terminal as an example for illustration. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0162] In step S410, the interaction information between the sample object and multiple sample contents in the target scene is obtained; the multiple sample contents include the target sample content and the historical sample content sequence; the target scene is any one of multiple recommendation scenes, which are divided based on the association attribute information of the recommendation content; the interaction time between the target sample content and the sample object is later than the interaction time between the historical sample content and the sample object.
[0163] In step S420, the global feature layer and scene feature layer of the content recommendation model to be trained corresponding to the target scene are used to extract features from the target sample content and the historical sample content sequence, respectively, to obtain the scene features and global features of the historical sample content and the target sample content. The scene features represent the features that affect the interaction between the sample object and the sample content in the target scene, and the global features represent the features that affect the interaction between the sample object and the sample content in multiple scenes.
[0164] In step S430, the scene features and global features of the historical sample content are encoded by the global sequence encoder and scene sequence encoder in the content recommendation model to be trained, respectively, to obtain the scene sequence features and global sequence features of the historical sample content sequence.
[0165] In step S440, the scene sequence features of the historical sample content sequence are extracted through the group prototype attention layer in the content recommendation model to be trained, so as to obtain the group features of the sample objects.
[0166] In step S450, the information determination unit in the content recommendation model to be trained processes the group features, scene sequence features, global sequence features, and scene and global features of the target sample content to obtain the recommendation index information of the target sample content in the target scene.
[0167] In step S460, based on the recommendation index information and the interaction information between the sample object and the target sample content, the content recommendation model to be trained is trained to obtain the content recommendation model corresponding to the target scenario.
[0168] Interaction information can be understood as information that characterizes the sample object's preference for sample content. For example, interaction information can include viewing time, click rate, whether to view or post comments, whether to like or favorite, etc.
[0169] The historical sample content sequence includes multiple sample contents.
[0170] Understandably, different users and sample content result in different sample data in different scenarios. Therefore, the content recommendation models trained for different scenarios will also differ, specifically in their model parameters, although the model architecture remains the same. For example, refer to... Figure 3 The diagram illustrates the model structure of the content recommendation model. While the architectures of the content recommendation models for scenarios A and B are identical, the model parameters trained on scenarios A and B may differ. Therefore, it is necessary to train the model separately for each scenario. For ease of description, this embodiment uses the target scenario as an example to illustrate the training method of the content recommendation model provided in this disclosure.
[0171] In the specific implementation, before training the model, sample data is first acquired, namely, sample objects (or sample users) in the target scenario, as well as the interaction information between the sample objects and multiple sample contents. According to the interaction time between the sample objects and each sample content, the multiple sample contents are sorted from early to late. The sample contents with earlier interaction times form a historical sample content sequence, and the sample contents with later interaction times are used as the target sample contents to be predicted. This is so that the recommendation index information obtained by predicting the target sample contents based on the content recommendation model, as well as the actual interaction information of the sample objects with the target sample contents, can be used to train the content recommendation model.
[0172] More specifically, after obtaining the recommendation index information of the target sample content, the sample type of the target sample content can be determined based on the interaction information of the sample object with the target sample content, that is, whether the target sample content is positive sample content or negative sample content. Thus, when the two target sample contents obtained from the two predictions form a positive and negative sample pair, the difference between the recommendation index information of the positive sample content and the recommendation index information of the negative sample content can be obtained as the loss value. Based on this loss value, the model parameters of the content recommendation model to be trained are adjusted until the preset number of training times or the loss value converges, and the trained content recommendation model is obtained, which serves as the content recommendation model corresponding to the target scenario.
[0173] It should be noted that there is no specific limit to the number of sample contents in the historical sample content sequence. Therefore, multiple sample contents can be divided into multiple sets of historical sample content sequences and target sample contents. For example, suppose the multiple sample contents in the acquired sample data are... By dividing it according to interaction time, we can obtain the historical sample content sequence. and target sample content Historical sample content sequences can also be obtained. The corresponding target sample content can be to For any sample content in the sequence, it is only necessary to satisfy the condition that the interaction time of the target sample content is later than the interaction time of each sample content in the historical sample content sequence.
[0174] The training method for the content recommendation model provided in this embodiment, on the one hand, utilizes the proposed concept of group features to obtain the group features of sample objects when processing the target sample content and the sample content sequence of Lishui City. This enables the sharing of user intent at the group level, thus achieving cross-scenario sharing of common intent among different users without relying on overlapping users. On the other hand, in terms of content representation, it uses scene features in specific scenarios and global features in multiple scenarios to represent the content, achieving cross-scenario sharing of content features and exhibiting better multi-scenario compatibility. The content recommendation model trained based on this method has better performance and can improve the quality of recommended content across scenarios.
[0175] In an exemplary embodiment, step S440 involves processing the historical sample content sequence to obtain the group characteristics of the sample object, including: obtaining the prototype features of multiple predetermined group prototypes; comparing the scene sequence features with the prototype features of the multiple group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype; and obtaining the group characteristics of the sample object based on the group similarity and the prototype features of each group prototype.
[0176] In the specific implementation, after obtaining the scene sequence features, the scene sequence features are pooled. Through a fully connected layer, the pooled features corresponding to the scene sequence features and the prototype features of each group prototype are processed to obtain the group similarity between the scene sequence features and the prototype features of each group prototype, which is used as the weight of each group prototype. The weight of each group prototype is then averaged with the prototype features of each group prototype to obtain the personalized group features of the sample object.
[0177] In this embodiment, by setting up a group prototype, it is possible to share user intent at the group level, thereby enabling the sharing of common intent among different users across scenarios without relying on overlapping users.
[0178] In an exemplary embodiment, the prototype features of multiple group prototypes are determined by: obtaining scene sequence features of sample content sequences of interactions between multiple sample objects in multiple sample scenarios to obtain multiple scene sequence features; determining the current scene sequence feature and the current prototype features of multiple preset group prototypes among the multiple scene sequence features; adjusting the current prototype features of the multiple preset group prototypes according to the current scene sequence features to obtain the adjusted prototype features of each group prototype; obtaining the difference information between the adjusted prototype features of each pair of group prototypes; when the difference information does not meet the preset conditions, determining the next scene sequence feature among the multiple scene sequence features as a new scene sequence feature, and determining the adjusted prototype feature as a new prototype feature, and returning the step of adjusting the current prototype features of the multiple preset group prototypes according to the current scene sequence features, until the difference information between the current prototype features of each pair of group prototypes meets the preset conditions, thus obtaining the prototype features of each group prototype.
[0179] In practice, before applying the prototype features of multiple group prototypes to determine the personalized group features of sample objects, it is necessary to first train the prototype features of each group prototype. Specifically, scene sequence features of multiple sample objects in multiple sample scenarios can be obtained as sample data, and the prototype features of each group prototype can be pre-initialized. Then, the initialized prototype features of each group prototype are trained using each scene sequence feature until the training termination condition is met, thus obtaining the prototype features of each group prototype.
[0180] More specifically, a scene sequence feature is used to adjust the initial prototype features of each group prototype to obtain the current prototype features of each group prototype. The difference information between the current prototype features of each pair of group prototypes is obtained. When the difference information does not meet the preset conditions, the current prototype features of each group prototype are adjusted again by the next scene sequence feature to obtain new prototype features. The process of obtaining the difference information between the current prototype features of each pair of group prototypes is repeated until the difference information between the current prototype features of each pair of group prototypes meets the preset conditions, thus obtaining the prototype features of each group prototype.
[0181] It is understandable that each group prototype should express different aspects and should not have repetition or redundancy. Therefore, the prototype features of each group prototype should be dissimilar to each other. Thus, the difference information between the prototype features of each group prototype should be as large as possible. Correspondingly, its loss function is the constraint of maximizing the distance between each pair of prototype features of the group prototype. Converting this to minimization, the negative of the formula is as follows:
[0182]
[0183] Among them, G i and Gj N represents the prototype characteristics of two different group prototypes. ɡ λ represents the total number of prototypes in the defined group. ɡ Represents the coefficient.
[0184] In this embodiment, the prototype features of each group prototype are trained by the scene sequence features of multiple sample objects in multiple sample scenarios, thereby obtaining an accurate representation of the prototype features of each group prototype. Furthermore, by setting the group prototype deentanglement constraint, the prototype features of each group prototype are determined when the distance between the prototype features of each pair of group prototypes is maximized, avoiding duplication and redundancy between group prototypes. This improves the accuracy of the user group features determined based on group prototypes without duplication and redundancy.
[0185] In an exemplary embodiment, step S240 involves training the content recommendation model to be trained based on recommendation metric information and interaction information between the sample object and the target sample content, thereby obtaining the content recommendation model corresponding to the target scenario. This can be achieved through the following steps:
[0186] Step S240a: Based on the interaction information between the sample object and the target sample content, determine the sample type of the target sample content; the sample type includes positive sample content and negative sample content, positive sample content represents the content in which the sample object has given positive feedback, and negative sample content represents the content in which the sample object has given negative feedback;
[0187] Step S240b: Obtain the loss value between the recommendation index information of positive sample content and the recommendation index information of negative sample content;
[0188] Step S240c: Train the content recommendation model to be trained based on the loss value until the preset number of training times is reached or the loss value converges, and obtain the content recommendation model corresponding to the target scenario.
[0189] Positive sample content can be understood as content that the sample object is interested in, specifically content that the sample object has interacted with (such as watching, liking, commenting, etc.). Negative sample content can be understood as content that the sample object is not interested in, specifically content that the sample object has not interacted with.
[0190] In the specific implementation, for each sample object, the sample content in the collected sample data should include positive sample content from positive feedback from the sample object and negative sample content from negative feedback from the sample object. This allows the target sample content of each sample object to include two sample types: positive sample content and negative sample content. Then, based on the loss value between the recommendation index information of positive sample content and the recommendation index information of negative sample content, the content recommendation model to be trained can be trained until the preset number of training times or the loss value converges, thus obtaining the content recommendation model corresponding to the target scenario.
[0191] Understandably, the conditions for a content recommendation model to recommend content to a user should be: the probability of recommending positive sample content should be higher than the probability of recommending negative sample content, and the difference between the recommendation probabilities of positive and negative sample content should be as large as possible. Therefore, taking scenario A as an example, the logarithmic loss function for scenario A can be expressed as:
[0192]
[0193] Among them, R A This represents the training sample set for scenario A. Let u represent the sample content, t represent the sample object, and t represent the interaction time. Indicates the sample type (positive or negative) of the target sample content. This represents the probability of recommending the content of the target sample.
[0194] In this embodiment, the content recommendation model is trained using the loss value between the recommendation index information of positive sample content and the recommendation index information of negative sample content. This widens the gap between the recommendation index information of positive and negative sample content, making the recommendation index information of positive sample content as high as possible and the recommendation index information of negative sample content as low as possible. This allows the content recommendation model to learn the relative preference order of sample objects for different sample content, improving the prediction effect of the content recommendation model. This avoids the problem of traditional methods that only use the loss value between the actual interaction information of a single sample content and the predicted recommendation index information for training, resulting in the content recommendation model having small differences in recommendation index information for all sample content and making it difficult to accurately distinguish the preferences of sample objects.
[0195] Understandably, existing technologies for cross-scenario recommendation based on bidirectional learning mechanisms heavily rely on overlapping users. However, in many practical cross-domain sequential recommendation applications, users are always non-overlapping. For example, two companies sharing data for cross-scenario recommendation often have different users, or users may be anonymous due to privacy regulations. Therefore, existing application scenarios primarily involve cross-scenario recommendation with only overlapping content IDs, facing the following three main challenges:
[0196] (1) Content characteristics differ across scenarios. Even if content is shared across scenarios, it still reflects different characteristics. For example, for high-end e-commerce websites, price has a smaller impact when users buy goods, while it plays an important role in low-end websites. This difference makes it difficult to learn accurate content representations across different scenarios.
[0197] (2) Diverse Sequence Patterns Across Scenarios. Similar to content, sequence behavior varies across different scenarios. For example, on high-end e-commerce websites, users may be more cautious when placing orders, leading to very short sequence behaviors and very long sequence cycle patterns. Therefore, sequence patterns are diverse across different scenarios, which poses a challenge for modeling.
[0198] (3) Preference transfer among non-overlapping users. Since this work focuses on real-world applications, only content can be shared, making cross-scenario transfer of user preferences a challenge. In other words, even without overlapping users, sharing user preferences is a challenge.
[0199] Based on this, in order to address the three challenges mentioned above one by one, this disclosure proposes a new solution based on a hybrid attention network, which combines three types of attention network designs at the content level, sequence level, and group level.
[0200] The first is the content similarity attention module, which is used to refine the local or global content representation encoded by the local or global feature encoding layer.
[0201] The second is the sequence fusion attention module, which is used to fuse local and global sequence patterns captured by the scene encoder and the global encoder.
[0202] The third is the group prototype attention module, which proposes several group prototypes to convey the intent of user behavior sequences at the group level. Although user information cannot be directly shared, the group (intent) of behavior sequences can be shared across scenarios.
[0203] In another exemplary embodiment, to facilitate understanding of the embodiments of this disclosure by those skilled in the art, the following will use a short video as an example and illustrate the solution with reference to the accompanying drawings. The solution mainly includes the following three steps:
[0204] (1) Obtain training data and construct training samples. The training samples are in the form of structured table data, with each row being a record of user interaction with a video, including the user and video IDs, as well as other attributes and features.
[0205] The required training data includes:
[0206] User characteristics: User ID, User activity level.
[0207] Video features: Video ID, video clustering category ID, video author ID, video author clustering category ID, video duration, and video popularity.
[0208] User behavior characteristics related to videos: user clicks on videos, user likes on videos, etc.
[0209] (2) Construction and training of content recommendation model
[0210] refer to Figure 3 This is a schematic diagram of the model structure of the content recommendation model provided in this disclosure, including a content similarity attention enhancement feature layer, a sequence fusion attention layer, a group prototype attention layer, and a prediction layer. A brief description of each module is as follows:
[0211] Content Similarity Attention Enhancement Feature Layer. This disclosure constructs scene-specific and global features of the content, and further proposes a content similarity attention module to enhance the video features, thereby obtaining enhanced features.
[0212] Sequence Fusion Attention Layer. A sequence fusion attention module is proposed to transfer video-to-video transition modes across scenes.
[0213] Group Prototype Attention Layer. Although specific overlapping user IDs cannot be utilized, different sequences can reflect the consumption intentions of specific types of users (which can be regarded as user groups). Therefore, this disclosure proposes a group prototype attention module for sharing the common intention groups of different users across multiple scenarios.
[0214] Prediction Layer. Taking the outputs of the three attention modules as input, this disclosure deploys a local prediction layer and a global prediction layer to predict the probability that the user will interact with the candidate next video in each scene.
[0215] refer to Figure 5 The following is a complete flowchart illustrating a training method for a content recommendation model according to one embodiment. Figure 3 The training process of the model is explained as follows:
[0216] Step S510: Divide the multiple sample videos in the acquired training data into target sample videos and historical sample video sequences according to the interaction time. For example... Figure 3 Lieutenant General Divided into historical sample video sequences and target sample video The following explanation uses this partitioning result as an example.
[0217] Step S520: Obtain scene features and global features for each historical sample video and the target sample video. Specifically, input the historical sample video sequence and the target sample video into the scene feature layer and the global feature layer, respectively. Process the scene feature layer to obtain the scene features of each historical sample video and the scene features of the target sample video. And the global features of each historical sample video and the global features of the target sample video are obtained through global feature layer processing.
[0218] Step S530: Based on scene features and global features, obtain the scene sequence features and global sequence features of the historical sample video sequence. Specifically, process the scene features of each historical sample video in the historical sample video sequence using a scene encoder to obtain the scene sequence features s of the historical sample video sequence. A Furthermore, by processing the global features of each historical sample video through a global encoder, the global sequence features s of the historical sample video sequence are obtained. Ag .
[0219] Step S540a involves obtaining enhanced features for each historical sample video through a content similarity attention enhancement feature layer. Specifically, the scene features and global features of each historical sample video and the target sample video are first fused to obtain fused features for each historical sample video and the target sample video. The fused features of each historical sample video are then compared with those of the target sample video to obtain the video similarity between them. Based on this video similarity, the fused features of each historical sample video are weighted to obtain the enhanced feature e for each historical sample video. Ai .
[0220] Step S540b involves obtaining fused sequence features through a sequence fusion attention layer. Specifically, this involves extracting scene sequence features s from historical sample video sequences. A and global sequence features s Ag The input sequence is fused with an attention layer for fusion processing to obtain the fused sequence features s. As .
[0221] Step S540c: Obtain the group characteristics of the sample users through the group prototype attention layer. Specifically, the group prototype attention layer compares the scene sequence features with the prototype features of multiple preset group prototypes to obtain the group similarity between the scene sequence features and the prototype features of each group prototype; the group similarity and the prototype features of each group prototype are weighted and averaged to obtain the group characteristics g of the sample users. Au .
[0222] Step S550: Based on the various features obtained in the above steps, scene recommendation index information and global recommendation index information are obtained. Specifically, the enhanced features e of each historical sample video are... Ai , fusion sequence features As Group characteristics of sample users g Au Scene sequence features of historical sample video sequences A and scene features of the target sample video. Input local prediction layer ( Figure 3 The first MLP from left to right in the middle obtains the scene recommendation index information of the target sample video, as well as the global features of the target sample video. Global sequence features of historical sample video sequences Ag Input to global prediction layer ( Figure 3 The second MLP in the process yields global recommendation metrics information for the target sample video.
[0223] Step S560: Based on the scene recommendation index information and the global recommendation index information, obtain the recommendation index information L of the target sample video in scene A. A Specifically, the scene recommendation metrics can be added to the global recommendation metrics to obtain the recommendation metrics.
[0224] Step S570: Determine the sample type of the target sample video, and train the content recommendation model based on the loss value between the recommendation index information of positive sample videos and negative sample videos.
[0225] The training method for the content recommendation model provided in this embodiment has the following advantages:
[0226] (1) Enhanced cross-scenario recommendation performance. This disclosure verifies the cross-scenario capability of the proposed technical solution through experiments on real datasets. Specifically, the cross-scenario capability was studied on two datasets: a short video dataset with relatively dense interaction records and a relatively sparse e-commerce dataset. Through experimental results on four scenarios across the two datasets, it was determined that compared with existing recommendation algorithms, the proposed solution achieved optimal performance in all cases, with an AUC (a model evaluation metric) improvement of approximately 4%.
[0227] (2) Independent of overlapping users. The scheme disclosed herein transfers user preferences at the user group level, independent of specific overlapping user IDs. Data visualization shows that the model can learn effective group information.
[0228] (3) It can handle more than two scenarios, with each scenario cooperating with the others while remaining independent. The solution disclosed herein only requires modification of the objective function to increase from two scenarios to multiple scenarios. At the same time, the training of each scenario is independent, and stopping one scenario will not affect other scenarios, thus achieving mutual cooperation and independence between scenarios.
[0229] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0230] It is understood that the same / similar parts between the various embodiments of the methods described above in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments, and relevant parts can be referred to the description of other method embodiments.
[0231] Based on the same inventive concept, this disclosure also provides a training apparatus for a content recommendation model for implementing the training method of the content recommendation model involved above, and a content recommendation apparatus for implementing the content recommendation method involved above.
[0232] Figure 6 This is a structural block diagram illustrating a content recommendation device according to an exemplary embodiment. (Refer to...) Figure 6 The device includes: an acquisition unit 610, a content feature extraction unit 620, an encoding unit 630, a group feature extraction unit 640, a recommendation index determination unit 650, and a recommendation unit 660, wherein...
[0233] The acquisition unit 610 is configured to acquire the historical interaction content sequence and candidate content of the object to be recommended in the target scenario; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommended content.
[0234] The content feature extraction unit 620 is configured to perform feature extraction on the historical interaction content sequence and candidate content through the global feature layer and scene feature layer in the content recommendation model, respectively, to obtain the scene features and global features of the historical interaction content and candidate content; the scene features represent the features that affect the interaction between the recommended object and the candidate content in the target scene, and the global features represent the features that affect the interaction between the recommended object and the candidate content in multiple scenes.
[0235] The encoding unit 630 is configured to execute the global sequence encoder and the scene sequence encoder in the content recommendation model to encode the scene features and global features of the historical interaction content respectively, so as to obtain the scene sequence features and global sequence features of the historical interaction content sequence.
[0236] The group feature extraction unit 640 is configured to perform feature extraction on the scene sequence features of the historical interaction content sequence through the group prototype attention layer in the content recommendation model to obtain the group features of the object to be recommended.
[0237] The recommendation indicator determination unit 650 is configured to execute the information determination unit in the content recommendation model to process group features, scene sequence features, global sequence features, and scene and global features of candidate content to obtain recommendation indicator information of candidate content in the target scene.
[0238] Recommendation unit 660 is configured to determine target recommendation content for the object to be recommended from the candidate content based on recommendation metric information.
[0239] In an exemplary embodiment, the group feature extraction unit 640 is further configured to perform the following operations: acquiring prototype features of a plurality of predetermined group prototypes; comparing scene sequence features with the prototype features of the plurality of group prototypes to obtain group similarity between scene sequence features and prototype features of each group prototype; and obtaining group features of the object to be recommended based on group similarity and prototype features of each group prototype.
[0240] In an exemplary embodiment, the group feature extraction unit 640 is further configured to perform weighted features of each group prototype by weighting the prototype features of each group prototype through group similarity, and to average the weighted features of each group prototype to obtain the group features of the object to be recommended.
[0241] In an exemplary embodiment, the information determination unit includes a first information determination unit and a second information determination unit; the recommendation index determination unit 650 is further configured to perform the following operations: by processing the group characteristics, scene sequence characteristics, and scene characteristics of the candidate content through the first information determination unit to obtain scene recommendation index information of the candidate content; by processing the global sequence characteristics and global characteristics of the candidate content through the second information determination unit to obtain global recommendation index information of the candidate content; and by obtaining recommendation index information of the candidate content in the target scene based on the scene recommendation index information and the global recommendation index information.
[0242] In an exemplary embodiment, the apparatus further includes an enhancement processing unit configured to perform enhancement processing on the scene features and global features of historical interaction content based on the global features and scene features of candidate content, thereby obtaining enhanced features of historical interaction content.
[0243] The recommendation indicator determination unit 650 is also configured to process the group characteristics, scene sequence characteristics, scene characteristics of candidate content, and enhanced features of historical interaction content to obtain scene recommendation indicator information.
[0244] In an exemplary embodiment, the enhancement processing unit is further configured to perform fusion processing on global features and scene features of candidate content to obtain fused features of candidate content, and to perform fusion processing on scene features and global features of historical interaction content to obtain fused features of historical interaction content; compare the fused features of historical interaction content with the fused features of candidate content to obtain content similarity between historical interaction content and candidate content; and perform weighted processing on the fused features of historical interaction content based on content similarity to obtain enhanced features of historical interaction content.
[0245] In one exemplary embodiment, the apparatus further includes a fusion unit configured to perform fusion processing on scene sequence features and global sequence features through a sequence fusion attention layer in a content recommendation model to obtain fused sequence features;
[0246] The recommendation indicator determination unit 650 is also configured to process group features, scene sequence features, scene features of candidate content, and fusion sequence features to obtain scene recommendation indicator information.
[0247] Figure 7 This is a structural block diagram illustrating a training apparatus for a content recommendation model according to an exemplary embodiment. (Refer to...) Figure 7 The device includes: a sample acquisition unit 710, a content feature extraction unit 720, an encoding unit 730, a group feature extraction unit 740, a recommendation index determination unit 750, and a model training unit 760, wherein...
[0248] The sample acquisition unit 710 is configured to acquire the interaction information between a sample object and multiple sample contents in a target scenario; the multiple sample contents include target sample content and a sequence of historical sample content; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommendation content; the interaction time between the target sample content and the sample object is later than the interaction time between the historical sample content and the sample object.
[0249] The content feature extraction unit 720 is configured to perform feature extraction on the target sample content and the historical sample content sequence through the global feature layer and the scene feature layer in the content recommendation model to be trained corresponding to the target scene, respectively, to obtain the scene features and global features of the historical sample content and the target sample content; the scene features represent the features that affect the interaction between the sample object and the sample content in the target scene, and the global features represent the features that affect the interaction between the sample object and the sample content in multiple scenes.
[0250] The encoding unit 730 is configured to perform the encoding of scene features and global features of historical sample content by the global sequence encoder and scene sequence encoder in the content recommendation model to be trained, so as to obtain scene sequence features and global sequence features of historical sample content sequence.
[0251] The group feature extraction unit 740 is configured to perform feature extraction on the scene sequence features of the historical sample content sequence through the group prototype attention layer in the content recommendation model to be trained, so as to obtain the group features of the sample objects.
[0252] The recommendation index determination unit 750 is configured to execute the information determination unit in the content recommendation model to be trained, process the group features, scene sequence features, global sequence features, and scene features and global features of the target sample content, and obtain the recommendation index information of the target sample content in the target scene.
[0253] The model training unit 760 is configured to train the content recommendation model to be trained based on recommendation metric information and the interaction information between the sample object and the target sample content, so as to obtain the content recommendation model corresponding to the target scenario.
[0254] In an exemplary embodiment, the group feature extraction unit 740 is further configured to perform the following: acquiring prototype features of a plurality of predetermined group prototypes; comparing scene sequence features with the prototype features of the plurality of group prototypes to obtain group similarity between scene sequence features and prototype features of each group prototype; and obtaining group features of the sample object based on group similarity and prototype features of each group prototype.
[0255] In an exemplary embodiment, the apparatus further includes a prototype feature determination unit, configured to perform the following steps: acquiring scene sequence features of sample content sequences of interactions between multiple sample objects in multiple sample scenarios to obtain multiple scene sequence features; determining the current scene sequence feature and the current prototype features of multiple preset group prototypes among the multiple scene sequence features; adjusting the current prototype features of the multiple preset group prototypes according to the current scene sequence features to obtain the adjusted prototype features of each group prototype; acquiring difference information between the adjusted prototype features of each pair of group prototypes; when the difference information does not meet preset conditions, determining the next scene sequence feature among the multiple scene sequence features as a new scene sequence feature; determining the adjusted prototype feature as a new prototype feature; and returning the step of adjusting the current prototype features of the multiple preset group prototypes according to the current scene sequence features, until the difference information between the current prototype features of each pair of group prototypes meets preset conditions, thereby obtaining the prototype features of each group prototype.
[0256] In an exemplary embodiment, the model training unit 760 is configured to perform the following actions: determine the sample type of the target sample content based on the interaction information between the sample object and the target sample content; the sample type includes positive sample content and negative sample content, where positive sample content represents content for which the sample object has provided positive feedback, and negative sample content represents content for which the sample object has provided negative feedback; obtain the loss value between the recommendation index information of the positive sample content and the recommendation index information of the negative sample content; and train the content recommendation model to be trained based on the loss value until a preset number of training iterations or the loss value converges, thereby obtaining the content recommendation model corresponding to the target scenario.
[0257] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0258] Figure 8 This is a block diagram illustrating an electronic device 800 for implementing a training method or content recommendation method for a content recommendation model, according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0259] Reference Figure 8 The electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.
[0260] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0261] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, optical disk, or graphene storage.
[0262] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0263] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0264] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0265] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0266] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or its components, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0267] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0268] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0269] In one exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0270] In one exemplary embodiment, a computer program product is also provided, which includes instructions that can be executed by a processor 820 of an electronic device 800 to perform the above-described method.
[0271] It should be noted that the above-mentioned apparatus, electronic equipment, computer-readable storage medium, computer program product, etc., may also include other implementation methods according to the description of the method embodiments. For specific implementation methods, please refer to the description of the relevant method embodiments, which will not be elaborated here.
[0272] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0273] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A content recommendation method, characterized in that, The method includes: Obtain the historical interaction content sequence and candidate content of the object to be recommended in the target scenario; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommended content; The historical interaction content sequence and the candidate content are feature extracted by the global feature layer and the scene feature layer in the content recommendation model, respectively, to obtain the scene features and global features of the historical interaction content and the candidate content. The scene features represent the features that affect the interaction between the recommended object and the candidate content in the target scene, and the global features represent the features that affect the interaction between the recommended object and the candidate content in multiple scenes. The scene features and global features of the historical interaction content are encoded by the global sequence encoder and scene sequence encoder in the content recommendation model to obtain the scene sequence features and global sequence features of the historical interaction content sequence. The scene sequence features represent the transfer features between content that are unique to the target scene, and the global sequence features represent the transfer features between content that are present in multiple recommendation scenes. The scene sequence features are compared with the prototype features of multiple pre-determined group prototypes through the group prototype attention layer in the content recommendation model to obtain the group similarity between the scene sequence features and the prototype features of each group prototype. The group similarity is used to perform a weighted average of the prototype features of each group prototype to obtain the group features of the object to be recommended. The information determination unit in the content recommendation model processes the group features, the scene sequence features, the global sequence features, and the scene and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene. Based on the recommendation metric information, target recommendation content for the object to be recommended is determined from the candidate content.
2. The method according to claim 1, characterized in that, The information determination unit includes a first information determination unit and a second information determination unit; the process of processing the group features, the scene sequence features, the global sequence features, and the scene features and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene includes: The first information determining unit processes the group characteristics, the scene sequence characteristics, and the scene characteristics of the candidate content to obtain the scene recommendation index information of the candidate content. The second information determination unit processes the global sequence features and the global features of the candidate content to obtain the global recommendation index information of the candidate content. Based on the scenario recommendation index information and the global recommendation index information, the recommendation index information of the candidate content in the target scenario is obtained.
3. The method according to claim 2, characterized in that, Before processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content, the method further includes: By using the content similarity attention enhancement feature layer in the content recommendation model, and based on the global and scene features of the candidate content, the scene features and global features of the historical interaction content are enhanced to obtain the enhanced features of the historical interaction content. The process of processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content includes: The group characteristics, the scene sequence characteristics, the scene characteristics of the candidate content, and the enhanced features of the historical interaction content are processed to obtain the scene recommendation index information.
4. The method according to claim 3, characterized in that, The global features and scene features based on the candidate content, The scene features and global features of the historical interaction content are enhanced to obtain the enhanced features of the historical interaction content, including: The global features and scene features of the candidate content are fused to obtain the fused features of the candidate content; and the scene features and global features of the historical interaction content are fused to obtain the fused features of the historical interaction content. The fusion features of the historical interaction content are compared with the fusion features of the candidate content to obtain the content similarity between the historical interaction content and the candidate content. By weighting the fusion features of the historical interaction content based on the content similarity, the enhanced features of the historical interaction content are obtained.
5. The method according to claim 2, characterized in that, Before processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content, the method further includes: The sequence fusion attention layer in the content recommendation model is used to fuse the scene sequence features and the global sequence features to obtain fused sequence features. The step of processing the group features, the scene sequence features, and the scene features of the candidate content to obtain the scene recommendation index information of the candidate content further includes: The group features, the scene sequence features, the scene features of the candidate content, and the fused sequence features are processed to obtain the scene recommendation index information.
6. A training method for a content recommendation model, characterized in that, The method includes: The interaction information between a sample object and multiple sample contents in a target scenario is obtained; the multiple sample contents include target sample content and a sequence of historical sample content; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommendation content; the interaction time between the target sample content and the sample object is later than the interaction time between the historical sample content and the sample object. By using the global feature layer and scene feature layer in the content recommendation model to be trained corresponding to the target scene, features are extracted from the target sample content and the historical sample content sequence, respectively, to obtain scene features and global features of the historical sample content and the target sample content; the scene features represent the features that affect the interaction between the sample object and the sample content in the target scene, and the global features represent the features that affect the interaction between the sample object and the sample content in multiple scenes. The scene features and global features of the historical sample content are encoded by the global sequence encoder and scene sequence encoder in the content recommendation model to be trained, respectively, to obtain the scene sequence features and global sequence features of the historical sample content sequence; the scene sequence features represent the transfer features between content unique to the target scene, and the global sequence features represent the transfer features between content that are present in multiple recommendation scenes. The scene sequence features are compared with the prototype features of multiple pre-determined group prototypes through the group prototype attention layer in the content recommendation model to be trained, so as to obtain the group similarity between the scene sequence features and the prototype features of each group prototype; the group similarity is used to perform a weighted average of the prototype features of each group prototype to obtain the group features of the sample object. The information determination unit in the content recommendation model to be trained processes the group features, the scene sequence features, the global sequence features, and the scene features and global features of the target sample content to obtain the recommendation index information of the target sample content in the target scene. Based on the recommendation metric information and the interaction information between the sample object and the target sample content, the content recommendation model to be trained is trained to obtain the content recommendation model corresponding to the target scenario.
7. The method according to claim 6, characterized in that, The prototype characteristics of the multiple group prototypes are determined in the following way: Obtain scene sequence features of sample content sequences of interactions between multiple sample objects in multiple sample scenarios, and obtain multiple scene sequence features; Determine the current scene sequence feature and the current prototype feature of multiple preset group prototypes among the multiple scene sequence features; Based on the current scene sequence features, the current prototype features of multiple preset group prototypes are adjusted to obtain the adjusted prototype features of each group prototype. The process involves obtaining the difference information between the adjusted prototype features of each pair of group prototypes. When the difference information does not meet the preset conditions, the process involves determining the next scene sequence feature among the multiple scene sequence features as the new scene sequence feature, and determining the adjusted prototype feature as the new prototype feature. The process then returns to the step of adjusting the current prototype features of the preset multiple group prototypes based on the current scene sequence features, until the difference information between the current prototype features of each pair of group prototypes meets the preset conditions, thus obtaining the prototype features of each group prototype.
8. The method according to claim 6, characterized in that, The step of training the content recommendation model to be trained based on the recommendation metric information and the interaction information between the sample object and the target sample content to obtain the content recommendation model corresponding to the target scenario includes: Based on the interaction information between the sample object and the target sample content, the sample type of the target sample content is determined; the sample type includes positive sample content and negative sample content, where positive sample content represents the content for which the sample object has provided positive feedback, and negative sample content represents the content for which the sample object has provided negative feedback; Obtain the loss value between the recommendation metrics of positive sample content and the recommendation metrics of negative sample content; The content recommendation model to be trained is trained based on the loss value until a preset number of training iterations are reached or the loss value converges, thereby obtaining the content recommendation model corresponding to the target scenario.
9. A content recommendation device, characterized in that, The device includes: The acquisition unit is configured to acquire the historical interaction content sequence and candidate content of the object to be recommended in the target scenario; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommended content; The content feature extraction unit is configured to perform feature extraction on the historical interaction content sequence and the candidate content through the global feature layer and the scene feature layer in the content recommendation model, respectively, to obtain scene features and global features of the historical interaction content and the candidate content; the scene features represent the features that affect the interaction between the object to be recommended and the candidate content in the target scene, and the global features represent the features that affect the interaction between the object to be recommended and the candidate content in multiple scenes; The encoding unit is configured to execute the global sequence encoder and the scene sequence encoder in the content recommendation model to encode the scene features and global features of the historical interaction content respectively, so as to obtain the scene sequence features and global sequence features of the historical interaction content sequence; the scene sequence features represent the transition features between content unique to the target scene, and the global sequence features represent the transition features between content that are present in the multiple recommendation scenes. The group feature extraction unit is configured to perform a comparison of the scene sequence features with the prototype features of multiple pre-determined group prototypes through the group prototype attention layer in the content recommendation model, to obtain the group similarity between the scene sequence features and the prototype features of each group prototype, and to perform a weighted average of the prototype features of each group prototype through the group similarity to obtain the group features of the object to be recommended. The recommendation index determination unit is configured to execute the information determination unit in the content recommendation model to process the group features, the scene sequence features, the global sequence features, and the scene features and global features of the candidate content to obtain the recommendation index information of the candidate content in the target scene. The recommendation unit is configured to determine target recommendation content for the object to be recommended from the candidate content based on the recommendation metric information.
10. A training device for a content recommendation model, characterized in that, The device includes: The sample acquisition unit is configured to acquire interaction information between a sample object and multiple sample contents in a target scenario; the multiple sample contents include target sample content and a sequence of historical sample content; the target scenario is any one of multiple recommendation scenarios, which are divided based on the association attribute information of the recommendation content; the interaction time between the target sample content and the sample object is later than the interaction time between the historical sample content and the sample object. The content feature extraction unit is configured to perform feature extraction on the target sample content and the historical sample content sequence through the global feature layer and scene feature layer in the content recommendation model to be trained corresponding to the target scene, respectively, to obtain scene features and global features of the historical sample content and the target sample content; the scene features represent the features that affect the interaction between the sample object and the sample content in the target scene, and the global features represent the features that affect the interaction between the sample object and the sample content in multiple scenes; The encoding unit is configured to encode the scene features and global features of the historical sample content using the global sequence encoder and scene sequence encoder in the content recommendation model to be trained, respectively, to obtain the scene sequence features and global sequence features of the historical sample content sequence; the scene sequence features represent the transition features between content unique to the target scene, and the global sequence features represent the transition features between content that are present in multiple recommendation scenes. The group feature extraction unit is configured to perform a comparison of the scene sequence features with the prototype features of multiple pre-determined group prototypes through the group prototype attention layer in the content recommendation model to be trained, to obtain the group similarity between the scene sequence features and the prototype features of each group prototype; and to obtain the group features of the sample object by weighted averaging the prototype features of each group prototype through the group similarity. The recommendation metric determination unit is configured to execute the information determination unit in the content recommendation model to be trained, and process the group features, the scene sequence features, the global sequence features, and the scene features and global features of the target sample content to obtain the recommendation metric information of the target sample content in the target scene. The model training unit is configured to train the content recommendation model to be trained based on the recommendation metric information and the interaction information between the sample object and the target sample content, so as to obtain the content recommendation model corresponding to the target scenario.
11. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the method as described in any one of claims 1 to 8.
13. A computer program product, the computer program product comprising instructions, characterized in that, When the instructions are executed by the processor of the electronic device, the electronic device is enabled to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Content recommendation method and device
CN110059261A
Content recommendation method and device, training method and device, equipment and storage medium
CN110162703A
Resources recommendation method and device
CN113886695A