A method and device for generating training samples

By determining the recommended information and samples to be filled for each business scenario, querying and extracting the target data to be filled, the problem of maintaining training samples in different business scenarios is solved, and efficient training sample generation is achieved.

CN110717536BActive Publication Date: 2025-04-29BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910944345.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-30
Publication Date
2025-04-29
Estimated Expiration
2039-09-30

AI Technical Summary

Technical Problem

In the prior art, training samples for different business scenarios are difficult to maintain and lack a unified generation method, resulting in low maintenance efficiency and low generation efficiency.

Method used

By determining recommendation information for each business scenario, determining the samples to be filled based on the user's operation results, and querying the recommendation information and user information during model training, extracting the target data to fill the samples, and generating training samples for model training.

Benefits of technology

A unified training sample generation method is realized, which reduces maintenance difficulty and improves the generation efficiency of training samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110717536B_ABST
    Figure CN110717536B_ABST
Patent Text Reader

Abstract

This specification discloses a method and device for generating training samples, in which for each business scenario, at least one recommendation information recommended to a user is determined, for each recommendation information, according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario, the sample to be filled corresponding to the recommendation information in the business scenario is determined and saved, when the model is trained in the business scenario, according to the data identifier and the user identifier in the sample to be filled, the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier are queried, and the target data is extracted from the queried recommendation information and the user information respectively, and the sample to be filled is filled with the extracted target data to generate a training sample for model training in the business scenario. This makes it convenient to maintain the training samples and improves the efficiency of generating training samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and more particularly to a method and device for generating training samples. Background Art

[0002] In order to provide users with a better service experience, each service platform can analyze the user's service preferences and habits based on the user's historical service records, historical browsing records and other information to recommend information to the user.

[0003] Normally, the business platform can implement information recommendation in the business scenario through the prediction model set for the business scenario. In order to enable the prediction model to adapt to business changes, the business platform needs to train the prediction model based on the business log to update the prediction model. Specifically, the business platform can extract feature data from the business log, and input the feature data into the prediction model to obtain the prediction result, and recommend the recommended information determined by the prediction result to the user, while monitoring the operation results performed by the user based on the recommended information. The business platform can subsequently train the prediction model based on the recommendation information and the operation results to update the prediction model.

[0004] However, in the prior art, training samples of different business scenarios are often obtained according to the training sample generation method of each business scenario, which greatly increases the difficulty of maintaining the training samples. Therefore, how to reduce the difficulty of maintaining the training samples is an urgent problem to be solved. Summary of the invention

[0005] This specification provides a method and device for generating training samples to partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This specification provides a method for generating a training sample, comprising:

[0008] For each business scenario, determining at least one piece of recommended information to be recommended to the user in the business scenario;

[0009] For each piece of recommended information, according to the data identifier corresponding to the recommended information, the user identifier of the user, and the operation result of the user on the recommended information in the business scenario, determine and save the sample to be filled corresponding to the recommended information in the business scenario;

[0010] When model training is performed in this business scenario, based on the data identifier and the user identifier in the sample to be filled, the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier are queried;

[0011] Extracting target data from the queried recommendation information and the user information respectively;

[0012] The sample to be filled is filled with the extracted target data to generate training samples for model training in the business scenario.

[0013] Optionally, according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario, determining and saving the to-be-filled sample corresponding to the recommendation information in the business scenario specifically includes:

[0014] Determining a sample label corresponding to the recommendation information in the business scenario according to an operation result of the user on the recommendation information in the business scenario;

[0015] Determining a data category corresponding to the user information of the user as a first data category, and determining a data category corresponding to the recommendation information as a second data category;

[0016] According to the sample label, the correspondence between the user identifier and the first data category, and the correspondence between the data identifier and the second data category, the sample to be filled corresponding to the recommendation information in the business scenario is determined and saved.

[0017] Optionally, extracting target data from the queried recommendation information and the user information respectively includes:

[0018] According to the first data category contained in the sample to be filled, the data required for the first data category is extracted from the user information as the target data; according to the second data category contained in the sample to be filled, the data required for the second data category is extracted from the queried recommendation information as the target data.

[0019] Optionally, filling the sample to be filled with the extracted target data to generate a training sample for model training in the business scenario specifically includes:

[0020] Using the target data extracted from the user information as the first key value corresponding to the user identifier, and using the target data extracted from the queried recommendation information as the second key value corresponding to the data identifier;

[0021] The first key value and the second key value are used to fill in the to-be-filled samples corresponding to the business scenario, and to generate training samples for model training in the business scenario.

[0022] Optionally, the method further comprises:

[0023] Determine the corresponding mirror model of the prediction model set in the online service system under the business scenario in the offline test system under the business scenario as the model to be trained;

[0024] Extracting feature data required by the model to be trained from the target data contained in the training sample;

[0025] Training the model to be trained according to the feature data and the sample labels contained in the training samples;

[0026] The prediction model is updated by using the trained model to be trained.

[0027] This specification provides a real-time generation device for training samples, including:

[0028] A determination module, used to determine, for each business scenario, at least one piece of recommendation information to be recommended to the user in the business scenario;

[0029] A saving module, used to determine and save, for each piece of recommended information, a sample to be filled corresponding to the recommended information in the business scenario according to the data identifier corresponding to the recommended information, the user identifier of the user, and the operation result of the user on the recommended information in the business scenario;

[0030] A query module, used to query the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier according to the data identifier and the user identifier in the sample to be filled when the model is trained in the business scenario;

[0031] An extraction module, used to extract target data from the queried recommendation information and the user information respectively;

[0032] A generation module is used to fill the samples to be filled with the extracted target data to generate training samples for model training in the business scenario.

[0033] Optionally, the saving module is specifically used to determine a sample label corresponding to the recommended information in the business scenario based on the operation results of the user on the recommended information in the business scenario; determine a data category corresponding to the user information of the user as the first data category, and determine the data category corresponding to the recommended information as the second data category; determine and save the sample to be filled corresponding to the recommended information in the business scenario based on the sample label, the correspondence between the user identifier and the first data category, and the correspondence between the data identifier and the second data category.

[0034] Optionally, the extraction module is specifically used to extract data required for the first data category from the user information as target data based on the first data category contained in the sample to be filled, and to extract data required for the second data category from the queried recommendation information as target data based on the second data category contained in the sample to be filled.

[0035] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for generating training samples is implemented.

[0036] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for generating training samples when executing the program.

[0037] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0038] In the method for generating training samples provided in the present specification, for each business scenario, at least one recommendation information recommended to the user can be determined. For each recommendation information, the sample to be filled corresponding to the recommendation information in the business scenario is determined and saved according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario. When performing model training for the business scenario, the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier are queried according to the data identifier and the user identifier in the sample to be filled, and the target data are respectively extracted from the queried recommendation information and the user information, and the sample to be filled is filled with the extracted target data to generate a training sample for model training for the business scenario.

[0039] It can be seen from the above method that for each business scenario, the samples to be filled corresponding to the recommended information in the business scenario can be determined and saved according to the recommended information and the user's operation results on the recommended information in the business scenario. When model training is required later, the saved samples to be filled can be filled to generate training samples for model training in the business scenario. In this way, the training samples of different business scenarios are maintained in a unified manner, which greatly facilitates the maintenance of training samples and greatly improves the efficiency of generating training samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0041] Figure 1 A schematic diagram of a process for generating training samples provided in this specification;

[0042] Figure 2 A schematic diagram for determining a sample to be filled provided in this specification;

[0043] Figure 3 A schematic diagram of the process of filling training samples for the server provided in this specification;

[0044] Figure 4 A schematic diagram of a device for generating training samples provided in this specification;

[0045] Figure 5 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of this specification clearer, the technical solutions in this specification will be clearly and completely described in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0047] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0048] Figure 1 A flow chart of generating training samples provided in this specification specifically includes the following steps:

[0049] S101: For each business scenario, determine at least one piece of recommendation information to be recommended to a user in the business scenario.

[0050] In this specification, before generating training samples for model training, at least one recommendation information to be recommended to the user may be determined. The execution subject of determining the recommendation information may be a server or a terminal device such as a computer. For ease of description, the method for generating training samples provided in this specification will be described below by taking the server as the execution subject as an example.

[0051] The server may determine at least one recommendation information to be recommended to the user based on the user's user identification. The recommendation of information to the user based on the user's user identification mentioned here may refer to the user server sending a service request carrying the user's user identification, and the server may determine attribute information (such as user portrait) that can reflect the user's preferences, interests, shopping habits, etc. based on the user identification, and then determine the recommendation information to be recommended to the user based on the user's attribute information through a prediction model set in the server.

[0052] For another example, when a user starts an application (Application, App) installed in a terminal, the terminal can send a service request carrying a user identifier to the server corresponding to the App based on the user account logged in by the user in the App (the user identifier can refer to the user account, or it can refer to identification information such as the user's mobile phone number, ID number, etc. queried through the user account). Correspondingly, the server can query the user's attribute information based on the user identifier carried in the received service request, and then recommend information to the user based on the user's attribute information through a prediction model. Other specific forms are not illustrated one by one here.

[0053] It should be noted that, in actual applications, the same information can be recommended to users as recommendation information for different business scenarios. Since the models used to recommend information to users are different in different business scenarios, in this specification, for the same recommendation information, it is necessary to determine the training samples of the model used in the business scenario for each business scenario. That is, for the same recommendation information, the training samples corresponding to the recommendation information in different business scenarios may be different.

[0054] S102: For each piece of recommendation information, according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario, determine and save the sample to be filled corresponding to the recommendation information in the business scenario.

[0055] For each business scenario, after the server determines at least one recommendation information to be sent to the user, it can further obtain the operation results of the user on the recommendation information in the business scenario. The operation results can reflect the specific operation of the user on the recommendation information in the business scenario. For example, for each recommendation information obtained by the user, the operation result records information such as whether the user clicked to view the recommendation information and the specific browsing time.

[0056] The server can determine, for each determined recommendation information, the sample to be filled corresponding to the recommendation information in the business scenario according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information. The data identifier corresponding to the recommendation information mentioned here is used to uniquely identify the recommendation information, and the operation result of the user on the recommendation information is mainly used to determine the sample label corresponding to the recommendation information.

[0057] Specifically, if it is determined through the operation result that the user has viewed the recommended information by performing a specified operation such as clicking or pressing, then it can be determined that the sample label corresponding to the recommended information in the business scenario is a positive sample, otherwise, it can be determined that the sample label corresponding to the recommended information in the business scenario is a negative sample. In other words, the server can label the recommended information as positive and negative samples through the operation result. Among them, the user viewing the recommended information by performing a specified operation mentioned here does not mean that the user has viewed the recommended information in the recommended information list, but that the user has opened the recommended information and viewed the specific content of the recommended information by performing a specified operation.

[0058] Since the same information can be recommended to users as recommended information in multiple business scenarios, the results of users' operations on the same recommended information in different business scenarios may be different. For example, for a piece of recommended information about sports shoes, if it is in the business scenario of a sports sale, the possibility of users viewing the recommended information is high, but in the business scenario of a winter clothing sale, the possibility of users viewing the recommended information will be greatly reduced.

[0059] Based on this, since the user's operation results on the recommended information in different business scenarios are not the same, the sample labels corresponding to the recommended information in different business scenarios are also different, so the training samples generated by the server for the recommended information in different business scenarios are also different.

[0060] In this specification, the server can determine the sample to be filled corresponding to the recommendation information in the business scenario according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario in accordance with the preset data format. Specifically, the server can determine that the data category corresponding to the user information of the user is the first data category, and determine that the data category corresponding to the recommendation information is the second data category according to the correspondence between each information and each data category saved in advance. Then, according to the determined sample label corresponding to the recommendation information in the business scenario, the correspondence between the user identifier of the user and the first data category (since the user information belongs to the first data category, the first data category corresponds to the user identifier of the user), and the correspondence between the data identifier of the recommendation information and the second data category (for the recommendation information belongs to the second data category, so the second data category corresponds to the data identifier of the recommendation information), the sample to be filled corresponding to the recommendation information in the business scenario is determined.

[0061] The second data category includes multiple data categories. For example, when the recommended information is an advertisement, it belongs to the advertisement data category. When the recommended information is context-related information, it belongs to the context data category. The advertisement data category and the context data category mentioned here can both be referred to as the second data category. The server determines the specific sample to be filled as follows: Figure 2 shown.

[0062] Figure 2 A schematic diagram for determining the sample to be filled provided in this specification.

[0063] exist Figure 2 In the example, the server determines that the training sample corresponding to the recommended information in the business scenario is a positive sample according to the user's operation result on the recommended information. Figure 2The value of positive in the sample to be filled is set to 1, that is, when the value of positive is 1, it indicates that the training sample corresponding to the recommended information in the business scenario is a positive sample. The server can determine that the data category to which the user information of the user belongs is data category 11 according to the correspondence between each information and each data category stored in advance, and then the user identifier of the user can be added to data category 11, that is, the user identifier: id=193475132 is added to type=11. Similarly, when the server determines that the recommended information is an advertisement, it can determine that the data category to which the recommended information belongs is data category 13, and then the data identifier of the recommended information can be added to data category 13, that is, the data identifier: id=652742951 is added to type=13. The recommended information also belongs to context-related information, and the context data category of the information associated with it is data category 12, so the server can add the data identifier of the information that is context-related to the recommended information to data category 12, that is, the data identifier: id=456328943 is added to type=12. The data category 12 and the data category 13 mentioned here are both the second data category.

[0064] exist Figure 2 In the example, the first segment 50007 of the sample to be filled is used to uniquely identify the sample to be filled, and Figure 2 It can be seen that since the sample to be filled has been marked as whether the corresponding training sample is a positive sample or a negative sample, and the user ID of the user and the data ID of the recommended information have been recorded in the sample to be filled, in the subsequent process of generating training samples, it is only necessary to query the corresponding data according to the user ID and data ID recorded in the sample to be filled, and complete the combination between the sample to be filled and the queried data, so as to obtain the training sample of the recommended information in this business scenario.

[0065] The contextual information mentioned above refers to the situation that the user viewed a recommended information because he viewed another recommended information. For example, when the user was viewing recommended information A, he saw recommended information B and viewed recommended information B. Then recommended information A and B belong to contextual information.

[0066] After determining the samples to be filled, the server can save the samples to be filled. Since the samples to be filled do not contain the full data of the training samples, but record the data identifiers and user identifiers used to query these data, this greatly saves the storage space of the server.

[0067] S103: When performing model training in this business scenario, query the recommendation information corresponding to the data identifier and the user identifier in the sample to be filled, and query the user information corresponding to the data identifier.

[0068] S104: extracting target data from the queried recommendation information and the user information respectively.

[0069] In order to ensure that accurate recommendation information can be provided to users through the prediction model during the business execution process, it is necessary to train the prediction models of different business scenarios. For each business scenario, when the server trains the prediction model of the business scenario, it can query the information required for the sample to be filled based on the pre-saved sample to be filled of the business scenario, and then generate training samples for training the prediction model of the business scenario in the subsequent process.

[0070] Specifically, for any sample to be filled in the business scenario, the server can query the user information of the user corresponding to the user identifier and the recommendation information corresponding to the data identifier based on the user identifier and data identifier recorded in the sample to be filled.

[0071] The server has pre-recorded the data required for each data category. Therefore, since the user information corresponds to the first data category, the server can extract the data required for the first data category from the user information as the target data according to the first data category. Similarly, the server can extract the data required for the second data category from the recommended information as the target data according to the second data category in the sample to be filled.

[0072] It should be noted that the target data extracted by the server can be understood as: the server extracts all the data that may be required by the prediction model of each business scenario. In this way, even if the feature dimensions required by the subsequent prediction model have changed, the server can extract the corresponding feature data from the target data, thereby improving the efficiency of feature data extraction. In addition, since the target data is the data of the feature dimensions that may be required by the prediction model extracted by the server, that is, the server removes some information in the user information that is useless for the model information, so the storage space occupied by the generated training samples in the server can be further reduced, saving the server's storage resources.

[0073] S105: Fill the sample to be filled with the extracted target data to generate a training sample for model training in the business scenario.

[0074] After extracting the corresponding target data from the user information and the recommended information, the server can fill the sample to be filled with the extracted target data, thereby obtaining the corresponding training sample. Specifically, in the present specification, the server can use the target data extracted from the user information as the first key value corresponding to the user identifier in the sample to be filled, and use the target data extracted from the queried recommended information as the second key value corresponding to the data identifier in the sample to be filled. Then, the server can fill in the location for storing user information in the sample to be filled according to the first key value, and at the same time, can fill in the location for storing recommended information in the sample to be filled according to the second key value, thereby obtaining a training sample, such as Figure 3 shown.

[0075] Figure 3 A schematic diagram of the process of filling training samples for the server provided in this specification.

[0076] The server is Figure 3 When filling the sample to be filled, the corresponding information can be queried according to the user identifier and data identifier recorded in the sample to be filled. Figure 3 The User Entity shown in is a user information entity, which means the user information queried by the server according to the user identifier recorded in the sample to be filled. Ctx PoiEntity is a context-related information entity, which means the recommended information queried by the server according to the data identifier of the context-related information recorded in the sample to be filled. AdEntity is an advertisement information entity, which means the advertisement information queried by the server as recommended information according to the data identifier recorded in the sample to be filled.

[0077] After the server queries the user information and each recommendation information, it can extract the target data from the user information and the recommendation information respectively, and fill the extracted target data in the corresponding position of the sample to be filled according to the data category to which the user information and the recommendation information belong. Among them, if the user information belongs to data category 11, the server can fill the target data extracted from the user information in the position corresponding to data category 11 in the sample to be filled. Similarly, the context-related information and the advertising information as the recommendation information belong to data categories 12 and 13 respectively, and the server can fill the target data extracted from the context-related information and the advertising information in the corresponding positions of these two data categories respectively, so as to obtain the training sample.

[0078] It can be seen from the above method that for each business scenario, the samples to be filled corresponding to the recommended information in the business scenario can be determined and saved according to the recommended information and the user's operation results on the recommended information in the business scenario. When model training is required later, the saved samples to be filled can be filled to generate training samples for model training in the business scenario. In this way, the training samples of different business scenarios are maintained in a unified manner, which greatly facilitates the maintenance of training samples and greatly improves the efficiency of generating training samples.

[0079] For each business scenario, after generating a training sample for training the prediction model of the business scenario, the server can use the prediction model of the business scenario as the model to be trained, and extract the feature data required by the model to be trained from the target data contained in the training sample. Then, the server can train the model to be trained based on the extracted feature data and the sample labels contained in the training sample.

[0080] It should be noted that in this specification, a business scenario corresponds to an online service system and an offline test system, wherein the online service system is used to recommend information to users in the business scenario, and the offline test system is used to maintain and update the online service system. Specifically, a prediction model is provided in the online service system, and the server in the online service system needs to send recommendation information to the user through the prediction model. In the offline test system, a mirror model corresponding to the prediction model in the online service system is provided. The role of the mirror model is that the parameters of the prediction model in the online service system can be updated by training the mirror model.

[0081] Based on this, in this specification, after the online service system recommends information to the user, the user ID of the user and the data ID of the recommended information sent can be sent to the offline test system, that is, it is not necessary to send the complete data of the user information and the recommended information to the offline test system, thereby greatly saving data bandwidth. After obtaining the user ID and the data ID, the offline test system can determine the sample label of the subsequently generated sample to be filled according to the obtained operation result of the user for the recommended information in the business scenario, and then generate the corresponding sample to be filled according to the sample label, the user ID and the data label. When the test system generates the training sample corresponding to the sample to be filled, the corresponding user information and recommended information can be queried through the user ID and the data ID recorded in the sample to be filled, and then the sample to be filled is filled based on the queried information, thereby obtaining the training sample for training the mirror model set in the offline test system. That is, the above-mentioned model training in the business scenario can refer to the training of the mirror model in the offline test system. The trained mirror model can be used to update the prediction model set in the online service system under the business scenario.

[0082] In this specification, a business scenario may have multiple prediction models in the online service system. Similarly, multiple mirror models of the business scenario will also be set in the offline test system. It should be pointed out that since the target data extracted by the server from the queried user information and recommended information can be the data of the feature dimensions required by all prediction models in the business scenario, for the same business scenario, no matter which prediction model of the business scenario is used to recommend information to users, all training samples of the business scenario generated by the server can be used to train the corresponding mirror models of all prediction models of the business scenario in the offline test system.

[0083] The above is a method for generating training samples provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding device for generating training samples, such as Figure 4 shown.

[0084] Figure 4 A schematic diagram of a device for generating training samples provided in this specification specifically includes:

[0085] A determination module 401 is used to determine, for each business scenario, at least one piece of recommendation information to be recommended to the user in the business scenario;

[0086] The saving module 402 is used to determine and save the sample to be filled corresponding to each recommendation information in the business scenario according to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario;

[0087] A query module 403 is used to query the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier according to the data identifier and the user identifier in the sample to be filled when the model training is performed in the business scenario;

[0088] An extraction module 404 is used to extract target data from the queried recommendation information and the user information respectively;

[0089] The generation module 405 is used to fill the to-be-filled samples with the extracted target data, and generate training samples for model training in the business scenario.

[0090] Optionally, the saving module 402 is specifically used to determine a sample label corresponding to the recommended information in the business scenario according to the operation results of the user on the recommended information in the business scenario; determine a data category corresponding to the user information of the user as the first data category, and determine a data category corresponding to the recommended information as the second data category; determine and save the sample to be filled corresponding to the recommended information in the business scenario according to the sample label, the correspondence between the user identifier and the first data category, and the correspondence between the data identifier and the second data category.

[0091] Optionally, the extraction module 404 is specifically used to extract data required for the first data category from the user information as target data based on the first data category included in the sample to be filled, and to extract data required for the second data category from the queried recommendation information as target data based on the second data category included in the sample to be filled.

[0092] Optionally, the generation module 405 is specifically used to use the target data extracted from the user information as the first key value corresponding to the user identifier, and the target data extracted from the queried recommendation information as the second key value corresponding to the data identifier; through the first key value and the second key value, the to-be-filled samples corresponding to the business scenario are filled, and training samples for model training under the business scenario are generated.

[0093] Optionally, the device further comprises:

[0094] The training module 406 is used to determine, for each business scenario, a mirror model corresponding to the prediction model set in the online service system under the business scenario in the offline test system under the business scenario as a model to be trained; extract feature data required for the model to be trained from the target data included in the training sample; and train the model to be trained according to the feature data and the sample labels included in the training sample;

[0095] The prediction model is updated by using the trained model to be trained.

[0096] This specification also provides a computer-readable storage medium, which stores a computer program. The computer program can be used to execute the above method for generating training samples.

[0097] This manual also provides Figure 5 The schematic structure diagram of the electronic device shown in FIG. Figure 5 As described above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned method of generating training samples. Of course, in addition to the software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0098] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0099] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.

[0100] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0101] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0102] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0103] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0104] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0107] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0108] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0109] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0110] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0111] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0112] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0113] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A method for generating training samples, characterized in that: include: For each business scenario, determining at least one piece of recommended information to be recommended to the user in the business scenario; For each piece of recommended information, according to the data identifier corresponding to the recommended information, the user identifier of the user, and the operation result of the user on the recommended information in the business scenario, determine and save the sample to be filled corresponding to the recommended information in the business scenario; When model training is performed in this business scenario, based on the data identifier and the user identifier in the sample to be filled, the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier are queried; Extracting target data from the queried recommendation information and the user information respectively; The sample to be filled is filled with the extracted target data to generate training samples for model training in the business scenario.

2. The method according to claim 1, characterized in that According to the data identifier corresponding to the recommendation information, the user identifier of the user, and the operation result of the user on the recommendation information in the business scenario, determining and saving the to-be-filled sample corresponding to the recommendation information in the business scenario, specifically including: Determining a sample label corresponding to the recommendation information in the business scenario according to an operation result of the user on the recommendation information in the business scenario; Determining a data category corresponding to the user information of the user as a first data category, and determining a data category corresponding to the recommendation information as a second data category; According to the sample label, the correspondence between the user identifier and the first data category, and the correspondence between the data identifier and the second data category, the sample to be filled corresponding to the recommendation information in the business scenario is determined and saved.

