Contextual information-based user modeling method and device, and contextual information-based prediction method and device

By introducing context information into user behavior sequence modeling and utilizing the context generation module and the generative transformer module, the problem of context information not being utilized in the existing technology is solved, and the accuracy and efficiency of modeling are improved.

CN118735629APending Publication Date: 2024-10-01DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410750210.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing technologies fail to effectively utilize contextual information of users' historical behaviors in user behavior sequence modeling, resulting in low accuracy of modeling results.

Method used

A user modeling method based on context information is adopted. Through the context generation module and the generative transformer module, the context embedding vector of the user behavior sequence is generated by combining user characteristics, target product characteristics and historical product characteristics, thereby improving the accuracy of modeling.

Benefits of technology

By introducing contextual information, the accuracy of user behavior sequence modeling is improved, allowing the model to better express user behavior and reducing the cost of obtaining contextual information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735629A_ABST
    Figure CN118735629A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a user modeling method based on context information and a prediction method and device thereof, and the method comprises the steps: obtaining multiple types of features in a sample, training a recommendation model through a training sample containing the multiple types of features, and enabling the recommendation model to comprise a context generation module and a prediction module, the target user behavior sequence generation module is used for generating a missing embedding vector of a second context for each historical product in the training sample, and generating a target user behavior sequence containing a complete context feature according to the embedding vector of the second context; the transformer is used for determining an embedding vector of a target product according to the target user behavior sequence; and the interaction prediction module is used for predicting the interaction probability of the target product according to the embedding vector of the target product. According to the method, the modeling result of the user behavior sequence is more accurate by introducing the context information of the product, the user behavior sequence can be better expressed by adopting the generative structure transformer module, and the performance of the recommendation model is integrally improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of product recommendation, and in particular to a user modeling method, a prediction method and a device thereof based on context information. Background Art

[0002] In scenarios such as advertising, recommendation, and search, user historical behavior sequences are used for sequence modeling. Sequence models can be used to train click-through rate (CTR) models or conversion rate (CVR) models.

[0003] Conventional sequence modeling generally uses the user's product-side features (including product ID and product attribute information, etc.) for modeling, without considering the contextual information corresponding to the user's historical behavior, resulting in low accuracy of the modeling results. Summary of the invention

[0004] The embodiments of the present application provide a user modeling method, a prediction method and a device thereof based on contextual information, which models the user behavior sequence according to the product characteristics and contextual characteristics of each product, so that the modeling result is more accurate. The transformer module obtained by modeling adopts a generative structure, and the output of the model is an estimated expression of the next product. This structure can better express the user behavior sequence.

[0005] In a first aspect, an embodiment of the present application provides a user modeling method based on context information, the method comprising:

[0006] Acquire multiple training samples, wherein the training samples include user features, features of a target product, features of multiple historical products, and label information of the target product, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context;

[0007] Using the plurality of training samples to train a recommendation model, the recommendation model includes a context generation module, a transformer module and an interaction prediction module;

[0008] The context generation module is used to generate an embedding vector of a second context of each of the historical products according to the user characteristics, the characteristics of the target product, and the characteristics of multiple historical products, and obtain a target user behavior sequence according to the characteristics of each of the historical products, the embedding vector of the second context, and the characteristics of the target product;

[0009] The transformer module is used to determine the embedding vector of the target product according to the target user behavior sequence;

[0010] The interaction prediction module is used to predict the interaction probability of the target product according to the embedding vector of the target product.

[0011] In some embodiments, the recommendation model further includes a factorization machine FM correlation model, a feature cross module and a connection module;

[0012] The FM related model is used to process the user features, the features of the target product, and the features of multiple historical products to obtain an FM feature vector;

[0013] The feature intersection module is used to perform feature intersection on the embedding vector of the target product and the feature of the target product to obtain a first intersection feature;

[0014] The connection module is used to concatenate the FM feature vector and the first cross feature to obtain a first feature vector, and input the first feature vector into the interaction prediction module.

[0015] In some embodiments, the recommendation model further includes an embedding layer and a second linear layer;

[0016] The embedding layer is used to process the user features, the features of the target product, and the features of multiple historical products to obtain an embedding vector of the total features;

[0017] The feature crossover module is further used to perform feature crossover on the embedding vector of the target product and the user feature to obtain a second crossover feature;

[0018] The connection module is further used to concatenate the embedding vector of the total feature and the second cross feature to obtain a second feature vector;

[0019] The second linear layer is used to process the second eigenvector to obtain a third eigenvector, and input the third eigenvector into the interaction prediction module.

[0020] In some embodiments, the recommendation model further includes a third linear layer, a loss module, and an update module:

[0021] The connection module is further used to concatenate the second cross feature, the embedding vector of the target product and the user feature to obtain a fourth feature vector;

[0022] The third linear layer is used to process the fourth eigenvector to obtain a first interactive prediction result;

[0023] The loss module is used to calculate a first loss according to the first interactive prediction result and the label information, and calculate a second loss according to the second interactive prediction result and the label information, wherein the second interactive prediction result is a result predicted by the interactive prediction module according to the first feature vector and the third feature vector;

[0024] The updating module is used to update the parameters of the recommendation model according to the first loss and the second loss.

[0025] In some embodiments, the context generation module is specifically used to: generate a predicted embedding vector of a second context of the target product by taking the user feature, the product feature of the target product, and the feature of the first context of the target product as input;

[0026] The loss module is further used to: calculate the reconstruction loss according to the predicted embedding vector of the second context of the target product and the features of the second context of the target product;

[0027] The updating module is further used to update the parameters of the context generation module according to the reconstruction loss;

[0028] The updated context generation module is used to: take the user features, the product features of each of the historical products and the features of the first context as input to generate an embedding vector of the second context of each of the historical products.

[0029] In some embodiments, the transformer module uses hidden unit contribution to learn the LHUC structure.

[0030] In some embodiments, the transformer module includes two cascaded processing units, each of which includes an attention module and a feedforward neural network FFN, and the FFN includes two cascaded LHUC layers, each of which is connected to a normalization layer.

[0031] In some embodiments, the attention module uses a causal masking method to perform information shielding.

[0032] In some embodiments, the recommendation model is a click rate model or a conversion rate model.

[0033] In some embodiments, the context generation module is a multi-layer perceptron.

[0034] In a second aspect, an embodiment of the present application provides a prediction method, comprising:

[0035] Obtaining a request to be predicted, the request to be predicted including user features, features of a target product, and features of a plurality of historical products, the features of the target product including product features and context features of the target product, the context features of the target product including features of a first context and features of a second context, and the features of the historical products including product features of the historical products and features of the first context;

[0036] The request to be predicted is input into the recommendation model obtained by modeling according to the method of the first aspect to obtain the predicted interaction probability of the target product.

[0037] In a third aspect, an embodiment of the present application provides a user modeling device based on context information, including:

[0038] an acquisition module, configured to acquire a plurality of training samples, wherein the training samples include user features, features of a target product, features of a plurality of historical products, and label information of the target product, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context;

[0039] A training module, used to train a recommendation model using a plurality of the training samples, wherein the recommendation model includes a context generation module, a transformer module and an interaction prediction module;

[0040] The context generation module is used to generate an embedding vector of a second context of each of the historical products according to the user characteristics, the characteristics of the target product, and the characteristics of multiple historical products, and obtain a target user behavior sequence according to the characteristics of each of the historical products, the embedding vector of the second context, and the characteristics of the target product;

[0041] The transformer module is used to determine the embedding vector of the target product according to the target user behavior sequence;

[0042] The interaction prediction module is used to predict the interaction probability of the target product according to the embedding vector of the target product.

[0043] In a fourth aspect, an embodiment of the present application provides a prediction device, including:

[0044] an acquisition module, configured to acquire a request to be predicted, wherein the request to be predicted includes user features, features of a target product, and features of multiple historical products, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context;

[0045] A prediction module is used to input the request to be predicted into the recommendation model obtained by modeling the device described in the third aspect to obtain the predicted interaction probability of the target product.

[0046] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method described in the first aspect or the second aspect above.

[0047] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program enables a computer to execute the method described in the first aspect or the second aspect above.

[0048] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or the second aspect above.

[0049] The user modeling method, prediction method and device based on context information provided in the embodiment of the present application introduce the context information of each product when using the transformer module to model the user behavior sequence, and model the user behavior sequence according to the product characteristics and context characteristics of each product, so that the modeling result is more accurate. The transformer module adopts a generative structure, and the output of the model is the estimated expression of the next product. This structure can better express the user behavior sequence. In addition, by modeling a context generation module, the context information of the user behavior sequence is obtained by generation, which makes the method of obtaining the context information of the user behavior sequence simpler and the acquisition cost lower. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 A flowchart of a user modeling method based on context information provided in Embodiment 1 of the present application;

[0052] Figure 2 Schematic diagram of the training and inference process of the context generation module;

[0053] Figure 3 A schematic diagram of a structure of a recommendation model provided in an embodiment of the present application;

[0054] Figure 4 A flowchart of a user modeling method based on context information provided in Embodiment 2 of the present application;

[0055] Figure 5 A schematic diagram of the structure of a transformer module applicable to an embodiment of the present application;

[0056] Figure 6 A flowchart of a prediction method provided in Example 3 of the present application;

[0057] Figure 7 A schematic diagram of the structure of a user modeling device based on context information provided in Embodiment 5 of the present application;

[0058] Figure 8 A schematic diagram of the structure of the prediction device provided in Example 5 of the present application;

[0059] Fig. 9 A structural schematic diagram of an electronic device provided in Example 6 of the present application. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0061] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0062] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0063] It is understood that before using the technical solutions disclosed in the embodiments of the present application, the type, scope of use, and usage scenarios of the personal information involved in the present application should be informed to the user and the user's authorization should be obtained in an appropriate manner according to relevant laws and regulations. For example, in response to receiving the user's active request, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present application according to the prompt message. As an optional but non-limiting implementation method, in response to receiving the user's active request, the method of sending the prompt message to the user can be, for example, a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understood that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation method of the present application. Other methods that meet relevant laws and regulations can also be applied to the implementation method of the present application. It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0064] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" refers to two or more than two, that is, at least two. "At least one" refers to one or more than one.

[0065] In the fields of recommendation, advertising or search, user behavior data is very rich. When a product (i.e., item) is exposed to users, users can generate various behaviors based on the item, such as clicking, playing, swiping away, liking, commenting, sharing, rewarding, repeating, exiting, etc. These behaviors imply the diverse interests of users and directly express the degree of user preference for the item. When a user repeatedly plays an item, the user is likely to be very interested in the current item. When a user swipes away an item, the user is likely to have no interest in the current item.

[0066] In addition to rich historical user behaviors, the behavioral data of different users vary greatly. The behavioral data of a single user changes over time. User behaviors have a temporal sequence. Which products (which can be advertisements, goods, articles) to recommend to users at a certain moment can generally be decided based on the user's behavior before the current moment. Therefore, user behavior sequence modeling applications are born.

[0067] User behavior sequence modeling is to model the user's behavior sequence through a sequence model to obtain the user's real-time interest vector, and then apply this information to the recall, sorting and other modules of the recommendation system to provide users with personalized services.

[0068] The transformer module is a commonly used user behavior sequence modeling module. In some modeling schemes, the product-side features of the user's historical behavior are usually used for modeling, that is, modeling is performed based on the product information in the user's historical behavior. The product information includes the product ID and product attribute information. The product attribute information includes but is not limited to the product category, product title, product label, etc. However, when performing sequence modeling, the product's context information is not considered.

[0069] In the embodiment of the present application, the context information of the product is used to characterize the environment in which the user is in when the consumption behavior (such as click or conversion) occurs. The consumption behavior is also called interactive behavior, which includes click behavior or conversion behavior. Click behavior refers to the user's click operation on the product, and conversion behavior refers to the user's behavior on the product that generates revenue after clicking on the product. Conversion behavior includes but is not limited to purchase, download, consumption, consultation, registration, authentication, etc. In the e-commerce scenario, the context information of the product can be the user's search information, the location information of the product, etc. The location information of the product can be the channel type where the product is located when the consumption behavior occurs, for example, whether the product is located in a live broadcast room, a store, or an advertisement. Search information includes search ID, search word segmentation information, search intent, etc.

