Recommendation model training method, management and control product recommendation method and device
By combining comparative learning and multi-task learning, the recommended models in the field of Internet finance are optimized and trained, which solves the problem of insufficient accuracy and robustness of existing models in risk management and achieves more accurate and reliable management and control products recommend.
Patent Information
- Application Number
- CN202411218327.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-31
AI Technical Summary
The existing recommendation models in the field of Internet finance have insufficient accuracy and robustness in risk control, and it is difficult to effectively recommend products that meet user expectations and have risk control capabilities.
Comparative learning is used for model pre-training, combined with multi-task learning, and the output interpretability of the model is enhanced. By obtaining the control sample set and transaction data set, the recommended model is optimized and trained, improving the robustness and accuracy of the model.
It improves the accuracy and robustness of controlling product recommendations, alleviates the problem of insufficient learning of a few sample types, and enhances the prediction accuracy of the model for specific business needs.
Smart Images

Figure CN119228381A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to data processing technology, and in particular to a recommendation model training method, a management and control product recommendation method and device. Background Art
[0002] Internet finance is the product of the combination of the Internet and the financial industry, including various forms such as third-party payment and big data finance. Internet finance can achieve symmetry of new market information, and also has a convenient payment function, so that the supply and demand sides of funds can trade directly.
[0003] Among them, risk control is an important part of payment security management, which can determine what kind of control action to output for risky transaction events, such as directly letting them go, performing multiple verifications such as SMS and face verification on transaction events, etc. In the transaction process, various recommendation models are usually used to recommend products that are more in line with user expectations and have risk control capabilities to users, in order to ensure user payment security. At present, there is an urgent need to provide a new recommendation model training scheme to use the optimized recommendation model to more accurately recommend control products to users. Summary of the invention
[0004] The embodiments of this specification provide a recommendation model training method, a management product recommendation method and a device. By using contrastive learning to perform model pre-training and using multi-task learning to enhance the output interpretability of the model, the recommendation model can be optimized and trained, and the robustness and accuracy of the recommendation model can be improved, thereby improving the accuracy of management product recommendations. The recommendation model training method includes:
[0005] Obtain control sample set;
[0006] Using the control sample set to train a preset contrastive learning representation network to obtain a pre-trained recommendation model;
[0007] The model parameters of the pre-trained recommendation model are transferred to a preset multi-task learning network, and the preset multi-task learning network is fine-tuned using a transaction data set to obtain a target recommendation model.
[0008] Further, in some embodiments, the control sample set includes a query sample, a positive sample and a negative sample corresponding to the query sample; the preset contrastive learning representation network includes a main encoder, a momentum encoder and a dictionary queue;
[0009] The using the control sample set to train a preset contrastive learning representation network includes:
[0010] Inputting the query samples in each training batch into the main encoder to obtain query feature representation;
[0011] Inputting the positive sample into the momentum encoder to obtain a key feature representation;
[0012] Obtaining a first feature representation corresponding to a negative sample in a historical training batch from the dictionary queue;
[0013] A preset contrastive learning loss function is used to calculate contrastive loss values between the query feature representation, the key feature representation, and the first feature representation, and model parameters in the main encoder and the momentum encoder are adjusted according to the contrastive loss values.
[0014] Further, in some embodiments, the using a preset contrastive learning loss function to calculate the contrastive loss value between the query feature representation, the key feature representation, and the first feature representation, and adjusting the model parameters in the main encoder and the momentum encoder according to the contrastive loss value includes:
[0015] Based on the contrastive learning loss function, calculating a first similarity between the query feature representation and the key feature representation and calculating a second similarity between the query feature representation and the first feature representation, and determining a contrastive loss value between the query feature representation, the key feature representation, and the first feature representation according to the first similarity and the second similarity;
[0016] Adjusting the model parameters in the main encoder according to the contrast loss value by a back propagation algorithm;
[0017] The model parameters in the momentum encoder are adjusted according to the updated model parameters in the main encoder through the momentum update method.
[0018] Further, in some embodiments, the main encoder includes an online encoder and a multi-layer perceptron head;
[0019] The step of inputting the query samples in each training batch into the main encoder to obtain the query feature representation includes:
[0020] Inputting the query samples in each training batch into the online encoder to obtain original feature representation;
[0021] The original feature representation is nonlinearly transformed by the multi-layer perceptron head to obtain a query feature representation.
[0022] Furthermore, in some embodiments, the method further comprises:
[0023] After each training batch is completed, the negative samples in each training batch are input into the momentum encoder after the model parameters are updated to obtain a second feature representation corresponding to the negative samples in each training batch;
[0024] The second feature representation is stored in the dictionary queue, and the dictionary queue is updated according to the second feature representation.
[0025] Furthermore, in some implementations, obtaining the control sample set includes:
[0026] Acquire historical control data that meets the first preset screening condition;
[0027] Selecting a plurality of candidate control data from the historical control data using a second preset screening condition;
[0028] Selecting at least one query sample from the plurality of candidate control data, and selecting positive samples corresponding to each of the query samples from the plurality of candidate control data using a third preset screening condition;
[0029] The other candidate control data except the positive samples among the multiple candidate control data are used as negative samples corresponding to each of the query samples.
[0030] Furthermore, in some embodiments, the first preset screening condition is whether the historical control cost corresponding to the historical control data is lower than the preset control cost; the second preset screening condition includes whether the number of historical transactions of the user exceeds the first preset number, whether the number of times the user has been deceived is less than the second preset number; the third preset screening condition includes at least whether the users are the same, whether the controlled products are the same, whether the risk reports are the same, and whether the customer complaint reports are the same.
[0031] Furthermore, in some implementations, fine-tuning the preset multi-task learning network using the transaction dataset to obtain a target recommendation model includes:
[0032] Extracting binary features from the transaction data set and true labels corresponding to the binary features;
[0033] Using the binary features and the true labels as supervised training data, and using the supervised training data to train the preset multi-task learning network to obtain the target recommendation model;
[0034] Among them, the binary feature is composed of transaction event features and regulated product features, the real label includes a main label and an auxiliary label, the main label includes a regulated product label, and the auxiliary label includes at least a risk label and a customer complaint label.
[0035] Further, in some embodiments, the preset multi-task learning network includes multiple expert networks, multiple gating networks, and multiple combiners;
[0036] The method of using the binary features and the true labels as supervised training data, and using the supervised training data to train the preset multi-task learning network to obtain the target recommendation model includes:
[0037] Using each of the expert networks to extract features from the supervised training data to obtain a plurality of feature vectors;
[0038] Based on the supervised training data, determining the weight of each of the feature vectors through each of the gating networks corresponding to each task;
[0039] The feature vectors and the weights of the feature vectors are combined by the combiners corresponding to each task to obtain a corresponding prediction label;
[0040] The expert networks, the gating networks and the combiners corresponding to each task are supervisedly trained using the true labels and the predicted labels, and after the training is completed, the target recommendation model is obtained.
[0041] Further, in some embodiments, each of the expert networks includes a dynamic embedding layer, a first deep neural network layer, and a second deep neural network layer;
[0042] The method of extracting features from the supervised training data using the multiple expert networks to obtain multiple feature vectors includes:
[0043] Performing feature conversion on the supervised training data through each of the dynamic embedding layers to obtain underlying features;
[0044] Performing nonlinear transformation on the underlying features through each of the first deep neural network layers to obtain shared features across tasks in the underlying features;
[0045] Independent features for the target task are extracted from the shared features through each of the second deep neural network layers, and the independent features are integrated to obtain a corresponding feature vector.
[0046] Further, in some embodiments, the dynamic embedding layer includes a multi-embedding layer and a third deep neural network layer;
[0047] The step of converting the supervised training data into features through each of the dynamic embedding layers to obtain underlying features includes:
[0048] Binning the supervised training data to obtain bin features;
[0049] Performing quantile division processing on the supervised training data to obtain quantile features;
[0050] The binning feature is converted into a first intermediate feature through the multi-embedding layer, and the quantile feature is nonlinearly transformed through the third deep neural network layer to obtain a second intermediate feature;
[0051] The first intermediate feature and the second intermediate feature are fused to obtain the underlying feature.
[0052] The present specification also provides a method for recommending a controlled product, the method comprising:
[0053] Get the characteristic information of the current transaction event;
[0054] Inputting the feature information into a trained target recommendation model to obtain a to-be-recommended regulated product corresponding to the current transaction event, and displaying the to-be-recommended regulated product on a user interface;
[0055] The target recommendation model is trained by any one of the recommendation model training methods.
[0056] The present specification also proposes a recommendation model training device, the device comprising:
[0057] The sample data acquisition module is used to obtain the management and control sample set;
[0058] A first model training module, used to train a preset contrastive learning representation network using the control sample set to obtain a pre-trained recommendation model;
[0059] The second model training module is used to migrate the model parameters of the pre-trained recommendation model to a preset multi-task learning network, and use the transaction data set to fine-tune the preset multi-task learning network to obtain a target recommendation model.
[0060] The embodiment of this specification also provides a device for recommending managed products, the device comprising:
[0061] A feature information acquisition module is used to acquire feature information of the current transaction event;
[0062] A controlled product recommendation module, used for inputting the feature information into a trained target recommendation model, obtaining a to-be-recommended controlled product corresponding to the current transaction event, and displaying the to-be-recommended controlled product on a user interface;
[0063] The target recommendation model is trained by any one of the recommendation model training methods.
[0064] The embodiments of the present specification also provide a storage medium, wherein the storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the steps of the above method.
[0065] An embodiment of the present specification also provides an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.
[0066] The embodiments of the present specification also provide a computer program product, wherein the computer program product stores at least one instruction, and the at least one instruction is suitable for being loaded by a processor and executing the above method steps.
[0067] In an embodiment of the present specification, first, a control sample set is obtained, and the preset contrastive learning representation network is trained using the control sample set to obtain a pre-trained recommendation model. Then, the model parameters of the pre-trained recommendation model are migrated to the preset multi-task learning network, and the preset multi-task learning network is fine-tuned using the transaction data set to obtain a target recommendation model. Finally, the optimized target recommendation model is used to achieve accurate recommendations for controlled products. By using the method in the embodiment of the present specification, by using contrastive learning for model pre-training and using multi-task learning to enhance the output interpretability of the model, it is possible to achieve optimized training of the recommendation model, improve the robustness and accuracy of the recommendation model, and thus improve the accuracy of the recommendation of controlled products. Specifically, on the one hand, by using the control sample set to pre-train the comparative learning representation network, not only can we learn information that is more in line with business preferences in the model pre-training stage, but also can alleviate the problem of poor minority class prediction results caused by insufficient feature learning of minority class samples; on the other hand, by migrating the parameters of the pre-trained model to the multi-task learning network, we can directly use the feature representation related to the recommendation task to speed up the learning speed in the subsequent fine-tuning stage; on the other hand, by further fine-tuning on the transaction data set, the use of a multi-task learning framework can enhance the model's explanatory power, improve the prediction accuracy of the recommendation model for specific business needs, and help achieve accurate recommendations for control products. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of a system architecture for applying the embodiments of this specification;
[0069] Figure 2 A flowchart of a recommendation model training method provided in an embodiment of this specification;
[0070] Figure 3 A schematic diagram of a process for obtaining a control sample set provided in an embodiment of this specification;
[0071] Figure 4 A schematic diagram of the structure of a preset contrast learning representation network provided in an embodiment of this specification;
[0072] Figure 5A flowchart of another recommendation model training method provided in an embodiment of this specification;
[0073] Figure 6 A schematic diagram of a flow chart of fine-tuning a preset multi-task learning network provided in an embodiment of this specification;
[0074] Figure 7 A schematic diagram of a process of extracting feature vectors using an expert network provided in an embodiment of this specification;
[0075] Figure 8 A schematic diagram of another process of extracting feature vectors using an expert network provided in an embodiment of this specification;
[0076] Fig. 9 A schematic diagram of the structure of an expert network provided in an embodiment of this specification;
[0077] Fig.10 A flowchart of a method for recommending a product for management provided in an embodiment of this specification;
[0078] Fig.11 A schematic diagram of the structure of a recommendation model training device provided in an embodiment of this specification;
[0079] Fig.12 A schematic diagram of the structure of a device for recommending products for management and control provided in an embodiment of this specification;
[0080] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0082] Figure 1 A schematic diagram of an architecture to which the embodiments of this specification can be applied is shown.
[0083] like Figure 1As shown, the system architecture 100 may include one or more of terminal devices such as a smart phone 101, a portable computer 102, a desktop computer 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal device and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The terminal device may be various electronic devices with data processing functions, and the electronic device may have a display screen, which is used to display a control sample set, a to-be-recommended control product corresponding to the current transaction event, and the like.
[0084] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0085] See also Figure 2 , which is a flowchart of a recommendation model training method provided in an embodiment of this specification. In an embodiment of this specification, the recommendation model training method is applied to a recommendation model training device or an electronic device equipped with a recommendation model training device. Figure 2 The process shown is described in detail, and the recommendation model training method may specifically include the following steps:
[0086] S202, obtaining a control sample set;
[0087] In one or more embodiments of the present specification, the control sample set refers to the control data used for contrastive learning pre-training. The control sample set may include query samples, positive samples corresponding to the query samples, and negative samples. Among them, the query sample refers to the sample that is subsequently input into the preset contrastive learning representation network, and is also the sample from which the preset contrastive learning representation network wants to learn feature representation; the positive sample refers to the sample that is related to the query sample or has similar features. In contrastive learning, the positive sample is used to enhance the query sample feature representation; the negative sample refers to the sample that is irrelevant to the query sample or has a large difference in features. In contrastive learning, the negative sample is used to distinguish query samples from irrelevant samples to help the model learn more robust feature representations.
[0088] It should be noted that each control sample corresponds to a transaction event. Accordingly, each control sample may include at least user information, control product information, risk reporting information and customer reporting information. For example, a certain control sample is: User A, no control, no risk reporting, and no customer complaint reporting.
[0089] Exemplarily, when obtaining a control sample set, historical control data that meets a first preset screening condition may be obtained first. For example, the first preset screening condition is whether the historical control cost corresponding to the historical control data is lower than the preset control cost. Accordingly, when the historical control cost is lower than the preset control cost, it indicates that the historical control data can achieve risk control at a lower control cost.
[0090] Then, multiple candidate control data are selected from the historical control data using the second preset screening condition, and at least one query sample is selected from the multiple candidate control data. For example, the second preset screening condition includes whether the number of historical transactions of the user exceeds the first preset number, and whether the number of times the user has been deceived is less than the second preset number. For example, if the first preset number and the second preset number are both 2 times, the present disclosure does not limit this. For example, multiple candidate control data can be selected from the historical control data, where the number of historical transactions of the user exceeds 2 times and the number of times the user has been deceived is less than 2 times, and any of the candidate control data can be used as a query sample.
[0091] Finally, the third preset screening condition is used to select positive samples corresponding to each query sample from multiple candidate control data, and the other candidate control data except the positive samples in the multiple candidate control data are used as negative samples corresponding to each query sample. For example, the third preset screening condition includes whether the user is the same, whether the control product is the same, whether the risk report is the same, and whether the customer complaint report is the same, that is, transactions for the same user, providing the same control product, with the same risk report and the same customer complaint report can be regarded as positive sample pairs.
[0092] For example, if user A has 4 transactions, the first transaction: no control, no risk report, no customer complaint report; the second transaction: reminder control, no risk report, no customer complaint report; the third transaction: no control, fraud risk report, no customer complaint report; the fourth transaction: reminder control, no risk report, no customer complaint report. If the second transaction is selected as the query sample, then the fourth transaction is the positive sample corresponding to the second transaction. Similarly, the second transaction and the fourth transaction form a positive sample pair, and the first transaction and the third transaction are the negative samples corresponding to the second transaction, and correspondingly, two groups of negative sample pairs can be formed.
[0093] It can be understood that the multiple preset screening conditions in the embodiments of this description can be flexibly adjusted according to specific needs and specific scenarios. This description does not limit this. It is sufficient to determine the control data that meets the comparative learning pre-training based on multiple preset screening conditions.
[0094] refer to Figure 3As shown, a schematic diagram of a process for obtaining a controlled sample set in an embodiment of this specification is given, wherein the controlled sample set consists of a positive sample pair set and a negative sample pair set, a positive sample pair can consist of a query sample and a corresponding positive sample, and a negative sample pair can consist of a query sample and a corresponding negative sample. Specifically, the process may include the following steps:
[0095] S301, determine whether the number of historical transactions of the user exceeds 2 times: select the control data of the user with the number of historical transactions exceeding 2 times from the historical control data that meets the requirement of being less than the preset control cost, if yes, execute step S303, if not, execute step S302;
[0096] S302, filtering out the control data of users with less than 2 historical transaction times;
[0097] S303, determine whether the user belongs to the group of people who are easily deceived: for the control data of the user's historical transaction times exceeding 2 times, further determine whether the user involved in these control data belongs to the group of people who are easily deceived, such as determining whether the number of times the user has been deceived is greater than 2 times. If so, determine that the user is a group of people who are easily deceived, and execute step S304; if not, execute step S305;
[0098] S304, filtering out the control data of users who are easily deceived;
[0099] S305, determine whether the users are the same, the managed products are the same, the risk reports are the same, and the customer complaints are the same. If so, execute step S306; if not, execute step S307;
[0100] S306, random combination in pairs: any two control data belonging to the same user, the same control product, the same risk report, and the same customer complaint report are combined to obtain a positive sample pair set;
[0101] S307, random combination in pairs: any two control data that do not have the same user, the same control product, the same risk report, and the same customer complaint report are combined to obtain a negative sample pair set.
[0102] By building a control sample set for comparative learning pre-training through historical control data, the value of historical control data can be maximized and the predictive performance of the recommendation model can be improved.
[0103] S204, training a preset contrastive learning representation network using the control sample set to obtain a pre-trained recommendation model;
[0104] Contrastive learning can make full use of unlabeled data to improve the learning ability of the network's common features, and has strong generalization, so it can be effectively transferred to downstream subtasks. Usually, contrastive learning learns representations by comparing different samples. Therefore, a control sample set containing positive and negative samples can be used to train the preset contrastive learning representation network to obtain a pre-trained recommendation model.
[0105] In one or more embodiments of the present specification, the preset contrastive learning representation network can be a MoCo (Momentum Contrast for Unsupervised Visual Representation Learning) network, a SimCLR (Simple Framework for Contrastive Learning of Visual Representations) network, a BYOL (Bootstrap Your Own Latent) network, and of course other types of contrastive learning representation networks, which are not limited in this specification.
[0106] After obtaining the control sample set, the control sample set can be used for contrastive learning pre-training. Optionally, the contrastive learning representation network may include an encoder and a projection head, the encoder is used to extract the feature representation of the input sample, and the projection head is used to further transform the feature vector to make it more suitable as a target for contrastive learning. For example, the encoder can be a convolutional neural network, and the projection head can be a multi-layer perceptron. It is understandable that the structure of the encoder is not fixed.
[0107] In each iterative training, positive and negative samples are randomly selected from the control sample set, and the positive and negative samples are sent to the contrastive learning representation network to obtain the corresponding feature representation through the encoder and projection head. With the goal of maximizing the similarity between positive sample pairs and minimizing the similarity between negative sample pairs, the loss value is calculated according to the pre-defined contrastive loss function, and the error is back-propagated according to the calculated loss value. The weights in the network are continuously iterated and updated until the preset number of iterations is reached or other iteration termination conditions are met, the training is completed, and the pre-trained recommendation model is obtained.
[0108] Contrastive learning can help the model learn more robust and generalized feature representations. Using the pre-trained model for downstream tasks, such as management product recommendations in recommendation systems, can improve the performance of the recommendation system.
[0109] S206, migrating the model parameters of the pre-trained recommendation model to a preset multi-task learning network, and fine-tuning the preset multi-task learning network using a transaction data set to obtain a target recommendation model.
[0110] In one or more embodiments of this specification, the preset multi-task learning network can be a network model for realizing the underlying decoupling and selective sharing of feature learning between multiple tasks. For example, the preset multi-task learning network can be an MMoE (Multi-gate Mixture-of-Experts) network, a PLE (Progressive Layered Extraction) network, an MTAN (Multi-Task Attention Networks) network, and of course other types of contrastive learning representation networks, which are not limited in this specification.
[0111] Migrate the model parameters of the pre-trained recommendation model to the preset multi-task learning network, that is, use the model parameters of the pre-trained recommendation model as the initial parameters of the preset multi-task learning network. The transfer learning strategy can effectively reuse the feature representations learned by the pre-trained recommendation model, accelerate the convergence of the preset multi-task learning network, and enable the preset multi-task learning network to better understand and capture key information in transaction events, thereby improving the ability to recommend products for unknown transaction events.
[0112] It should be noted that the pre-trained recommendation model and the preset multi-task learning network need to have a high degree of compatibility in the model architecture so that the model parameters in the two can correspond to each other, thereby realizing the migration of model parameters. For example, the weights of the pre-trained recommendation model are loaded into the corresponding layers of the preset multi-task learning network, especially the feature extraction network of the preset multi-task learning network will directly inherit the weights learned by the pre-trained recommendation model during the pre-training process, rather than randomly initialized.
[0113] After the model parameters of the pre-trained recommendation model are loaded into the preset multi-task learning network, fine-tuning is performed on the transaction data set to ensure that the recommendation model can receive the characteristics of transaction events as input and predict the most suitable regulated products as output. The transaction data set includes a data set consisting of transaction events and regulated products.
[0114] At this stage, the preset multi-task learning network will adjust the model parameters according to the new data and task objectives, and can effectively correct the mislabeled regulated product labels, further improving the robustness and accuracy of the recommendation model.
[0115] See also Figure 4 , is a schematic diagram of a structure of a preset contrast learning representation network provided in an embodiment of this specification. Figure 4In the embodiment, the preset contrastive learning representation network includes a main encoder 41, a momentum encoder 42 and a dictionary queue 43, and the main encoder 41 includes an online encoder 401 and a multi-layer perceptron head 402. The main encoder 41 is used to generate a first feature representation 403 of an input query sample q, and the momentum encoder 42 is used to generate an input positive sample K + The second feature representation 404 of the input is generated by a momentum update method. - The third feature representation is based on the negative sample K - The third feature of represents the updated dictionary queue 43, which acts as a large negative sample pool, allowing the model to access more negative samples in each training step, thereby improving the quality of contrastive learning.
[0116] Furthermore, the first similarity between the first feature representation 403 and the second feature representation 404 can be calculated, and the second similarity between the first feature representation 403 and the third feature representation can be calculated. The loss function encourages the model to improve the first similarity of positive sample pairs and reduce the second similarities of all negative sample pairs, so that the model can learn effective representations that can distinguish different categories or instances.
[0117] Combination Figure 4 The preset contrast learning representation network structure is given, Figure 5 A flow chart of another recommendation model training method provided in the embodiments of this specification is given. Figure 5 As shown, the method comprises the following steps:
[0118] S502, obtaining a control sample set;
[0119] For step S502, please refer to the detailed description of step S202 in another embodiment of this specification, which will not be repeated here. As can be seen from step S202, the control sample set may include the query sample, the positive samples corresponding to the query sample, and the negative samples.
[0120] S504, inputting the query samples in each training batch into the main encoder to obtain query feature representation;
[0121] During the training process, the control samples can be divided into multiple control sample subsets, each of which is a training batch, and each training batch includes at least one query sample, positive samples and negative samples corresponding to each query sample. The query samples in each training batch are input into the main encoder, and the query features obtained are represented as a vector of fixed length, such as a vector of 128 dimensions or higher.
[0122] like Figure 4As shown, the main encoder 41 includes an online encoder 401 and a multi-layer perceptron head 402. Accordingly, the query samples in each training batch can be input into the online encoder 401 to obtain the original feature representation, and the original feature representation is nonlinearly transformed by the multi-layer perceptron head 402 to obtain the query feature representation.
[0123] Among them, the online encoder 401 may include convolutional layers, pooling layers, and other types of layers (such as activation functions) to capture key information of the input samples. The multi-layer perceptron head 402 includes at least two fully connected layers, wherein the first fully connected layer is followed by a nonlinear activation function, which can be regarded as a projection layer, which is used to map the original feature representation to a new space to better separate positive sample pairs and negative sample pairs. The last fully connected layer has no activation function and directly outputs the transformed features. This layer is a prediction layer, which is used to further transform the features so that the final query feature representation is more suitable for calculating the contrast loss, thereby updating the parameters of the online encoder 401 and the multi-layer perceptron head 402.
[0124] The multi-layer perceptron head 402 includes an additional nonlinear layer, which can capture more complex feature transformations. By using the multi-layer perceptron head 402, the model can learn stronger invariance and generalization capabilities. It should be noted that the multi-layer perceptron head 402 is not used in the migration phase.
[0125] It should be noted that in contrastive learning, the main encoder shares weights, that is, within a training cycle, the weights of the main encoder and the momentum encoder are the same.
[0126] S506, inputting the positive sample into the momentum encoder to obtain a key feature representation;
[0127] In one or more embodiments of the present specification, a momentum encoder is used to convert an input positive sample into a feature vector, and the obtained key feature is represented as a vector of fixed length, such as a vector of 128 dimensions or higher. The weights of the momentum encoder are updated during the training process to better capture the features of the positive samples. Secondly, the momentum encoder can also be used to encode negative samples. Similarly, the negative sample encoding weights are updated through a momentum term, which is a moving average of the momentum encoder weights. More stable negative samples can be introduced, which helps to reduce the randomness and instability of the encoding, so that the model can better distinguish between positive and negative samples and improve the comparative learning process.
[0128] like Figure 4As shown, the structure of the momentum encoder 42 may be the same as that of the online encoder 401, but the update strategies of the two are different. For example, the weights of the online encoder 401 are directly updated through back propagation, while the momentum encoder 42 is gradually synchronized from the weights of the online encoder 401 through a momentum update mechanism, which means that the weight update of the momentum encoder 42 is slower than that of the online encoder 401, but the update method is smoother.
[0129] The key feature representation is used to calculate the first similarity between the positive sample and the query sample. By optimizing the loss function, the model learns how to maximize the similarity between the query sample and the positive sample, while minimizing the similarity between the query sample and the negative sample.
[0130] S508, obtaining a first feature representation corresponding to a negative sample in a historical training batch from the dictionary queue;
[0131] The dictionary queue is a circular queue that is used to store the feature representations generated by the momentum encoder as negative samples, which helps maintain a large negative example pool without increasing the size of each batch of data. Moreover, the use of the dictionary queue can expand the diversity of negative examples, thereby improving the effect of contrastive learning.
[0132] The first feature representation corresponding to the negative samples in the historical training batches can be obtained from the dictionary queue, so as to compare and learn the positive samples in the current batch with the negative samples in the historical batches based on the first feature representation, thereby helping the model to learn more generalized feature representations and helping to use historical information to enhance the comparative learning effect of the current batch.
[0133] S510, using a preset contrastive learning loss function to calculate contrastive loss values between the query feature representation, the key feature representation, and the first feature representation, and adjusting model parameters in the main encoder and the momentum encoder according to the contrastive loss values to obtain a pre-trained recommendation model;
[0134] Optionally, based on the contrastive learning loss function, a first similarity between the query feature representation and the key feature representation and a second similarity between the query feature representation and the first feature representation can be calculated, and a contrastive loss value between the query feature representation, the key feature representation and the first feature representation can be determined based on the first similarity and the second similarity. This specification does not limit the specific method for calculating the similarity, such as using cosine similarity to calculate the similarity between two feature representations.
[0135] For example, the contrastive learning loss function can be:
[0136]
[0137] Among them, q·K +Represents the query feature representation corresponding to the query sample q and the positive sample K + The first similarity between the corresponding key feature representations, q·K - Represents the query feature representation corresponding to the query sample q and the negative sample K - The second similarity between the corresponding first feature representations, τ is a temperature hyperparameter used to control the concentration of the similarity distribution. Of course, the contrast loss function can also use a normalized temperature-scaled cross entropy loss function, which is not limited in this specification.
[0138] Then, the model parameters in the main encoder are adjusted according to the contrast loss value by the back propagation algorithm, and the model parameters in the momentum encoder are adjusted according to the updated model parameters in the main encoder by the momentum update method. It can be understood that the model parameters in the momentum encoder are mainly adjusted according to the updated model parameters in the online encoder.
[0139] Taking the model parameter as weight as an example, the momentum update method can be:
[0140] θ 2 ←m·θ 2 +(1-m)·θ 1 (2)
[0141] Among them, θ 2 is the weight of the momentum encoder, θ 1 is the weight of the online encoder, m is the momentum factor, and the value of m is usually close to 1.
[0142] By optimizing the contrastive learning loss function, the model learns how to maximize the similarity between positive sample pairs and minimize the similarity between negative sample pairs. The model gradually learns representations that can effectively distinguish different samples and can directly use the representations of different samples in many downstream tasks, such as classification, clustering, or retrieval tasks.
[0143] S512, migrating the model parameters of the obtained pre-trained recommendation model to a preset multi-task learning network, and fine-tuning the preset multi-task learning network using the transaction data set to obtain a target recommendation model.
[0144] For step S512, please refer to the detailed description of step S206 in another embodiment of this specification, which will not be repeated here.
[0145] In the embodiments of this specification, by making full use of historical control data and considering the control products, risk reporting, customer complaint reporting and other information from the user dimension to construct positive and negative sample pairs, the diversity of samples can be increased, which helps the model to better understand the characteristics of different types of samples. The recommendation model is pre-trained by comparative learning using the constructed positive and negative sample pairs, and a more powerful feature representation is learned by comparing the differences between similar samples (positive sample pairs) and dissimilar samples (negative sample pairs), which can enhance the model's ability to learn the key features of minority samples. Therefore, in the model pre-training stage, not only can information that is more in line with business preferences be learned, but also the problem of poor minority class prediction results caused by insufficient learning of minority class sample features can be alleviated.
[0146] In addition, after each training batch is completed, the negative samples in the current training batch will be saved in the dictionary queue, which is used to maintain a dynamically updated set of negative samples. For example, the negative samples in each training batch can be input into the momentum encoder after the model parameters are updated to obtain the second feature representation corresponding to the negative samples in each training batch. The second feature representation is stored in the dictionary queue, and the dictionary queue is updated according to the second feature representation.
[0147] It can be seen that by using a circular queue to save negative sample features, the negative sample features can be extracted from historical training batches. Even if there are not enough negative samples in the current training batch, the model can use historical data to enhance the contrastive learning signal. After each iterative training, the second feature representation of the negative sample newly output by the momentum encoder will be added to one end of the dictionary queue. When the dictionary queue is full, the old features at the other end of the dictionary queue will be removed.
[0148] By maintaining a dynamically updated large-scale negative sample pool and maintaining the stability of the model through the momentum encoder, the model is able to learn high-quality feature representations from unlabeled data, thereby demonstrating superior performance on a variety of downstream tasks.
[0149] In one embodiment of the present specification, the preset multi-task learning network may include multiple expert networks, multiple gating networks, and multiple combiners. Figure 6 , step S512 may further include the following steps:
[0150] S602, migrating the model parameters of the pre-trained recommendation model to a preset multi-task learning network;
[0151] The model parameters of the pre-trained recommendation model are migrated to the preset multi-task learning network, that is, the model parameters of the pre-trained recommendation model are used as the initial parameters of the preset multi-task learning network.
[0152] S606, extracting bigram features in the transaction data set and real labels corresponding to the bigram features;
[0153] The transaction data set includes a data set consisting of transaction events and controlled products. The binary features in the transaction data set and the real labels corresponding to the binary features can be extracted, wherein the binary features include transaction event features and controlled product features, and the transaction event features include transaction features and user features involved in the transaction process. For example, transaction features include features extracted from information such as transaction amount, transaction time and transaction location, user features include features such as the number of transactions of the user within 7 days and the number of times the user is intercepted within 3 days, and controlled product features include features extracted from information such as product type, control intensity, and control effect.
[0154] The real label corresponding to the binary feature can be determined based on the control information in the historical control data. For example, the real label includes control product labels, risk labels, customer complaint labels, etc. The control product label is used to characterize the type of control product, including release, reminder, cooling-off period and failure of transaction events, etc. The risk label is used to reflect whether there is a risk in the transaction event, and the customer complaint label is used to record whether the customer has complained. Of course, it can also include a variety of auxiliary labels such as help labels, upgrade and downgrade labels, which are not limited in this manual.
[0155] S606, using the binary features and the true labels as supervised training data, and using each of the expert networks to perform feature extraction on the supervised training data to obtain a plurality of feature vectors;
[0156] In one or more embodiments of the present specification, when training a target recommendation model, it is necessary to perform supervised learning on multiple tasks such as product control prediction, risk prediction, customer complaint prediction, etc. Each task corresponds to an expert network, and each expert network will generate an output related to a specific task.
[0157] It should be noted that multiple expert networks are parallel networks, and each expert network learns for the entire data set. However, as the training progresses, each expert network becomes an "expert" in processing specific types of data or specific tasks.
[0158] The supervised training data is input into each expert network for feature extraction. Each expert network outputs a feature vector. Each feature vector captures the key attributes of the input data for a specific task for subsequent model use.
[0159] S608, based on the supervised training data, determining the weight of each of the feature vectors through each of the gating networks corresponding to each task;
[0160] The gating network is used to determine which expert network outputs are most relevant to the input supervised training data, and then dynamically assign weights to different expert networks at each data point. The gating network dynamically adjusts the weights by learning the features of different data points to ensure that the most suitable expert network can lead the prediction process at different data points. It is understood that in the embodiments of this specification, a data point refers to a set of sample data consisting of a binary feature and a true label.
[0161] Optionally, each gating network corresponds to a task, i.e., product control prediction, risk prediction, customer complaint prediction, etc. For example, suppose there are three expert networks E 1 、E 2 and E 3 And a gating network G for task T 1 When a data point is input into the model, the gating network G calculates a set of weights w based on the characteristics of the data point based on the attention mechanism. 1 、w 2 、w 3 , corresponding to E 1 、E 2 and E 3 , this set of weights determines the contribution of the feature vectors output by each expert network at this data point to the final prediction.
[0162] Therefore, the gating network can intelligently select the most appropriate expert network for prediction according to the characteristics and requirements of different data points, thereby improving the overall prediction accuracy and effect of the model.
[0163] S610, combining the feature vectors and the weights of the feature vectors through the combiners corresponding to each task to obtain a corresponding prediction label;
[0164] Each task has a combiner that generates task-related output, i.e., the predicted label of the task. Specifically, the output is obtained by combining the feature vectors and the weights of the feature vectors by the combiner corresponding to each task, for example, multiplying the feature vector by the corresponding weight to generate the final predicted label.
[0165] Optionally, the combiner can be a multi-layer perceptron, a loop layer, an attention layer, etc., which is not limited in this specification. In the embodiments of this specification, the corresponding prediction labels obtained can include the outputs of multiple tasks such as control product prediction, risk prediction, and customer complaint prediction. For example, the control product label can be a four-category label, including four types: release, reminder, cooling-off period, and failure. Auxiliary labels such as risk labels, customer complaint labels, help labels, and upgrade and downgrade labels can be two-category labels, that is, whether labels, including risk / no risk, customer complaint / no customer complaint, etc.
[0166] S612, using the real label and the predicted label to perform supervised training on each of the expert networks, each of the gating networks and each of the combiners corresponding to each task, and after the training is completed, the target recommendation model is obtained.
[0167] The training samples in the supervised training data are input into each expert network, and each expert network will output a feature vector accordingly. At the same time, the gating network evaluates the outputs of all expert networks and generates a weight distribution to guide the outputs of all expert networks. The combiner performs a weighted average of the outputs of the expert networks based on the weight distribution generated by the gating network to generate the final corresponding prediction label.
[0168] The final predicted label of the corresponding task is compared with the true label in the training data set, and the loss function is calculated. It is understandable that the design of the loss function should take all labels into consideration to ensure that the model can achieve good performance in different aspects. Through the back-propagation algorithm, the gradient is calculated according to the loss function, and the parameters of the expert network, gating network, and combiner are updated using an optimization algorithm (such as gradient descent) to minimize the loss. The entire training process will iterate multiple times, and each iteration will adjust the parameters of the model expert network, gating network, and combiner until the preset iteration termination conditions are met, and the target recommendation model can be obtained. Among them, the preset iteration termination conditions include reaching the maximum number of iterations, loss function convergence, etc.
[0169] In the embodiments of this specification, through the design of the gated network and the expert network, the model can simultaneously learn multiple related but different tasks such as control product prediction, risk prediction, customer complaint prediction, etc. during the training process, so that the model can not only predict the control products, but also identify and understand potential risk factors and customer satisfaction issues, so as to effectively correct the mislabeled control product labels, further improve the robustness and accuracy of the model, and help to recommend control products more accurately in the future.
[0170] See also Figure 7 , is a flow chart of extracting feature vectors using an expert network provided in an embodiment of this specification. Each expert network includes a dynamic embedding layer, a first deep neural network layer, and a second deep neural network layer. Figure 7 As shown, the process includes the following steps:
[0171] S702, performing feature conversion on the supervised training data through each of the dynamic embedding layers to obtain underlying features;
[0172] The dynamic embedding layer is used to perform preliminary feature conversion on the input supervised training data, and the parameters of the dynamic embedding layer can be dynamically adjusted according to the different input data, so as to generate more accurate feature representation for different input data.
[0173] For example, the underlying features can be embedded vectors obtained by mapping discrete or continuous features in supervised training data to a high-dimensional continuous space, and the embedded vectors can capture the complex relationships between features.
[0174] S704, performing nonlinear transformation on the underlying features through each of the first deep neural network layers to obtain cross-task shared features in the underlying features;
[0175] After obtaining the underlying features, it is necessary to further explore the common information in the underlying features. The first deep neural network layer is used to extract cross-task shared features from the underlying features. Shared features refer to features that are important for all or most tasks, which can help the model better understand the common patterns and rules between different tasks.
[0176] S706, extracting independent features for the target task from the shared features through each of the second deep neural network layers, and integrating the independent features to obtain a corresponding feature vector;
[0177] The second deep neural network layer focuses on extracting the independent features required for each specific task from the shared features, allowing the model to optimize the performance of each task in a targeted manner without being interfered with by other tasks. Among them, independent features refer to features that are important for a specific task but unimportant relative to other tasks.
[0178] In the embodiments of this specification, by extracting shared features, the model can learn more general representations from multiple related tasks, thereby improving the generalization ability on new tasks. Moreover, the existence of shared features allows the model to learn together on multiple tasks, avoiding the problem of overfitting on a single task. The extraction of independent features helps the model to effectively transfer knowledge between similar tasks, and can quickly adapt to new tasks even when the amount of data is limited. By cleverly combining the extraction of shared features and independent features, both global shared information and task-specific details are taken into account, achieving high efficiency and high performance in multi-task learning scenarios.
[0179] See also Figure 8 , is another flow chart of extracting feature vectors using an expert network provided in the embodiments of this specification. Fig. 9 As shown, a structural diagram of an expert network is given, wherein the expert network includes a dynamic embedding layer 901, a first deep neural network layer 902, a second deep neural network layer 903 and a fourth deep neural network layer 904, the dynamic embedding layer 901 includes a multi-embedding layer 911 and a third deep neural network layer 912, and the dynamic embedding layer 901 is used to convert discrete features into continuous vector representations.
[0180] Furthermore, combined with Fig. 9 The network structure given in Figure 8 The individual steps shown in are explained below:
[0181] S802, binning the supervised training data to obtain bin features;
[0182] Supervised training data includes various types of data, such as numerical and categorical data. Binning refers to dividing the continuous numerical features in the supervised training data into several intervals, each interval corresponding to a discrete value, so as to convert the numerical features into categorical features, which can better handle nonlinearity and outliers, and facilitate subsequent embedding layer processing.
[0183] S804, performing quantile division processing on the supervised training data to obtain quantile features;
[0184] The quantile partitioning process divides the continuous numerical features in the supervised training data into certain proportions, such as quartiles, deciles, etc. It can also convert continuous features into categorical form, while also taking into account the characteristics of data distribution.
[0185] S808, converting the binning feature into a first intermediate feature through the multi-embedding layer, and performing a nonlinear transformation on the quantile feature through the third deep neural network layer to obtain a second intermediate feature;
[0186] The preprocessed features are input into the dynamic embedding layer 901. Specifically, the binned features include multiple category features, and the multi-embedding layer 911 can be regarded as multiple separate embedding layers, each of which is responsible for processing a specific feature. Therefore, each category feature is input into the corresponding embedding layer, and the corresponding first intermediate feature is output. The setting of the multi-embedding layer 911 enables the model to capture the information of each category feature more finely.
[0187] The quantile features can be input into the third deep neural network layer 912, which is composed of multiple fully connected layers. The second intermediate features are obtained by nonlinearly transforming the quantile features and extracting the deep expression of the features.
[0188] S808, fusing the first intermediate feature and the second intermediate feature to obtain the underlying feature;
[0189] The first intermediate feature output from the multi-embedding layer 911 and the second intermediate feature output from the third deep neural network layer 912 are fused, such as performing element-wise multiplication of the first intermediate feature and the second intermediate feature to obtain the underlying feature. This fusion method helps to retain the important information of each feature while enhancing the interdependence between the features.
[0190] Taking the binary features and the corresponding true labels as input for underlying feature mining ensures that the model can understand the data from multiple perspectives.
[0191] S810, performing nonlinear transformation on the underlying features through each of the first deep neural network layers to obtain cross-task shared features in the underlying features;
[0192] Among them, the first deep neural network layer 902 can automatically learn and extract high-level abstract representations between features through multi-layer neuron connections, that is, learn the common features required for all tasks, that is, shared features.
[0193] The fused underlying features are input into the first deep neural network layer 902. Through the multi-layer nonlinear transformation of the first deep neural network layer 902, the shared features across tasks in the underlying features are mined, which helps the model understand the basic patterns and structures of the data.
[0194] S812, extracting independent features for the target task from the shared features through each of the second deep neural network layers, and integrating the independent features to obtain a corresponding feature vector.
[0195] In one or more embodiments of the present specification, the second deep neural network layer 903 may include multiple deep neural network layers. Optionally, deeper feature mining can be performed through two independent deep neural network layers, each deep neural network layer mining different feature information for a specific task, such as the specificity of transaction event features or the uniqueness of control product features. By extracting information specific to each task, the model can make accurate predictions for different tasks.
[0196] Each deep neural network layer in the second deep neural network layer 903 can output an independent feature. Finally, all independent features can be concatenated, and the concatenated feature vectors are nonlinearly transformed through the fourth deep neural network layer 904 to obtain feature vectors corresponding to specific tasks, ensuring that the model can both utilize shared features and take into account task specificity.
[0197] See also Fig.10 , is a flow chart of a method for recommending controlled products provided in an embodiment of this specification. In an embodiment of this specification, the method for recommending controlled products is applied to a device for recommending controlled products or an electronic device equipped with the device for recommending controlled products. Fig.10 As shown, the method comprises the following steps:
[0198] S1002, obtaining characteristic information of the current transaction event;
[0199] In one or more embodiments of the present specification, the feature information of the current transaction event includes a feature vector of the transaction event. Optionally, the transaction features of the current transaction event may be obtained first, such as the transaction amount, transaction time, and transaction location. Further, the transaction features of the current transaction event are preprocessed and feature engineered, such as missing value processing, data cleaning, feature coding, and feature selection, to obtain a feature vector of the current transaction event, thereby ensuring the quality and validity of the input data of the target recommendation model.
[0200] S1004: Input the feature information into a trained target recommendation model to obtain a to-be-recommended regulated product corresponding to the current transaction event, and display the to-be-recommended regulated product on a user interface.
[0201] It should be noted that the target recommendation model is optimized by the method described in detail in steps S202 to S206 of another embodiment of this specification, or optimized by the method described in detail in steps S502 to S512 of another embodiment of this specification, which will not be repeated here.
[0202] The feature vector of the current transaction event is input into the trained target recommendation model. The target recommendation model obtains the recommended control product that best matches the current transaction event based on the learned prediction model. Finally, the recommendation results output by the model are presented to the user through the user interface, including the name of the recommended control product, product description, and recommendation reason.
[0203] In the embodiments of this specification, by using contrastive learning for model pre-training and using multi-task learning to enhance the interpretability of the model's output, the recommendation model can be optimized for training, and the robustness and accuracy of the recommendation model can be improved. Since the optimized recommendation model has a strong generalization ability and can more accurately identify and respond to the user's specific needs and preferences, the recommendation model can be used to accurately recommend regulated products to users who perform transaction operations, thereby improving the user experience. Moreover, it is possible to provide highly personalized regulated product recommendations based on the specific features of transaction events, further improving the accuracy and pertinence of the recommendations. The automated recommendation system significantly reduces the time for manual screening and decision-making, speeds up the transaction process, and improves overall operational efficiency.
[0204] See also Fig.11 , is a schematic diagram of the structure of a recommendation model training device provided in an embodiment of this specification. Fig.11 As shown, the recommendation model training device 1 can be implemented as all or part of the electronic device through software, hardware or a combination of both. According to some embodiments, the recommendation model training device 1 includes a sample data acquisition module 110, a first model training module 120 and a second model training module 13, specifically including:
[0205] The sample data acquisition module 110 is used to acquire a management and control sample set;
[0206] A first model training module 120, used to train a preset contrastive learning representation network using the control sample set to obtain a pre-trained recommendation model;
[0207] The second model training module 130 is used to migrate the model parameters of the pre-trained recommendation model to a preset multi-task learning network, and use the transaction data set to fine-tune the preset multi-task learning network to obtain a target recommendation model.
[0208] Optionally, the controlled sample set includes a query sample, a positive sample and a negative sample corresponding to the query sample; the preset contrastive learning representation network includes a main encoder, a momentum encoder and a dictionary queue; when the first model training module 120 executes training of the preset contrastive learning representation network using the controlled sample set, it is specifically used to:
[0209] Inputting the query samples in each training batch into the main encoder to obtain query feature representation;
[0210] Inputting the positive sample into the momentum encoder to obtain a key feature representation;
[0211] Obtaining a first feature representation corresponding to a negative sample in a historical training batch from the dictionary queue;
[0212] A preset contrastive learning loss function is used to calculate contrastive loss values between the query feature representation, the key feature representation, and the first feature representation, and model parameters in the main encoder and the momentum encoder are adjusted according to the contrastive loss values.
[0213] Optionally, when the first model training module 120 calculates the contrast loss value between the query feature representation, the key feature representation and the first feature representation using a preset contrast learning loss function, and adjusts the model parameters in the main encoder and the momentum encoder according to the contrast loss value, it is specifically used to:
[0214] Based on the contrastive learning loss function, calculating a first similarity between the query feature representation and the key feature representation and calculating a second similarity between the query feature representation and the first feature representation, and determining a contrastive loss value between the query feature representation, the key feature representation, and the first feature representation according to the first similarity and the second similarity;
[0215] Adjusting the model parameters in the main encoder according to the contrast loss value by a back propagation algorithm;
[0216] The model parameters in the momentum encoder are adjusted according to the updated model parameters in the main encoder through the momentum update method.
[0217] Optionally, the main encoder includes an online encoder and a multi-layer perceptron head; when the first model training module 120 inputs the query samples in each training batch into the main encoder to obtain the query feature representation, it is specifically used to:
[0218] Inputting the query samples in each training batch into the online encoder to obtain original feature representation;
[0219] The original feature representation is nonlinearly transformed by the multi-layer perceptron head to obtain a query feature representation.
[0220] Optionally, after each training batch is completed, the first model training module 120 inputs the negative samples in each training batch into the momentum encoder after updating the model parameters to obtain a second feature representation corresponding to the negative samples in each training batch; stores the second feature representation in the dictionary queue, and updates the dictionary queue according to the second feature representation.
[0221] Optionally, when executing the acquisition of the management and control sample set, the sample data acquisition module 110 is specifically used to:
[0222] Acquire historical control data that meets the first preset screening condition;
[0223] Selecting a plurality of candidate control data from the historical control data using a second preset screening condition;
[0224] Selecting at least one query sample from the plurality of candidate control data, and selecting positive samples corresponding to each of the query samples from the plurality of candidate control data using a third preset screening condition;
[0225] The other candidate control data except the positive samples among the multiple candidate control data are used as negative samples corresponding to each of the query samples.
[0226] Optionally, in the sample data acquisition module 110, the first preset screening condition is whether the historical control cost corresponding to the historical control data is lower than the preset control cost; the second preset screening condition includes whether the number of historical transactions of the user exceeds the first preset number, whether the number of times the user has been deceived is less than the second preset number; the third preset screening condition includes at least whether the users are the same, whether the controlled products are the same, whether the risk reports are the same, and whether the customer complaint reports are the same.
[0227] Optionally, when the second model training module 130 uses the transaction data set to fine-tune the preset multi-task learning network to obtain the target recommendation model, it is specifically used to:
[0228] Extracting binary features from the transaction data set and true labels corresponding to the binary features;
[0229] Using the binary features and the true labels as supervised training data, and using the supervised training data to train the preset multi-task learning network to obtain the target recommendation model;
[0230] Among them, the binary feature is composed of transaction event features and regulated product features, the real label includes a main label and an auxiliary label, the main label includes a regulated product label, and the auxiliary label includes at least a risk label and a customer complaint label.
[0231] Optionally, the preset multi-task learning network includes multiple expert networks, multiple gating networks and multiple combiners; when the second model training module 130 uses the binary features and the true labels as supervised training data, trains the preset multi-task learning network using the supervised training data, and obtains the target recommendation model, it is specifically used to:
[0232] Using each of the expert networks to extract features from the supervised training data to obtain a plurality of feature vectors;
[0233] Based on the supervised training data, determining the weight of each of the feature vectors through each of the gating networks corresponding to each task;
[0234] The feature vectors and the weights of the feature vectors are combined by the combiners corresponding to each task to obtain a corresponding prediction label;
[0235] The expert networks, the gating networks and the combiners corresponding to each task are supervisedly trained using the true labels and the predicted labels, and after the training is completed, the target recommendation model is obtained.
[0236] Optionally, each of the expert networks includes a dynamic embedding layer, a first deep neural network layer, and a second deep neural network layer;
[0237] When the second model training module 130 uses the multiple expert networks to extract features from the supervised training data to obtain multiple feature vectors, it is specifically used to:
[0238] Performing feature conversion on the supervised training data through each of the dynamic embedding layers to obtain underlying features;
[0239] Performing nonlinear transformation on the underlying features through each of the first deep neural network layers to obtain shared features across tasks in the underlying features;
[0240] Independent features for the target task are extracted from the shared features through each of the second deep neural network layers, and the independent features are integrated to obtain a corresponding feature vector.
[0241] Optionally, the dynamic embedding layer includes a multi-embedding layer and a third deep neural network layer;
[0242] When the second model training module 130 performs feature conversion on the supervised training data through each of the dynamic embedding layers to obtain the underlying features, it is specifically used to:
[0243] Binning the supervised training data to obtain bin features;
[0244] Performing quantile division processing on the supervised training data to obtain quantile features;
[0245] The binning feature is converted into a first intermediate feature through the multi-embedding layer, and the quantile feature is nonlinearly transformed through the third deep neural network layer to obtain a second intermediate feature;
[0246] The first intermediate feature and the second intermediate feature are fused to obtain the underlying feature.
[0247] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.
[0248] See also Fig.12 , is a schematic diagram of the structure of a control product recommendation device provided in an embodiment of this specification. Fig.12 As shown, the control product recommendation device 2 can be implemented as all or part of the electronic device through software, hardware or a combination of both. According to some embodiments, the control product recommendation device 2 includes a feature information acquisition module 210 and a control product recommendation module 220, specifically including:
[0249] The feature information acquisition module 210 is used to acquire the feature information of the current transaction event;
[0250] A controlled product recommendation module 220 is used to input the feature information into a trained target recommendation model to obtain a to-be-recommended controlled product corresponding to the current transaction event, and display the to-be-recommended controlled product on a user interface;
[0251] Wherein, the target recommendation model is trained by the method described in the recommendation model training device 1.
[0252] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.
[0253] The present specification also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figures 2 to 10 The method of the embodiment shown in the figure can be specifically executed by referring to Figures 2 to 10 The specific description of the illustrated embodiment will not be repeated here.
[0254] The present specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figures 2 to 10 The method of the embodiment shown in the figure can be specifically executed by referring to Figures 2 to 10 The specific description of the illustrated embodiment will not be repeated here.
[0255] The embodiments of this specification also provide Fig.13 The structural diagram of the electronic device shown in FIG. Fig.13 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned voice activity detection method.
[0256] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0257] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0258] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0259] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0260] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0261] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0262] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0263] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0264] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0265] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0266] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0267] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0268] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0269] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0270] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0271] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0272] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A recommendation model training method, the method comprising: Obtain control sample set; Using the control sample set to train a preset contrastive learning representation network to obtain a pre-trained recommendation model; The model parameters of the pre-trained recommendation model are transferred to a preset multi-task learning network, and the preset multi-task learning network is fine-tuned using a transaction data set to obtain a target recommendation model.
2. According to the recommendation model training method of claim 1, the control sample set includes a query sample, a positive sample and a negative sample corresponding to the query sample; The preset contrastive learning representation network includes a main encoder, a momentum encoder and a dictionary queue; The using the control sample set to train a preset contrastive learning representation network includes: Inputting the query samples in each training batch into the main encoder to obtain query feature representation; Inputting the positive sample into the momentum encoder to obtain a key feature representation; Obtaining a first feature representation corresponding to a negative sample in a historical training batch from the dictionary queue; A preset contrastive learning loss function is used to calculate contrastive loss values between the query feature representation, the key feature representation, and the first feature representation, and model parameters in the main encoder and the momentum encoder are adjusted according to the contrastive loss values.
3. The recommendation model training method according to claim 2, wherein the using a preset contrastive learning loss function to calculate the contrastive loss value between the query feature representation, the key feature representation and the first feature representation, and adjusting the model parameters in the main encoder and the momentum encoder according to the contrastive loss value, comprises: Based on the contrastive learning loss function, calculating a first similarity between the query feature representation and the key feature representation and calculating a second similarity between the query feature representation and the first feature representation, and determining a contrastive loss value between the query feature representation, the key feature representation, and the first feature representation according to the first similarity and the second similarity; Adjusting the model parameters in the main encoder according to the contrast loss value by a back propagation algorithm; The model parameters in the momentum encoder are adjusted according to the updated model parameters in the main encoder through the momentum update method.
4. The recommendation model training method according to claim 2, wherein the main encoder comprises an online encoder and a multi-layer perceptron head; The step of inputting the query samples in each training batch into the main encoder to obtain the query feature representation includes: Inputting the query samples in each training batch into the online encoder to obtain original feature representation; The original feature representation is nonlinearly transformed by the multi-layer perceptron head to obtain a query feature representation.
5. The recommendation model training method according to claim 2, further comprising: After each training batch is completed, the negative samples in each training batch are input into the momentum encoder after the model parameters are updated to obtain a second feature representation corresponding to the negative samples in each training batch; The second feature representation is stored in the dictionary queue, and the dictionary queue is updated according to the second feature representation.
6. According to the recommendation model training method of claim 2, the step of obtaining a control sample set comprises: Acquire historical control data that meets the first preset screening condition; Selecting a plurality of candidate control data from the historical control data using a second preset screening condition; Selecting at least one query sample from the plurality of candidate control data, and selecting positive samples corresponding to each of the query samples from the plurality of candidate control data using a third preset screening condition; The other candidate control data except the positive samples among the multiple candidate control data are used as negative samples corresponding to each of the query samples.
7. According to the recommendation model training method of claim 6, the first preset screening condition is whether the historical control cost corresponding to the historical control data is lower than the preset control cost; the second preset screening condition includes whether the number of historical transactions of the user exceeds the first preset number, and whether the number of times the user has been deceived is less than the second preset number; the third preset screening condition at least includes whether the users are the same, whether the controlled products are the same, whether the risk reports are the same, and whether the customer complaint reports are the same.
8. The recommendation model training method according to claim 1, wherein the step of fine-tuning the preset multi-task learning network using the transaction data set to obtain the target recommendation model comprises: Extracting binary features from the transaction data set and true labels corresponding to the binary features; Using the binary features and the true labels as supervised training data, and using the supervised training data to train the preset multi-task learning network to obtain the target recommendation model; Among them, the binary feature is composed of transaction event features and regulated product features, the real label includes a main label and an auxiliary label, the main label includes a regulated product label, and the auxiliary label includes at least a risk label and a customer complaint label.
9. The recommendation model training method according to claim 8, wherein the preset multi-task learning network comprises a plurality of expert networks, a plurality of gating networks and a plurality of combiners; The method of using the binary features and the true labels as supervised training data and using the supervised training data to train the preset multi-task learning network to obtain the target recommendation model includes: Using each of the expert networks to extract features from the supervised training data to obtain a plurality of feature vectors; Based on the supervised training data, determining the weight of each of the feature vectors through each of the gating networks corresponding to each task; The feature vectors and the weights of the feature vectors are combined by the combiners corresponding to each task to obtain a corresponding prediction label; The expert networks, the gating networks and the combiners corresponding to each task are supervisedly trained using the true labels and the predicted labels, and after the training is completed, the target recommendation model is obtained.
10. The recommendation model training method according to claim 9, wherein each of the expert networks comprises a dynamic embedding layer, a first deep neural network layer, and a second deep neural network layer; The method of extracting features from the supervised training data using the multiple expert networks to obtain multiple feature vectors includes: Performing feature conversion on the supervised training data through each of the dynamic embedding layers to obtain underlying features; Performing nonlinear transformation on the underlying features through each of the first deep neural network layers to obtain cross-task shared features in the underlying features; Independent features for the target task are extracted from the shared features through each of the second deep neural network layers, and the independent features are integrated to obtain a corresponding feature vector.
11. The recommendation model training method according to claim 10, wherein the dynamic embedding layer comprises a multi-embedding layer and a third deep neural network layer; The step of converting the supervised training data into features through each of the dynamic embedding layers to obtain underlying features includes: Binning the supervised training data to obtain bin features; Performing quantile division processing on the supervised training data to obtain quantile features; The binning feature is converted into a first intermediate feature through the multi-embedding layer, and the quantile feature is nonlinearly transformed through the third deep neural network layer to obtain a second intermediate feature; The first intermediate feature and the second intermediate feature are fused to obtain the underlying feature.
12. A method for recommending a controlled product, the method comprising: Get the characteristic information of the current transaction event; Inputting the feature information into a trained target recommendation model to obtain a to-be-recommended regulated product corresponding to the current transaction event, and displaying the to-be-recommended regulated product on a user interface; Wherein, the target recommendation model is trained by the method described in any one of claims 1-11.
13. A recommendation model training device, the device comprising: The sample data acquisition module is used to obtain the management and control sample set; A first model training module, used to train a preset contrastive learning representation network using the control sample set to obtain a pre-trained recommendation model; The second model training module is used to migrate the model parameters of the pre-trained recommendation model to a preset multi-task learning network, and use the transaction data set to fine-tune the preset multi-task learning network to obtain a target recommendation model.
14. A device for recommending controlled products, the device comprising: A feature information acquisition module is used to acquire feature information of the current transaction event; A controlled product recommendation module, used for inputting the feature information into a trained target recommendation model, obtaining a to-be-recommended controlled product corresponding to the current transaction event, and displaying the to-be-recommended controlled product on a user interface; Wherein, the target recommendation model is trained by the method described in any one of claims 1-11.
15. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.
16. An electronic device comprising: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method according to any one of claims 1 to 12.
17. A computer program product having at least one instruction stored thereon, wherein when the at least one instruction is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
