CN113591986B - Method for generating object weight of recommendation model and personalized recommendation method - Google Patents

Method for generating object weight of recommendation model and personalized recommendation method Download PDF

Info

Publication number
CN113591986B
CN113591986B CN202110873500.6A CN202110873500A CN113591986B CN 113591986 B CN113591986 B CN 113591986B CN 202110873500 A CN202110873500 A CN 202110873500A CN 113591986 B CN113591986 B CN 113591986B
Authority
CN
China
Prior art keywords
data
preference
vector
recommendation
recommended
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.)
Active
Application number
CN202110873500.6A
Other languages
Chinese (zh)
Other versions
CN113591986A (en
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.)
Alibaba Innovation Co
Original Assignee
Alibaba Innovation Co
Filing date
Publication date
Application filed by Alibaba Innovation Co filed Critical Alibaba Innovation Co
Priority to CN202110873500.6A priority Critical patent/CN113591986B/en
Publication of CN113591986A publication Critical patent/CN113591986A/en
Application granted granted Critical
Publication of CN113591986B publication Critical patent/CN113591986B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

Disclosed are a sample data generation method, a method for generating object weights of a recommendation model, a personalized recommendation method, a personalized recommendation device and electronic equipment. The generation method of the sample data comprises the following steps: generating a basic recommendation data set of the recommended party based on the behavior data of the recommended party and recommendation data generated by the recommendation model; generating a preference data set of a recommended party aiming at basic recommendation data in the basic recommendation data set of the recommended party; and screening the preference data set of the recommended party based on the basic recommendation data in the basic recommendation data set of the recommended party to determine effective sample data for training a recommendation model. In this way, sample data which accurately represents the personalized tendency of the recommended party can be obtained, the recommended object is enabled to be more in line with the preference of the recommended party, and by personalized recommendation, the accuracy of recommendation can be improved, and the experience of the recommended party can be improved.

Description

Method for generating object weight of recommendation model and personalized recommendation method
Technical Field
The present application relates to the field of recommended data processing, and more particularly, to a method, a personalized recommendation method, a device and an electronic apparatus for generating an object weight of a basic recommendation model.
Background
The recommendation model may also be referred to as a personalized recommendation model, which is used to infer an object that a recommended party may like from among candidate objects based on a predetermined algorithm. In the actual use process, a main purpose of the recommendation model is to enable the recommended object to be more in line with the preference of the recommended party, and the recommended object can be selected by the recommended party, in particular to the first recommended object. For example, the object recommendation may be a merchandise recommendation, an advertisement recommendation, a route recommendation, and the like. Thus, for a recommendation model, there is room for improvement in the ability of the recommendation model to predict the personalized propensity of a recommender, so long as there is a non-agreement between the selected object of the recommender and the recommended object, especially in the first recommended object.
Currently, the optimization method of the recommended model mainly comprises two modes of personalized trend data mining and model iterative optimization. The personalized trend data mining mainly comprises the steps of representing the personalized trend of a recommended party based on the statistical characteristics of the historical behavior of the recommended party, such as the frequency of selecting a certain characteristic commodity and the frequency of selecting a certain characteristic route; or based on the historical selection behavior of the recommended party, coding the historical selection behavior through a model, wherein the coding comprises characteristics reflecting the personalized tendency of the recommended party.
The personalized tendency data are obtained according to the historical behaviors of the recommended party; since the history behavior of the recommended party contains the influence of the used recommendation model on the recommended party, for example, scenes such as navigation route recommendation, the first route recommended by the route recommendation model has a strong guiding effect on the recommended party, and even if the recommended party selects the first route recommended by the route recommendation model, the first route cannot be represented as the route meeting the real tendency of the recommended party.
It is therefore desirable to provide an improved solution that can be used to obtain sample data that accurately characterizes the personalized tendencies of the recommended parties.
Disclosure of Invention
The present application has been made to solve the above-mentioned technical problems. The embodiment of the application provides a sample data generation method, a method for generating an object weight of a recommendation model, a personalized recommendation method, a personalized recommendation device and electronic equipment, which can obtain sample data for accurately representing personalized trends of a recommended party, and enable a recommended object to better accord with the preference of the recommended party by giving an alternative object of a basic recommendation model an object weight based on the preference of the recommended party.
According to an aspect of the present application, there is provided a method of generating sample data, including: generating a basic recommendation data set of the recommended party based on the behavior data of the recommended party and recommendation data generated by the recommendation model; generating a preference data set of a recommended party aiming at basic recommendation data in the basic recommendation data set of the recommended party; and screening the preference data set of the recommended party based on the basic recommendation data in the basic recommendation data set of the recommended party to determine effective sample data for training a recommendation model.
In the above method for generating sample data, each piece of basic recommendation data in the basic recommendation data set includes a recommender identifier, a candidate object set composed of candidate object vectors, a model recommendation object vector, a recommender selection object vector and a first environment vector.
In the above method for generating sample data, generating a preference data set of a recommended party for base recommendation data in the base recommendation data set of the recommended party includes: determining a candidate data set of the recommended party from the base recommendation data, the candidate data set including a plurality of candidate data, and the model recommendation object vector of each candidate data being different from a recommended party selection object vector; for each piece of candidate data, calculating a difference between the model recommended object vector and a recommended party selected object vector to obtain an object difference vector; obtaining a first environment vector corresponding to the object difference vector as a second environment vector; constructing a recommender identifier of the recommender, the object difference vector and the second environment vector into preference data of the recommender corresponding to the candidate data; and forming a plurality of pieces of preference data of the recommended side corresponding to the plurality of pieces of candidate data into a preference data set of the recommended side.
In the above method for generating sample data, screening the set of preference data of the recommended party based on the basic recommendation data in the set of basic recommendation data of the recommended party to determine effective sample data for training a recommendation model includes: selecting, for each piece of candidate data, candidate preference data having a recommendation time in a second environmental vector in the preference data set of the recommended party earlier than a recommendation time in a first environmental vector of the candidate data; in response to the number of candidate preference data being greater than a predetermined threshold, forming a set of sample preferences corresponding to the candidate data from the candidate preference data; and the candidate data corresponds to the recommended party identifier, the candidate object set, the recommended party selection object vector, the first environment vector, the sample preference set and the number of the candidate preference data form the valid sample data.
In the above method for generating sample data, screening the set of preference data of the user based on the basic recommendation data in the set of basic recommendation data of the user to determine valid sample data for training a recommendation model further includes: corresponding valid sample data is generated based on each user in the base recommendation data to obtain a valid sample set.
According to another aspect of the present application, there is provided a method for generating an object weight of a recommendation model, comprising: acquiring effective sample data for training a recommendation model, which is determined by the sample data generation method; and generating object weights for weighting candidate objects of the recommendation model using the valid sample data.
In the above method for generating an object weight of a recommendation model, generating an object weight for weighting a candidate object of the recommendation model using the valid sample data includes: for each valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the set of sample preferences; multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and obtaining the object weight based on the final preference vector, the number of data in the sample preference set in the valid sample data and the first environment vector, the object weight being in the form of a preference weight vector, the dimension of the preference weight vector being the same as the dimension of the candidate object vector, and each bit of the preference weight vector being in one-to-one correspondence with the attribute value of each bit of the candidate object vector.
In the above method for generating an object weight of a recommendation model, generating an object weight for weighting a candidate object of the recommendation model using the valid sample data includes: for the valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the second set of preferences using a first neural network; multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and based on the final preference vector, obtaining the object weight value by using a second neural network, wherein the object weight value is in the form of a preference weight value vector, the dimension of the preference weight value vector is the same as that of the alternative object vector, and each bit of the preference weight value vector corresponds to the attribute value of each bit of the alternative object vector one by one.
In the method for generating the object weight of the recommendation model, the training process of the first neural network and the second neural network includes: for each piece of valid sample data, weighting each candidate object vector in a candidate object set in the valid sample data by the preference weight vector to obtain a personalized score of each candidate object in the candidate object set; calculating a base score for each candidate object in the set of candidate objects using the recommendation model; calculating a softmax function value of the personalized score and the base score of each candidate object to obtain a final score vector; generating a tag vector based on whether each object in the set of candidate objects is a recommended party selection object; calculating a cross entropy loss function value of the label vector and the final score vector; and training the first neural network and the second neural network based on the cross entropy loss function value.
In the method for generating the object weight of the recommendation model, the method further includes: and forming a preference weight set by using the object weights generated based on all the recommended parties and the corresponding first environment vectors, wherein each preference weight in the preference weight set is formed by the recommended party identification, the first environment vectors and the object weights.
According to still another aspect of the present application, there is provided a personalized recommendation method, including: determining recommendation environment parameters of a recommended party to be recommended; obtaining basic scores of candidate objects of the recommendation model; acquiring an object weight of the recommended party to be recommended under the recommended environment parameters; calculating a preference score of the candidate object obtained by weighting the object weight; and recommending the object based on the basic score and the preference score of the candidate object.
In the above personalized recommendation method, the obtaining the object weight of the recommended party to be recommended under the recommendation environment parameter includes: determining whether object weights corresponding to the recommended party to be recommended and the recommendation environment parameters exist or not by querying a preference weight set; acquiring valid sample data corresponding to the recommended environment parameter generated by the generation method of sample data as described above in response to the absence of the object weight; and generating object weights using the valid sample data in the method for generating object weights of a recommendation model as described above.
The personalized recommendation method further comprises the following steps: based on the recommended party identifier and the first environment vector in the effective sample data, combining the object weight to form preference weight record data; and combining the preference weight record data into the preference weight set by the recommended party.
The personalized recommendation method further comprises the following steps: and in response to the existence of the object weight corresponding to the recommended party to be recommended and the recommendation environment parameter, directly acquiring the object weight of the recommended party to be recommended under the recommendation environment parameter from the preference weight set.
The personalized recommendation method further comprises the following steps: combining the preference weight set with the recommendation model to obtain a personalized recommendation model, wherein the object score of the personalized recommendation model is the combination of the preference score and the basic score; according to the sample data generating method, the personalized recommendation model is taken as a recommendation model to obtain new effective sample data; according to the method for generating the object weight of the recommendation model as described above, a new object weight is obtained from the new valid sample data; generating a new set of preference weights based on the new object weights; and merging the preference weight set and the new preference weight set to obtain an updated preference weight set, wherein the object weight is the sum of corresponding object weights in the preference weight set and the new preference weight set.
According to another aspect of the present application, there is provided a sample data generating apparatus including: the basic data generation unit is used for generating a basic recommendation data set of the recommended party based on the behavior data of the recommended party and recommendation data generated by the recommendation model; a preference data generating unit, configured to generate a preference data set of a recommended party for basic recommendation data in a basic recommendation data set of the recommended party; and the effective sample generation unit is used for screening the preference data set of the recommended party based on the basic recommendation data in the basic recommendation data set of the recommended party so as to determine effective sample data for training a recommendation model.
According to still another aspect of the present application, there is provided an apparatus for generating an object weight of a recommendation model, comprising: an effective sample acquisition unit configured to acquire effective sample data for training the recommendation model generated by the generation means of sample data as described above; and an object weight generating unit for generating an object weight for weighting the candidate object of the recommendation model using the valid sample data.
According to still another aspect of the present application, there is provided a personalized recommendation device, including: the environment determining unit is used for determining recommended environment parameters of the recommended party to be recommended; the score acquisition unit is used for acquiring the basic score of the recommendation model for scoring the candidate object; the weight acquisition unit is used for acquiring the object weight of the recommended party to be recommended under the recommended environment parameters; a preference calculation unit for calculating a preference score of the candidate object obtained by weighting the object weight; and an object recommendation unit for recommending the object based on the basic score and the preference score of the candidate object.
According to still another aspect of the present application, there is provided an electronic apparatus including: a processor; and a memory in which computer program instructions are stored which, when executed by the processor, cause the processor to perform the method of generating sample data, the method of generating object weights for a recommendation model and the personalized recommendation method as described above.
According to a further aspect of the present application, there is provided a computer readable medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform a method of generating sample data, a method of generating object weights of a recommendation model and a personalized recommendation method as described above.
According to the sample data generation method, the method for generating the object weight of the recommendation model, the personalized recommendation method, the device and the electronic equipment, sample data which accurately represent the personalized tendency of the recommended party can be obtained, the recommended object is enabled to be more in line with the preference of the recommended party by giving the candidate object of the basic recommendation model the object weight based on the preference of the recommended party, and the personalized recommendation is carried out by the method, the recommendation accuracy can be improved, and the experience of the recommended party is improved.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing embodiments of the present application in more detail with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of embodiments of the application and are incorporated in and constitute a part of this specification, illustrate the application and together with the embodiments of the application, and not constitute a limitation to the application. In the drawings, like reference numerals generally refer to like parts or steps.
Fig. 1 illustrates a schematic diagram of an application scenario of a generation method of sample data, a method for generating object weights of a recommendation model, and a personalized recommendation method according to an embodiment of the present application;
FIG. 2 illustrates a flow chart of a method of generating sample data according to an embodiment of the application;
FIG. 3 illustrates a flow chart of a method for generating object weights for a recommendation model, in accordance with an embodiment of the present application;
FIG. 4 illustrates a schematic diagram of an example neural network of similarity calculation functions, according to an embodiment of the application;
FIG. 5 illustrates a schematic diagram of an example neural network of weight calculation functions, according to an embodiment of the application;
FIG. 6 illustrates a schematic diagram of a training process for an example of a neural network of a preference weight generation model, in accordance with an embodiment of the present application;
FIG. 7 illustrates a flow chart of a personalized recommendation method according to an embodiment of the application;
FIG. 8 illustrates a block diagram of a sample data generating apparatus according to an embodiment of the present application;
FIG. 9 illustrates a block diagram of an apparatus for generating object weights for a recommendation model, in accordance with an embodiment of the present application;
FIG. 10 illustrates a block diagram of a personalized recommendation device, according to an embodiment of the application;
Fig. 11 illustrates a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
Hereinafter, exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be apparent that the described embodiments are only some embodiments of the present application and not all embodiments of the present application, and it should be understood that the present application is not limited by the example embodiments described herein.
Scene overview
Fig. 1 illustrates a schematic diagram of an application scenario of a generation method of sample data, a method for generating an object weight of a recommendation model, and a personalized recommendation method according to an embodiment of the present application.
As shown in fig. 1, the recommendation model is generally located in a server S for recommending objects to a mobile terminal T based on a recommendation request from the mobile terminal T of a recommended party U. Specifically, the server S includes a plurality of candidate objects, and the server S selects a recommended object from the candidate objects according to a predetermined recommendation algorithm and transmits the recommended object to the mobile terminal T.
After seeing the recommended objects presented on the mobile terminal T, the recommended party U may select one or more of the recommended objects or may feel that the recommended object is not his/her desire, but may additionally select other objects. As described above, the purpose of optimization of the recommendation model is to make the recommended object conform to the requirements of the recommended party as much as possible, thereby ensuring that the object selected by the recommended party is in the range of the recommended object. In particular, if the recommended object is a plurality of objects and is arranged from large to small in accordance with a predetermined recommendation score, it is desirable that the object selected by the recommended party is the object whose recommendation score is highest and whose arrangement position is the forefront.
Based on the above, the method for generating the sample data according to the embodiment of the application is used for generating the sample data which can accurately represent the personalized tendency of the recommended party, and the method for generating the object weight of the recommendation model is used for giving the weight of the candidate object of the recommendation model based on the preference of the recommended party, so that the score of the recommendation model on the recommendation object is more consistent with the preference of the recommended party. According to the personalized recommendation method, personalized recommendation conforming to the preference of the recommended party is carried out on the recommended party according to the method, so that the accuracy of recommendation is improved, and the experience of the recommended party is improved.
Hereinafter, an exemplary sample data generating method, a method for generating object weights of a recommendation model, and a personalized recommendation method according to an embodiment of the present application will be further described with reference to the accompanying drawings.
Exemplary sample data Generation method
Fig. 2 illustrates a method of generating sample data according to an embodiment of the present application.
As shown in fig. 2, the method for generating sample data according to an embodiment of the present application includes the following steps.
Step S110, based on the behavior data of the recommended party and the recommendation data generated by the recommendation model, a basic recommendation data set of the recommended party is generated. That is, data collection is first required to obtain the basic recommendation data of the recommendation model.
Specifically, after the recommendation model is run for a period of time, basic recommendation data generated by the recommendation model is collected, for example, a data set of the collected basic recommendation data is denoted as D. Each piece of data in the dataset D is denoted D, which is a five-tuple denoted d= (ID, O m,ou,E),om,ou E O, where ID represents the identity of the recommended party, i.e. the recommended party ID, O represents the set of candidate objects in the basic recommendation model, O m represents the object recommended by the recommendation model, O u represents the object selected by the recommended party, E represents the environment in which the recommendation is performed.
Here, each candidate object in the set of candidate objects O may be represented as O, and both of them and O m,ou may be represented using an attribute vector. For example, if the attribute vector contains m attribute values, it is an m-dimensional vector.
Taking route recommendation of an electronic map application as an example, a recommended object is a route, and an attribute vector table is, for example, o= (eta, dist, toll, …), where eta is a route length when the route is expected to be used, dist is a route length, and toll is a route charge. Of course, those skilled in the art will appreciate that the attribute vector of the recommended object may also include other attributes. And, the recommended object may be other types of objects, such as merchandise, advertisements, etc. In addition, E may also be represented by its attribute vector, e.g., e= (t, stdist, …), where t represents the time of initiating the recommendation and stdist represents the straight line distance between the start point and the end point. Of course, those skilled in the art will appreciate that the attribute vector of the environment may also include other attributes, and thus, E is also a multidimensional vector in which each vector value is a corresponding attribute value.
Thus, in an embodiment of the present application, each piece of basic recommendation data in the basic recommendation data set includes a recommender identifier, a candidate object set composed of candidate object vectors, a model recommendation object vector, a recommender selection object vector, and a first environment vector. Here, the context vector based on the base recommendation data is referred to as a first context vector. The candidate object vector, the model recommended object vector, and the recommended-party selected object vector are all m-dimensional vectors, and include m attribute values of the object.
Step S120, generating a preference data set of a recommended party aiming at basic recommendation data in the basic recommendation data set of the recommended party. That is, it is necessary to perform personalized preference mining for the recommended party, that is, to determine a preference data set of the recommended party, that is, personalized preference data of the recommended party, from the above-described basic recommendation data. Specifically, for a predetermined recommended party u (id=uid), a data set satisfying the following conditions is first selected from the data sets D described above:
Here, the selected data set D u may be referred to as a candidate data set of the predetermined recommended party, where each candidate data belongs to the data set D, and the recommended party ID corresponding to the data is the ID of the predetermined recommended party u, and the object recommended by the recommendation model is different from the object selected by the recommended party.
Then according toThat is, the data in D u is ordered (from small to large) at the time of initiating the recommendation in the recommendation environment corresponding to each piece of data, and the ordered data set is still denoted as D u for convenience of representation.
Next, for each piece of data D in D u, an object disparity vector Δo is calculated:
here, the object disparity vector Δo is a disparity vector of the model recommended object vector and the recommended side selected object vector, which is also an m-dimensional vector.
Taking the attribute value vector of the line object as described above as an example:
Δo=(Δeta,Δdist,Δtoll,…)
And, Δo is combined with the ID in the piece of data d and the environment E to generate one piece of preference data p= (ID, Δo, E). And, all preference data constitute a preference set P u representing the preference set of the predetermined recommended party u. Taking Δeta as an example, if Δeta >0, this means that the predetermined recommended party likes a route for which the route is expected to be used longer than a route recommended by the base recommendation model; conversely, this means that a route that is shorter when the route is predicted to be liked is meant, and the absolute value of Δeta may represent the degree of preference of the predetermined recommended party for the route when it is predicted to be liked.
In the above manner, for each recommended party u in the dataset D, a set of preferences P u, referred to herein as a first set of preferences, corresponding to that recommended party can be generated.
Thus, in an embodiment of the present application, generating a set of preference data for a user for base recommendation data in the set of base recommendation data for the user comprises: determining a candidate data set of the recommended party from the basic recommendation data, the candidate data set comprising a plurality of candidate data, and the model recommendation object vector of each candidate data being different from a user selection object vector; for each piece of candidate data, calculating a difference between the model recommended object vector and a recommended party selected object vector to obtain an object difference vector; obtaining a first environment vector corresponding to the object difference vector as a second environment vector; constructing a recommender identifier of the recommender, the object difference vector and the second environment vector into preference data of the recommender corresponding to the candidate data; and forming a plurality of pieces of preference data of the recommended party corresponding to the plurality of candidate data sets into preference data sets of the recommended party.
That is, the preference data set of the recommenders includes a plurality of pieces of preference data of the recommenders, and each piece of preference data includes a recommender identification, an object disparity vector that is a disparity vector of a model recommendation object vector and a recommender selection object vector, and a second environment vector. Here, the context vector based on the preference data is referred to as a second context vector to distinguish from the first context vector as described above. Of course, those skilled in the art will appreciate that the second context vector is essentially the same as the first context vector.
Step S130, screening the preference data set of the recommended party based on the basic recommendation data in the basic recommendation data set of the recommended party to determine effective sample data for training a recommendation model. Thus, this step may also be referred to as sample generation, and specifically, this step comprises obtaining valid sample data from each candidate data based on the candidate data set of the recommended party as described above.
Specifically, for a certain piece of data D in the data set D u corresponding to the predetermined recommended party u, a preference set corresponding to the piece of data is screened, which is referred to herein as a sample preference set, and is expressed as:
This means that the preference data in the sample preference set belongs to the preference data set P u corresponding to the predetermined recommended party u, and is the preference data corresponding to the piece of data d when the recommendation occurs (i.e., when the recommendation occurs), that is, the recommendation time corresponding to the preference data in the preference set is earlier than the recommendation time corresponding to the piece of data. A predetermined threshold k of the number of elements in P d, where k >0, may be set to determine whether the preference data set P u is valid. Here, k may be set according to the specific case. If the preference data set P u is valid, sample data corresponding to the piece of data d is generated, denoted as q, where q= (ID, O, O u,E,Pd, n), where ID, O, O u and E have the same meaning as described above. In addition, if the preference data set P u is invalid, i.e., the number of elements in P d is less than k, it indicates that a valid sample cannot be generated based on the piece of data d.
In this way, for each piece of data in the data set D u corresponding to the predetermined recommended side u, a valid sample may be generated, and for all recommended sides in the data set D, a set of valid samples may be generated, e.g., denoted as Q. It is noted that for each valid sample in the set Q of valid samples, e.g. denoted as Q, the preference data P d is a set, i.e. comprising a plurality of pieces of preference data, e.g. n pieces of data.
Thus, in an embodiment of the present application, filtering the set of preference data of the user based on the base recommendation data in the set of base recommendation data of the user to determine valid sample data for training the recommendation model includes: selecting, for each piece of candidate data, candidate preference data having a recommendation time in a second environmental vector in the preference data set of the recommended party earlier than a recommendation time in a first environmental vector of the candidate data; in response to the number of candidate preference data being greater than a predetermined threshold, forming a set of sample preferences corresponding to the candidate data from the candidate preference data; and the candidate data corresponds to the recommended party identifier, the candidate object set, the recommended party selection object vector, the first environment vector, the sample preference set and the number of the candidate preference data form the valid sample data.
That is, in the embodiment of the present application, each valid sample data includes a recommender identification corresponding to one piece of candidate data, a candidate object set, a recommender selection object vector, a first environment vector, a sample preference set made up of preference data earlier than a recommendation time in the first environment vector in a preference set of the recommender, and the number of data in the sample preference set.
And, in an embodiment of the present application, filtering the preference data set of the user based on the basic recommendation data in the basic recommendation data set of the user to determine valid sample data for training the recommendation model further includes: generating corresponding valid sample data based on each recommender in the basic recommendation data to obtain a valid sample set.
In this way, sample data capable of accurately representing personalized trends of the recommended party can be generated, so that object weights of the recommendation model are generated based on the sample data, and the object weights can be endowed to weights of candidate objects of the recommendation model based on the preference of the recommended party, so that the scoring of the recommendation model on the recommendation object is more consistent with the preference of the recommended party.
Exemplary object weight Generation method
FIG. 3 illustrates a flowchart of a method for generating object weights for a recommendation model, according to an embodiment of the application.
As shown in fig. 3, the method for generating the object weight of the recommendation model according to the embodiment of the present application includes the following steps.
Step S210, obtaining valid sample data for training the recommendation model, which is determined by the sample data generating method as described above. That is, a set Q of valid samples as described above is acquired.
And step S220, generating an object weight value for weighting the object recommended by the recommendation model by using the valid sample data. Because the candidate objects of the recommendation model are in the form of object vectors as described above, in the embodiment of the present application, the object weights used to weight the object vectors of the candidate objects are also in the form of weight vectors. And, since the weight vector can embody the preference of the recommended party, it is also referred to as a preference weight vector hereinafter.
Specifically, for each valid sample data Q in the above set of valid samples Q, a first preference vector thereof, denoted herein as Q E, is calculated, and a second context vector, denoted herein as p E, of each preference data in the set of sample preferences, denoted herein as:
simpq=Fsim(pE,qE),0≤simpq≤1
Here, F sim is a similarity calculation function, which can be calculated using the cosine distance of the vector, and can also be calculated using a neural network. As described above, the sample preference set contains n pieces of preference data, and thus the calculated similarity should be n numbers.
In particular, fig. 4 illustrates a schematic diagram of an example of a neural network of similarity calculation functions according to an embodiment of the present application. As shown in fig. 4, the first environment vector q E and the second environment vector Matrix multiplication (MatMul) is performed, followed by multiplication by a scaling factor (Scale), which may be, for example, the inverse of the square root of the number of dimensions of q E, and finally the similarity/>, obtained by the Softmax function
Next, a final preference vector is calculated, expressed as:
here the number of the elements is the number, Is the object disparity vector in each piece of preference data in the sample preference set of the valid piece of sample data. As described above, for the valid sample data, the n similarity values may constitute n-dimensional vectors, and the n object difference vectors may constitute an n×m matrix, so that the final preference vector may also be expressed as a matrix product of the similarity vector of the valid sample data and the object difference matrix, which is output as an m-dimensional vector, which is the same as the dimension of the object vector, and each bit corresponds to a bit of the object vector.
Then, a preference weight vector is calculated based on the final preference vector, expressed as:
for example, for the feature vector exemplified by the route as described above, the above preference weight vector is expressed as:
w=(weta,wdist,wtoll,…)
Here, F w is a weight calculation function, which may be implemented by a neural network, or may be implemented based on rules, and optimized by manually adjusting parameters. And q n represents the number of data in the set of sample preferences in the piece of sample data, q E represents the first context vector in the piece of sample data.
In particular, fig. 5 illustrates a schematic diagram of an example of a neural network of weight calculation functions according to an embodiment of the present application. As shown in fig. 5, willQ n,qE inputs the deep neural network composed of the full connection layers and calculates the preference weight vector w. It should be noted that the preference weight vector w is used to weight the object vector o, so the dimensions of the preference weight vector w and the object vector o should be the same, i.e. m dimensions, and each bit of the preference weight vector w should also be in one-to-one correspondence with the attribute value of each bit in the object vector o.
Therefore, in the embodiment of the present application, the preference weight vector w can directly reflect the preference degree of the recommended party for the attribute of the object. For example, w dist reflects the preference of the recommended party for the route length, and the smaller w dist, the more favored the recommended party is for a route with a short route length. In this way, the preference weight w is highly interpretable.
In an embodiment of the present application, generating, using the valid sample data, an object weight for weighting an object recommended by the base recommendation model includes: for each valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the set of sample preferences; multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and obtaining the preference weight vector based on the final preference vector, wherein the number of data in the sample preference set in the valid sample data and the first environment vector are the same as the dimension of the candidate object vector, and each bit of the preference weight vector corresponds to the attribute value of each bit in the candidate object vector one by one.
In the practical application process, when the neural network is used to calculate the similarity and the weight, the neural network needs to be trained, and the training step of the neural network will be further described below.
For valid sample data q, after obtaining its preference weight vector w, calculate its candidate set of objects, denoted as the personalized score for each object in q O, denoted as:
Sprefer={w·o|o∈qO}=(prefer1,prefer2,…)
where w·o represents a calculation vector product for the preference weight vector w in m dimensions and the object vector o in m dimensions, equivalent to a weighted sum of each bit in the preference weight vector w weighted by each bit in the calculation object vector o.
And, a base score for each object in q O is calculated using the base recommendation model, expressed as:
Sbase=(base1,base2,…)
The final score is then calculated as:
S=softmax(Sbase+Sprefer)=(s1,s2,…),0≤si≤1,∑si=1
Then, the recommended party based on the valid sample data selects an object vector, which is recorded as Generating a tag, expressed as:
Where o i=ou denotes that an object in the candidate object set is a recommended-party selected object, and o i≠ou denotes that an object in the candidate object set is not a recommended-party selected object.
Here, the number of elements in the sample data q, S prefer,Sbase, S, and S l is equal to the number of objects in the selected object set q O in the strip of valid sample data, and corresponds one-to-one. Further, by calculating the cross entropy loss function values of S and S l, training of the neural network can be accomplished by training methods such as gradient descent or Adam (Adaptive Moment Estimation: adaptive momentum estimation).
FIG. 6 illustrates a schematic diagram of a training process for an example of a neural network of a preference weight generation model, according to an embodiment of the present application. As described in fig. 6, for each valid sample data, n similarities between its first environmental vector and the second environmental vector of n pieces of preference data in the sample preference set are calculated by the first neural network. Then, the n similarities are multiplied and summed with the object disparity vectors of the corresponding preference data in the second preference set, respectively, to obtain a final preference vector. Then, based on the final preference vector, the number n of data stripes in the set of sample preferences in the valid sample data, and the first context vector, a preference weight vector is calculated by a second neural network. Each object vector in the set of candidate objects in the valid sample data is then weighted with the preference weight vector to obtain a personalized score for each object in the set of candidate objects. Then, a base score for each object in the set of candidate objects is calculated using the base recommendation model, and a personalized score and a softmax function value for the base score for each object are calculated to obtain a final score vector. Then, generating a tag vector based on whether each object in the candidate object set is a recommended object, calculating a cross entropy loss function value of the tag vector and the final score vector, and training the first neural network and the second neural network based on the cross entropy loss function value.
Thus, in an embodiment of the present application, generating object weights for weighting candidate objects of the base recommendation model using the valid sample data comprises: for each valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the set of sample preferences using a first neural network; multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and based on the final preference vector, obtaining the preference weight vector by using a second neural network, wherein the preference weight vector is the same as the dimension of the alternative object vector, and each bit of the preference weight vector corresponds to the attribute value of each bit of the alternative object vector one by one.
Also, in an embodiment of the present application, the training process of the first neural network and the second neural network includes: for each piece of valid sample data, weighting each candidate object vector in a candidate object set in the valid sample data by the preference weight vector to obtain a personalized score of each candidate object in the candidate object set; calculating a base score for each candidate object in the set of candidate objects using the recommendation model; calculating a softmax function value of the personalized score and the base score of each candidate object to obtain a final score vector; generating a tag vector based on whether each object in the set of candidate objects is a recommended party selection object; calculating a cross entropy loss function value of the label vector and the final score vector; and training the first neural network and the second neural network based on the cross entropy loss function value.
Thus, by the method for generating the object weight of the recommendation model as described above, the object weight of the selected object recommended by the recommendation model with respect to the recommended party u can be generated. Thus, for each recommended side u, valid sample data q may be constructed for data d of the recommended environment E (taking the latest one time if the same environment appears many times) that the recommended side has historically appeared, by the sample data generating method described above, and weight vector w may be calculated by the method for generating object weights of the recommendation model described above, thereby generating one preference weight record uew = (ID, E, w). If d cannot generate valid sample data q, then w of the recommended party in the environment is not calculated. Also, since multiple recommendation environments may occur with the same recommended party, multiple uew records may be generated.
And, all UEW records generated by all users and their corresponding environments may constitute a set of preference weights, denoted UEW. In this set, the same (ID, E) corresponds to a unique one w.
Accordingly, in the method for generating the object weight of the recommendation model according to the embodiment of the present application, further comprising: and forming a preference weight set by using object weights generated based on all recommended parties and corresponding first environment vectors, wherein each preference weight in the preference weight set consists of a user identifier, the first environment vector and the object weight.
Exemplary personalized recommendation methods
Fig. 7 illustrates a flowchart of a personalized recommendation method according to an embodiment of the application.
As shown in fig. 7, the personalized recommendation method according to the embodiment of the application includes the following steps.
In step S310, a recommendation environment parameter of the recommended party to be recommended is determined. That is, for the recommenders to be recommended, the first environment vector E in the basic recommendation data of the recommendation model as described above is determined.
In step S320, a base score of the recommendation model for scoring the candidate object is obtained, that is, the base score S base obtained by scoring the candidate object by the recommendation model as described above.
Step S330, obtaining the object weight of the recommended party to be recommended under the recommended environment parameter. Here, as described above, by constructing the preference weight set, the object weights of different recommended parties under different recommendation environment parameters can be obtained. Thus, it is possible to determine whether there is an object weight corresponding to the recommended party to be recommended and the recommendation environment parameter by querying the preference weight set. If the object weight corresponding to the recommended party to be recommended and the recommended environment parameter exists, the object weight of the recommended party to be recommended under the recommended environment parameter can be directly obtained from the preference weight set.
And if there is no object weight corresponding to the recommended party to be recommended and the recommendation environment parameter, the object weight may be generated according to the generation method of the sample data and the method for generating the object weight of the recommendation model as described above.
Therefore, in the personalized recommendation method according to the embodiment of the application, the obtaining the object weight of the user to be recommended under the recommendation environment parameter includes: determining whether object weights corresponding to the recommended party to be recommended and the recommendation environment parameters exist or not by querying a preference weight set; acquiring valid sample data corresponding to the recommended environment parameter generated by the sample data generating method as described above in response to the absence of the object weight; and generating object weights using the valid sample data in the method for generating object weights of a recommendation model as described above.
In addition, in the personalized recommendation method, the method further includes: based on the recommended party identifier and the first environment vector in the effective sample data, combining the object weight to form preference weight record data; and combining the preference weight record data into the preference weight set.
In addition, in the above personalized recommendation method, further comprising: and in response to the existence of the object weight corresponding to the user to be recommended and the recommendation environment parameter, directly acquiring the object weight of the user to be recommended under the recommendation environment parameter from the preference weight set.
Step S340, calculating a preference score obtained by weighting the candidate object by the object weight. That is, S prefer = w·o as described above.
And step S350, recommending the object based on the basic score and the preference score of the candidate object. For example, s=s base+Sprefer is taken as the final score, and the object with the highest score is selected as the recommended object. Furthermore, one skilled in the art will appreciate that a weighted sum of the base score and the preference score, or a score calculated by other algorithms, may also be used.
That is, in the personalized recommendation method of the embodiment of the present application, the personalized trends of different recommended parties are finally reflected by the preference weight set, and the trends are model-based trends, which are obtained according to the recommendation model. Thus, a personalized preference score may be derived based on this tendency and used to revise the recommendation model to optimize the recommendation model.
Thus, in the personalized recommendation method, when the object recommendation needs to be performed on the new recommended party to be recommended, the ID of the recommended party can be directly used for inquiring and obtaining the object weight from the preference weight set, the basic score and the preference score can be obtained in the mode, and the object recommendation is performed.
And if the preference weight set is queried according to the ID of the recommended party, the object weight corresponding to the new recommended party to be recommended is not obtained, the object recommendation can be performed on the new recommended party to be recommended based on a recommendation model only.
Also, in the embodiment of the present application, by combining the base score and the preference score as described above, a new personalized recommendation model is actually obtained from the recommendation model. That is, the personalized recommendation model is a combination of a recommendation model and an initial set of preference weights, which may be expressed as m= { m b, UEW }, where m is a personalized recommendation model and m b is a recommendation model, for example.
After a period of use, the personalized recommendation model m may obtain personalized recommendation data in a similar manner to the recommendation model, and a new set of preference weights UEW new may be generated in accordance with the method of generating object weights as described above.
In this way, the initial set of preference weights UEW and the new set of preference weights UEW new may be combined. Here, for the same (ID, E), if only one of UEW and UEW new appears, its corresponding record of (ID, E, w) is kept, otherwise, the two records are combined to get (ID, E, w 0+w1), where w 0 and w 1 are the object weights in UEW and UEW new, respectively. Thus, the updated set of preference weights, e.g., denoted UEW update, and correspondingly the updated personalized recommendation set denoted m update={mb,UEWupdate, are obtained after merging. Therefore, in the embodiment of the present application, iteration of the preference weight may be implemented in the above manner, and the iteration period may be determined according to circumstances, for example, one month, three months, etc., and theoretically, only enough data is collected, so that one iteration may be performed.
That is, in the personalized recommendation method according to the embodiment of the present application, further comprising: combining the preference weight set with the recommendation model to obtain a personalized recommendation model, wherein the object score of the personalized recommendation model is the combination of the preference score and the basic score; according to the sample data generating method, the personalized recommendation model is taken as a recommendation model to obtain new effective sample data; according to the method for generating the object weight of the recommendation model as described above, a new object weight is obtained from the new valid sample data; generating a new set of preference weights based on the new object weights; and merging the preference weight set and the new preference weight set to obtain an updated preference weight set, wherein the object weight is the sum of corresponding object weights in the preference weight set and the new preference weight set.
Therefore, in the embodiment of the application, the personalized tendency iteration can be performed by continuously updating the preference weight set, so that the accuracy of personalized recommendation is improved.
Exemplary apparatus
Fig. 8 illustrates a block diagram of a sample data generating apparatus according to an embodiment of the present application.
As shown in fig. 8, a sample data generating apparatus 400 according to an embodiment of the present application includes: a basic data generating unit 410, configured to generate a basic recommendation data set of the recommended party based on the behavior data of the recommended party and recommendation data generated by the recommendation model; a preference data generating unit 420, configured to generate, for basic recommendation data in a basic recommendation data set of a recommended party, a preference data set of the recommended party; and an effective sample generating unit 430, configured to filter the preference data set of the recommended party based on the basic recommendation data in the basic recommendation data set of the recommended party, so as to determine effective sample data for training the recommendation model.
In one example, in the generating apparatus 400 of sample data, each piece of basic recommendation data in the basic recommendation data set includes a recommender identifier, a candidate object set composed of candidate object vectors, a model recommendation object vector, a recommender selection object vector, and a first environment vector.
In one example, in the generating apparatus 400 of sample data, the preference data generating unit 420 is configured to: determining a candidate data set of the recommended party from the base recommendation data, the candidate data set including a plurality of candidate data, and the model recommendation object vector of each candidate data being different from a recommended party selection object vector; for each piece of candidate data, calculating a difference between the model recommended object vector and a recommended party selected object vector to obtain an object difference vector; obtaining a first environment vector corresponding to the object difference vector as a second environment vector; constructing a recommender identifier of the recommender, the object difference vector and the second environment vector into preference data of the recommender corresponding to the candidate data; and forming a plurality of pieces of preference data of the recommended side corresponding to the plurality of pieces of candidate data into a preference data set of the recommended side.
In one example, in the above-described sample data generating apparatus 400, the valid sample generating unit 430 is configured to: selecting, for each piece of candidate data, candidate preference data having a recommendation time in a second environmental vector in the preference data set of the recommended party earlier than a recommendation time in a first environmental vector of the candidate data; in response to the number of candidate preference data being greater than a predetermined threshold, forming a set of sample preferences corresponding to the candidate data from the candidate preference data; and the candidate data corresponds to the recommended party identifier, the candidate object set, the recommended party selection object vector, the first environment vector, the sample preference set and the number of the candidate preference data form the valid sample data.
In one example, in the generating apparatus 400 of sample data, the valid sample generating unit 430 is further configured to: corresponding valid sample data is generated based on each user in the base recommendation data to obtain a valid sample set.
FIG. 9 illustrates a block diagram of an apparatus for generating object weights for a recommendation model, in accordance with an embodiment of the present application.
As shown in fig. 9, an apparatus 500 for generating object weights of a recommendation model according to an embodiment of the present application includes: an effective sample acquiring unit 510 for acquiring effective sample data for training the recommendation model generated by the generating means 400 of sample data as described above; and an object weight generating unit 520 for generating an object weight for weighting the candidate object of the recommendation model using the valid sample data.
In one example, in the above-mentioned apparatus 500 for generating an object weight of a recommendation model, the object weight generating unit 520 is configured to: for each valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the set of sample preferences; multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and obtaining the object weight based on the final preference vector, the number of data in the sample preference set in the valid sample data and the first environment vector, the object weight being in the form of a preference weight vector, the dimension of the preference weight vector being the same as the dimension of the candidate object vector, and each bit of the preference weight vector being in one-to-one correspondence with the attribute value of each bit of the candidate object vector.
In one example, in the above-mentioned apparatus 500 for generating an object weight of a recommendation model, the object weight generating unit 520 is configured to: for the valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the second set of preferences using a first neural network; multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and based on the final preference vector, obtaining the object weight value by using a second neural network, wherein the object weight value is in the form of a preference weight value vector, the dimension of the preference weight value vector is the same as that of the alternative object vector, and each bit of the preference weight value vector corresponds to the attribute value of each bit of the alternative object vector one by one.
In one example, in the apparatus 500 for generating object weights of a recommendation model, the training process of the first neural network and the second neural network includes: for each piece of valid sample data, weighting each candidate object vector in a candidate object set in the valid sample data by the preference weight vector to obtain a personalized score of each candidate object in the candidate object set; calculating a base score for each candidate object in the set of candidate objects using the recommendation model; calculating a softmax function value of the personalized score and the base score of each candidate object to obtain a final score vector; generating a tag vector based on whether each object in the set of candidate objects is a recommended party selection object; calculating a cross entropy loss function value of the label vector and the final score vector; and training the first neural network and the second neural network based on the cross entropy loss function value.
In one example, in the apparatus 500 for generating the object weight of the recommendation model, the method further includes: the weight set generating unit is used for forming a preference weight set by the object weights generated based on all recommended parties and the corresponding first environment vectors, wherein each preference weight in the preference weight set is composed of the recommended party identification, the first environment vectors and the object weights.
Fig. 10 illustrates a block diagram of a personalized recommendation device according to an embodiment of the application.
As shown in fig. 10, the personalized recommendation device 600 according to the embodiment of the application includes: an environment determining unit 610, configured to determine recommended environment parameters of a recommended party to be recommended; a score obtaining unit 620, configured to obtain a base score of the recommendation model for scoring the candidate object; a weight obtaining unit 630, configured to obtain an object weight of the recommended party to be recommended under the recommendation environment parameter; a preference calculation unit 640 for calculating a preference score of the candidate object obtained by weighting the object weights; and an object recommendation unit 650 for performing object recommendation based on the base score and the preference score of the candidate object.
In one example, in the personalized recommendation device 600, the weight obtaining unit 630 is configured to: determining whether object weights corresponding to the recommended party to be recommended and the recommendation environment parameters exist or not by querying a preference weight set; acquiring valid sample data corresponding to the recommended environment parameter generated by the generation method of sample data as described above in response to the absence of the object weight; and generating object weights using the valid sample data in the method for generating object weights of a recommendation model as described above.
In one example, in the personalized recommendation device 600, the weight obtaining unit 630 is further configured to: based on the recommended party identifier and the first environment vector in the effective sample data, combining the object weight to form preference weight record data; and combining the preference weight record data into the preference weight set by the recommended party.
In one example, in the personalized recommendation device 600, the weight obtaining unit 630 is further configured to: and in response to the existence of the object weight corresponding to the recommended party to be recommended and the recommendation environment parameter, directly acquiring the object weight of the recommended party to be recommended under the recommendation environment parameter from the preference weight set.
In one example, in the personalized recommendation device 600, a model updating unit is further included for: combining the preference weight set with the recommendation model to obtain a personalized recommendation model, wherein the object score of the personalized recommendation model is the combination of the preference score and the basic score; according to the sample data generating method, the personalized recommendation model is taken as a recommendation model to obtain new effective sample data; according to the method for generating the object weight of the recommendation model as described above, a new object weight is obtained from the new valid sample data; generating a new set of preference weights based on the new object weights; and merging the preference weight set and the new preference weight set to obtain an updated preference weight set, wherein the object weight is the sum of corresponding object weights in the preference weight set and the new preference weight set.
Here, it will be understood by those skilled in the art that the specific functions and operations of the respective units and modules in the above-described generation apparatus 400 of sample data, the apparatus 500 for generating object weights of recommendation models, and the personalized recommendation apparatus 600 have been described in detail in the above description of the generation method of sample data, the method for generating object weights of recommendation models, and the personalized recommendation method with reference to fig. 1to 7, and thus, repetitive descriptions thereof will be omitted.
As described above, the generation apparatus 400 of sample data, the apparatus 500 for generating object weights of recommendation models, and the personalized recommendation apparatus 600 according to the embodiment of the present application may be implemented in various server devices, such as a server providing a recommendation service, etc. In one example, the generating means 400 of sample data, the means 500 for generating object weights of a recommendation model and the personalized recommendation means 600 according to an embodiment of the present application may be integrated into a server device as one software module and/or hardware module. For example, the means 400 for generating sample data, the means 500 for generating object weights of the recommendation model and the personalized recommendation means 600 may be one software module in the operating system of the server device or may be one application developed for the server device; of course, the generating means 400 of the sample data, the means 500 for generating the object weights of the recommendation model and the personalized recommendation means 600 may equally be one of a number of hardware modules of the server device.
Alternatively, in another example, the generating means 400 of the sample data, the means 500 for generating the object weight of the recommendation model and the personalized recommendation means 600 may be separate devices from the server device, and the generating means 400 of the sample data, the means 500 for generating the object weight of the recommendation model and the personalized recommendation means 600 may be connected to the server device through a wired and/or wireless network and transmit the interaction information according to the agreed data format.
Exemplary electronic device
Next, an electronic device according to an embodiment of the present application is described with reference to fig. 11.
Fig. 11 illustrates a block diagram of an electronic device according to an embodiment of the application.
As shown in fig. 11, the electronic device 10 includes one or more processors 11 and a memory 12.
The processor 13 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
Memory 12 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. On which one or more computer program instructions may be stored that may be executed by the processor 11 to implement the methods of generating sample data, the methods of generating object weights for recommendation models, and personalized recommendation methods described above for the various embodiments of the application, and/or other desired functions. Various contents such as sample data, object weights, and the like may also be stored in the computer-readable storage medium.
In one example, the electronic device 10 may further include: an input device 13 and an output device 14, which are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
The input means 13 may comprise, for example, a keyboard, a mouse, etc.
The output device 14 may output various information to the outside, including personalized recommendation results, and the like. The output means 14 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device 10 that are relevant to the present application are shown in fig. 11 for simplicity, components such as buses, input/output interfaces, etc. being omitted. In addition, the electronic device 10 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer readable storage Medium
In addition to the methods and apparatus described above, embodiments of the application may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps of the methods of generating sample data, methods for generating object weights of a recommendation model and personalized recommendation methods according to various embodiments of the application described in the "exemplary methods" section of this specification.
The computer program product may write program code for performing operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the first recommender computing device, partly on the first recommender device, as a stand-alone software package, partly on the first recommender computing device, partly on a remote computing device, or entirely on a remote computing device or server.
Furthermore, embodiments of the present application may also be a computer-readable storage medium, on which computer program instructions are stored, which, when being executed by a processor, cause the processor to perform steps in a method of generating sample data, a method of generating object weights for a recommendation model, and a personalized recommendation method according to various embodiments of the present application described in the above "exemplary methods" section of the present specification.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present application have been described above in connection with specific embodiments, but it should be noted that the advantages, benefits, effects, etc. mentioned in the present application are merely examples and not intended to be limiting, and these advantages, benefits, effects, etc. are not to be construed as necessarily possessed by the various embodiments of the application. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, as the application is not necessarily limited to practice with the above described specific details.
The block diagrams of the devices, apparatuses, devices, systems referred to in the present application are only illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
It is also noted that in the apparatus, devices and methods of the present application, the components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the application to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (12)

1. A method of generating sample data, comprising:
Generating a basic recommendation data set of a recommended party based on the behavior data of the recommended party and recommendation data generated by a recommendation model, wherein each piece of basic recommendation data in the basic recommendation data set comprises an identification of the recommended party, an alternative object set consisting of alternative object vectors, a model recommendation object vector, an object vector selected by the recommended party and a first environment vector;
determining a candidate data set of the recommended party from basic recommendation data in the basic recommendation data set of the recommended party, wherein the candidate data set comprises a plurality of candidate data, and the model recommendation object vector of each candidate data is different from the recommended party selection object vector;
For each piece of candidate data, calculating a difference between the model recommended object vector and a recommended party selected object vector to obtain an object difference vector;
obtaining a first environment vector corresponding to the object difference vector as a second environment vector;
Constructing a recommender identifier of the recommender, the object difference vector and the second environment vector into preference data of the recommender corresponding to the candidate data;
Forming a plurality of pieces of preference data of the recommended side corresponding to the plurality of pieces of candidate data into a preference data set of the recommended side; and
And screening the preference data set of the recommended party based on the basic recommendation data in the basic recommendation data set of the recommended party to determine effective sample data for training a recommendation model.
2. The sample data generating method of claim 1, wherein filtering the recommended-party preference data set based on basic recommendation data in the recommended-party basic recommendation data set to determine valid sample data for training a recommendation model comprises:
Selecting, for each piece of candidate data, candidate preference data having a recommendation time in a second environmental vector in the preference data set of the recommended party earlier than a recommendation time in a first environmental vector of the candidate data;
In response to the number of candidate preference data being greater than a predetermined threshold, forming a set of sample preferences corresponding to the candidate data from the candidate preference data; and
And the candidate data corresponds to the recommended party identifier, the candidate object set, the recommended party selection object vector, the first environment vector, the sample preference set and the number of the candidate preference data form the valid sample data.
3. A method for generating object weights for a recommendation model, comprising:
Acquiring valid sample data for training a recommendation model as determined by the sample data generation method of claim 1; and
Object weights for weighting candidate objects of the recommendation model are generated using the valid sample data.
4. A method for generating object weights for a recommendation model, comprising:
Acquiring valid sample data for training a recommendation model as determined by the sample data generation method of claim 2; and
Object weights for weighting candidate objects of the recommendation model are generated using the valid sample data.
5. The method for generating object weights for a recommendation model of claim 4, wherein generating object weights for weighting candidate objects for the recommendation model using the valid sample data comprises:
For each valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the set of sample preferences;
multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and
Based on the final preference vector, the number of data in the sample preference set in the valid sample data and the first environment vector obtain the object weight, the object weight is in the form of a preference weight vector, the dimension of the preference weight vector is the same as the dimension of the alternative object vector, and each bit of the preference weight vector corresponds to the attribute value of each bit of the alternative object vector one by one.
6. The method for generating object weights for a recommendation model of claim 4, wherein generating object weights for weighting candidate objects for the recommendation model using the valid sample data comprises:
for the valid sample data, calculating a similarity between a first environmental vector and a second environmental vector of each piece of preference data in the set of sample preferences using a first neural network;
multiplying the similarity corresponding to each piece of preference data by the object disparity vector for that piece of preference data and summing each piece of preference data in the sample preference set to obtain a final preference vector; and
Based on the final preference vector, the number of data in the sample preference set in the valid sample data and the first environment vector, obtaining the object weight using a second neural network, the object weight being in the form of a preference weight vector, the dimension of the preference weight vector being the same as the dimension of the candidate object vector, and each bit of the preference weight vector being in one-to-one correspondence with the attribute value of each bit of the candidate object vector.
7. The method for generating object weights for the recommendation model of claim 6, wherein the training process of the first and second neural networks comprises:
for each piece of valid sample data, weighting each candidate object vector in a candidate object set in the valid sample data by the preference weight vector to obtain a personalized score of each candidate object in the candidate object set;
calculating a base score for each candidate object in the set of candidate objects using the recommendation model;
Calculating a softmax function value of the personalized score and the base score of each candidate object to obtain a final score vector;
Generating a tag vector based on whether each object in the set of candidate objects is a recommended party selection object;
Calculating a cross entropy loss function value of the label vector and the final score vector; and
Training the first neural network and the second neural network based on the cross entropy loss function value.
8. The method for generating object weights for a recommendation model according to claim 3 or 4, further comprising:
and forming a preference weight set by using the object weights generated based on all the recommended parties and the corresponding first environment vectors, wherein each preference weight in the preference weight set is formed by the recommended party identification, the first environment vectors and the object weights.
9. A personalized recommendation method, comprising:
determining recommendation environment parameters of a recommended party to be recommended;
Obtaining basic scores of candidate objects of the recommendation model;
determining whether object weights corresponding to the recommended party to be recommended and the recommendation environment parameters exist or not by querying a preference weight set;
Acquiring valid sample data corresponding to the recommended environment parameter generated by the sample data generating method according to claim 1 or 2 in response to the absence of the object weight; and
Generating object weights using the valid sample data in the method for generating object weights of a recommendation model as claimed in any one of claims 3 to 8;
calculating a preference score of the candidate object obtained by weighting the object weight; and
And recommending the object based on the basic score and the preference score of the candidate object.
10. The personalized recommendation method of claim 9, further comprising:
Based on the recommended party identifier and the first environment vector in the effective sample data, combining the object weight to form preference weight record data; and
The recommender combines the preference weight record data into the preference weight set.
11. The personalized recommendation method of claim 9, further comprising:
And in response to the existence of the object weight corresponding to the recommended party to be recommended and the recommendation environment parameter, directly acquiring the object weight of the recommended party to be recommended under the recommendation environment parameter from the preference weight set.
12. The personalized recommendation method of claim 10, further comprising:
combining the preference weight set with the recommendation model to obtain a personalized recommendation model, wherein the object score of the personalized recommendation model is the combination of the preference score and the basic score;
According to the sample data generating method as claimed in claim 1 or 2, the personalized recommendation model is taken as a recommendation model to obtain new valid sample data;
The method for generating object weights of a recommendation model according to any of claims 3 to 8, obtaining new object weights from the new valid sample data;
Generating a new set of preference weights based on the new object weights; and
Combining the preference weight set and the new preference weight set to obtain an updated preference weight set, wherein in the updated preference weight set, the object weight is the sum of corresponding object weights in the preference weight set and the new preference weight set.
CN202110873500.6A 2021-07-30 Method for generating object weight of recommendation model and personalized recommendation method Active CN113591986B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110873500.6A CN113591986B (en) 2021-07-30 Method for generating object weight of recommendation model and personalized recommendation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110873500.6A CN113591986B (en) 2021-07-30 Method for generating object weight of recommendation model and personalized recommendation method

Publications (2)

Publication Number Publication Date
CN113591986A CN113591986A (en) 2021-11-02
CN113591986B true CN113591986B (en) 2024-06-04

Family

ID=

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021379A (en) * 2016-05-12 2016-10-12 深圳大学 Personalized recommendation method and system based on user preference
CN107273436A (en) * 2017-05-24 2017-10-20 北京京东尚科信息技术有限公司 The training method and trainer of a kind of recommended models
CN109559208A (en) * 2019-01-04 2019-04-02 平安科技(深圳)有限公司 A kind of information recommendation method, server and computer-readable medium
CN110046952A (en) * 2019-01-30 2019-07-23 阿里巴巴集团控股有限公司 A kind of training method and device, a kind of recommended method and device of recommended models
CN112200602A (en) * 2020-09-21 2021-01-08 北京达佳互联信息技术有限公司 Neural network model training method and device for advertisement recommendation
WO2021004228A1 (en) * 2019-07-08 2021-01-14 汉海信息技术(上海)有限公司 Generation of recommendation reason
CN112434218A (en) * 2020-05-15 2021-03-02 广州知弘科技有限公司 Deep learning sample labeling method based on big data and used for content recommendation
CN112529665A (en) * 2020-12-18 2021-03-19 平安银行股份有限公司 Product recommendation method and device based on combined model and computer equipment
WO2021103994A1 (en) * 2019-11-26 2021-06-03 北京达佳互联信息技术有限公司 Model training method and apparatus for information recommendation, electronic device and medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021379A (en) * 2016-05-12 2016-10-12 深圳大学 Personalized recommendation method and system based on user preference
CN107273436A (en) * 2017-05-24 2017-10-20 北京京东尚科信息技术有限公司 The training method and trainer of a kind of recommended models
CN109559208A (en) * 2019-01-04 2019-04-02 平安科技(深圳)有限公司 A kind of information recommendation method, server and computer-readable medium
CN110046952A (en) * 2019-01-30 2019-07-23 阿里巴巴集团控股有限公司 A kind of training method and device, a kind of recommended method and device of recommended models
WO2021004228A1 (en) * 2019-07-08 2021-01-14 汉海信息技术(上海)有限公司 Generation of recommendation reason
WO2021103994A1 (en) * 2019-11-26 2021-06-03 北京达佳互联信息技术有限公司 Model training method and apparatus for information recommendation, electronic device and medium
CN112434218A (en) * 2020-05-15 2021-03-02 广州知弘科技有限公司 Deep learning sample labeling method based on big data and used for content recommendation
CN112200602A (en) * 2020-09-21 2021-01-08 北京达佳互联信息技术有限公司 Neural network model training method and device for advertisement recommendation
CN112529665A (en) * 2020-12-18 2021-03-19 平安银行股份有限公司 Product recommendation method and device based on combined model and computer equipment

Similar Documents

Publication Publication Date Title
CN110297848B (en) Recommendation model training method, terminal and storage medium based on federal learning
CN108804633B (en) Content recommendation method based on behavior semantic knowledge network
CN110866181B (en) Resource recommendation method, device and storage medium
JP4785906B2 (en) Content recommendation apparatus and method
JP5734460B2 (en) Method and system for comparing images
WO2015192667A1 (en) Advertisement recommending method and advertisement recommending server
CN109993627B (en) Recommendation method, recommendation model training device and storage medium
CN111429161B (en) Feature extraction method, feature extraction device, storage medium and electronic equipment
CN111159563A (en) Method, device and equipment for determining user interest point information and storage medium
KR101639656B1 (en) Method and server apparatus for advertising
CN112256973B (en) User portrait correction method, device, medium, and electronic apparatus
CN113221019A (en) Personalized recommendation method and system based on instant learning
CN110598126B (en) Cross-social network user identity recognition method based on behavior habits
KR102429392B1 (en) Method, device and system of providing product information using image crawling
CN115730125A (en) Object identification method and device, computer equipment and storage medium
KR20230150239A (en) A method and a device for providing recommendation information for affiliated stores
CN113591986B (en) Method for generating object weight of recommendation model and personalized recommendation method
CN115409617B (en) Foreign currency exchange method and system based on block chain
JP6700146B2 (en) A system that determines recommended content based on evaluation values
CN113761365B (en) Data processing system for determining target information
JP5588938B2 (en) Item recommendation apparatus, method and program
US20150170035A1 (en) Real time personalization and categorization of entities
CN114925275A (en) Product recommendation method and device, computer equipment and storage medium
KR102323424B1 (en) Rating Prediction Method for Recommendation Algorithm Based on Observed Ratings and Similarity Graphs
CN111684817B (en) Selection method of recommendation algorithm and corresponding device

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20240314

Address after: # 03-06, Lai Zan Da Building 1, 51 Belarusian Road, Singapore

Applicant after: Alibaba Innovation Co.

Country or region after: Singapore

Address before: Room 01, 45th Floor, AXA Building, 8 Shanton Road, Singapore

Applicant before: Alibaba Singapore Holdings Ltd.

Country or region before: Singapore

GR01 Patent grant