[0070] The conventional modeling idea is to add the context information of each product to the training samples and use the training samples containing the product's context information for training. However, in this scheme, since there are many products in the training samples and each product has a context information, the cost of processing the product's context information is high.

[0071] To this end, the embodiment of the present application provides a user modeling method based on context information, which models a context generation module, generates a context embedding vector of a product through the context generation module, and forms a new user behavior sequence with the context embedding vector of the product and the product information, and then models the user behavior sequence containing the context embedding vector through a generative transformer module to obtain an estimated result of the target product (i.e., the embedding vector of the target product). The user modeling method can be applied in the fields of advertising, e-commerce recommendation, etc.

[0072] The technical solution of the present application is described in detail below through some embodiments. The embodiments described below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0073] Figure 1 This is a flowchart of a user modeling method based on context information provided in the first embodiment of the present application. The method of this embodiment can be executed by a training device, which can be a terminal or a server. The terminal device can be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, an intelligent voice interaction device, and a wearable device, etc. The server can be a server cluster or a single server, and the server can be a cloud server, etc. Figure 1 As shown, the method provided in this embodiment includes the following steps:

[0074] S101. Acquire multiple training samples, where the training samples include user features, features of a target product, features of multiple historical products, and label information of the target product. The features of the target product include product features and context features of the target product. The context features of the target product include features of a first context and features of a second context. The features of historical products include product features of historical products and features of a first context.

[0075] The training device obtains multiple training samples, which constitute a training data set, and the training data set is used to train the recommendation model. Batch training can be adopted, wherein the number of training data in a batch can be flexibly adjusted according to actual training needs, such as 200, 256 or other numbers. The training data set includes training samples of multiple users.

[0076] Each training sample includes multiple types of features, which may be user features, target product features, features of multiple historical products, and label information of the target product, etc. User features are used to represent basic information of the user, which includes but is not limited to user ID, user portrait information, etc.

[0077] The target item refers to the product that needs to be predicted currently, or the product that needs to be predicted this time. The historical product is relative to the target product. The historical product refers to the product that the user has clicked or converted before the target product.

[0078] The product features of a product are used to characterize the product information of the product. The product information includes the product ID, product attribute information, product interaction time, product brand and product price, etc. The product attribute information includes but is not limited to the product category, product title, etc. It can be understood that different types of products have different information.

[0079] In the embodiment of the present application, the recommendation model can be applied in the fields of advertisement recommendation, e-commerce recommendation, etc. In different fields, the product types are different and the product information is different.

[0080] When the product is a commodity, the commodity information includes the commodity ID, commodity title, the name of the store to which the commodity belongs, the store ID, the commodity category, the price, etc. The commodity category can be multi-level categories. For example, common commodities include three levels of categories, namely: first-level category, second-level category and third-level category. The third-level category is the most detailed category.

[0081] When the product is multimedia data, taking video as an example, the video information may include: video ID, resource address, video type (such as short video, TV series or movie, etc.), name, duration, creator information, release time, click volume, keywords, names of main actors, plot summary and other information. The creator information may be the creator's name, account or ID. Taking music as an example, the music information may include: song ID, song name, singer's ID, name of the album to which the song belongs, lyrics, music style, etc. The singer's ID may be the singer's name or a number corresponding to the singer's name.

[0082] When the product is an advertisement, the advertisement information may include: advertisement ID, advertisement type, creator information, advertiser information, etc.

[0083] The contextual features of a product are used to characterize the information of the scene in which the product is located. The contextual features of a product may include features of multiple contextual information. For example, the contextual information of a product includes: search (query) information, product location information, product popularity information, etc. Among them, the search information includes the search ID (i.e., query ID), search terms, word segmentation information of search terms, search intent, etc. The location information of a product can be called the channel information of the product. For example, the location information of a product is: the product is located in a live broadcast room, the product is located in a store, or the product is located in an advertisement.

[0084] The training device can obtain the complete context features of the target product, but for historical products, it is costly to obtain the complete context features and it is difficult to obtain the complete context features. Therefore, only partial context features of the historical products are obtained. In this embodiment, the partial context features of the historical products are referred to as the features of the first context, and the complete context features include the features of the first context and the features of the second context, and the features of the second context are the missing context features of the historical products.

[0085] Exemplarily, assuming that the complete context features include features of search information and features of product location information, the features of product location information can be used as features of the first context, and the features of product location information can be used as features of the second context. Alternatively, part of the product's search information can be used as features of the first context, and the features of the remaining search information and the features of the location information of the product can be used as features of the second context. For example, the features of the product's query ID can be used as features of the first context, and the features of the segmentation information of the product's search terms and the features of the location information can be used as features of the second context.

[0086] The label information (label) of the target product is used to indicate whether the user has interacted with the target product. The interactive behavior can be a click behavior or a conversion behavior. The label information is related to the recommendation model. When the recommendation model is a click-through-rate (CTR) prediction model, the CTR prediction model is used to predict the probability of the user clicking on the target product, and the label information of the target product is used to indicate whether the user has clicked on the target product. When the recommendation model is a conversion rate (CVR) prediction model, the CVR prediction model is used to predict the probability of the user converting to the target product, and the label information of the target product is used to indicate whether the user has converted to the target product.

[0087] S102: Use multiple training samples to train a recommendation model, wherein the recommendation model includes a context generation module, a transformer module, and an interaction prediction module.

[0088] The context generation module is used to generate an embedding vector of a second context of each historical product according to user features, features of a target product, and features of multiple historical products. The embedding vector of the second context of a historical product is a context feature missing from the historical product.

[0089] The context generation module can adopt a feedforward neural network model, which is the simplest neural network. Each neuron is arranged in layers, and each neuron is only connected to the neurons in the previous layer. It receives the output of the previous layer and outputs it to the next layer, and there is no feedback between the layers.

[0090] Exemplarily, the context generation module uses a multi-layer perceptron (MLP). MLP is a feed-forward neural network model, and its structure includes an input layer, one or more hidden layers, and an output layer.

[0091] The learning process of MLP is carried out through the back-propagation algorithm. During the training process, the model first receives input data, and then the data passes through each layer of nodes through forward propagation, and finally obtains the output. Then, the output is compared with the true label and the loss function is calculated. Next, the gradient of the loss function is back-propagated from the output layer to the input layer through the back-propagation algorithm to update the weights and biases of the nodes in each layer. This process is repeated until the performance of the model on the validation set reaches the preset stopping criteria.

[0092] The generation idea of ​​the context generation module can be explained by the following example: Assume that the context features of the target product are divided into two parts: targetA and targetB, and the context features of the historical product are divided into two parts: seqA and seqB. A represents the context features of both the target product and the historical product, that is, the features of the first context, and B represents the context features that only exist in the target product, that is, the features of the second context. We expect to get all the features of A and B, of which only the seqB part is unknown, that is, seqB is the part that needs to be estimated.

[0093] To this end, it is necessary to model a context generation module. Assuming that the context generation module is represented by f, the parameters of the context generation module can be trained by targetB=f(targetA), and then seqB can be predicted by seqB=f(seqA).

[0094] Figure 2 A schematic diagram of the training process and inference process of the context generation module is shown in Figure 2As shown, during the training process, user features, product features of the target product, and features of the first context of the target product are used as inputs to the context generation module to generate a predicted embedding vector of the second context of the target product, that is, the predicted embedding vector of the second context of the target product is the output of the context generation module.

[0095] The recommendation model also includes a loss module and an update module, wherein the loss module is used to calculate the reconstruction loss based on the predicted embedding vector of the second context of the target product and the feature of the second context of the target product, wherein the feature of the second context of the target product is a label. The update module is used to update the parameters of the context generation module according to the reconstruction loss, and the parameters of the updated context generation module are shared with the reasoning process. The reconstruction loss can use mean square error (MSE) or other loss functions, which is not limited in this embodiment.

[0096] During the inference process, the updated context generation module is used to generate a predicted embedding vector of the second context of each historical product by taking user features, product features of each historical product and features of the first context as input.

[0097] Taking the search scenario as an example, the search-related information in the search scenario is a good context information. The search information (including query ID, word segmentation information, etc.) and location information, title information and other information can be used as the target of generating context features. The specific implementation is as follows:

[0098] When modeling the context generation module, use the context features that are common to both the target product and the historical product as the input of the context generation module, such as user information, product information of the target product, and partial search information; use the context features that are only available to the target product as the output of the context generation module, such as partial search information and location information. Then calculate the MSE as the reconstruction loss and train the context generation module. During inference, for each historical product in the historical sequence, take the user information and partial search information of the historical product as input, and pass through the context generation module to generate a user behavior sequence containing complete context information for modeling in the next transformer module.

[0099] According to the features of each historical product, the embedding vector of the second context and the features of the target product, the target user behavior sequence is obtained. In the target user behavior sequence, the target product and each historical product contain complete context features, that is, they both contain the features of the first context and the features of the second context. The target user behavior sequence is used as the input of the transformer module.

[0100] The target user behavior sequence may be a binary sequence, and the binary may be represented as (product feature, context feature), wherein the product includes multiple historical products, and the context feature in the binary includes a feature of a first context and a feature of a second context. The number of historical products in the target user behavior sequence is multiple, for example, 50, 100, or 200.

[0101] The transformer module is used to determine the embedding vector of the target product based on the target user behavior sequence. When modeling the transformer module, the prior art usually adopts a transformer module with a structure similar to bidirectional encoder representations from transformers (BERT), and the output of the transformer module of this structure is the expression of the user behavior sequence, that is, the embedding vector (embedding) of the user behavior sequence. The transformer module used in the embodiment of the present application is a generative transformer module, and the output of the generative transformer module is the estimated expression of the next product (i.e., the target product), and the estimated expression of the next product can be the embedding vector of the next product.

[0102] The generative transformer module models the target user behavior sequence containing the contextual features of the product and outputs the embedding vector of the target product. Therefore, the generative transformer module is also called a causal transformer.

[0103] The interaction prediction module is the main model of the recommendation model. The interaction prediction module is used to predict the interaction probability of the target product based on the embedding vector of the target product.

[0104] It can be understood that the interaction prediction module also includes other inputs, and the embedding vector of the target product can be combined with the interaction prediction module or act on the interaction prediction module in a variety of ways. For example, the embedding vector of the target product is input into the interaction prediction module after performing feature crossover, splicing and other operations with other inputs of the interaction prediction module. Since the embedding vector of the target product is predicted based on the product features and context features of each historical product in the historical user behavior sequence, the embedding vector of the target product is more accurate, thereby improving the model performance.

[0105] The recommendation model can be a CTR prediction model or a CVR prediction model, etc. When the recommendation model is a CTR prediction model, the prediction result of the interaction prediction module is the estimated click probability of the target product. When the recommendation model is a CVR prediction model, the prediction result of the interaction prediction module is the estimated conversion probability of the target product.

[0106] During the user modeling process, the model loss is calculated based on the estimated results of the interaction prediction module and the label information of the target product in the training sample, and the parameters of the recommendation model are updated based on the model loss, including updating the parameters of the transformer module and the interaction prediction module.

[0107] In this embodiment, when using the transformer module to model the user behavior sequence, the context information of each product is introduced, and the user behavior sequence is modeled according to the product characteristics and context characteristics of each product, so that the modeling result is more accurate and sufficient. The transformer module adopts a generative structure, and the output of the model is the estimated expression of the next product. This structure can better express the user behavior sequence. In addition, by modeling a context generation module, the context information of the user behavior sequence is obtained by generation, which makes the method of obtaining the context information of the user behavior sequence simpler and the acquisition cost lower.

[0108] Embodiment 2 of the present application provides a user modeling method based on contextual information, which is used to explain in detail the combination of the embedding vector of the target product generated by the transformer module and the interaction prediction module. Figure 3 A schematic diagram of a structure of a recommendation model provided in an embodiment of the present application, Figure 4 This is a flowchart of a user modeling method based on context information provided in Example 2 of the present application, referring to Figure 3 and Figure 4 As shown, the method provided in this embodiment includes the following steps.

[0109] S201. Acquire multiple training samples, where the training samples include user features, features of a target product, features of multiple historical products, and label information of the target product.

[0110] S202, the context generation module generates an embedding vector of a second context of each historical product according to user characteristics, characteristics of the target product, and characteristics of multiple historical products, and obtains a target user behavior sequence according to the characteristics of each historical product, the embedding vector of the second context, and the characteristics of the target product.

[0111] S203, the transformer module determines the embedding vector of the target product according to the target user behavior sequence.

[0112] The specific implementation of steps S201-S203 refers to the relevant description of the first embodiment and will not be repeated here.

[0113] The transformer module usually includes one or more processing units, which include an attention module and a feed forward neural network (FFN). The FFN usually uses two linear layers. When multiple layers of FFN are stacked, it has the approximate ability of a deep neural network. In fact, a two-layer FFN has a strong fitting ability.

[0114] Optionally, the transformer module can adopt the Learning Hidden Unit Contributions (LHUC) structure. LHUC is mainly used to optimize the personalized performance of the model. The core idea of ​​LHUC is to introduce learnable weight factors after the hidden layer of the neural network. These weight factors are called "contributions". These contributions can adjust the output of each hidden unit, so that the model can dynamically adjust its internal representation according to different input data or task requirements, thereby improving the accuracy of prediction and classification.

[0115] In the recommendation system, it is usually necessary to process a large number of user features and product features, and predict the products that the user may be interested in based on the user's historical behavior and other information. The LHUC structure can help the recommendation system learn each user's preference for different features, thereby providing users with more personalized recommendations. In this embodiment, LHUC can be used instead of the linear layer of FFN to introduce interaction with user features.

[0116] Figure 5 A schematic diagram of the structure of a transformer module applicable to the embodiment of the present application is shown in FIG. Figure 5 As shown, the transformer module includes two cascaded processing units, each processing unit includes an attention module and a FFN, the FNN includes two cascaded LHUC layers, and each LHUC layer is connected to a normalization layer (LayerNormalization, LN).

[0117] Optionally, the transformer module may further include more or fewer processing units, for example, only one processing unit, or three processing units. The number of processing units included in the transformer module needs to take into account the performance requirements and model complexity of the model.

[0118] The attention module can adopt a self-attention mechanism, which is an attention mechanism that associates different positions of a single sequence to calculate the representation of the same sequence.

[0119] In this embodiment, the attention module uses a causal mask to shield information. CausalMask is mainly used to limit the visual range of the model to prevent the model from seeing future data. In the specific implementation, CausalMask can set all future tokens to zero, shielding these tokens from the attention mechanism, so that the model can only focus on past and current tokens when making predictions.

[0120] Reference Figure 5 As shown, from the matrix point of view, the causal mask is similar to an inverted triangle, with the lower half being 1 and the upper half (i.e., the gray area) being 0.

[0121] S204, the feature cross module performs feature cross-talk on the embedding vector of the target product and the feature of the target product to obtain a first cross feature, the connection module concatenates the FM feature vector and the first cross feature to obtain a first feature vector, and the first feature vector is input into the interactive prediction module.

[0122] Reference Figure 3 As shown, in this embodiment, the recommendation model includes a factor machine (FM) related model, a feature cross module and a connection module in addition to a context generation module, a transformer module and an interaction prediction module.

[0123] The FM related model is used to process user features, target product features, and features of multiple historical products to obtain FM feature vectors.

[0124] The FM-related model may be any model in the FM family model, and the FM family model includes the FM model, the FNN model, the NFM model, the AFM model or the DeepFM, etc. Among them, the FNN model, the NFM model, the AFM model or the DeepFM is evolved from the FM.

[0125] The FM model represents each feature by decomposing the feature vector into a low-dimensional factor vector, and models the interaction between features by calculating the inner product between two factor vectors, thereby realizing the automatic crossover of features between two features and learning the weights of crossover features through the inner product of the feature latent vector.

[0126] In one implementation, the FM correlation model performs feature crossover on the target product's features and user's features, and crossover on the target product's features and historical product-side features, wherein the historical product-side features can be understood as embeddings of the features of the multiple historical products.

[0127] The connection module can use the concat function to concatenate the FM feature vector and the first cross feature.

[0128] Optionally, the recommendation model further includes a fourth linear layer, which is used to process the features of the target product before feature crossover to obtain a first feature of the target product. Accordingly, the feature crossover module is used to perform feature crossover on the embedding vector of the target product and the first feature of the target product to obtain a first crossover feature.

[0129] The linear layer is the basic layer structure in deep learning and neural networks, also known as the fully connected layer. Its main function is to perform linear transformation on the input data. It contains a weight matrix and a bias term, and maps the input data to the output data through matrix multiplication and addition operations.

[0130] S205, the feature cross module performs feature cross-feature on the embedding vector of the target product and the user feature to obtain a second cross feature, the connection module concatenates the embedding vector of the total feature and the second cross feature to obtain a second feature vector, the second linear layer processes the second feature vector to obtain a third feature vector, and the third feature vector is input into the interactive prediction module.

[0131] Reference Figure 3 As shown, the recommendation model also includes an embedding layer and a second linear layer. The embedding layer is used to process user features, target product features, and features of multiple historical products to obtain an embedding vector of the total features (also called all embedding).

[0132] The feature crossover module is also used to perform feature crossover on the embedding vector of the target product and the user feature to obtain a second crossover feature. Optionally, the recommendation model also includes a first linear layer, which is used to process the user feature to obtain a first user feature before the feature crossover. Accordingly, the feature crossover module is used to perform feature crossover on the embedding vector of the target product and the first user feature to obtain a second crossover feature.

[0133] The connection module can use the concat function to concatenate the embedding vector of the total feature and the second cross feature.

[0134] S206, the connection module concatenates the second cross feature, the embedding vector of the target product and the user feature to obtain a fourth feature vector, and the third linear layer processes the fourth feature vector to obtain a first interactive prediction result.

[0135] Reference Figure 3 As shown, the recommendation model also includes a third linear layer, a loss module and an update module. The connection module can concatenate the second cross feature, the embedding vector of the target product and the user feature through the concat function to obtain the fourth feature vector.

[0136] Figure 3 The FM-related model and the embedding layer are existing modules in the recommendation model. Although there is a transformer module in the existing recommendation model, the structure of the transformer module is different from the structure of the transformer module provided in this application. It can be understood that Figure 3 It is just a schematic diagram. The recommendation model may also include other more modules. The embodiment of the present application only shows the modules related to the present invention.

[0137] If the user feature is processed by the first linear layer, optionally, the connection module concatenates the second cross feature, the embedding vector of the target product and the first user feature to obtain a fourth feature vector.

[0138] S207. The interaction prediction module performs prediction based on the first eigenvector and the third eigenvector to obtain the interaction probability of the target product.

[0139] The interaction prediction module takes the first eigenvector and the third eigenvector as inputs to predict the interaction probability of the target product. It can be understood that the first eigenvector and the second eigenvector are two new inputs added to this application, which are the result of the embedding vector of the target product generated by the transformer module acting on the main model, and the interaction prediction module also includes some other inputs. For example, the input of the interaction prediction module also includes: FM feature vector, embedding vector of total features, output of Deep Interest Network (DIN), and output of various features in the training sample after passing through the linear layer, etc.

[0140] S208. The loss module calculates a first loss according to the first interaction prediction result and the label information, and calculates a second loss according to the second interaction prediction result and the label information.

[0141] In this embodiment, the loss module calculates the first loss based on the first interaction prediction result and label information. The first loss is an auxiliary loss, which is used to assist the recommendation model in updating parameters. The second predicted interaction result is the result predicted by the interaction prediction module based on the first eigenvector and the third eigenvector. The second loss is calculated based on the second interaction prediction result and label information. The second loss is the main loss.

[0142] The first loss or the second loss may be a cross entropy (CE) loss, or may be an MSE loss, a mean absolute error (MAE) loss, a focal loss, a relative entropy or an exponential loss, etc.

[0143] S209: The updating module updates the parameters of the recommendation model according to the first loss and the second loss.

[0144] In this embodiment, the embedding vector of the target product is applied to the interactive prediction module in the above three ways, namely, way 1 described in step S204, way 2 described in step S205, and way 3 described in step S206. It should be noted that in other embodiments of the present application, any one or any two of the above three ways may also be applied to the interactive prediction module.

[0145] For example, if only method 1 is used on the interaction prediction module, the input of the interaction prediction module includes the first eigenvector but does not include the third eigenvector. The interaction prediction module predicts the interaction probability of the target product based on the first eigenvector and other inputs, calculates the second loss based on the prediction result and the label, and updates the recommendation model based on the second loss.

[0146] For another example, if only method 2 is used on the interaction prediction module, the input of the interaction prediction module includes the third eigenvector but not the first eigenvector. The interaction prediction module predicts the interaction probability of the target product based on the third eigenvector and other inputs, calculates the second loss based on the prediction result and the label, and updates the recommendation model based on the second loss.

[0147] For another example, only method one and method three are used to act on the interactive prediction module, then the input of the interactive prediction module includes the first eigenvector, but does not include the third eigenvector. The interactive prediction module obtains a second interactive prediction result based on the first eigenvector and other input predictions, calculates the second loss based on the second interactive prediction result and the label, obtains the first interactive prediction result based on step S206, calculates the first loss based on the first interactive prediction result and the label, and updates the recommendation model based on the first loss and the second loss.

[0148] In this embodiment, the embedding vector of the target product and the features of the target product are cross-featured to obtain a first cross-feature, the FM feature vector and the first cross-feature are concatenated to obtain a first feature vector, and the first feature vector is input into the interactive prediction module. The embedding vector of the target product and the user features are cross-featured to obtain a second cross-feature, the embedding vector of the total features and the second cross-feature are concatenated to obtain a second feature vector, the second feature vector is processed to obtain a third feature vector, and the third feature vector is input into the interactive prediction module. The second cross-feature, the embedding vector of the target product and the user features are concatenated to obtain a fourth feature vector, the fourth feature vector is linearly processed to obtain a first interactive prediction result, the first loss is calculated based on the first interactive prediction result and the label information, and the first loss is used to assist in model updating. The embedding vector of the target product is applied to the interactive prediction module in the above three ways, so that the prediction result of the recommendation model obtained by modeling is more accurate.

[0149] After a detailed introduction to the training process of the recommendation model, the third embodiment of the present application describes the application of the recommendation model. The recommendation model can be applied in scenarios such as advertising delivery, product recommendation / search, and multimedia data recommendation / search. Figure 6 A flowchart of a prediction method provided in Example 3 of the present application is shown in FIG. Figure 6 As shown, the method may include the following steps:

[0150] S301. Obtain a request to be predicted, where the request to be predicted includes user features, features of a target product, and features of multiple historical products. The features of the target product include product features and context features of the target product. The context features of the target product include features of a first context and features of a second context. The features of the historical product include product features of the historical product and features of the first context.

[0151] The prediction request can be triggered by the user, for example, when the user is browsing the product, the prediction request is generated in response to the user's browsing operation, or in response to the user's search request, or it can be automatically triggered by the product APP. The prediction request is consistent with the content of the training sample, except that the prediction request does not include the label information of the target product.

[0152] S302: Input the request to be predicted into the recommendation model to obtain the predicted interaction probability of the target product. The recommendation model includes a context generation module, a transformer module and an interaction prediction module.

[0153] The context generation module is used to generate an embedding vector of the second context of each historical product based on user characteristics, characteristics of the target product, and characteristics of multiple historical products, and obtain a target user behavior sequence based on the characteristics of each historical product, the embedding vector of the second context, and the characteristics of the target product.

[0154] The transformer module is used to determine the embedding vector of the target product based on the target user behavior sequence. The interaction prediction module is used to predict the interaction probability of the target product based on the embedding vector of the target product.

[0155] The recommendation model of this embodiment is a recommendation model modeled by the method described in the above embodiment 1 or embodiment 2. The interaction probability of the target product predicted by the recommendation model takes into account the context information of the target product, making the prediction result more accurate.

[0156] In order to better implement the user modeling method based on context information of the embodiment of the present application, the embodiment of the present application also provides a user modeling device based on context information. Figure 7 This is a schematic diagram of the structure of a user modeling device based on context information provided in Embodiment 5 of the present application, such as Figure 7 As shown, the user modeling device 100 based on context information may include:

[0157] An acquisition module 11 is used to acquire multiple training samples, wherein the training samples include user features, features of a target product, features of multiple historical products, and label information of the target product, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context;

[0158] A training module 12, used to train a recommendation model using a plurality of the training samples, wherein the recommendation model includes a context generation module, a transformer module and an interaction prediction module;

[0159] The context generation module is used to generate an embedding vector of a second context of each of the historical products according to the user characteristics, the characteristics of the target product, and the characteristics of multiple historical products, and obtain a target user behavior sequence according to the characteristics of each of the historical products, the embedding vector of the second context, and the characteristics of the target product;

[0160] The transformer module is used to determine the embedding vector of the target product according to the target user behavior sequence;

[0161] The interaction prediction module is used to predict the interaction probability of the target product according to the embedding vector of the target product.

[0162] In some implementations, the recommendation model further includes a factorization machine FM related model, a feature cross module and a connection module;

[0163] The FM related model is used to process the user features, the features of the target product, and the features of multiple historical products to obtain an FM feature vector;

[0164] The feature intersection module is used to perform feature intersection on the embedding vector of the target product and the feature of the target product to obtain a first intersection feature;

[0165] The connection module is used to concatenate the FM feature vector and the first cross feature to obtain a first feature vector, and input the first feature vector into the interaction prediction module.

[0166] In some implementations, the recommendation model further includes an embedding layer and a second linear layer;

[0167] The embedding layer is used to process the user features, the features of the target product, and the features of multiple historical products to obtain an embedding vector of the total features;

[0168] The feature crossover module is further used to perform feature crossover on the embedding vector of the target product and the user feature to obtain a second crossover feature;

[0169] The connection module is further used to concatenate the embedding vector of the total feature and the second cross feature to obtain a second feature vector;

[0170] The second linear layer is used to process the second eigenvector to obtain a third eigenvector, and input the third eigenvector into the interaction prediction module.

[0171] In some implementations, the recommendation model further includes a third linear layer, a loss module, and an update module:

[0172] The connection module is further used to concatenate the second cross feature, the embedding vector of the target product and the user feature to obtain a fourth feature vector;

[0173] The third linear layer is used to process the fourth eigenvector to obtain a first interactive prediction result;

[0174] The loss module is used to calculate a first loss according to the first interactive prediction result and the label information, and calculate a second loss according to the second interactive prediction result and the label information, wherein the second interactive prediction result is a result predicted by the interactive prediction module according to the first feature vector and the third feature vector;

[0175] The updating module is used to update the parameters of the recommendation model according to the first loss and the second loss.

[0176] In some implementations, the context generation module is specifically used to: generate a predicted embedding vector of a second context of the target product using the user feature, the product feature of the target product, and the feature of the first context of the target product as input;

[0177] The loss module is further used to: calculate the reconstruction loss according to the predicted embedding vector of the second context of the target product and the features of the second context of the target product;

[0178] The updating module is further used to update the parameters of the context generation module according to the reconstruction loss;

[0179] The updated context generation module is used to: take the user features, the product features of each of the historical products and the features of the first context as input to generate an embedding vector of the second context of each of the historical products.

[0180] In some implementations, the transformer module uses hidden unit contribution to learn the LHUC structure.

[0181] In some implementations, the transformer module includes two cascaded processing units, each of which includes an attention module and a feed-forward neural network FFN, and the FFN includes two cascaded LHUC layers, each of which is connected to a normalization layer.

[0182] In some implementations, the attention module uses a causal masking approach to perform information shielding.

[0183] In some implementations, the recommendation model is a click rate model or a conversion rate model.

[0184] In some implementations, the context generation module is a multi-layer perceptron.

[0185] The device of this embodiment can be used to execute the method described in the above-mentioned embodiment 1 or embodiment 2. The specific implementation method refers to the description of the method embodiment, which will not be repeated here.

[0186] Figure 8This is a schematic diagram of the structure of the prediction device provided in Example 5 of the present application, such as Figure 8 As shown, the prediction device 200 may include:

[0187] An acquisition module 21 is used to acquire a request to be predicted, wherein the request to be predicted includes a user feature, a feature of a target product, and features of multiple historical products, wherein the feature of the target product includes a product feature and a context feature of the target product, wherein the context feature of the target product includes a feature of a first context and a feature of a second context, and wherein the feature of the historical product includes a product feature of the historical product and a feature of the first context;

[0188] The prediction module 22 is used to input the request to be predicted into the recommendation model obtained by the device modeling described in Example 4 to obtain the predicted interaction probability of the target product.

[0189] The device of this embodiment can be used to execute the prediction method provided in the above-mentioned embodiment 3. The specific implementation method refers to the description of the method embodiment, which will not be repeated here.

[0190] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here.

[0191] The above describes the apparatus 100, 200 of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0192] An embodiment of the present application also provides an electronic device. Fig. 9 A structural diagram of an electronic device provided in Embodiment 6 of the present application, such as Fig. 9 As shown, the electronic device 300 may include:

[0193] The memory 31 and the processor 32, the memory 31 is used to store the computer program and transmit the program code to the processor 32. In other words, the processor 32 can call and run the computer program from the memory 31 to implement the user modeling method or prediction method based on context information provided in the embodiment of the present application.

[0194] For example, the processor 32 may be configured to execute the user modeling method or prediction method based on context information provided by the above method embodiment according to the instructions in the computer program.

[0195] In some embodiments of the present application, the processor 32 may include but is not limited to: a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0196] In some embodiments of the present application, the memory 31 includes, but is not limited to, volatile memory and / or non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (Direct Rambus RAM, DR RAM).

