CN113781079A - Method and apparatus for training a model - Google Patents

Method and apparatus for training a model Download PDF

Info

Publication number
CN113781079A
CN113781079A CN202011092078.2A CN202011092078A CN113781079A CN 113781079 A CN113781079 A CN 113781079A CN 202011092078 A CN202011092078 A CN 202011092078A CN 113781079 A CN113781079 A CN 113781079A
Authority
CN
China
Prior art keywords
user
information
behavior
target object
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011092078.2A
Other languages
Chinese (zh)
Inventor
白涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011092078.2A priority Critical patent/CN113781079A/en
Publication of CN113781079A publication Critical patent/CN113781079A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

Methods and apparatus for training a model, and methods and apparatus for generating information are disclosed. The implementation scheme of the method for training the model is as follows: acquiring a training sample set, wherein training samples in the training sample set comprise attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period; and training to obtain a user behavior prediction model by using a machine learning algorithm and taking the attribute information of the user, the characteristic information of the target object matched with the user and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data and the probability value of the user as expected output data. According to the scheme, model training is performed by using the user behavior sequence information of the time sequence, so that the result of the model training is more real and accurate.

Description

Method and apparatus for training a model
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of big data technologies, and in particular, to a method and an apparatus for training a model, and a method and an apparatus for generating information.
Background
In recent years, internet e-commerce is continuously permeated in daily life of people, and the life of people is influenced in various aspects. Meanwhile, the development of the internet is increasingly perfect, the number of online shopping users is increasingly saturated, the marketing cost and the customer acquisition cost are higher and higher, and the method has important significance on researching and analyzing the purchasing intention of the user through the portrait of the user and the commodity and aiming at the user behaviors (such as the behaviors of collecting and purchasing the commodity).
At present, the user behavior of the electric power company is constructed mainly by issuing operation data of the user to an offline system and summarizing behavior preferences of the user from the offline system. But the behavior of the user is a behavior sequence, and the time sequence of the behavior needs to be considered.
Disclosure of Invention
A method, apparatus, device, and storage medium for training a model, a method and apparatus for generating information are provided.
According to a first aspect of the application, there is provided a method for training a model, the method comprising: acquiring a training sample set, wherein training samples in the training sample set comprise attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period; by utilizing a machine learning algorithm, attribute information of a user, feature information of a target object matched with the user and behavior sequence information of the user, which are included in training samples in a training sample set, are used as input data, probability values of the user, which correspond to the input attribute information of the user, the feature information of the target object and the behavior sequence information, are used as expected output data, and a user behavior prediction model is obtained through training, wherein the probability values are used for representing the possibility that the user determines to obtain the target object, and the user behavior prediction model is built based on a network structure of SEQ2 SEQ.
In some embodiments, the method further comprises: and storing the model parameters of the user behavior prediction model into a Redis cache.
In some embodiments, the user behavior prediction model is constructed based on an attention mechanism.
In some embodiments, obtaining a training sample set comprises: determining a user behavior tag according to a message queue of a real-time computing system, wherein the user behavior at least comprises: clicking, buying, collecting and ordering; based on the position information of the user behavior tag, acquiring the attribute information of the user corresponding to the user behavior tag, the characteristic information of the target object matched with the user and the behavior sequence information of the user, and storing the determined user behavior tag, the acquired attribute information of the user, the characteristic information of the target object and the behavior sequence information to a file system, wherein the position information represents key position information corresponding to preset information in a software interface or code position information corresponding to the preset information in a program.
In some embodiments, obtaining a training sample set comprises: acquiring a user tag, a target object tag matched with the user and the preset user behavior, and time information and position information corresponding to the user and the preset user behavior from a file system based on the preset user behavior; determining attribute information of a user according to a user tag, and determining characteristic information of a target object according to a target object tag; and acquiring behavior sequence information of the user matched with the preset user behavior based on the time information and the position information.
In some embodiments, the file system is updated according to a preset time period.
According to a second aspect of the present application, there is provided a method for generating information, the method comprising: monitoring the operation behavior of a user and acquiring the operation behavior information of the user; in response to the fact that the operation behavior information of the user is equal to the preset user behavior information, acquiring attribute information of the user, characteristic information of a target object matched with the user and the preset user behavior information and behavior sequence information of the user matched with the preset user behavior information, wherein the preset user behavior information represents one or more operation behavior information which indicates that the user wishes to obtain the target object; inputting the acquired attribute information of the user, the feature information of the target object and the behavior sequence information into a pre-trained user behavior prediction model, and generating probability values of the user corresponding to the attribute information of the user, the feature information of the target object and the behavior sequence information, wherein the user behavior prediction model is obtained by training according to the method of one of claims 1 to 7.
According to a third aspect of the present application, there is provided an apparatus for training a model, the apparatus comprising: the training device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire a training sample set, wherein training samples in the training sample set comprise attribute information of a user, characteristic information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period; the training unit is configured to use a machine learning algorithm to take the attribute information of the user, the feature information of the target object matched with the user and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data, take the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object and the behavior sequence information, as expected output data, and train to obtain a user behavior prediction model, wherein the probability value is used for representing the possibility of the user determining to obtain the target object, and the user behavior prediction model is built based on the network structure of SEQ2 SEQ.
In some embodiments, the apparatus further comprises: a storage unit configured to store the model parameters of the user behavior prediction model to a Redis cache.
In some embodiments, the user behavior prediction model in the training unit is constructed based on an attention mechanism.
In some embodiments, the obtaining unit comprises: a first determination module configured to determine a user behavior tag from a message queue of a real-time computing system, wherein user behavior comprises at least: clicking, buying, collecting and ordering; the first obtaining module is configured to obtain attribute information of a user corresponding to a user behavior tag, feature information of a target object matched with the user and behavior sequence information of the user based on position information of the user behavior tag, and store the determined user behavior tag and the obtained attribute information of the user, the feature information of the target object and the behavior sequence information to a file system, wherein the position information represents key position information corresponding to preset information in a software interface or code position information corresponding to the preset information in a program.
In some embodiments, the obtaining unit comprises: the second acquisition module is configured to acquire a user tag, a target object tag matched with the user and the preset user behavior, and time information and position information corresponding to the user and the preset user behavior from the file system based on the preset user behavior; the second determination module is configured to determine attribute information of the user according to the user tag and determine characteristic information of the target object according to the target object tag; and the third acquisition module is configured to acquire behavior sequence information of the user matched with the preset user behavior based on the time information and the position information.
In some embodiments, the file system in the second obtaining module is updated according to a preset time period.
According to a fourth aspect of the present application, there is provided an apparatus for generating information, the apparatus comprising: the monitoring unit is configured to monitor the operation behavior of the user and acquire the operation behavior information of the user; the acquisition unit is configured to respond to the fact that the operation behavior information of the user is equal to preset user behavior information, and acquire attribute information of the user, characteristic information of a target object matched with the user and the preset user behavior information and behavior sequence information of the user matched with the preset user behavior information, wherein the preset user behavior information represents one or more operation behavior information which indicates that the user wants to obtain the target object; a generating unit configured to input the acquired attribute information of the user, the feature information of the target object, and the behavior sequence information to a pre-trained user behavior prediction model, and generate a probability value of the user corresponding to the attribute information of the user, the feature information of the target object, and the behavior sequence information, wherein the user behavior prediction model is trained by the method of one of claims 1 to 7.
According to a fifth aspect of the present application, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any one of the implementations of the first aspect.
According to a sixth aspect of the present application, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions, wherein the computer instructions are for causing a computer to perform the method as described in any one of the implementations of the first aspect.
According to the technology of the application, a training sample set is obtained, wherein training samples in the training sample set comprise attribute information of a user, characteristic information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period, a machine learning algorithm is utilized, the attribute information of the user, the characteristic information of the target object matched with the user and the behavior sequence information of the user, which are included in the training samples in the training sample set, are used as input data, the probability value of the user, which corresponds to the input attribute information of the user, the characteristic information of the target object and the behavior sequence information, is used as expected output data, a user behavior prediction model is obtained through training, wherein the probability value is used for representing the possibility that the user determines to obtain the target object, the user behavior prediction model is built based on the network structure of SEQ2SEQ, the network structure of SEQ2SEQ is applied to user behavior modeling, the intention of a user to obtain a target object (namely, to purchase a commodity) under different operation behaviors of the user is predicted, product marketing cost is reduced, a product can be more conveniently obtained by a customer, model training is performed by using the user behavior sequence information of a time sequence, the result of the model training is more real and accurate, and a more accurate prediction result is obtained by using the model.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application.
FIG. 1 is a schematic diagram of a first embodiment of a method for training a model according to the present application;
FIG. 2 is a scenario diagram of a method for training a model in which an embodiment of the present application may be implemented;
FIG. 3 is a schematic diagram of a second embodiment of a method for training a model according to the present application;
FIG. 4 is a schematic diagram of one embodiment of a method for generating information, in accordance with the present application;
FIG. 5 is a schematic diagram of an embodiment of an apparatus for training a model according to the present application;
FIG. 6 is a schematic block diagram illustrating one embodiment of an apparatus for generating information according to the present application;
FIG. 7 is a block diagram of an electronic device for implementing a method for training a model according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a schematic diagram 100 of a first embodiment of a method for training a model according to the present application. The method for training the model comprises the following steps:
step 101, a training sample set is obtained.
In this embodiment, an executing entity (e.g., a server or a terminal device) of the method for training a model may obtain a massive training sample set from other electronic devices or locally through a wired connection manner or a wireless connection manner. The training samples in the training sample set comprise attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user and probability values of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period.
Here, the attribute information of the user may include: age, gender, occupation, store preferences, brand preferences, etc. of the user. The characteristic information of the target object may include: the third class of the target object is the scope of the target object (such as the shop where the target object is located), the name of the target object, and the applicable group of the target object (such as the gender tag of the target object). The operational behavior information may include behavior data of different dimensions, the different dimensions including at least: the user operation behavior, the measurement unit of the target object, the index of the target object, the preset time period and other dimensions, and the index of the target object may include: the target object class, the target object brand, the target object belonged range and the target object value interval.
102, using a machine learning algorithm, taking the attribute information of the user, the feature information of the target object matched with the user and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data, and taking the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object and the behavior sequence information, as expected output data, and training to obtain a user behavior prediction model.
In this embodiment, the executive body may use a machine learning algorithm to train the attribute information of the user, the feature information of the target object matched with the user, and the behavior sequence information of the user, which are acquired in step 101, as input data, and use the probability value of the user corresponding to the input attribute information of the user, the feature information of the target object, and the behavior sequence information as expected output data, so as to obtain the user behavior prediction model. The probability value is used for representing the possibility that a user determines to obtain a target object, and the user behavior prediction model is built based on a network structure of SEQ2 SEQ.
With continued reference to fig. 2, fig. 2 is a schematic diagram of an application scenario of the method for training a model according to the present embodiment. In the application scenario of fig. 2, the method 200 for training a model of the present embodiment is executed in an electronic device 201. The electronic device 201 first obtains a training sample set 202, wherein training samples in the training sample set 202 include attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user, and a probability value of the user, then the electronic device 201 uses a machine learning algorithm to train the attribute information of the user, the feature information of the target object matched with the user, and the behavior sequence information of the user, which are included in the training samples in the training sample set 202, as input data, and uses the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object, and the behavior sequence information, as expected output data, so as to obtain a user behavior prediction model 203. The behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period, the probability value is used for representing the possibility that the user determines to obtain a target object, and the user behavior prediction model is built based on a network structure of SEQ2 SEQ.
The method for training a model provided in the above embodiment of the present application adopts obtaining a training sample set, where training samples in the training sample set include attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user, and a probability value of the user, the behavior sequence information of the user is used to represent user operation behavior information at each time point within a certain time period, a machine learning algorithm is used to take the attribute information of the user, the feature information of the target object matched with the user, and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data, and take the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object, and the behavior sequence information, as expected output data, and a user behavior prediction model is obtained by training, where the probability value is used to represent a possibility that the user determines to obtain the target object, the user behavior prediction model is built based on the network structure of SEQ2SEQ, the network structure of SEQ2SEQ is applied to user behavior modeling, the intention of a user to obtain a target object (namely, to purchase a commodity) under different operation behaviors of the user is predicted, product marketing cost is reduced, a product can be more conveniently obtained by a customer, model training is performed by using the user behavior sequence information of a time sequence, the result of the model training is more real and accurate, and a more accurate prediction result is obtained by using the model.
With further reference to FIG. 3, a schematic diagram 300 of a second embodiment of a method for training a model is shown. The process of the method comprises the following steps:
step 301, a training sample set is obtained.
In some optional implementations of this embodiment, obtaining the training sample set includes: determining a user behavior tag according to a message queue of a real-time computing system, wherein the user behavior at least comprises: clicking, buying, collecting and ordering; based on the position information of the user behavior tag, acquiring the attribute information of the user corresponding to the user behavior tag, the characteristic information of the target object matched with the user and the behavior sequence information of the user, and storing the determined user behavior tag, the acquired attribute information of the user, the characteristic information of the target object and the behavior sequence information to a file system, wherein the position information represents key position information corresponding to preset information in a software interface or code position information corresponding to the preset information in a program. Training samples are obtained through the message queue, training sample data are obtained in real time, effectiveness and accuracy of the data are guaranteed, and accurate and real-time training of the user behavior model is achieved.
The streaming big data processing framework flink is used for accessing real-time data in a live broadcast room and a user browsing the live broadcast room, so that the real-time processing capability of continuously changing and large-batch data is realized. Behavior tags of 4 dimensions (clicking, buying, collecting and placing) of the user are obtained by using a plurality of message queues JDQ, and behavior information of the 4 dimensions of the user is obtained by analyzing a required buried point (namely a position point in software) in the JDQ. And after the analysis is finished, the file is sent to an off-line file system HDFS. If the buried point information of the target object collected by the user is detected in the message queue, counting the real-time behavior of the user after collecting the target object, and predicting whether the user wants to obtain the target object in real time.
In some optional implementations of this embodiment, obtaining the training sample set includes: acquiring a user tag, a target object tag matched with the user and the preset user behavior, and time information and position information corresponding to the user and the preset user behavior from a file system based on the preset user behavior; determining attribute information of a user according to a user tag, and determining characteristic information of a target object according to a target object tag; and acquiring behavior sequence information of the user matched with the preset user behavior based on the time information and the position information. The off-line mass data and the distributed system architecture are utilized to complete the training of parameters in the network structure, so that the model obtained by training is more widely and accurately applied.
The user label and the target object label are acquired through an offline file system HDFS, and after the labels are acquired, corresponding user behavior information is inquired and matched through a data warehouse tool HIVE. Firstly, inquiring the embedded point information (namely position information) of a certain target object collected by a user in an HDFS file to obtain the time point and the corresponding position point of the target object collected by the user, and then acquiring and storing the user behavior after the time point.
In some optional implementations of this embodiment, the file system is updated according to a preset time period. By regularly updating the file system, the training of the model is more accurate and comprehensive.
Step 302, using a machine learning algorithm, taking the attribute information of the user, the feature information of the target object matched with the user, and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data, and taking the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object, and the behavior sequence information, as expected output data, and training to obtain a user behavior prediction model.
In this embodiment, the executive body may use a machine learning algorithm to train the attribute information of the user, the feature information of the target object matched with the user, and the behavior sequence information of the user, which are acquired in step 301, as input data, and use the probability value of the user corresponding to the input attribute information of the user, the feature information of the target object, and the behavior sequence information as expected output data, so as to obtain the user behavior prediction model. The probability value is used for representing the possibility that a user determines to obtain a target object, a user behavior prediction model is built based on a network structure of SEQ2SEQ, and the user behavior prediction model is built based on an attention mechanism.
To be more specific, the user behavior coding framework SEQ2SEQ is mainly composed of an encoder, a decoder, and a long-short term memory network LSTM. The input of the encoder is the characteristics of various dimensions of the user and the target object, and the characteristics of the user are sent into the LSTM network. And in response to the operation behavior information of the user being equal to the preset user behavior information (such as a collection signal of the user is determined), the output of the LSTM network and a series of behaviors of the user after collection are put into a decoder for continuous decoding, and the purchase expectation of the user after collection of the commodity is predicted. The input of the encoder is the current behavior data of the user and the implicit layer data output by the previous layer. After encoding the current behavior of the user, the current behavior is sent into the LSTM network together, and the current prediction result is generated and output at the same time. The decoder differs from the encoder in that it incorporates a non-linear activation function at the input and a logistic regression model softmax at the output for outputting probability predictors between 0 and 1.
Here, in order to construct a negative feedback mechanism for the predicted result, an attention mechanism network structure is introduced. And obtaining attention weight by using the input of the decoder and the state information of the decoder, multiplying the attention weight by the output of the encoder to obtain attention weight encoding output, and taking the attention weight encoding output as the input of the next decoding period in a reverse direction.
And step 303, storing the model parameters of the user behavior prediction model to a Redis cache.
In this embodiment, the executing agent may store the model parameters of the user behavior prediction model trained in step 302 in a Redis cache.
In this embodiment, the specific operation of step 301 is substantially the same as the operation of step 101 in the embodiment shown in fig. 1, and is not described herein again.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 1, the schematic diagram 300 of the method for training the model in this embodiment is constructed based on an attention mechanism by using the user behavior prediction model, and in order to implement real-time prediction of the result, the model parameters of the trained user behavior prediction model are pushed to the Redis cache, so as to further implement real-time prediction, and improve the system efficiency.
Referring further to FIG. 4, a diagram 400 of one embodiment of a method for generating information is shown. The method for generating information comprises the following steps:
step 401, monitoring the operation behavior of the user, and acquiring the operation behavior information of the user.
In this embodiment, the execution subject of the method for generating information may monitor the operation behavior of the user, and obtain the operation behavior information of the user.
Step 402, in response to that the operation behavior information of the user is equal to the preset user behavior information, acquiring attribute information of the user, feature information of a target object matched with the user and the preset user behavior information, and behavior sequence information of the user matched with the preset user behavior information.
In this embodiment, the execution main body may determine the monitored operation behavior information, and in response to determining that the operation behavior information of the user is equal to the preset user behavior information, obtain attribute information of the user, feature information of a target object matched with the user and the preset user behavior information, and behavior sequence information of the user matched with the preset user behavior information. The preset user behavior information represents one or more operation behavior information of a target object which the user wishes to obtain.
Step 403, inputting the acquired attribute information of the user, the feature information of the target object and the behavior sequence information into a pre-trained user behavior prediction model, and generating a probability value of the user corresponding to the attribute information of the user, the feature information of the target object and the behavior sequence information.
In this embodiment, the executive agent may input the attribute information of the user, the feature information of the target object, and the behavior sequence information acquired in step 402 into a pre-trained user behavior prediction model, and generate a probability value of the user corresponding to the attribute information of the user, the feature information of the target object, and the behavior sequence information. Wherein, the user behavior prediction model is obtained by training through the method of any embodiment of the method for training the model.
It should be noted that, the prediction of information by using the model is a well-known technique that is widely researched and applied at present, and is not described herein again.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 1, the schematic diagram 400 of the method for generating information in the present embodiment highlights the step of generating the probability value of the user by using the trained user behavior prediction model. Therefore, the scheme described by the embodiment can improve the accuracy and timeliness of generating the probability value of the user.
With further reference to fig. 5, as an implementation of the method shown in fig. 1 to 3, the present application provides an embodiment of an apparatus for training a model, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for training a model of the present embodiment includes: the device comprises an obtaining unit 501 and a training unit 502, wherein the obtaining unit is configured to obtain a training sample set, wherein training samples in the training sample set comprise attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period; the training unit is configured to use a machine learning algorithm to take the attribute information of the user, the feature information of the target object matched with the user and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data, take the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object and the behavior sequence information, as expected output data, and train to obtain a user behavior prediction model, wherein the probability value is used for representing the possibility of the user determining to obtain the target object, and the user behavior prediction model is built based on the network structure of SEQ2 SEQ.
In this embodiment, specific processes of the obtaining unit 501 and the training unit 502 of the apparatus 500 for training a model and technical effects thereof may refer to the related descriptions of step 101 to step 102 in the embodiment corresponding to fig. 1, and are not described herein again.
In some optional implementations of this embodiment, the apparatus further includes: a storage unit configured to store the model parameters of the user behavior prediction model to a Redis cache.
In some alternative implementations of the present embodiment, the user behavior prediction model in the training unit is constructed based on an attention mechanism.
In some optional implementation manners of this embodiment, the obtaining unit includes: a first determination module configured to determine a user behavior tag from a message queue of a real-time computing system, wherein user behavior comprises at least: clicking, buying, collecting and ordering; the first obtaining module is configured to obtain attribute information of a user corresponding to a user behavior tag, feature information of a target object matched with the user and behavior sequence information of the user based on position information of the user behavior tag, and store the determined user behavior tag and the obtained attribute information of the user, the feature information of the target object and the behavior sequence information to a file system, wherein the position information represents key position information corresponding to preset information in a software interface or code position information corresponding to the preset information in a program.
In some optional implementation manners of this embodiment, the obtaining unit includes: the second acquisition module is configured to acquire a user tag, a target object tag matched with the user and the preset user behavior, and time information and position information corresponding to the user and the preset user behavior from the file system based on the preset user behavior; the second determination module is configured to determine attribute information of the user according to the user tag and determine characteristic information of the target object according to the target object tag; and the third acquisition module is configured to acquire behavior sequence information of the user matched with the preset user behavior based on the time information and the position information.
In some optional implementation manners of this embodiment, the file system in the second obtaining module is updated according to a preset time period.
With further reference to fig. 6, as an implementation of the method shown in fig. 4, the present application provides an embodiment of an apparatus for generating information, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 4, and the apparatus may be applied to various electronic devices.
As shown in fig. 6, the apparatus 600 for generating information of the present embodiment includes: a monitoring unit 601, an obtaining unit 602, and a generating unit 603, where the monitoring unit is configured to monitor an operation behavior of a user and obtain operation behavior information of the user; the acquisition unit is configured to respond to the fact that the operation behavior information of the user is equal to preset user behavior information, and acquire attribute information of the user, characteristic information of a target object matched with the user and the preset user behavior information and behavior sequence information of the user matched with the preset user behavior information, wherein the preset user behavior information represents one or more operation behavior information which indicates that the user wants to obtain the target object; and the generating unit is configured to input the acquired attribute information of the user, the feature information of the target object and the behavior sequence information into a pre-trained user behavior prediction model, and generate a probability value of the user corresponding to the attribute information of the user, the feature information of the target object and the behavior sequence information, wherein the user behavior prediction model is obtained by training through the method of any one embodiment of the methods for training the model.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
FIG. 7 is a block diagram of an electronic device for a method of training a model according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 7, the electronic apparatus includes: one or more processors 701, a memory 702, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 7, one processor 701 is taken as an example.
The memory 702 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for training a model provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the method for training a model provided herein.
The memory 702, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method for training a model in the embodiments of the present application (e.g., the obtaining unit 501 and the training unit 502 shown in fig. 5). The processor 701 executes various functional applications of the server and data processing by executing non-transitory software programs, instructions, and modules stored in the memory 702, that is, implements the method for training the model in the above method embodiment.
The memory 702 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of the electronic device for training the model, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 702 may optionally include memory located remotely from processor 701, which may be connected to an electronic device for training models via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for the method of training a model may further comprise: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected by a bus or other means, and fig. 7 illustrates an example of a connection by a bus.
The input device 703 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic apparatus used to train the model, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer, one or more mouse buttons, a track ball, a joystick, or other input device. The output devices 704 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here may be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user may interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the method comprises the steps of responding to a received prediction request sent by a user to obtain the prediction information corresponding to the prediction request, determining all prediction submodels through which the prediction information flows in the prediction process and the sequence of each prediction submodel in all prediction submodels according to the prediction information, associating each prediction submodel in all prediction submodels based on the sequence of each prediction submodel, predicting the prediction information based on each associated prediction submodel to generate the prediction result corresponding to the prediction request, solving the problem that the technologies of two parties cannot be fully invoked to carry out joint co-construction in the existing joint prediction scheme, avoiding the possibility that one party exchanging data diffuses the received data, reducing the risk of data leakage, and realizing the method for carrying out online data prediction by using the model trained by a federal learning platform, data can be safely shared, model effect is improved through online joint prediction, service indexes are further improved, and user experience is better.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A method for training a model, the method comprising:
acquiring a training sample set, wherein training samples in the training sample set comprise attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period;
and training to obtain a user behavior prediction model by using a machine learning algorithm and taking the attribute information of the user, the feature information of the target object matched with the user and the behavior sequence information of the user, which are included in the training samples in the training sample set, as input data, and taking the probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object and the behavior sequence information, as expected output data, wherein the probability value is used for representing the possibility of the user for determining to obtain the target object, and the user behavior prediction model is built based on the network structure of SEQ2 SEQ.
2. The method of claim 1, further comprising:
and storing the model parameters of the user behavior prediction model to a Redis cache.
3. The method of claim 1, wherein the user behavior prediction model is constructed based on an attention mechanism.
4. The method of claim 1, wherein the obtaining a training sample set comprises:
determining a user behavior tag according to a message queue of a real-time computing system, wherein the user behavior at least comprises: clicking, buying, collecting and ordering;
based on the position information of the user behavior tag, acquiring attribute information of a user corresponding to the user behavior tag, feature information of a target object matched with the user and behavior sequence information of the user, and storing the determined user behavior tag, the acquired attribute information of the user, the feature information of the target object and the behavior sequence information to a file system, wherein the position information represents key position information corresponding to preset information in a software interface or code position information corresponding to the preset information in a program.
5. The method of claim 4, wherein the obtaining a training sample set comprises:
acquiring a user tag, a target object tag matched with the user and the preset user behavior, and time information and position information corresponding to the user and the preset user behavior from the file system based on the preset user behavior;
determining attribute information of a user according to the user tag, and determining characteristic information of the target object according to the target object tag;
and acquiring the behavior sequence information of the user matched with the preset user behavior based on the time information and the position information.
6. The method of claim 5, wherein the file system is updated according to a preset time period.
7. A method for generating information, the method comprising:
monitoring the operation behavior of a user and acquiring the operation behavior information of the user;
responding to that the operation behavior information of the user is equal to preset user behavior information, and acquiring attribute information of the user, characteristic information of a target object matched with the user and the preset user behavior information, and behavior sequence information of the user matched with the preset user behavior information, wherein the preset user behavior information represents one or more operation behavior information that the user intentionally obtains the target object;
inputting the acquired attribute information of the user, the feature information of the target object and the behavior sequence information into a pre-trained user behavior prediction model, and generating a probability value of the user corresponding to the attribute information of the user, the feature information of the target object and the behavior sequence information, wherein the user behavior prediction model is obtained by training according to the method of one of claims 1 to 7.
8. An apparatus for training a model, the apparatus comprising:
the training device comprises an obtaining unit, a judging unit and a judging unit, wherein the obtaining unit is configured to obtain a training sample set, training samples in the training sample set comprise attribute information of a user, feature information of a target object matched with the user, behavior sequence information of the user and a probability value of the user, and the behavior sequence information of the user is used for representing user operation behavior information of each time point in a certain time period;
a training unit configured to train, by using a machine learning algorithm, attribute information of a user, feature information of a target object matched with the user, and behavior sequence information of the user, which are included in training samples in the training sample set, as input data, and a probability value of the user, which corresponds to the input attribute information of the user, the feature information of the target object, and the behavior sequence information, as expected output data, to obtain a user behavior prediction model, wherein the probability value is used for representing a possibility that the user determines to obtain the target object, and the user behavior prediction model is built based on a network structure of SEQ2 SEQ.
9. The apparatus of claim 8, further comprising:
a storage unit configured to store model parameters of the user behavior prediction model to a Redis cache.
10. The apparatus of claim 8, wherein the user behavior prediction model in the training unit is constructed based on an attention mechanism.
11. The apparatus of claim 8, wherein the obtaining unit comprises:
a first determination module configured to determine a user behavior tag from a message queue of a real-time computing system, wherein the user behavior comprises at least: clicking, buying, collecting and ordering;
the first obtaining module is configured to obtain attribute information of a user corresponding to the user behavior tag, feature information of a target object matched with the user and behavior sequence information of the user based on position information of the user behavior tag, and store the determined user behavior tag and the obtained attribute information of the user, the feature information of the target object and the behavior sequence information to a file system, wherein the position information represents key position information corresponding to preset information in a software interface or code position information corresponding to the preset information in a program.
12. The apparatus of claim 11, wherein the obtaining unit comprises:
a second obtaining module configured to obtain, based on a preset user behavior, a user tag, a target object tag matching the user and the preset user behavior, and time information and location information corresponding to the user and the preset user behavior from the file system;
a second determination module configured to determine attribute information of a user according to the user tag and determine feature information of the target object according to the target object tag;
a third obtaining module configured to obtain behavior sequence information of the user matching the preset user behavior based on the time information and the location information.
13. The apparatus of claim 12, wherein the file system in the second retrieving module is updated according to a preset time period.
14. An apparatus for generating information, the apparatus comprising:
the monitoring unit is configured to monitor the operation behavior of a user and acquire the operation behavior information of the user;
an obtaining unit configured to obtain attribute information of the user, feature information of a target object matching the user and preset user behavior information, and behavior sequence information of the user matching the preset user behavior information in response to that the operation behavior information of the user is equal to the preset user behavior information, wherein the preset user behavior information is one or more kinds of operation behavior information representing that the user intentionally obtains the target object;
a generating unit configured to input the acquired attribute information of the user, the feature information of the target object, and the behavior sequence information to a pre-trained user behavior prediction model, and generate a probability value of the user corresponding to the attribute information of the user, the feature information of the target object, and the behavior sequence information, wherein the user behavior prediction model is trained by the method of one of claims 1 to 7.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202011092078.2A 2020-10-13 2020-10-13 Method and apparatus for training a model Pending CN113781079A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011092078.2A CN113781079A (en) 2020-10-13 2020-10-13 Method and apparatus for training a model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011092078.2A CN113781079A (en) 2020-10-13 2020-10-13 Method and apparatus for training a model