3. The method according to claim 2, characterized in that Extracting target data from the queried recommendation information and the user information respectively includes: According to the first data category contained in the sample to be filled, the data required for the first data category is extracted from the user information as the target data; according to the second data category contained in the sample to be filled, the data required for the second data category is extracted from the queried recommendation information as the target data.

4. The method according to claim 1 or 3, characterized in that Filling the sample to be filled with the extracted target data to generate a training sample for model training in the business scenario, specifically including: Using the target data extracted from the user information as the first key value corresponding to the user identifier, and using the target data extracted from the queried recommendation information as the second key value corresponding to the data identifier; The first key value and the second key value are used to fill in the to-be-filled samples corresponding to the business scenario, and to generate training samples for model training in the business scenario.

5. The method according to claim 4, characterized in that The method further comprises: Determine the corresponding mirror model of the prediction model set in the online service system under the business scenario in the offline test system under the business scenario as the model to be trained; Extracting feature data required by the model to be trained from the target data contained in the training sample; Training the model to be trained according to the feature data and the sample labels contained in the training samples; The prediction model is updated by using the trained model to be trained.

6. A device for generating training samples, characterized in that: include: A determination module, used to determine, for each business scenario, at least one piece of recommendation information to be recommended to the user in the business scenario; A saving module, configured to determine and save, for each piece of recommended information, a sample to be filled corresponding to the recommended information in the business scenario according to a data identifier corresponding to the recommended information, a user identifier of the user, and an operation result of the user on the recommended information in the business scenario; A query module, used to query the recommendation information corresponding to the data identifier and the user information corresponding to the user identifier according to the data identifier and the user identifier in the sample to be filled when the model training is performed in the business scenario; An extraction module, used to extract target data from the queried recommendation information and the user information respectively; A generation module is used to fill the samples to be filled with the extracted target data to generate training samples for model training in the business scenario.

7. The device according to claim 6, characterized in that The storage module is specifically used to determine, according to the operation result of the user on the recommended information in the business scenario, a sample label corresponding to the recommended information in the business scenario; determine the data category corresponding to the user information of the user as the first data category, and determine the data category corresponding to the recommended information as the second data category; According to the sample label, the correspondence between the user identifier and the first data category, and the correspondence between the data identifier and the second data category, the sample to be filled corresponding to the recommendation information in the business scenario is determined and saved.

8. The device according to claim 7, characterized in that The extraction module is specifically used to extract data required by the first data category from the user information as target data based on the first data category included in the sample to be filled, and to extract data required by the second data category from the queried recommendation information as target data based on the second data category included in the sample to be filled.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Online system individuation recommending method, system and device and electronic device

    CN107203518A

  • Product recommendation method, device and electronic equipment

    CN107424043A