Model training method and device, storage medium and electronic device
By using tracking identifiers in user feature information and recommendation item tags to generate training samples, the problems of time-to-time correlation error and storage are solved, thus improving the training efficiency and performance of the ranking model.
Patent Information
- Application Number
- CN202210844973.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-07-18
AI Technical Summary
In existing technologies, the point-to-point association of user feature information and user tags suffers from problems such as large timestamp errors, large storage requirements, lack of timestamps in data records, and disordered causal relationships in training samples, leading to overfitting in the ranking model.
By tracking and associating user identifiers and recommendation item identifiers, training samples are generated using a bypass model to avoid timestamp errors, ensure consistent causal relationships, and reduce storage requirements.
It improves the ranking performance of the ranking model, reduces the storage capacity and transmission bandwidth pressure of training samples, avoids the disorder of causal relationships in training samples, and improves the training efficiency of the model.
Smart Images

Figure CN115221405B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the field of computer information technology, and more particularly, embodiments of the present disclosure relate to a model training method and device, a storage medium and an electronic device. BACKGROUND
[0002] This section is intended to provide background information to facilitate an understanding of embodiments of the disclosure set forth in the claims. The description herein does not constitute admission of prior art.
[0003] With the development of the big data era, based on user features and to-be-recommended item features, the to-be-recommended item is sorted by a sorting model, and the push based on the to-be-recommended item sorting can improve user experience and reduce user operation. SUMMARY
[0004] In some technologies, since user feature information and user labels change over time, in order to ensure the consistency of user feature information and user labels used in the training and updating of the sorting model in time, logs with complete time chains can be saved to associate user feature information and user labels with time stamps, so that user feature information and user labels can be associated point by point by time point.
[0005] However, in the way of associating and saving user feature information and user labels point by point by time point, there are the following defects:
[0006] 1) There may be a large error in recording time stamps by different devices, which may lead to inaccurate association;
[0007] 2) Some features may only store the latest version without complete time chain records;
[0008] 3) When the number of users and the number of features are large, a very large storage capacity is required;
[0009] 4) The data records in stock often lack time stamps, making it difficult to completely cover user feature information and user labels.
[0010] In other technologies, the sorting model is trained and updated based on user labels obtained by sorting and recommending the sorting model. However, the features used by the sorting model in sorting and recommending are obtained at the time of sorting, while the training and updating of the sorting model often differs from the sorting and recommending by a long time, so the features obtained at the time of training and updating of the sorting model have changed compared with the features obtained at the time of sorting. At this time, the user labels such as user operation information are actually caused by the features obtained at the time of sorting, rather than the features obtained at the time of updating, so that the changed features and user labels are spliced as samples to train and update the sorting model, which is likely to cause overfitting of the training and updating of the sorting model.
[0011] Therefore, there is a great need for an improved model training method, device, storage medium and electronic equipment, which can avoid the influence of timestamps on model training samples, ensure the causal relationship between model training features and user labels, and reduce the storage space required for training samples.
[0012] In this context, embodiments of the application aim to provide a model training method, comprising:
[0013] receiving recommendation request information, the recommendation request information containing a tracking identifier and a user identifier to be recommended;
[0014] obtaining N1 item identifiers of N1 items to be recommended, N1 being an integer greater than 1;
[0015] sending the user identifier and the N1 item identifiers of the N1 items to be recommended to an online ranking model, and performing ranking of the N1 items to be recommended by the online ranking model according to user feature information and recommendation item feature information of the items to be recommended, the user feature information being obtained according to the user identifier, and the recommendation item feature information being obtained according to the item identifiers;
[0016] retaining N2 items to be recommended from the N1 items to be recommended as quasi-recommendation items to be recommended to a user associated with the user identifier according to the ranking of the N1 items to be recommended by the online ranking model, N2 being less than N1, and N2 being an integer greater than 1 or N2 being equal to 1;
[0017] sending the tracking identifier, N2 recommendation item identifiers of the N2 quasi-recommendation items, and the user identifier to a bypass model, and generating training samples associated with the tracking identifier stored by the bypass model according to the user identifier and the recommendation item identifiers;
[0018] training and updating the online ranking model based on the training samples and operation labels of the user on the quasi-recommendation items.
[0019] According to one aspect of the present disclosure, a model training device is provided, comprising:
[0020] a receiving module configured to receive recommendation request information, the recommendation request information containing a tracking identifier and a user identifier to be recommended;
[0021] an obtaining module configured to obtain N1 item identifiers of N1 items to be recommended, N1 being an integer greater than 1;
[0022] The first sending module is configured to send the user identifier and the to-be-recommended item identifiers of the N1 to-be-recommended items to an online ranking model, and the online ranking model performs ranking of the N1 to-be-recommended items according to user feature information and recommendation item feature information of the to-be-recommended items, the user feature information is obtained according to the user identifier, and the recommendation item feature information is obtained according to the to-be-recommended item identifiers;
[0023] The ranking module is configured to retain N2 to-be-recommended items from the N1 to-be-recommended items as quasi-recommendation items recommended to a user associated with the user identifier according to the ranking of the N1 to-be-recommended items by the online ranking model, N2 is less than N1, and N2 is an integer greater than 1 or N2 is equal to 1;
[0024] The second sending module is configured to send the tracking identifier, the recommendation item identifiers of the N2 quasi-recommendation items, and the user identifier to a bypass model, and the bypass model generates a training sample associated with the tracking identifier stored according to the user identifier and the recommendation item identifiers;
[0025] The training module is configured to train and update the online ranking model based on the training sample and an operation label of the quasi-recommendation items by the user.
[0026] According to an aspect of the present disclosure, a storage medium is provided, and the storage medium stores a computer program. When the computer program is executed by a processing unit, the model training method described above is performed.
[0027] According to an aspect of the present disclosure, an electronic device is provided, and the electronic device includes a processing unit and a storage unit configured to store executable instructions of the processing unit. The processing unit is configured to perform the model training method described above by executing the executable instructions.
[0028] According to the embodiments of the present disclosure, the present disclosure has the following advantages:
[0029] 1) The recommendation item identifiers and the user identifier are associated by the tracking identifier to generate a training sample associated with the tracking identifier by the bypass model. Compared with the point-to-point association at a time point, there is no need to consider that there may be a large error in the time stamp recorded by different devices, and the problem that the time stamp cannot be accurately associated and it is difficult to obtain a complete training sample in time is avoided.
[0030] 2) When the online ranking model is ranked, the bypass model generates a training sample associated with the stored training sample of the tracking identifier according to the user identifier and the recommendation item identifier, so that the training sample of the online ranking model is trained and updated, and the operation label of the user on the quasi-recommendation item has a time causal relationship, avoiding the change of the feature in the training sample caused by the long time difference between the obtained label and the training sample, affecting the online ranking model training, thereby improving the ranking performance of the online ranking model;
[0031] 3) The bypass model generates a training sample based only on the tracking identifier, the recommendation item identifier of the N2 quasi-recommendation items recommended by ranking, and the user identifier, reduces the required storage capacity of the training sample, and further reduces the bandwidth pressure and storage cost of the training sample transmission. BRIEF DESCRIPTION OF DRAWINGS
[0032] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0033] Figure 1 A schematic diagram of ranking model ranking and training update is schematically shown;
[0034] Figure 2 A flowchart of a model training method according to an embodiment of the present disclosure is schematically shown;
[0035] Figure 3 A flowchart of a model training method according to an embodiment of the present disclosure is schematically shown;
[0036] Figure 4 A schematic diagram of a first feature processing layer according to an embodiment of the present disclosure is schematically shown;
[0037] Figure 5 A schematic diagram of a model calculation layer according to an embodiment of the present disclosure is schematically shown;
[0038] Figure 6 A flowchart of feature selection according to a snapshot configuration according to an embodiment of the present disclosure is schematically shown;
[0039] Figure 7 A flowchart of obtaining a training sample according to an embodiment of the present disclosure is schematically shown;
[0040] Figure 8 A flowchart of obtaining a training sample according to another embodiment of the present disclosure is schematically shown;
[0041] Figure 9A block diagram of a model training apparatus according to an embodiment of the disclosure is schematically shown;
[0042] Figure 10 A schematic diagram of a storage medium according to an embodiment of the disclosure is shown; and
[0043] Figure 11 A block diagram of an electronic device according to an embodiment of the disclosure is schematically shown.
[0044] In the drawings, identical or corresponding reference signs indicate identical or corresponding parts. DETAILED DESCRIPTION
[0045] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and in no way limit the scope of the present application. On the contrary, these embodiments are provided to make the disclosure more thorough and complete, and to fully convey the scope of the disclosure to those skilled in the art.
[0046] Those skilled in the art will appreciate that the embodiments of the disclosure can be implemented as a system, apparatus, device, method or computer program product. Therefore, the disclosure can be embodied in the form of entire hardware, entire software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0047] According to embodiments of the disclosure, a model training method, a model training apparatus, a storage medium and an electronic device are provided.
[0048] In this document, any number of elements in the drawings represent examples and not limitation, and any name is only used for distinction and does not have any limiting meaning.
[0049] The principles and spirits of the present disclosure will be described in detail below with reference to several representative embodiments of the disclosure. SUMMARY
[0051] The inventors found that in some technologies, since user feature information and user labels change over time, in order to ensure the consistency of user feature information and user labels used in the training and updating of the ranking model in time, a log with complete time chain can be saved to associate the user feature information and the user labels with time stamps, so that the user feature information and the user labels can be associated point by point through time points.
[0052] The recorded user feature information can be shown in the following example (the time stamp in the table records the update time of the user feature information, in other words, the user feature information can remain unchanged between adjacent update times):
[0053]
[0054] The recorded user tags can be shown as follows:
[0055]
[0056] The user feature information and the user tags associated with the time points can be shown as follows:
[0057]
[0058] However, in the way of associating the time points to save the user feature information and the user tags, there are the following defects:
[0059] 1) There can be a large error in recording the time stamp by different devices, resulting in inaccurate association;
[0060] 2) Some features can only store the latest version, without recording the complete time chain;
[0061] 3) When the number of users and the number of features are large, a very large storage capacity is required;
[0062] 4) The recorded data often lacks a time stamp, making it difficult to completely cover the user feature information and the user tags.
[0063] In some other technologies, the sorting model is trained and updated based on the user tags obtained by the sorting recommendation of the sorting model. However, the features used by the sorting model in the sorting recommendation are obtained at the time of sorting, and the training and updating of the sorting model often differ from the sorting recommendation by a long time, so that the features obtained at the time of training and updating of the sorting model have changed compared with the features obtained at the time of sorting. At this time, the user tags such as user operation information are actually caused by the features obtained at the time of sorting, rather than the features obtained at the time of updating, so that the changed features and the user tags are spliced as samples to train and update the sorting model, which is easy to cause the training and updating of the sorting model to overfit.
[0064] For example, Figure 1The schematic diagram of this mode is shown: at T-1 moment, the features of user a and to-be-recommended items b and c are updated, and after the ranking model ranks, the to-be-recommended items are ranked by the score of the ranking model; when the ranking model is updated at T+1 moment, the training samples need to be spliced, at this time, the features of user a and to-be-recommended items b and c at T+1 moment (compared with T-1 moment) and the user label such as user operation information at T+1 moment are spliced to obtain samples, however, the user label at T+1 moment is actually caused by the features at T-1 moment, rather than the features at T+1 moment, so that the spliced features with disordered causal relationship are used as samples to update the ranking model, which is easy to cause overfitting of the training update of the ranking model.
[0065] In view of the above, the basic idea of the present application is to:
[0066] 1) The recommendation item identifier and the user identifier are associated by tracking the identifier to generate training samples associated with the tracking identifier by the bypass model, compared with the point-to-point association mode at different time points, there is no need to consider that the time stamp recorded by different devices may have a large error, and the problems that accurate association cannot be achieved due to the time stamp and it is difficult to obtain complete training samples in time are avoided;
[0067] 2) When the online ranking model ranks, the bypass model generates training samples associated with the training samples stored by the tracking identifier according to the user identifier and the recommendation item identifier, so that the training samples for training and updating the online ranking model have a time causal relationship with the operation label of the user on the recommended item, avoiding the change of the features in the training samples caused by the long time difference between the obtained label and the training samples, affecting the training of the online ranking model, thereby improving the ranking performance of the online ranking model;
[0068] 3) The bypass model generates training samples only based on the tracking identifier, the recommendation item identifier of the N2 recommended items after ranking, and the user identifier, reduces the required storage capacity of the training samples, and further reduces the bandwidth pressure and storage cost of the transmission of the training samples.
[0069] After introducing the basic principles of the present disclosure, the various non-limiting embodiments of the present disclosure will be specifically introduced below.
[0070] Exemplary method
[0071] The model training method according to the exemplary embodiments of the present disclosure will be described below in combination with Figure 2 .
[0072] Referring to Figure 2 , the model training method can include the following steps:
[0073] Step S110, receiving recommendation request information, the recommendation request information containing a tracking identifier and a user identifier to be recommended;
[0074] Step S120, obtaining N1 item identifiers of N1 items to be recommended, N1 being an integer greater than 1;
[0075] Step S130, sending the user identifier and the N1 item identifiers of the N1 items to be recommended to an online ranking model, and performing ranking of the N1 items to be recommended by the online ranking model according to user feature information and recommendation item feature information of the items to be recommended, the user feature information being obtained according to the user identifier, and the recommendation item feature information being obtained according to the item identifiers;
[0076] Step S140, retaining N2 items to be recommended from the N1 items to be recommended as quasi-recommendation items to be recommended to a user associated with the user identifier according to the ranking of the N1 items to be recommended by the online ranking model, N2 being less than N1, and N2 being an integer greater than 1 or N2 being equal to 1;
[0077] Step S150, sending the tracking identifier, N2 recommendation item identifiers of the N2 quasi-recommendation items, and the user identifier to a bypass model, and generating a training sample associated with the tracking identifier stored by the bypass model according to the user identifier and the recommendation item identifiers;
[0078] Step S160, training and updating the online ranking model based on the training sample and an operation label of the user on the quasi-recommendation items.
[0079] In the model training method of the embodiments of the present disclosure, 1) the recommendation item identifier and the user identifier are associated by the tracking identifier to generate a training sample associated with the tracking identifier by the bypass model, compared with the point-to-point association at a time point, there is no need to consider that there may be a large error in the time stamp recorded by different devices, avoiding the problem that the time stamp cannot be accurately associated and it is difficult to obtain a complete training sample in time; 2) when ranking by the online ranking model, the bypass model generates a training sample associated with the tracking identifier stored by the bypass model according to the user identifier and the recommendation item identifier, so that the training sample for training and updating the online ranking model has a time causal relationship with the operation label of the user on the quasi-recommendation items, avoiding the change of features in the training sample caused by a long time difference between the label and the training sample, affecting the training of the online ranking model, thereby improving the ranking performance of the online ranking model; 3) the bypass model generates a training sample based on only the tracking identifier, the N2 recommendation item identifiers of the N2 quasi-recommendation items recommended after ranking, and the user identifier, reducing the storage capacity required by the training sample, and further reducing the bandwidth pressure and storage cost of the training sample transmission.
[0080] In some possible embodiments, a globally unique tracking identifier can be generated for each recommendation request information. In some preferred embodiments, the tracking identifier can have a small amount of data to reduce the transmission bandwidth requirement and storage capacity requirement of the tracking identifier. For example, the tracking identifier can be a distributed identifier generated based on a SnowFlake algorithm. The SnowFlake algorithm can ensure that the generated identifier is time-increasing (to achieve time differentiation through the identifier) and globally unique. The present disclosure is not limited thereto, and other embodiments of generating a globally unique identifier as a tracking identifier are also within the protection scope of the present disclosure. The recommendation request information can be triggered by a user operation. For example, the user can operate a control such as “Guess you like” on the client side to trigger the user’s client to generate the recommendation request information. For another example, the user can directly trigger the user’s client to generate the recommendation request information through browsing of the recommendation item. When the user’s client is to generate the recommendation request information, the tracking identifier can be generated at the gateway layer and added to the recommendation request information.
[0081] In some possible embodiments, the recommendation item can be an object that can be recommended, such as a commodity, a video, a text, an audio, etc., according to different services provided by the recommendation item providing platform. For example, the recommendation item providing platform is an e-commerce platform, and the recommendation item can be a commodity; the recommendation item providing platform is a live broadcast platform, and the recommendation item can be a live broadcast entry; the recommendation item providing platform is a short video platform, and the recommendation item can be a short video. The present disclosure is not limited thereto.
[0082] In some possible embodiments, the user identifier can be a user name, a user nickname, a user account, a user mobile phone number, user identification information on the recommendation item providing platform, etc. The recommendation item providing platform can store and maintain the user identifier and the recommendation item identifier, and can associate the user feature information with the user identifier and the recommendation item feature information with the recommendation item, and store them into an online feature library. Thus, the online feature library is used to store the user identifier and the user feature information associated with the user identifier, the recommendation item identifier and the recommendation item feature information associated with the recommendation item identifier.
[0083] In some possible embodiments, the user feature information can include one or more of user attribute information (age, gender, occupation, etc.), user social information (user feature information of user friends, etc.), and user behavior information (information of the recommendation item most frequently operated by the user, information of the recommendation item most frequently operated by the user, information of the recommendation item not operated / preferred by the user, etc.), but the present disclosure is not limited thereto, and other user feature information is also within the protection scope of the present disclosure.
[0084] In some possible implementations, the feature information of recommendation items may include, but is not limited to, one or more of the following: recommendation item attribute information (recommendation item form type, recommendation item content type, and other recommendation item attribute information), and feature information of users who prefer recommendation items. This disclosure is not limited thereto, and other recommendation item attribute information is also within the scope of protection of this disclosure. The recommendation item form type may indicate that the recommendation item is a text recommendation item, an audio recommendation item, a video recommendation item, etc. The recommendation item content type may be classified differently depending on the recommendation item. For example, for product recommendation items, the recommendation item content type may indicate that the recommendation item is food, clothing, daily necessities, etc.; for live streaming recommendation items, the recommendation item content type may indicate that the recommendation item is game live streaming, beauty live streaming, singing live streaming, etc. The above is merely an illustrative description of two types of recommendation item attribute information, and this disclosure is not intended to limit it.
[0085] In some possible implementations, the bypass model only needs to receive the tracking identifier, the recommendation item identifiers of N2 quasi-recommendation items, and the user identifier, and generate training samples without participating in online processing. Thus, the bypass model can have an offline environment. On the one hand, this reduces the impact of data transmission in the online environment on the training sample generation performance of the bypass model; on the other hand, the bypass environment does not occupy online bandwidth, so that the online ranking system can effectively utilize the online environment to rank the items to be recommended.
[0086] In some possible implementations, the user's action tags for the quasi-recommendation items can be set according to different recommendation items. In scenarios where the recommendation item is a product, the user's action tags for the quasi-recommendation item can be used to indicate whether the user purchases the recommendation item, shares the recommendation item, or views the recommendation item, or one or more of the following: In scenarios where the recommendation item is a live stream entry point, the user's action tags for the quasi-recommendation item can be used to indicate whether the user enters the live stream to watch, follows the live stream, or watches the live stream for a duration exceeding a set time threshold, or one or more of the following: These are merely illustrative examples, and this disclosure is not intended to be limiting.
[0087] See below. Figure 3 , Figure 3 A schematic flowchart of a model training method according to a specific embodiment of the present disclosure is shown. Figure 3 The diagram illustrates the interaction process between the online recommendation system 1, the ranking system 2, and the user client 3.
[0088] User client 3 executes step S201, sending recommendation request information to online recommendation system 1. The recommendation request information may include a tracking identifier and the identifier of the user to be recommended.
[0089] The online recommendation system 1 performs step S202: obtaining item identifiers of N1 items to be recommended. N1 is an integer greater than 1. For example, N1 is 100, 500, 1000, etc., which is not limited in the present disclosure. In some possible implementation, step S202 can obtain the item identifiers of N1 items to be recommended in a recall manner. For example, step S202 can perform preliminary screening among a plurality of candidate items to be recommended based on content matching or based on filtering conditions to obtain N1 items to be recommended, and obtain the respective item identifiers.
[0090] The online recommendation system 1 performs step S203: sending the user identifier and the item identifiers of N1 items to be recommended to the online ranking model 20 of the ranking system 2.
[0091] The online ranking model 20 can obtain user feature information and item feature information of the items to be recommended from the online feature library 23 based on the user identifier and the item identifiers, and perform ranking of N1 items to be recommended according to the user feature information and the item feature information of the items to be recommended.
[0092] In some possible implementation, the online ranking model 20 includes a first feature processing layer 21 and a model calculation layer 22. The first feature processing layer 21 converts the user feature information input into the online ranking model 20 into user model features, and converts the item feature information input into the online ranking model 20 into item model features. The model calculation layer 22 calculates the relevance of the user model features and the item model features, and ranks N1 items to be recommended from high to low according to the calculated relevance. The relevance can be used to represent the preference degree of the user to the item to be recommended. In different scenarios, the relevance can have different meanings. For example, when applied to an e-commerce platform, the relevance can be used to represent the purchase probability of the user to the item to be recommended; when applied to a live streaming platform, the relevance can be used to represent the probability of the user entering the live streaming room corresponding to the item to be recommended. The present disclosure can implement more variations, which are not described herein.
[0093] The online recommendation system 1 performs step S204: obtaining the ranking of N1 items to be recommended by the online ranking model 20.
[0094] The online recommendation system 1 performs step S205: retaining N2 items to be recommended from N1 items to be recommended as quasi-recommended items. N2 is less than N1, and N2 is an integer greater than 1 or N2 is equal to 1. For example, the quasi-recommended items are the top N2 items to be recommended in the ranking order.
[0095] In some possible implementation, N2 can be 5, 10, 20, etc., which is not limited in the present disclosure.
[0096] In some possible implementation, the step S205 can further include the operation of deduplication and filtering according to a set filtering rule on the N1 recommended items. The set filtering rule can be a filtering rule set by the user on the user client, or a filtering rule set by the online recommendation system 1, so as to realize the filtering of recommended items with different requirements. For example, in the scenario of an e-commerce platform, the user can select to filter the goods of a certain merchant, so as to not recommend the goods of the merchant; in the scenario of a live broadcast platform, the user can select to filter a certain anchor, so as to not recommend the live broadcast room of the anchor. For another example, the e-commerce platform can select not to recommend the goods of a merchant with a low credit score based on the credit score of the merchant; the live broadcast platform can select not to recommend the live broadcast room of an anchor with a high level of violation or a large number of violations according to the level of violation and the number of violations of the anchor. The present disclosure is not limited thereto.
[0097] The online recommendation system 1 performs step S206: packaging the quasi-recommended items according to the business system.
[0098] In some possible implementation, since the quasi-recommended items of different business systems can need to have different data structures and data requirements, the online recommendation system 1 can package the quasi-recommended items according to the requirements of different business systems through step S206.
[0099] The online recommendation system 1 performs step S207: returning the packaged quasi-recommended items to the user client 3 for recommendation.
[0100] The online recommendation system 1 performs step S208: sending the tracking identifier, the recommended item identifiers of the N2 quasi-recommended items, and the user identifier to the bypass model 20'.
[0101] The bypass model generates a training sample associated with the tracking identifier stored according to the user identifier and the recommended item identifier, and the training sample is used to train and update the online ranking model in combination with the operation label of the user on the quasi-recommended item.
[0102] In some possible implementation, the bypass model 20' can include a second feature processing layer 21'. The second feature processing layer 21' converts the user feature information corresponding to the user identifier input into the bypass model 20' into user model features, and converts the recommended item feature information of the quasi-recommended item input into the bypass model into recommended item model features, and the user model features and the recommended item model features are used to generate the training sample.
[0103] In some possible implementation, after receiving the tracking identification, the recommendation item identification of the N2 quasi-recommendation items, and the user identification, the bypass model 20' can obtain the user feature information and the recommendation item feature information of the to-be-recommended item from the online feature library 23 based on the user identification and the to-be-recommended item identification. Since the online ranking model 20 obtains the user feature information and the recommendation item feature information of the to-be-recommended item from the online feature library 23, performs feature processing and model calculation, and returns a ranking order, the time interval for the online recommendation system 1 to obtain the recommendation item identification of the N2 quasi-recommendation items is short, and the time interval is much smaller than the feature update time, so it can be assumed that the user feature information and the recommendation item feature information obtained by the bypass model 20' are consistent with the user feature information and the recommendation item feature information obtained by the online ranking model 20.
[0104] In some possible implementation, the second feature processing layer 21' and the first feature processing layer 21 have the same structure, so that the bypass model 20' can obtain the same user model features and recommendation item model features as the online ranking model 20 without the need to design a new feature processing algorithm for the bypass model 20'.
[0105] In some possible implementation, the bypass model 20' can deploy the same code and the same service as the online ranking model 20, and in this way, the model calculation layer of the bypass model 20' can not work, so as to reduce redundant calculation load.
[0106] In some possible implementation, the online recommendation system 1 can execute the step S207 and the step S208 asynchronously, so as to ensure that the step S207 and the step S208 can be executed smoothly.
[0107] The following refers to Figure 4 , Figure 4 The schematic diagram of the first feature processing layer according to the embodiment of the present disclosure is schematically shown.
[0108] After obtaining the user feature information and the recommendation item feature information from the online feature library, the user feature information can be deserialized into intermediate user model features in a model feature format, and the recommendation item feature information can be serialized into intermediate recommendation item model features in a model feature format. The model feature format can be, for example, a pb format for facilitating processing by a feature extraction operator.
[0109] The intermediate user model features and the intermediate recommendation item model features are input to the first feature processing layer 21 with feature extraction operators, so that the first feature processing layer 21 performs feature extraction on the intermediate user model features using the feature extraction operators to generate the user model features, and performs feature extraction on the intermediate recommendation item model features using the feature extraction operators to generate the recommendation item model features. The feature extraction operators can include hash, concat, bucket, etc., and the present disclosure is not limited in this regard.
[0110] Referring to FIG. 4, Figure 5 , Figure 5 A schematic diagram of a model calculation layer according to an embodiment of the present disclosure is shown schematically.
[0111] The user model features and the recommendation item model features output by the first feature processing layer are input to the model calculation layer 22. The model calculation layer 22 adopts an inference engine to perform a model algorithm. The inference engine can be, for example, tensorflow, pytorch, paddle, etc. The user model features and the recommendation item model features can also be further converted in data format based on different inference engines to adapt to the corresponding inference engines. The model algorithm can be, for example, a tree model xgboost, a convolutional neural network model (CNN), a deep neural network model (DNN), etc. The model algorithm calculates the relevance of the user model features and the recommendation item model features, and can sort the recommendation items according to the calculated relevance from high to low.
[0112] Referring to FIG. 4, Figure 6 , Figure 6 A flowchart of feature selection according to a snapshot configuration according to an embodiment of the present disclosure is shown schematically. The bypass model performs the following steps before performing feature processing:
[0113] Step S301: Query the snapshot configuration, which includes feature selection information.
[0114] In possible embodiments, the snapshot configuration can be a snapshot configuration defined according to snp language description (a custom description language for generating snapshots), such as snp.xml. The snapshot configuration is used to indicate the selection of user feature information and / or recommendation item feature information, user model features and / or recommendation item model features. In one possible example, the snapshot configuration can be:
[0115] <?xml version="1.0" encoding="UTF-8"?>
[0116] <snapshot version=""3”" rec_id_key=""traceId”" user_id_key=""userId”item_id_key=" "itemid”>
[0117] <realtime table_name=""snapshot-live_audio_home-topic”">
[0118] <out_exclude desc="Filter which features after feature processing">
[0119] <id name=""watchid_90_IDS” / ">
[0120] <id name=""cross_hour_pageimpress_id” / ">
[0121] < / out_exclude>
[0122] <input_include desc= "For the features before feature processing, select which features">
[0123] <id name=""live_anchor_index.popularity”" alias=""popularity” / ">
[0124] < / input_include>
[0125] < / id> < / id> < / id> < / realtime>
[0126] < / snapshot>
[0127] wherein, <out_exclude> is used to indicate which features in the user model features and / or the recommendation item model features are excluded; <input_include> is used to indicate which features in the user feature information and / or the recommendation item feature information are selected.
[0128] In a possible implementation, if no <out_exclude> configuration is performed, all the user model features and the recommendation item model features are retained.
[0129] Step S302: performing feature selection from the user feature information and / or the recommendation item feature information based on the snapshot configuration.
[0130] Further, the bypass model performs the following steps after performing the feature processing:
[0131] Step S302: performing feature selection from the user model features and / or the recommendation item model features based on the snapshot configuration.
[0132] In a possible implementation, after performing the feature selection based on the snapshot configuration, a sample snapshot of a training sample can be generated according to the tracking identifier, the user model features and the recommendation item model features, and the training sample is stored in the form of the sample snapshot. Further, the user feature information and / or the recommendation item feature information selected based on the snapshot configuration can also be compressed into the sample snapshot of the training sample. In a possible implementation, the sample snapshot is compressed by a snappy algorithm and stored in a protobuf format (efficient and lightweight structured data storage method). Other compression algorithms and storage formats are also within the protection scope of the present disclosure.
[0133] In the above possible real-time manner, the training sample can be obtained by Figure 7 The flowchart for obtaining the training sample is shown as follows, to obtain the training sample before training and updating the online ranking model:
[0134] Step S401: consuming the sample snapshot from the queue.
[0135] In a possible implementation, the training sample can be stored in the queue such as kafka in the form of the sample snapshot, and thus the sample snapshot can be consumed from the queue by using a Flink task.
[0136] Step S402: decompressing the sample snapshot.
[0137] Step S403: Flatten the user model features and the recommendation item model features according to the tracking identifier, the user identifier, and the recommendation item identifier to obtain the training sample table.
[0138] An example training sample table can be shown in the following table:
[0139]
[0140] Step S404: Store the training sample table in the training sample library.
[0141] When training and updating the online ranking model, the training sample table is read from the training sample library.
[0142] In possible implementations, the training sample table can be written to training sample repositories on different storage media as needed, such as HDFS (Hadoop Distributed File System), kv (Key-value database), and Hive (data warehouse tool). For example, the sink type of the training sample table can be set according to storage requirements, thereby storing the training sample table in the corresponding training sample repository on the corresponding storage media according to the sink type.
[0143] In a possible implementation, after feature selection based on snapshot configuration, a sample log of training samples can be compressed and generated according to the tracking identifier, the user model features, and the recommendation item model features. The training samples are stored in the form of the sample log on a local disk. Further, the user feature information and / or recommendation item feature information selected based on the snapshot configuration can also be compressed into the sample snapshot of the training samples. In a possible implementation, the sample snapshot is compressed using the gzip algorithm and stored in JSON format as the sample log. Other compression algorithms and storage formats are also within the scope of this disclosure.
[0144] Among the aforementioned possible real-time methods, it is possible to... Figure 8 The flowchart shown illustrates how to obtain training samples before training and updating the online ranking model:
[0145] Step S501: The local agent service reads the sample log from the local disk log.
[0146] Step S502: Decompress the sample log.
[0147] Step S503: Flatten the user model features and the recommendation item model features according to the tracking identifier, the user identifier, and the recommendation item identifier to obtain the training sample table.
[0148] Step S504: store the training sample table into a training sample library.
[0149] When the online ranking model is trained and updated, the training sample table is read from the training sample library.
[0150] Thus, various storage and reading modes of training samples are realized to adapt to different systems and scenarios.
[0151] The above merely illustrates various specific implementations of the present disclosure, and the present disclosure is not limited thereto.
[0152] Exemplary apparatus
[0153] After introducing the model training method of the exemplary embodiments of the present disclosure, next, with reference to Figure 9 The model training device of the exemplary embodiments of the present disclosure is described.
[0154] With reference to Figure 9 The model training device 600 of the exemplary embodiments of the present disclosure can include a receiving module 610, an obtaining module 620, a first sending module 630, a ranking module 640, a second sending module 650, and a training module 660. Among them,
[0155] The receiving module 610 is configured to receive recommendation request information, wherein the recommendation request information includes a tracking identifier and a user identifier to be recommended;
[0156] The obtaining module 620 is configured to obtain N1 item identifiers of N1 items to be recommended, wherein N1 is an integer greater than 1;
[0157] The first sending module 630 is configured to send the user identifier and the N1 item identifiers of the N1 items to be recommended to an online ranking model, and the online ranking model performs ranking of the N1 items to be recommended according to user feature information and recommendation item feature information of the items to be recommended, wherein the user feature information is obtained according to the user identifier, and the recommendation item feature information is obtained according to the item identifier;
[0158] The ranking module 640 is configured to retain N2 items to be recommended from the N1 items to be recommended as quasi-recommendation items to be recommended to a user associated with the user identifier according to the ranking of the N1 items to be recommended by the online ranking model, wherein N2 is less than N1, and N2 is an integer greater than 1 or N2 is equal to 1;
[0159] The second sending module 650 is configured to send the tracking identifier, N2 recommendation item identifiers of the N2 quasi-recommendation items, and the user identifier to a bypass model, and the bypass model generates a training sample stored in association with the tracking identifier according to the user identifier and the recommendation item identifier.
[0160] The training module 660 is configured to train and update the online ranking model based on the training samples and the operation labels of the quasi-recommendation items by the user.
[0161] According to the exemplary embodiments of the present disclosure, 1) the recommendation item identifier and the user identifier are associated by tracking the association tracking identifier to generate training samples associated with the association tracking identifier by the bypass model, compared with the point-to-point association at a time point, the large error of the time stamp recorded by different devices does not need to be considered, the problem that the accurate association cannot be achieved due to the time stamp and the complete training sample in time is difficult to obtain is avoided; 2) when the online ranking model is ranked, the training samples stored by the bypass model according to the user identifier and the recommendation item identifier associated with the tracking identifier are generated, so that the training samples for training and updating the online ranking model have a time causal relationship with the operation labels of the quasi-recommendation items by the user, the change of the features in the training samples caused by the long time difference between the labels and the training samples is avoided, the online ranking model training is affected, and thus the ranking performance of the online ranking model is improved; 3) the bypass model generates training samples based on only the tracking identifier, the recommendation item identifier of the N2 quasi-recommendation items recommended after ranking, and the user identifier, reduces the required storage capacity of the training samples, and further reduces the bandwidth pressure and storage cost of the training sample transmission.
[0162] According to the exemplary embodiments of the present disclosure, the user feature information and the recommendation item feature information of the to-be-recommended item are obtained from an online feature library, and the online feature library stores:
[0163] the user identifier and the user feature information associated with the user identifier; and
[0164] the to-be-recommended item identifier and the recommendation item feature information associated with the to-be-recommended item identifier.
[0165] According to the exemplary embodiments of the present disclosure, the online ranking model comprises:
[0166] a first feature processing layer, configured to convert the user feature information input into the online ranking model into user model features, and convert the recommendation item feature information of the to-be-recommended item input into the online ranking model into recommendation item model features;
[0167] a model calculation layer, configured to calculate the correlation degree of the user model features and the recommendation item model features, and rank N1 to-be-recommended items according to the calculated correlation degree from high to low.
[0168] According to the exemplary embodiments of the present disclosure, the conversion of the user feature information input into the online ranking model into user model features comprises:
[0169] deserializing the user feature information into intermediate user model features in a model feature format;
[0170] performing feature extraction on the intermediate user model features using a feature extraction operator to generate the user model features.
[0171] According to an example embodiment of the present disclosure, the converting the recommendation item feature information of the to-be-recommended item input into the online ranking model into recommendation item model features comprises:
[0172] deserializing the recommendation item feature information of the to-be-recommended item into intermediate recommendation item model features in a model feature format;
[0173] performing feature extraction on the intermediate recommendation item model features using a feature extraction operator to generate the recommendation item model features.
[0174] According to an example embodiment of the present disclosure, the bypass model comprises:
[0175] a second feature processing layer, configured to convert user feature information corresponding to a user identifier input into the bypass model into user model features, and convert recommendation item feature information of the quasi-recommendation item input into the bypass model into recommendation item model features, wherein the user model features and the recommendation item model features are used to generate the training sample.
[0176] According to an example embodiment of the present disclosure, the second feature processing layer and the first feature processing layer have the same structure.
[0177] According to an example embodiment of the present disclosure, further comprising:
[0178] a query module, configured to query a snapshot configuration, wherein the snapshot configuration comprises feature selection information;
[0179] a first selection module, configured to perform feature selection from the user feature information and / or the recommendation item feature information based on the snapshot configuration.
[0180] According to an example embodiment of the present disclosure, further comprising:
[0181] a second selection module, configured to perform feature selection from the user model features and / or the recommendation item model features based on the snapshot configuration.
[0182] According to an example embodiment of the present disclosure, the bypass model generates a training sample associated with the tracking identifier storage according to the user feature information and the recommendation item feature information of the quasi-recommendation item comprises:
[0183] According to the tracking identifier, the user model feature and the recommendation item model feature, a sample snapshot of a training sample is generated, and the training sample is stored in the form of the sample snapshot.
[0184] According to the exemplary embodiments of the present disclosure, further comprising:
[0185] A first decompression module is configured to decompress the sample snapshot.
[0186] A first tiling module is configured to tile the user model feature and the recommendation item model feature according to the tracking identifier, the user identifier and the recommendation item identifier, to obtain a training sample table.
[0187] A first storage module is configured to store the training sample table into a training sample library.
[0188] When the online ranking model is trained and updated, the training sample table is read from the training sample library.
[0189] According to the exemplary embodiments of the present disclosure, the training sample is stored in the form of the sample snapshot in a queue, further comprising:
[0190] A consumption module is configured to consume the sample snapshot from the queue.
[0191] According to the exemplary embodiments of the present disclosure, the bypass model generates a training sample associated with the tracking identifier according to the user feature information and the recommendation item feature information of the quasi-recommendation item, comprising:
[0192] According to the tracking identifier, the user model feature and the recommendation item model feature, a sample log of a training sample is generated, and the training sample is stored in the form of the sample log in a local disk log.
[0193] According to the exemplary embodiments of the present disclosure, further comprising:
[0194] A proxy reading module is configured to read the sample log from the local disk log by a local proxy service.
[0195] A second decompression module is configured to decompress the sample log.
[0196] A second tiling module is configured to tile the user model feature and the recommendation item model feature according to the tracking identifier, the user identifier and the recommendation item identifier, to obtain a training sample table.
[0197] A second storage module is configured to store the training sample table into a training sample library.
[0198] When the online ranking model is trained and updated, the training sample table is read from the training sample library.
[0199] According to the example embodiment of the present disclosure, the step performed by the sorting module is performed asynchronously with the step performed by the second sending module.
[0200] According to the example embodiment of the present disclosure, the bypass model has an offline environment.
[0201] According to the example embodiment of the present disclosure, the tracking identifier is a distributed identifier generated based on a snowflake algorithm.
[0202] Since each functional module of the model training apparatus of the present embodiment is the same as the model training method disclosed in the above embodiment, no further description is given here.
[0203] Exemplary storage medium
[0204] After introducing the model training method, apparatus and system of the example embodiment of the present disclosure, next, with reference to Figure 10 The storage medium of the example embodiment of the present disclosure is described.
[0205] Referring to Figure 10 As shown in the figure, a program product 1000 for implementing the above method according to the embodiment of the present disclosure is described, which can adopt a portable compact disc read-only memory (CD-ROM) and include program codes, and can run on a device such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used or combined with an instruction execution system, apparatus or device.
[0206] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0207] A computer readable signal medium can include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that can be involved in
[0208] The code can be transmitted in any form in any medium, including, but not limited to, radio frequency (RF), wireless, wire line, optical, or any suitable combination of the foregoing.
[0209] The program code can be implemented in any of a variety of programming languages, including object-oriented programming languages such as Java, C++, and the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device such as through the Internet using an Internet Service Provider. The program code can also be implemented in, or deployed
[0210] Exemplary electronic device
[0211] After the storage medium of the example embodiment of the present disclosure is introduced, next, the Figure 11 The electronic device of the example embodiment of the present disclosure is explained.
[0212] Figure 11 The electronic device 800 shown is merely an example and should not limit the function and use range of the embodiments of the present disclosure.
[0213] As Figure 11 The electronic device 800 is shown in the form of a general computing device. The components of the electronic device 800 can include, but are not limited to, the at least one processing unit 810, the at least one storage unit 820, a bus 830 connecting different system components, including the storage unit 820 and the processing unit 810, and a display unit 840.
[0214] The storage unit stores program codes which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present application described in the above "Exemplary Methods" section of the present specification. For example, the processing unit 810 can perform the steps as shown in the above "Exemplary Methods" section of the present specification. Figure 2
[0215] The storage unit 820 can include a volatile storage unit such as a random access memory (RAM) 8201 and / or a cache memory 8202, and further can include a non-volatile storage, or auxiliary storage unit 8203 such as a read only memory (ROM) 8203.
[0216] The storage unit 820 also can include a program / utility 8204 having a set (at least one) of program modules 8205, including an operating system, one or more application programs, other program modules, and program data, each of which can give the electronic device 800 its functionality, as well as potentially a user interface program. Such program modules 8205 can include, or make use of, the various components of the present application described herein.
[0217] The bus 830 can include a data bus, an address bus, and a control bus.
[0218] The electronic device 800 also can communicate with one or more external devices 900 such as a keyboard or pointing device, using the input / output (I / O) interface 850. The electronic device 800 also includes a display unit 840, which can be implemented with the input / output (I / O) interface 850, for displaying information to a user. Further, the electronic device 800 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet, using the network adapter 860. As depicted, the network adapter 860 communicates with the other components of the electronic device 800 via the bus 830. It should be appreciated that although the network adapter 860 is depicted as a single component, the network adapter 860 can comprise a plurality of components, which can be in communication with one another. It also should be appreciated that not all of the hardware and / or software modules described herein can be used in connection with the electronic device 800, and that described hardware and / or software modules can be combined in conjunction with the electronic device 800 or can be separated in accordance with the present application.
[0219] It should be noted that although several modules or sub-modules of the model training apparatus and the model training system are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into a plurality of units / modules.
[0220] Furthermore, although the operations of the methods of the present disclosure are described in a particular, sequential order, this should not be understood as a requirement or implied that the operations be performed in anything less than the order described, and / or that all be performed, to achieve desirable results. Additionally or alternatively, certain steps can be omitted, combined, performed simultaneously, and / or performed separately from other steps disclosed.
[0221] While the spirit and principles of the present disclosure have been described with reference to several particular embodiments, it is to be understood that the present disclosure is not limited to the particular embodiments disclosed and that various modifications can be possible without departing from the scope of the present disclosure. The aspects of the present disclosure are intended to cover what falls within the scope of the appended claims, and any and all equivalent arrangements.
Claims
1. A model training method, characterized in that, The method comprises: receiving recommendation request information, the recommendation request information comprising a tracking identifier and a user identifier to be recommended; obtaining N1 item identifiers of N1 items to be recommended, N1 being an integer greater than 1; sending the user identifier and the N1 item identifiers of the N1 items to be recommended to an online ranking model, and performing ranking of the N1 items to be recommended by the online ranking model according to user feature information and item feature information of the items to be recommended, the user feature information being obtained according to the user identifier, and the item feature information being obtained according to the item identifiers; retaining N2 items to be recommended from the N1 items to be recommended as quasi-recommended items according to the ranking of the N1 items to be recommended by the online ranking model, and recommending the N2 quasi-recommended items to a user associated with the user identifier, N2 being an integer greater than 1 or equal to 1; sending the tracking identifier, the N2 item identifiers of the N2 quasi-recommended items, and the user identifier to a bypass model, and generating a training sample associated with the tracking identifier by the bypass model according to the user identifier and the item identifiers; training and updating the online ranking model based on the training sample and an operation label of the user on the quasi-recommended items.
2. The model training method of claim 1, wherein, The user feature information and the item feature information of the items to be recommended are obtained from an online feature library, and the online feature library stores: the user identifier and user feature information associated with the user identifier; and the item identifiers and item feature information associated with the item identifiers. The online ranking model comprises:
3. The model training method of claim 1, wherein, a first feature processing layer, which converts user feature information input into the online ranking model into user model features, and converts item feature information of the items to be recommended input into the online ranking model into item model features; a model calculation layer, which calculates a correlation degree of the user model features and the item model features, and ranks the N1 items to be recommended from high to low according to the calculated correlation degree. The conversion of the user feature information input into the online ranking model into user model features comprises:
4. The model training method of claim 3, wherein, de-serializing the user feature information into intermediate user model features in a model feature format; performing feature extraction on the intermediate user model features by using a feature extraction operator to generate the user model features. The conversion of the item feature information of the items to be recommended input into the online ranking model into item model features comprises:
5. The model training method of claim 3, wherein, de-serializing the item feature information of the items to be recommended into intermediate item model features in a model feature format; performing feature extraction on the intermediate item model features by using a feature extraction operator to generate the item model features. The bypass model comprises:
6. The model training method of claim 3, wherein, a second feature processing layer, which converts user feature information corresponding to a user identifier input into the bypass model into user model features, and converts item feature information of the quasi-recommended items input into the bypass model into item model features, the user model features and the item model features being used to generate the training sample. The second feature processing layer and the first feature processing layer have the same structure.
7. The model training method according to claim 6, characterized in that, 8. The model training method of claim 6, wherein, Before the converting the user feature information corresponding to the user identification input into the bypass model into user model features and the converting the recommendation item feature information of the quasi-recommendation item input into the bypass model into recommendation item model features, the method further comprises: querying a snapshot configuration, the snapshot configuration comprising feature selection information; selecting features from the user feature information and / or the recommendation item feature information based on the snapshot configuration.
9. The model training method of claim 8, wherein, After the converting the user feature information corresponding to the user identification input into the bypass model into user model features and the converting the recommendation item feature information of the quasi-recommendation item input into the bypass model into recommendation item model features, the method further comprises: selecting features from the user model features and / or the recommendation item model features based on the snapshot configuration. 10.The model training method of claim 6, wherein, The bypass model generates training samples associated with the tracking identification and stored according to the user feature information and the recommendation item feature information of the quasi-recommendation item, which comprises: compressing the tracking identification, the user model features and the recommendation item model features to generate a sample snapshot of a training sample, and storing the training sample in the form of the sample snapshot.
11. The model training method of claim 10, wherein, Before the training and updating the online ranking model based on the training sample and the operation label of the quasi-recommendation item by the user, the method further comprises: decompressing the sample snapshot; tiling the user model features and the recommendation item model features according to the tracking identification, the user identification and the recommendation item identification to obtain a training sample table; storing the training sample table into a training sample library, wherein, when the online ranking model is trained and updated, the training sample table is read from the training sample library.
12. The model training method of claim 11, wherein, The training sample is stored in a queue in the form of the sample snapshot, and before the decompressing the sample snapshot, the method comprises: consuming the sample snapshot from the queue.
13. The model training method of claim 6, wherein, The bypass model generates training samples associated with the tracking identification and stored according to the user feature information and the recommendation item feature information of the quasi-recommendation item, which comprises: compressing the tracking identification, the user model features and the recommendation item model features to generate a sample log of a training sample, and storing the training sample in the form of the sample log in a local disk log.
14. The model training method according to claim 13, characterized in that, Before the training and updating the online ranking model based on the training sample and the operation label of the quasi-recommendation item by the user, the method further comprises: reading the sample log from the local disk log by a local agent service; decompressing the sample log; tiling the user model features and the recommendation item model features according to the tracking identification, the user identification and the recommendation item identification to obtain a training sample table; storing the training sample table into a training sample library, wherein, when the online ranking model is trained and updated, the training sample table is read from the training sample library. 15.The model training method of any of claims 1 to 14, wherein, The step of reserving N2 recommendation items from N1 recommendation items to be recommended as quasi-recommendation items recommended to the user associated with the user identification according to the ranking of the N1 recommendation items to be recommended by the online ranking model is performed asynchronously with the step of sending the tracking identification, the recommendation item identification of the N2 quasi-recommendation items and the user identification to the bypass model. 16.The model training method of any one of claims 1 to 14, wherein, The bypass model has an offline environment. 17.The model training method of any of claims 1 to 14, wherein, The tracking identifier is a distributed identifier generated based on a snowflake algorithm.
18. A model training apparatus, comprising: Comprise: The receiving module is used for receiving a recommendation request information, and the recommendation request information comprises a tracking identifier and a user identifier to be recommended; The acquisition module is used for acquiring N1 item identifiers of N1 items to be recommended, wherein N1 is an integer greater than 1; The first sending module is used for sending the user identifier and the N1 item identifiers of the N1 items to be recommended to an online sorting model, so that the online sorting model performs sorting on the N1 items to be recommended according to user feature information and item feature information of the items to be recommended, the user feature information is acquired according to the user identifier, and the item feature information is acquired according to the item identifier; The sorting module is used for retaining N2 items to be recommended from the N1 items to be recommended as quasi-recommended items to be recommended to a user associated with the user identifier according to the sorting of the N1 items to be recommended by the online sorting model, wherein N2 is less than N1, and N2 is an integer greater than 1 or N2 is equal to 1; The second sending module is used for sending the tracking identifier, item identifiers of N2 quasi-recommended items, and the user identifier to a bypass model, so that the bypass model generates a training sample stored in association with the tracking identifier according to the user identifier and the item identifiers; The training module is used for training and updating the online sorting model based on the training sample and an operation label of the user on the quasi-recommended items.
19. The model training apparatus of claim 18, wherein, The user feature information and the item feature information of the items to be recommended are acquired from an online feature library, and the online feature library stores: The user identifier and user feature information associated with the user identifier; And The item identifier and item feature information associated with the item identifier. 20.The model training apparatus of claim 18, wherein, The online sorting model comprises: A first feature processing layer, which converts user feature information input into the online sorting model into user model features and converts item feature information of the items to be recommended input into the online sorting model into item model features; A model calculation layer, which calculates the relevance of the user model features and the item model features, and sorts N1 items to be recommended from high to low according to the calculated relevance.
21. The model training apparatus of claim 20, wherein, The conversion of the user feature information input into the online sorting model into the user model features comprises: Deserializing the user feature information into intermediate user model features in a model feature format; Performing feature extraction on the intermediate user model features using a feature extraction operator to generate the user model features. 22.The model training apparatus of claim 20, wherein, The conversion of the item feature information of the items to be recommended input into the online sorting model into the item model features comprises: Deserializing the item feature information of the items to be recommended into intermediate item model features in a model feature format; Performing feature extraction on the intermediate item model features using a feature extraction operator to generate the item model features. 23.The model training apparatus of claim 20, wherein, The bypass model comprises: The second feature processing layer converts user feature information corresponding to a user identifier input into the bypass model into user model features, and converts recommendation item feature information of the quasi-recommendation item input into the bypass model into recommendation item model features, and the user model features and the recommendation item model features are used to generate the training sample. 24.The model training apparatus of claim 23, wherein, The second feature processing layer and the first feature processing layer have the same structure. 25.The model training apparatus of claim 23, wherein, Further comprising: A query module is configured to query a snapshot configuration, and the snapshot configuration comprises feature selection information. A first selection module is configured to select features from the user feature information and / or the recommendation item feature information based on the snapshot configuration.
26. The model training apparatus of claim 25, wherein, Further comprising: A second selection module is configured to select features from the user model features and / or the recommendation item model features based on the snapshot configuration.
27. The model training apparatus of claim 23, wherein, The bypass model generates a training sample associated with the tracking identifier based on the user feature information and the recommendation item feature information of the quasi-recommendation item, and the training sample is stored in the form of a sample snapshot. The training sample is stored in the form of a sample snapshot, and further comprising:
28. The model training apparatus of claim 27, wherein, A first decompression module is configured to decompress the sample snapshot; A first tiling module is configured to tile the user model features and the recommendation item model features according to the tracking identifier, the user identifier, and the recommendation item identifier to obtain a training sample table; A first storage module is configured to store the training sample table into a training sample library, When the online ranking model is trained and updated, the training sample table is read from the training sample library. The training sample is stored in the form of a sample snapshot in a queue, and further comprising:
29. The model training apparatus of claim 28, wherein, A consumption module is configured to consume the sample snapshot from the queue. The bypass model generates a training sample associated with the tracking identifier based on the user feature information and the recommendation item feature information of the quasi-recommendation item, and the training sample is stored in the form of a sample snapshot.
30. The model training apparatus of claim 23, wherein, The training sample is stored in the form of a sample snapshot in a queue, and further comprising: A consumption module is configured to consume the sample snapshot from the queue.
31. The model training apparatus of claim 30, wherein, The bypass model generates a training sample associated with the tracking identifier based on the user feature information and the recommendation item feature information of the quasi-recommendation item, and the training sample is stored in the form of a sample snapshot. The training sample is stored in the form of a sample snapshot in a queue, and further comprising: A consumption module is configured to consume the sample snapshot from the queue. The bypass model generates a training sample associated with the tracking identifier based on the user feature information and the recommendation item feature information of the quasi-recommendation item, and the training sample is stored in the form of a sample snapshot. The steps performed by the ranking module and the steps performed by the second sending module are executed asynchronously. The bypass model has an offline environment.
32. The model training apparatus according to any one of claims 18 to 31, characterized in that, The tracking identifier is a distributed identifier generated based on a snowflake algorithm.
33. The model training apparatus according to any one of claims 18 to 31, characterized by, Comprising:
34. The model training apparatus according to any one of claims 18 to 31, characterized by, A processing unit; 35. A processor data operation processing apparatus, comprising: A storage unit storing executable instructions of the processing unit; The processing unit is configured to execute the executable instructions to perform: The model training method according to any one of claims 1 to 17.
36. A computer readable storage medium for storing a program, characterized in that, The program is executed to implement: The model training method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Information recommendation and model training method, device and equipment and storage medium
CN110162700A
Feature management method and system for recommendation model
CN112182359A