Sample construction method and device, equipment and storage medium
By constructing negative samples based on location information, the problem of the impact of project position information in the CTR prediction model is solved, the training accuracy of the model and the accuracy of the recommendation system are improved, and the user experience and the benefits of the e-commerce platform are improved.
Patent Information
- Application Number
- CN202310593688.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-11-26
AI Technical Summary
The existing CTR prediction model does not consider project location information during the training process, resulting in poor prediction accuracy and affecting the accuracy of the recommendation system and user experience.
By obtaining historical exposed items and unexposed items, negative samples are constructed based on project location information, training data is enriched, missing negative samples are compensated, and model training accuracy is improved.
It improves the training accuracy and online inference performance of the CTR prediction model, enhances the accuracy of the recommendation project of the recommendation system, and improves the user experience and the benefits of the e-commerce platform.
Smart Images

Figure CN119027202A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a sample construction method, device, equipment and storage medium. Background Art
[0002] Click Through Ratio (CTR) prediction can be used to estimate the probability of users clicking on the recommended items provided by the recommendation system on the e-commerce platform, so it plays a vital role in the recommendation system of the e-commerce platform. Specifically, in the related technology, a CTR prediction model can be trained based on user items and user feedback information collected from the traffic log of the recommendation system, and then the trained CTR prediction model can be deployed to the real-time recommendation system to predict CTR, and then item recommendations can be made based on the CTR prediction results.
[0003] However, considering that a user may click on a recommended item not only because he likes it, but also because it is in a good position in the item list (e.g., at the front of the item list, etc.), the user feedback information collected from the traffic log of the recommendation system will be affected by the location information of the item. The training process of the CTR prediction model in the related art does not consider the influence of the above location information, resulting in poor training accuracy of the CTR prediction model, which will affect the accuracy of the subsequent recommendation system in providing recommended items to users, and further affect the user experience and the revenue of the e-commerce platform. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide a sample construction method, device, equipment and storage medium to solve the defects in the related art.
[0005] According to a first aspect of an embodiment of the present disclosure, a sample construction method is provided, the method comprising:
[0006] Acquire multiple historical exposure items corresponding to the target search term in a historical time period, where the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1;
[0007] Determine the currently unexposed items based on the currently exposed items and the multiple historically exposed items, wherein the currently exposed items include the currently actually exposed items extracted from the user log;
[0008] Determine the second position information of the currently unexposed item based on the first position information of the currently exposed item;
[0009] A first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
[0010] In some embodiments, determining the currently unexposed item based on the currently exposed item and the plurality of historically exposed items includes:
[0011] Determine other historical exposure items among the multiple historical exposure items except the current exposure item;
[0012] A preset number of items are selected from the other historically exposed items and used as the currently unexposed items.
[0013] In some embodiments, the method further comprises:
[0014] Sorting the plurality of historical exposure items according to the exposure times to obtain a list of the historical exposure items;
[0015] The determining of other historical exposure items among the plurality of historical exposure items except the current exposure item comprises:
[0016] Remove the current exposure item from the historical exposure item list to obtain the remaining items in the historical exposure item list;
[0017] The selecting a preset number of items from the other historically exposed items as the currently unexposed items includes:
[0018] The preset number of items are selected from the remaining items in order and serve as the unexposed items this time.
[0019] In some embodiments, the selecting a preset number of items from the other historically exposed items as the currently unexposed items includes:
[0020] Sorting the other historical exposure items according to the exposure times to obtain sorted historical exposure items;
[0021] The preset number of items are selected in order from the sorted historical exposure items and serve as the currently unexposed items.
[0022] In some embodiments, determining the second position information of the currently unexposed item based on the first position information of the currently exposed item includes:
[0023] Inserting the currently exposed item into the currently constructed training sample list according to the first position information;
[0024] Inserting the currently unexposed item into the training sample list at a position after the currently exposed item;
[0025] The second position information is written for the currently unexposed item based on the position inserted into the training sample list and the first position information.
[0026] In some embodiments, the method further comprises:
[0027] constructing positive samples for training the CTR prediction model based on the clicked items in the currently exposed items and their first position information;
[0028] A second portion of negative samples for training the CTR prediction model is constructed based on the unclicked items in the currently exposed items and the corresponding first position information.
[0029] In some embodiments, the method further comprises:
[0030] In response to the ratio of the number of positive samples to the total number of samples being less than or equal to a set threshold, undersampling is performed on negative samples in a negative sample set, where the negative sample set includes the first portion of negative samples and the second portion of negative samples.
[0031] According to a second aspect of an embodiment of the present disclosure, a sample construction device is provided, the device comprising:
[0032] A historical item acquisition module, used to acquire a plurality of historical exposure items corresponding to a target search term within a historical time period, wherein the number of exposures of the historical exposure items within the historical time period is greater than or equal to 1;
[0033] An unexposed item determination module, configured to determine the unexposed item based on the currently exposed item and the plurality of historically exposed items, wherein the currently exposed item includes the currently actually exposed item extracted from the user log;
[0034] A position information determination module, configured to determine the second position information of the currently unexposed item based on the first position information of the currently exposed item;
[0035] The first sample construction module is used to construct a first part of negative samples for training a click-through rate (CTR) prediction model based on the unexposed items and the second position information.
[0036] In some embodiments, the unexposed project determination module includes:
[0037] Another project determination unit, used for determining other historical exposure projects other than the current exposure project among the multiple historical exposure projects;
[0038] The unexposed item determination unit is used to select a preset number of items from the other historical exposed items and use them as the unexposed items this time.
[0039] In some embodiments, the unexposed project determination module further includes:
[0040] A history list acquisition unit, configured to sort the plurality of history exposure items according to the exposure times to obtain the history exposure item list;
[0041] The other item determination unit is further configured to remove the current exposure item from the historical exposure item list to obtain the remaining items in the historical exposure item list;
[0042] The unexposed item determination unit is further configured to select the preset number of items from the remaining items in sequence and use them as the unexposed items this time.
[0043] In some embodiments, the unexposed item determination unit is further configured to:
[0044] Sorting the other historical exposure items according to the exposure times to obtain sorted historical exposure items;
[0045] The preset number of items are selected in order from the sorted historical exposure items and serve as the currently unexposed items.
[0046] In some embodiments, the location information determination module includes:
[0047] A first inserting unit, configured to insert the currently exposed item into a currently constructed training sample list according to the first position information;
[0048] A second inserting unit, configured to insert the currently unexposed item into the training sample list at a position after the currently exposed item;
[0049] A position writing unit is used to write the second position information for the currently unexposed item based on the position inserted into the training sample list and the first position information.
[0050] In some embodiments, the apparatus further comprises:
[0051] A second sample construction module, configured to construct a positive sample for training the CTR prediction model based on the clicked item in the currently exposed item and its first position information;
[0052] The third sample construction module is used to construct a second part of negative samples for training the CTR prediction model based on the unclicked items in the currently exposed items and the corresponding first position information.
[0053] In some embodiments, the apparatus further comprises:
[0054] The undersampling module is used to perform undersampling processing on negative samples in a negative sample set in response to the ratio of the number of positive samples to the total number of samples being less than or equal to a set threshold, wherein the negative sample set includes the first part of negative samples and the second part of negative samples.
[0055] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, the device comprising:
[0056] a processor and a memory for storing a computer program;
[0057] Wherein, the processor is configured to implement, when executing the computer program:
[0058] Acquire multiple historical exposure items corresponding to the target search term in a historical time period, where the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1;
[0059] Determine the currently unexposed items based on the currently exposed items and the multiple historically exposed items, wherein the currently exposed items include the currently actually exposed items extracted from the user log;
[0060] Determine the second position information of the currently unexposed item based on the first position information of the currently exposed item;
[0061] A first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
[0062] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the following is implemented:
[0063] Acquire multiple historical exposure items corresponding to the target search term in a historical time period, where the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1;
[0064] Determine the currently unexposed items based on the currently exposed items and the multiple historically exposed items, wherein the currently exposed items include the currently actually exposed items extracted from the user log;
[0065] Determine the second position information of the currently unexposed item based on the first position information of the currently exposed item;
[0066] A first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
[0067] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0068] The present disclosure obtains multiple historical exposure items corresponding to a target search term within a historical time period, wherein the number of exposures of the historical exposure items within the historical time period is greater than or equal to 1, and determines the current unexposed items based on the current exposure items and the multiple historical exposure items, wherein the current exposure items include the items actually exposed this time extracted from the user log, and then determines the second position information of the current unexposed items based on the first position information of the current exposure items, and then constructs a first part of negative samples for training a click-through rate (CTR) prediction model based on the current unexposed items and the second position information, which can enrich the types of negative samples for training the CTR prediction model, make up for the problem of inaccurate CTR prediction caused by the lack of unexposed negative samples in the related art, improve the training accuracy of the CTR prediction model, and then improve the online reasoning performance of the CTR prediction model, so as to improve the accuracy of the subsequent recommendation system in providing recommended items to users, and improve the user experience and the revenue of the e-commerce platform.
[0069] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0071] Figure 1 is a flow chart of a sample construction method according to an exemplary embodiment of the present disclosure;
[0072] Figure 2 is a flowchart showing how to determine the currently unexposed project based on the currently exposed project and the multiple historically exposed projects according to an exemplary embodiment of the present disclosure;
[0073] Figure 3 is a flowchart showing how to determine the currently unexposed project based on the currently exposed project and the multiple historically exposed projects according to another exemplary embodiment of the present disclosure;
[0074] Figure 4 is a flowchart showing how to select a preset number of items from the other historical exposure items and use them as the currently unexposed items according to an exemplary embodiment of the present disclosure;
[0075] Figure 5 is a flowchart showing how to determine the second position information of the currently unexposed item based on the first position information of the currently exposed item according to an exemplary embodiment of the present disclosure;
[0076] Figure 6is a schematic diagram of a sample construction method according to an exemplary embodiment of the present disclosure;
[0077] Figure 7 is a block diagram of a sample construction device according to an exemplary embodiment of the present disclosure;
[0078] Figure 8 is a block diagram of another sample construction device according to an exemplary embodiment of the present disclosure;
[0079] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0080] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0081] Click Through Ratio (CTR) can be used to estimate the probability of users clicking on recommended items in specific application scenarios. It can be defined as the ratio of the number of clicks on a recommended item to the number of exposures (i.e., the number of times it is displayed) on an e-commerce platform. CTR prediction plays a vital role in the recommendation system of an e-commerce platform. The accuracy of CTR prediction will directly affect the accuracy of the recommended items provided by the recommendation system, which in turn affects the user experience and the revenue of the e-commerce platform.
[0082] At present, the application of recommendation systems mainly includes two important processes: offline training and online reasoning. In offline training, the CTR prediction model can be trained based on user items and user feedback collected from the traffic log of the recommendation system. Then in online reasoning, the trained CTR prediction model can be deployed to the real-time recommendation system to predict CTR, and then project recommendations are made based on the CTR prediction results. However, there is a position bias in the user feedback collected from the traffic log of the recommendation system, that is, a user may click on a recommended item not only because he likes it, but also because it is in the front row and easy to click. In order to eliminate the above position bias, there are two solutions in the related art:
[0083] One solution is to use the location information of the item as a feature in the training data of the CTR prediction model. Furthermore, since the actual location information of the item cannot be obtained in online reasoning, the default location value is usually used to predict the CTR in this solution. However, using different default location values will lead to completely different prediction results, which will lead to poor online reasoning performance of the model and poor generalization of the model.
[0084] Another solution is to use the location information of the item as a module of the CTR prediction model, that is, to model the location information in offline training so as to perform online reasoning without location information. However, if only exposure samples are used for offline training like most recommendation systems, the online reasoning performance of the model will be poor.
[0085] In view of this, the embodiments of the present disclosure provide the following sample construction method, apparatus, device and storage medium, which eliminate the influence of the position information of the recommended items during the CTR prediction model training process by constructing negative samples using unexposed samples, thereby solving the above-mentioned problems in the related art.
[0086] Figure 1 is a flow chart of a sample construction method according to an exemplary embodiment; the method of this embodiment can be executed by a sample construction device, which can be implemented by software and / or hardware and can be configured in electronic devices, such as servers, workstations, personal computers, mobile terminals (such as mobile phones, tablet computers, etc.), wearable devices (such as glasses, watches, etc.), etc. Specifically, Figure 1 As shown, the method includes the following steps S101-S104:
[0087] In step S101, a plurality of historical exposure items corresponding to a target search term within a historical time period are obtained.
[0088] In this embodiment, when constructing training samples for training a CTR prediction model, multiple historical exposure items corresponding to the target search term in a historical time period may be obtained, wherein the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1.
[0089] The above historical time period may be a time period of a preset length before the current moment.
[0090] It is worth noting that the above-mentioned preset duration can be set based on actual business needs, such as being set to 1 week, 1 month, etc., and this embodiment does not limit this.
[0091] The target search term may be determined based on the type of item recommended by the recommendation system, such as a game application, etc. This embodiment does not limit this.
[0092] In some embodiments, multiple historical exposure items corresponding to the target search term in the above historical time period can be extracted from the historical data recorded in the database of the recommendation system. Exemplarily, the multiple historical exposure items can be stored and presented in the form of a list (hereinafter referred to as the historical exposure item list), which is not limited in this embodiment.
[0093] In step S102, the currently unexposed items are determined based on the currently exposed items and the plurality of historically exposed items.
[0094] In this embodiment, after obtaining a plurality of historical exposure items corresponding to the target search term within the historical time period, the current non-exposed item may be determined based on the current exposure item and the plurality of historical exposure items.
[0095] Among them, the above-mentioned exposed items include the items actually exposed this time extracted from the user log.
[0096] For example, the above-mentioned current exposure project may be an actual exposure sample of a user device (such as a smart phone, tablet computer, etc.). Exemplarily, the above-mentioned actual exposure sample may be obtained from the user log of the user device. On this basis, the current non-exposed project may be determined from the multiple historical exposure projects based on the current exposure project, wherein the current non-exposed project may refer to the project that the above-mentioned user device has not exposed this time, and thus other projects (i.e., projects different from the current exposure project) may be selected from the multiple historical exposure projects as the current non-exposed project based on the current exposure project.
[0097] In one embodiment, the above method of determining the currently unexposed project based on the currently exposed project and the multiple historically exposed projects can also refer to the following Figure 2 The illustrated embodiment will not be described in detail here.
[0098] In step S103, the second position information of the item not exposed this time is determined based on the first position information of the item exposed this time.
[0099] In this embodiment, after the currently unexposed item is determined based on the currently exposed item and the plurality of historically exposed items, the second position information of the currently unexposed item may be determined based on the first position information of the currently exposed item.
[0100] In some embodiments, when determining the second position information of the unexposed item, position information different from the first position information can be determined for the unexposed item, that is, position information other than the first position information is determined as the second position information of the unexposed item.
[0101] In another embodiment, the above method of determining the second position information of the currently unexposed item based on the first position information of the currently exposed item can also refer to the following Figure 5 The illustrated embodiment will not be described in detail here.
[0102] In step S104, a first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
[0103] In this embodiment, after the second position information of the currently unexposed item is determined based on the first position information of the currently exposed item, a first portion of negative samples for training a click-through rate (CTR) prediction model may be constructed based on the currently unexposed item and the second position information.
[0104] In some embodiments, positive samples for training the CTR prediction model can also be constructed based on the clicked items in the currently exposed items and their first position information, and a second part of negative samples for training the CTR prediction model can be constructed based on the unclicked items in the currently exposed items and their corresponding first position information.
[0105] On this basis, in response to the ratio of the number of positive samples to the total number of samples being less than or equal to a set threshold, under-sampling processing can be performed on the negative samples in the negative sample set so that the ratio of the number of positive samples to the total number of processed samples is greater than the set threshold.
[0106] The negative sample set includes the first part of negative samples and the second part of negative samples.
[0107] It is worth noting that the above threshold value can be set based on actual business needs, such as being set to 10%, etc., and this embodiment does not limit this.
[0108] As can be seen from the above description, the method of this embodiment obtains multiple historical exposure items corresponding to the target search term in the historical time period, the exposure times of the historical exposure items in the historical time period are greater than or equal to 1 time, and determines the current unexposed items based on the current exposure items and the multiple historical exposure items, the current exposure items include the items actually exposed this time extracted from the user log, and then determines the second position information of the current unexposed items based on the first position information of the current exposure items, and then constructs the first part of negative samples for training the click-through rate CTR prediction model based on the current unexposed items and the second position information, which can enrich the types of negative samples used to train the CTR prediction model, improve the training accuracy of the CTR prediction model, and then improve the online reasoning performance of the CTR prediction model, so as to improve the accuracy of the subsequent recommendation system in providing recommended items to users, as well as improve the user experience and the revenue of the e-commerce platform.
[0109] Figure 2 According to an exemplary embodiment of the present disclosure, a flowchart is shown showing how to determine the current unexposed items based on the current exposure items and the multiple historical exposure items; based on the above-mentioned embodiment, this embodiment uses an example of how to determine the current unexposed items based on the current exposure items and the multiple historical exposure items.
[0110] like Figure 2 As shown, the step S102 described above of determining the currently unexposed item based on the currently exposed item and the multiple historically exposed items may include the following steps S201-S202:
[0111] In step S201, other historical exposure items among the plurality of historical exposure items except the current exposure item are determined.
[0112] In this embodiment, after obtaining a plurality of historical exposure items corresponding to the target search term within the historical time period, other historical exposure items other than the current exposure item among the plurality of historical exposure items may be determined.
[0113] For example, the current exposure item may be deleted from the multiple historical exposure items, and then the remaining items after deleting the current exposure item are used as the other historical exposure items.
[0114] In step S202, a preset number of items are selected from the other historical exposure items and used as the currently unexposed items.
[0115] In this embodiment, after determining other historical exposure items among the multiple historical exposure items except the current exposure item, a preset number of items may be selected from the other historical exposure items and used as the current non-exposed items.
[0116] It is worth noting that the above preset number can be set based on actual scenario needs, such as being set to 30% of the total number of samples, etc., and this embodiment does not limit this.
[0117] In some embodiments, the above method of selecting a preset number of items from the other historical exposure items can be set based on actual needs, such as setting it to select according to the number of exposures or randomly selecting, etc. This embodiment does not limit this.
[0118] In some other embodiments, the above method of selecting a preset number of items from the other historical exposure items can also refer to the following Figure 4 The illustrated embodiment will not be described in detail here.
[0119] From the above description, it can be seen that this embodiment determines other historical exposure items in the multiple historical exposure items except the current exposure item, and selects a preset number of items from the other historical exposure items as the current unexposed items. This can achieve accurate determination of the current unexposed items based on the current exposure items and the multiple historical exposure items, and then can achieve subsequent construction of the first part of negative samples based on the current unexposed items and the second position information, which can enrich the types of negative samples used to train the CTR prediction model, thereby improving the online reasoning performance of the CTR prediction model, and thus can improve the accuracy of the subsequent recommendation system in providing recommended items to users.
[0120] Figure 3 It is a flowchart showing how to determine the current non-exposed items based on the current exposure items and the multiple historical exposure items according to another exemplary embodiment of the present disclosure; this embodiment, based on the above embodiment, uses an example of how to determine the current non-exposed items based on the current exposure items and the multiple historical exposure items.
[0121] like Figure 3 As shown, the step S102 described above of determining the currently unexposed item based on the currently exposed item and the multiple historically exposed items may include the following steps S301-S303:
[0122] In step S301, the plurality of historical exposure items are sorted according to the exposure times to obtain the historical exposure item list.
[0123] In this embodiment, after obtaining a plurality of historical exposure items corresponding to the target search term within the historical time period, the plurality of historical exposure items may be sorted according to the exposure times to obtain the historical exposure item list.
[0124] In some embodiments, the plurality of historical exposure items may be sorted in order of exposure times from most to least, and the sorting result may be inserted into the historical exposure item list.
[0125] In step S302, the current exposure item is removed from the historical exposure item list to obtain the remaining items in the historical exposure item list.
[0126] In this embodiment, after obtaining the list of historical exposure items, the current exposure item may be removed from the list of historical exposure items, thereby obtaining the remaining items in the list of historical exposure items. It is understandable that the order of the remaining items in the list may not be changed during the process of removing the current exposure item from the list of historical exposure items, so the remaining items in the list are still arranged in order of the most exposure times to the least exposure times.
[0127] In step S303, the preset number of items are selected from the remaining items in order and used as the items not exposed this time.
[0128] In this embodiment, after removing the currently exposed items from the historical exposure item list and obtaining the remaining items in the historical exposure item list, the preset number of items can be selected from the remaining items in order (i.e., the arrangement order from front to back in the table) and used as the currently unexposed items.
[0129] From the above description, it can be seen that this embodiment obtains the list of historical exposure items by sorting the multiple historical exposure items according to the number of exposures, and removes the current exposure items from the list of historical exposure items to obtain the remaining items in the list of historical exposure items, and then selects the preset number of items from the remaining items in order as the current unexposed items. This can accurately determine the current unexposed items, and further lay the foundation for the subsequent construction of the first part of negative samples based on the current unexposed items and the second position information, which can improve the training accuracy of the CTR prediction model, and further improve the online reasoning performance of the CTR prediction model, thereby improving the accuracy of the subsequent recommendation system in providing recommended items to users.
[0130] Figure 4 It is a flowchart showing how to select a preset number of items from the other historical exposure items and use them as the currently unexposed items according to an exemplary embodiment of the present disclosure; this embodiment, based on the above embodiment, uses an example of how to select a preset number of items from the other historical exposure items as an example to exemplify.
[0131] like Figure 4As shown, the step S202 described above of selecting a preset number of items from the other historical exposure items and using them as the current unexposed items may include the following steps S401-S402:
[0132] In step S401, the other historical exposure items are sorted according to the exposure times to obtain sorted historical exposure items.
[0133] In this embodiment, after determining other historical exposure items other than the current exposure item among the multiple historical exposure items, the other historical exposure items may be sorted according to the number of exposures to obtain sorted historical exposure items.
[0134] In some embodiments, the other historical exposure items may be sorted in order of the number of exposures from most to least to obtain sorted historical exposure items.
[0135] In step S402, the preset number of items are selected in order from the sorted historical exposure items and used as the currently unexposed items.
[0136] In this embodiment, after obtaining the sorted historical exposure items, the preset number of items can be selected from the sorted historical exposure items in order (ie, in order of arrangement from front to back) and used as the currently unexposed items.
[0137] From the above description, it can be seen that this embodiment obtains sorted historical exposure items by sorting the other historical exposure items according to the number of exposures, and selects the preset number of items in order from the sorted historical exposure items as the unexposed items this time. This can achieve reasonable selection of a preset number of items from the other historical exposure items as the unexposed items this time, and then can achieve subsequent construction of the first part of negative samples based on the unexposed items this time and the second position information. Since the unexposed negative samples are compensated, the training accuracy of the CTR prediction model can be improved, and then the online reasoning performance of the CTR prediction model can be improved, and the accuracy of the subsequent recommendation system in providing recommended items to users can be improved.
[0138] Figure 5 It is a flowchart showing how to determine the second position information of the non-exposed item based on the first position information of the exposed item according to an exemplary embodiment of the present disclosure; based on the above embodiment, this embodiment uses the example of how to determine the second position information of the non-exposed item based on the first position information of the exposed item to illustrate an exemplary description.
[0139] like Figure 5As shown, the determination of the second position information of the currently unexposed item based on the first position information of the currently exposed item in the above step S103 may include the following steps S501-S503:
[0140] In step S501, the current exposure item is inserted into the currently constructed training sample list according to the first position information.
[0141] In this embodiment, when the second position information of the currently unexposed item is determined based on the first position information of the currently exposed item, the currently exposed item may be first inserted into the currently constructed training sample list according to the first position information.
[0142] For example, a training sample list for inserting training samples of the CTR model may be constructed (ie, an empty list is constructed), and then the current exposure items are inserted into the currently constructed training sample list according to the sequence of the first position information.
[0143] In step S502, the currently unexposed item is inserted into the training sample list at a position after the currently exposed item.
[0144] In this embodiment, after the currently exposed item is inserted into the currently constructed training sample list according to the first position information, the currently unexposed item may be inserted into the position after the currently exposed item in the training sample list.
[0145] In step S503, the second position information is written for the currently unexposed item based on the position inserted into the training sample list and the first position information.
[0146] In this embodiment, after the currently unexposed item is inserted into the position after the currently exposed item in the training sample list, the second position information can be written for the currently unexposed item based on the position inserted into the training sample list and the first position information.
[0147] In some embodiments, after the currently unexposed item is inserted into the position after the currently exposed item in the training sample list, the position information of the previous item of each currently unexposed item can be detected, and then the second position information of the currently unexposed item is determined as the next position information adjacent to the position information of the previous item. Exemplarily, if the position information of the previous item of the currently unexposed item is POS=5, the second position information of the currently unexposed item can be determined as the next position information adjacent to POS=5, that is, POS=6.
[0148] From the above description, it can be seen that in this embodiment, by inserting the exposed item this time into the currently constructed training sample list according to the first position information, and inserting the unexposed item this time into the position in the training sample list after the exposed item this time, and then writing the second position information for the unexposed item this time based on the position inserted into the training sample list and the first position information, it is possible to reasonably determine the second position information of the unexposed item this time, and then subsequently construct the first part of negative samples for training the click-through rate CTR prediction model based on the unexposed item this time and the second position information, which can improve the training accuracy of the CTR prediction model, and then improve the online reasoning performance of the CTR prediction model, and improve the accuracy of the subsequent recommendation system in providing recommended items to users.
[0149] The sample construction method of the present disclosure is described below with a specific example, but is not intended to limit the scope of the present disclosure.
[0150] Figure 6 is a schematic diagram of a sample construction method according to an exemplary embodiment of the present disclosure; wherein, this embodiment is described by taking a project as a game (game application) as an example, that is, each game in the figure represents a project.
[0151] like Figure 6 As shown, when constructing the training sample of the CTR prediction model, the following steps can be implemented:
[0152] 6.1. Obtain multiple historical exposure items corresponding to the target search term in the historical time period, and sort them in order of the number of exposures, so as to obtain a list of historical exposure items (i.e., Figure 6 ), wherein the number of exposures of each historical exposure item in the list during the historical time period is greater than or equal to 1;
[0153] 6.2. After obtaining the above-mentioned historical exposure project list, the current exposure project can be removed from the historical exposure project list (i.e., Figure 6 ), obtain the remaining items in the historical exposure item list, and then select a preset number of items from the remaining items in order from front to back as the non-exposed items (e.g., game2, game5, and game6);
[0154] 6.3. After the above-mentioned unexposed items are determined, the above-mentioned exposed items (such as gameA to gameF) can be inserted into the currently constructed training sample list (i.e., Figure 6); then the unexposed items (i.e., game2, game5, and game6) are inserted into the position after the exposed items in the training sample list (i.e., the position after gameF in the training sample list); then, based on the position inserted into the training sample list and the first position information, the second position information can be written for the unexposed items, i.e., position information pos=7, pos=8, and pos=9 are determined for the game2, game5, and game6, respectively;
[0155] 6.4. On this basis, we can get Figure 6 Specifically, the list includes a first part of negative samples constructed based on the unexposed items and the second position information, a second part of negative samples constructed based on the unclicked items in the exposed items and the corresponding first position information, and a positive sample constructed based on the clicked items in the exposed items and their first position information.
[0156] 6.5. In order to ensure that the proportion of positive samples in the training sample list meets the requirements of model training, this embodiment can detect whether the proportion of the number of positive samples to the total number of samples is less than or equal to a set threshold. If it is detected that it is less than or equal to the set threshold, the negative samples in the negative sample set can be undersampled, so that the proportion of the number of positive samples to the total number of processed samples is greater than the set threshold. The negative sample set includes the first part of negative samples and the second part of negative samples.
[0157] Figure 7 is a block diagram of a sample construction device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be implemented by software and / or hardware, and can be configured in electronic devices, such as servers, workstations, personal computers, mobile terminals (such as mobile phones, tablet computers, etc.), wearable devices (such as glasses, watches, etc.), etc. Specifically, Figure 7 As shown, the device may include: a historical item acquisition module 110, an unexposed item determination module 120, a position information determination module 130 and a first sample construction module 140, wherein:
[0158] A historical item acquisition module 110 is used to acquire a plurality of historical exposure items corresponding to a target search term in a historical time period, wherein the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1;
[0159] An unexposed item determination module 120, configured to determine the unexposed item based on the currently exposed item and the plurality of historically exposed items, wherein the currently exposed item includes the item actually exposed this time extracted from the user log;
[0160] A position information determination module 130, configured to determine the second position information of the currently unexposed item based on the first position information of the currently exposed item;
[0161] The first sample construction module 140 is used to construct a first part of negative samples for training a click-through rate (CTR) prediction model based on the currently unexposed items and the second position information.
[0162] As can be seen from the above description, the device of this embodiment obtains multiple historical exposure items corresponding to the target search term in the historical time period, and the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1 time, and determines the current unexposed item based on the current exposure item and the multiple historical exposure items, and the current exposure item includes the item actually exposed this time extracted from the user log, and then determines the second position information of the current unexposed item based on the first position information of the current exposure item, and then constructs the first part of negative samples for training the click-through rate CTR prediction model based on the current unexposed item and the second position information. This can enrich the types of negative samples used to train the CTR prediction model, make up for the problem of inaccurate CTR prediction due to the lack of unexposed negative samples in the related technology, and can improve the training accuracy of the CTR prediction model, and then improve the online reasoning performance of the CTR prediction model, so as to improve the accuracy of the subsequent recommendation system in providing recommended items to users, as well as improve the user experience and the revenue of the e-commerce platform.
[0163] Figure 8 2 is a block diagram of another sample construction device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be implemented by software and / or hardware, and can be configured in electronic devices, such as servers, workstations, personal computers, mobile terminals (such as mobile phones, tablet computers, etc.), wearable devices (such as glasses, watches, etc.), etc. Among them, the historical project acquisition module 210, the unexposed project determination module 220, the location information determination module 230 and the first sample construction module 240 are the same as the aforementioned Figure 7 The functions of the historical item acquisition module 110 , the unexposed item determination module 120 , the position information determination module 130 and the first sample construction module 140 in the illustrated embodiment are the same and will not be described in detail herein.
[0164] like Figure 8 As shown, the unexposed project determination module 120 may include:
[0165] Other item determination unit 221, used to determine other historical exposure items among the multiple historical exposure items except the current exposure item;
[0166] The unexposed item determination unit 222 is configured to select a preset number of items from the other historical exposed items as the currently unexposed items.
[0167] In some embodiments, the unexposed project determination module 220 may further include:
[0168] A history list acquisition unit 223, configured to sort the plurality of history exposure items according to the exposure times to obtain the history exposure item list;
[0169] Furthermore, the other item determination unit 221 may also be used to remove the current exposure item from the historical exposure item list to obtain the remaining items in the historical exposure item list;
[0170] The unexposed item determination unit 222 may also be configured to select the preset number of items from the remaining items in order and use them as the unexposed items for this time.
[0171] In some embodiments, the unexposed item determination unit 220 may also be used to:
[0172] Sorting the other historical exposure items according to the exposure times to obtain sorted historical exposure items;
[0173] The preset number of items are selected in order from the sorted historical exposure items and serve as the currently unexposed items.
[0174] In some embodiments, the location information determination module 230 may include:
[0175] A first inserting unit 231 is used to insert the current exposure item into the currently constructed training sample list according to the first position information;
[0176] A second inserting unit 232, configured to insert the currently unexposed item into the training sample list at a position after the currently exposed item;
[0177] The position writing unit 233 is used to write the second position information for the currently unexposed item based on the position inserted into the training sample list and the first position information.
[0178] In some embodiments, the above apparatus may further include:
[0179] A second sample construction module 250, configured to construct a positive sample for training the CTR prediction model based on the clicked item in the currently exposed items and its first position information;
[0180] The third sample construction module 260 is used to construct a second part of negative samples for training the CTR prediction model based on the unclicked items in the currently exposed items and the corresponding first position information.
[0181] In some embodiments, the above apparatus may further include:
[0182] The undersampling module 270 is used to perform undersampling processing on negative samples in a negative sample set in response to the ratio of the number of positive samples to the total number of samples being less than or equal to a set threshold, wherein the negative sample set includes the first part of negative samples and the second part of negative samples.
[0183] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0184] Fig. 9 900 is a block diagram of an electronic device according to an exemplary embodiment. For example, the device 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0185] Reference Fig. 9 , device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0186] The processing component 902 generally controls the overall operation of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0187] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0188] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.
[0189] The multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display panel and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0190] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
[0191] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0192] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display panel and keypad of the device 900, and the sensor assembly 914 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 914 can also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0193] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0194] In an exemplary embodiment, the device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0195] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by the processor 920 of the device 900 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0196] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0197] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A sample construction method, characterized in that: The method comprises: Acquire multiple historical exposure items corresponding to the target search term in a historical time period, where the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1; Determine the currently unexposed items based on the currently exposed items and the multiple historically exposed items, wherein the currently exposed items include the currently actually exposed items extracted from the user log; Determine the second position information of the currently unexposed item based on the first position information of the currently exposed item; A first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
2. The method according to claim 1, characterized in that The determining of the currently unexposed project based on the currently exposed project and the plurality of historically exposed projects includes: Determine other historical exposure items among the multiple historical exposure items except the current exposure item; A preset number of items are selected from the other historically exposed items and used as the currently unexposed items.
3. The method according to claim 2, characterized in that The method further comprises: Sorting the plurality of historical exposure items according to the exposure times to obtain a list of the historical exposure items; The determining of other historical exposure items among the plurality of historical exposure items except the current exposure item comprises: Remove the current exposure item from the historical exposure item list to obtain the remaining items in the historical exposure item list; The selecting a preset number of items from the other historically exposed items as the currently unexposed items includes: The preset number of items are selected from the remaining items in order and serve as the unexposed items this time.
4. The method according to claim 2, characterized in that: The selecting a preset number of items from the other historically exposed items as the currently unexposed items includes: Sorting the other historical exposure items according to the exposure times to obtain sorted historical exposure items; The preset number of items are selected in order from the sorted historical exposure items and serve as the currently unexposed items.
5. The method according to claim 1, characterized in that The determining the second position information of the currently unexposed item based on the first position information of the currently exposed item includes: Inserting the currently exposed item into the currently constructed training sample list according to the first position information; Inserting the currently unexposed item into the training sample list at a position after the currently exposed item; The second position information is written for the currently unexposed item based on the position inserted into the training sample list and the first position information.
6. The method according to claim 1, characterized in that The method further comprises: constructing positive samples for training the CTR prediction model based on the clicked items in the currently exposed items and their first position information; A second portion of negative samples for training the CTR prediction model is constructed based on the unclicked items in the currently exposed items and the corresponding first position information.
7. The method according to claim 6, characterized in that The method further comprises: In response to the ratio of the number of positive samples to the total number of samples being less than or equal to a set threshold, undersampling is performed on negative samples in a negative sample set, where the negative sample set includes the first portion of negative samples and the second portion of negative samples.
8. A sample construction device, characterized in that: The device comprises: A historical item acquisition module, used to acquire a plurality of historical exposure items corresponding to a target search term within a historical time period, wherein the number of exposures of the historical exposure items within the historical time period is greater than or equal to 1; An unexposed item determination module, configured to determine the unexposed item based on the currently exposed item and the plurality of historically exposed items, wherein the currently exposed item includes the currently actually exposed item extracted from the user log; A position information determination module, configured to determine the second position information of the currently unexposed item based on the first position information of the currently exposed item; The first sample construction module is used to construct a first part of negative samples for training a click-through rate (CTR) prediction model based on the unexposed items and the second position information.
9. The device according to claim 8, characterized in that The unexposed project determination module includes: Another project determination unit, used for determining other historical exposure projects other than the current exposure project among the multiple historical exposure projects; The unexposed item determination unit is used to select a preset number of items from the other historical exposed items and use them as the unexposed items this time.
10. An electronic device, characterized in that: The device comprises: a processor and a memory for storing a computer program; Wherein, the processor is configured to implement, when executing the computer program: Acquire multiple historical exposure items corresponding to the target search term in a historical time period, where the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1; Determine the currently unexposed items based on the currently exposed items and the multiple historically exposed items, wherein the currently exposed items include the currently actually exposed items extracted from the user log; Determine the second position information of the currently unexposed item based on the first position information of the currently exposed item; A first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it realizes: Acquire multiple historical exposure items corresponding to the target search term in a historical time period, where the number of exposures of the historical exposure items in the historical time period is greater than or equal to 1; Determine the currently unexposed items based on the currently exposed items and the multiple historically exposed items, wherein the currently exposed items include the currently actually exposed items extracted from the user log; Determine the second position information of the currently unexposed item based on the first position information of the currently exposed item; A first portion of negative samples for training a click-through rate (CTR) prediction model is constructed based on the currently unexposed items and the second position information.