[0197] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 31 and executed by the processor 32 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0198] like Fig. 9 As shown, the electronic device 300 may further include: a transceiver 33 , which may be connected to the processor 32 or the memory 31 .

[0199] The processor 32 may control the transceiver 33 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include an antenna, and the number of antennas may be one or more.

[0200] Understandable, although Fig. 9 Not shown, the electronic device 300 may also include a camera module, a wireless fidelity WIFI module, a positioning module, a Bluetooth module, a display, a power module, etc., which will not be repeated here.

[0201] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0202] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer performs the user modeling method or search method for eliminating deviations provided in the above method embodiment.

[0203] The present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the corresponding process of the user modeling method and the search method for eliminating deviations provided in the method embodiment, which will not be repeated here for the sake of brevity.

[0204] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0205] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0206] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A user modeling method based on context information, characterized in that: include: Acquire multiple training samples, wherein the training samples include user features, features of a target product, features of multiple historical products, and label information of the target product, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context; Using the plurality of training samples to train a recommendation model, the recommendation model includes a context generation module, a transformer module and an interaction prediction module; The context generation module is used to generate an embedding vector of a second context of each of the historical products according to the user characteristics, the characteristics of the target product, and the characteristics of multiple historical products, and obtain a target user behavior sequence according to the characteristics of each of the historical products, the embedding vector of the second context, and the characteristics of the target product; The transformer module is used to determine the embedding vector of the target product according to the target user behavior sequence; The interaction prediction module is used to predict the interaction probability of the target product according to the embedding vector of the target product.

2. The method according to claim 1, characterized in that The recommendation model also includes a factorization machine FM related model, a feature cross module and a connection module; The FM related model is used to process the user features, the features of the target product, and the features of multiple historical products to obtain an FM feature vector; The feature intersection module is used to perform feature intersection on the embedding vector of the target product and the feature of the target product to obtain a first intersection feature; The connection module is used to concatenate the FM feature vector and the first cross feature to obtain a first feature vector, and input the first feature vector into the interaction prediction module.

3. The method according to claim 2, characterized in that The recommendation model also includes an embedding layer and a second linear layer; The embedding layer is used to process the user features, the features of the target product, and the features of multiple historical products to obtain an embedding vector of the total features; The feature crossover module is further used to perform feature crossover on the embedding vector of the target product and the user feature to obtain a second crossover feature; The connection module is further used to concatenate the embedding vector of the total feature and the second cross feature to obtain a second feature vector; The second linear layer is used to process the second eigenvector to obtain a third eigenvector, and input the third eigenvector into the interaction prediction module.

4. The method according to claim 3, characterized in that The recommendation model also includes a third linear layer, a loss module and an update module: The connection module is further used to concatenate the second cross feature, the embedding vector of the target product and the user feature to obtain a fourth feature vector; The third linear layer is used to process the fourth eigenvector to obtain a first interactive prediction result; The loss module is used to calculate a first loss according to the first interactive prediction result and the label information, and calculate a second loss according to the second interactive prediction result and the label information, wherein the second interactive prediction result is a result predicted by the interactive prediction module according to the first feature vector and the third feature vector; The updating module is used to update the parameters of the recommendation model according to the first loss and the second loss.

5. The method according to claim 4, characterized in that The context generation module is specifically used to: take the user features, the product features of the target product and the features of the first context of the target product as input to generate a predicted embedding vector of the second context of the target product; The loss module is further used to: calculate a reconstruction loss based on the predicted embedding vector of the second context of the target product and the features of the second context of the target product; The updating module is further used to update the parameters of the context generation module according to the reconstruction loss; The updated context generation module is used to: take the user features, the product features of each of the historical products and the features of the first context as input to generate an embedding vector of the second context of each of the historical products.

6. The method according to any one of claims 1 to 5, characterized in that The transformer module uses hidden unit contribution to learn the LHUC structure.

7. The method according to claim 6, characterized in that The transformer module includes two cascaded processing units, each of which includes an attention module and a feedforward neural network FFN, and the FFN includes two cascaded LHUC layers, each of which is connected to a normalization layer.

8. The method according to claim 7, characterized in that The attention module uses a causal masking method to shield information.

9. The method according to any one of claims 1 to 5, characterized in that The recommendation model is a click rate model or a conversion rate model.

10. The method according to any one of claims 1 to 5, characterized in that The context generation module is a multi-layer perceptron.

11. A prediction method, characterized in that: include: Obtaining a request to be predicted, the request to be predicted including user features, features of a target product, and features of a plurality of historical products, the features of the target product including product features and context features of the target product, the context features of the target product including features of a first context and features of a second context, and the features of the historical products including product features of the historical products and features of the first context; The request to be predicted is input into the recommendation model obtained by modeling according to the method described in any one of claims 1 to 10 to obtain the predicted interaction probability of the target product.

12. A user modeling device based on context information, characterized in that: include: an acquisition module, configured to acquire a plurality of training samples, wherein the training samples include user features, features of a target product, features of a plurality of historical products, and label information of the target product, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context; A training module, used to train a recommendation model using a plurality of the training samples, wherein the recommendation model includes a context generation module, a transformer module and an interaction prediction module; The context generation module is used to generate an embedding vector of a second context of each of the historical products according to the user characteristics, the characteristics of the target product, and the characteristics of multiple historical products, and obtain a target user behavior sequence according to the characteristics of each of the historical products, the embedding vector of the second context, and the characteristics of the target product; The transformer module is used to determine the embedding vector of the target product according to the target user behavior sequence; The interaction prediction module is used to predict the interaction probability of the target product according to the embedding vector of the target product.

13. A prediction device, characterized in that: include: an acquisition module, configured to acquire a request to be predicted, wherein the request to be predicted includes user features, features of a target product, and features of multiple historical products, wherein the features of the target product include product features and context features of the target product, wherein the context features of the target product include features of a first context and features of a second context, and wherein the features of the historical products include product features of the historical products and features of the first context; A prediction module is used to input the request to be predicted into the recommendation model obtained by modeling the device according to claim 12 to obtain the predicted interaction probability of the target product.

14. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 11.

15. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 11.