Publications (1)

Publication Number Publication Date
CN113781079A true CN113781079A (en) 2021-12-10

Family

ID=78835047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011092078.2A Pending CN113781079A (en) 2020-10-13 2020-10-13 Method and apparatus for training a model

Country Status (1)

Country Link
CN (1) CN113781079A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019242144A1 (en) * 2018-06-19 2019-12-26 平安科技(深圳)有限公司 Electronic device, preference tendency prediction method and computer readable storage medium
CN110929138A (en) * 2018-09-04 2020-03-27 阿里巴巴集团控股有限公司 Recommendation information generation method, device, equipment and storage medium
CN111260449A (en) * 2020-02-17 2020-06-09 腾讯科技(深圳)有限公司 Model training method, commodity recommendation device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019242144A1 (en) * 2018-06-19 2019-12-26 平安科技(深圳)有限公司 Electronic device, preference tendency prediction method and computer readable storage medium
CN110929138A (en) * 2018-09-04 2020-03-27 阿里巴巴集团控股有限公司 Recommendation information generation method, device, equipment and storage medium
CN111260449A (en) * 2020-02-17 2020-06-09 腾讯科技(深圳)有限公司 Model training method, commodity recommendation device and storage medium

Similar Documents

Publication Publication Date Title
CN109460513B (en) Method and apparatus for generating click rate prediction model
CN111428008B (en) Method, apparatus, device and storage medium for training a model
KR102472572B1 (en) Method for profiling user's intention and apparatus therefor
CN112559007B (en) Parameter updating method and device of multitask model and electronic equipment
CN112261423B (en) Method, device, equipment and storage medium for pushing information
CN112036509A (en) Method and apparatus for training image recognition models
CN111046257A (en) Session recommendation method and device and electronic equipment
CN112163676A (en) Multitask service prediction model training method, device, equipment and storage medium
CN111259222A (en) Article recommendation method, system, electronic device and storage medium
CN113780329A (en) Method, apparatus, server and medium for identifying data anomalies
CN112288483A (en) Method and device for training model and method and device for generating information
CN111563198A (en) Material recall method, device, equipment and storage medium
CN115935185A (en) Training method and device for recommendation model
US20220198487A1 (en) Method and device for processing user interaction information
CN112541145A (en) Page display method, device, equipment and storage medium
CN113656689B (en) Model generation method and network information pushing method
CN113781079A (en) Method and apparatus for training a model
CN113780318B (en) Method, device, server and medium for generating prompt information
CN114036397A (en) Data recommendation method and device, electronic equipment and medium
CN113989562A (en) Model training and image classification method and device
CN112598136A (en) Data calibration method and device
CN113780548A (en) Method, apparatus, device and storage medium for training a model
CN114329230B (en) Information generation method and device
CN115983893A (en) Method and apparatus for training a model
CN112101008A (en) Text popularity determination method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination