Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Each financial enterprise needs to make service recommendations for different users. To increase user satisfaction with the service, more and more financial enterprises design service packages to attract users and provide users with more affordable packages.
In the conventional method, package recommendation is usually performed on different users through a graph neural network model. However, in general, packages exist only on holidays and events, and thus, history data on package recommendations is quite sparse. In addition, compared with the association relationship between data involved in single product recommendation, the association relationship between data involved in package recommendation is more complex, which results in greater difficulty in building a model for package recommendation, and the existing graph neural network model cannot realize package recommendation well. Therefore, when the graphic neural network model is adopted to conduct package recommendation for different users, the accuracy of package recommendation is low.
The package recommendation method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The server 104 obtains the characteristics of the preset user and the preset package set from the terminal 102; the server 104 inputs the characteristics of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and a package recommendation result of the preset user is generated; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a package recommendation method is provided, and the method is applied to the server 104 in fig. 1 for illustration, and includes the following steps:
step 220, obtaining the features of the preset user and the preset package set.
Alternatively, the server 104 may determine a preset user to be recommended for a package from the terminal 102, and obtain the characteristics of the preset user from the information of the preset user. In addition, the server 104 may further obtain a preset package set based on a plurality of historical packages constructed by the expert and a plurality of preset packages newly added after the package is generated. The preset user refers to a user to be recommended for a package. The characteristics of the preset user refer to attribute information of the user, including the characteristics of gender, age, occupation and the like of the preset user. The preset package set comprises a plurality of packages, wherein the packages comprise historical packages established by an expert and packages which are newly added after being generated by the packages. When the package recommendation is performed on the preset user, the package recommendation of the preset number of most interested packages of the preset user can be selected from the preset package set to be recommended to the preset user.
Step 240, inputting the features of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products.
The preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products. The preset package set and the preset package recommendation model are generated by training based on the initial hypergraph convolutional neural network model. The hypergraph convolutional neural network model (Hypergraph Neural Nerworks, HGNN) is a neural network model that represents feature information by hypergraph and performs hypergraph convolutional processing on the feature information. The feature information is represented by the hypergraph, and the features of the preset user and the information of the preset package set can be well integrated into the hypergraph, so that convenience is brought to the follow-up use of the preset package recommendation model.
Alternatively, first, the server 104 may determine whether the preset user has a target embedded vector that has been modeled and corresponds to the preset user. The target embedded vector corresponding to the preset user represents relevant characteristic information of the preset user. Then, if the preset user has the modeled target embedded vector corresponding to the preset user, the server 104 may input the target embedded vector of the preset user and the preset package set into the preset package recommendation model to perform package recommendation, so as to select, for the preset user, a preset number of packages most interested by the preset user from the preset package set, and use the preset number of packages most interested by the preset user as package recommendation results of the preset user, thereby sending the package recommendation results of the preset user to the preset user. If the preset user does not have the modeled target embedded vector, the preset user is indicated to be a new user, at this time, the server 104 may calculate the feature similarity between the features of the preset user and the features of other modeled historical users, and use the target embedded vector of the modeled historical user, which is most similar to the features of the preset user, to perform package recommendation, so as to generate a package recommendation result. And finally, taking the package recommendation result as a package recommendation result of the preset user, and outputting the package recommendation result to the preset user.
In the package recommendation method, the characteristics of a preset user and a preset package set are obtained; inputting the characteristics of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products. Because the preset package recommendation model is generated by training based on the initial hypergraph convolutional neural network model, the preset user characteristics and the preset package set are input into the preset package recommendation model to conduct package recommendation, the relationship between the preset user characteristics and the preset package set can be built through one hypergraph, package recommendation can be conducted on the preset user through the hypergraph convolutional neural network model, and therefore package recommendation results of the preset user can be generated. Therefore, compared with the traditional method that only a plurality of graphs can be used for recommending packages for different users by adopting the graph neural network model, the method can reduce the complexity of package recommendation and can improve the accuracy of package recommendation.
In one embodiment, as shown in fig. 3, the package recommendation method further includes:
step 320, generating initial embedded vectors corresponding to the history user and the history package according to the characteristics of the history user and the characteristics of the history package; the initial embedding vector comprises an initial embedding sub-vector of the history user and an initial embedding sub-vector of a history package corresponding to the history user; the history package contains the history product.
Alternatively, first, the server 104 may screen out historical features containing hundreds of feature numbers from a non-sensitive data pool containing thousands or even tens of thousands of feature numbers in a financial enterprise based on business logic and common sense factors. Second, the server 104 may calculate feature correlations for the candidate features. In this embodiment, the method of calculating the feature correlation is to calculate the spearman correlation coefficient. Of course, the method for calculating the feature correlation in the embodiment of the present application is not limited. Illustratively, the pearson correlation coefficient may also be calculated. Server 104 may analyze the correlation between candidate features based on the spearman correlation coefficient to reject invalid redundant features to filter the historical features to generate intermediate historical features. Among them, the Spearman correlation coefficient (Spearman correlation coefficient) is also called Spearman rank correlation coefficient, which is used to measure the correlation between two features. Spearman correlation coefficient r s The calculation formula of (2) is shown in the following formula (1):
where n represents the number of features, for two features or variables (xi, y i ) Rank is respectively carried out in order from small to large (or from large to small), R i Representing the rank of xi, Q i Representing y i Rank order of R i -Q i Representing feature xi and feature y i The difference between the rank of (2)。
Again, feature importance of each intermediate history feature is calculated using the logistic regression model and the tree model, and a feature importance ranking of the intermediate history features is generated. And selecting preset tens of dimension features with higher importance from the feature importance ranking of the intermediate history features as target history features. Wherein the target history features include target history features of a history user (user side) and target history features of a history package (package side). Then, inputting target historical features of the historical user into a fully-connected neural network model for processing, and generating an initial embedded sub-vector of the historical user; and inputting the target history characteristics of the history package into the fully connected neural network model for processing, and generating an initial embedded sub-vector of the history package corresponding to the history user. The formula of the feature processing by using the fully connected neural network model is shown as the following formula (2) and the following formula (3):
E u =MLP(X u ) (2)
E b =MLP(X b ) (3)
Wherein E is u Representing an initial embedded sub-vector of a historical user, E b Representing an initial embedded sub-vector of a history package corresponding to a history user, MLP representing a process of a fully connected neural network model, X u Representing target history characteristics of a history user, X b A target history feature representing a history package.
And finally, generating initial embedded vectors corresponding to the historical user and the historical package according to the initial embedded sub-vectors of the historical user and the initial embedded sub-vectors of the historical package corresponding to the historical user. The initial embedded vectors corresponding to the historical users and the historical packages comprise initial embedded sub-vectors of the historical users and initial embedded sub-vectors of the historical packages corresponding to the historical users; the history package contains the history product. An embedded vector represents a shallow embedded representation (Embedding) of features, and an embedded vector refers to a low-dimensional dense vector that describes an object, can represent some features of the object, and can represent similarity and association between different objects by distance of the vector from the vector in the same space. The calculation formula of the initial embedding vector is shown in the following formula (4):
wherein E represents initial embedded vectors corresponding to the historical user and the historical package, E u Representing an initial embedded sub-vector of a historical user, E b An initial embedded sub-vector representing a historical package corresponding to a historical user.
And 340, constructing a hypergraph between the history user and the history package according to the association relationship between the history user and the history package, the association relationship between the history user and the history product and the association relationship between the history package and the history product.
Alternatively, first, the server 104 may obtain the history user consumption record table and the history package detail table from the terminal 102, so that an initial association relationship between the history user and the history product and an initial association relationship between the history user and the history package may be obtained from the history user consumption record table, and an initial association relationship between the history package and the history product may be obtained from the history package detail table, so as to obtain the initial association relationship. The initial association relationship comprises an initial association relationship between the history user and the history product, an initial association relationship between the history user and the history package and an initial association relationship between the history package and the history product.
Secondly, the server 104 may screen the initial association according to the interaction of the historical user, so as to obtain the target association. The screening of the initial association relationship may include, but is not limited to, deleting interactive records with too short browsing time of the historical user, deleting related association records with application of unsubscribe or complaint by the historical user, and deleting historical packages specially customized for a short time activity in the historical package detail table. The target association relationship comprises an association relationship A between a history user and a history product ui Correlation between historical user and historical packageLinkage relation A ub Association relation A between history package and history product bi . Server 104 may then determine, based on association a between the historical user and the historical packages ub Association A between historic user and historic product ui Association relation A between history package and history product bi And constructing superedges among the historical users, the historical products and the historical packages, and constructing a supergraph among the historical users and the historical packages according to the superedges among the historical users, the historical products and the historical packages.
And step 360, training the initial hypergraph convolutional neural network model according to the initial embedded vector and the hypergraph to generate a preset package recommendation model.
Optionally, the server 104 may input the initial embedded vectors corresponding to the historical user and the historical package and the hypergraph between the historical user and the historical package into the initial hypergraph convolutional neural network model to train the model parameters of the initial hypergraph convolutional neural network model, thereby generating the target model parameters of the initial hypergraph convolutional neural network model, and further, the server 104 may generate the preset package recommendation model according to the target model parameters of the initial hypergraph convolutional neural network model. The preset package recommendation model is generated by training based on the initial hypergraph convolutional neural network model.
In this embodiment, first, according to characteristics of a history user and characteristics of a history package, initial embedded vectors corresponding to the history user and the history package are generated; secondly, according to the incidence relation between the history user and the history package, the incidence relation between the history user and the history product and the incidence relation between the history package and the history product, a hypergraph between the history user and the history package is constructed, and the incidence relation between the history user and the history package can be represented through the constructed hypergraph, so that the history characteristic information of the history user and the history package can be more accurately collected; and then, training the initial hypergraph convolutional neural network model according to the generated initial embedded vector and the constructed hypergraph, so as to generate a more accurate preset package recommendation model.
In one embodiment, as shown in fig. 4, the construction of the hypergraph between the history user and the history package according to the association relationship between the history user and the history package, the association relationship between the history user and the history product, and the association relationship between the history package and the history product includes:
and step 420, constructing an indirect superside according to the association relation between the historical user and the historical product and the association relation between the historical package and the historical product.
Optionally, as shown in fig. 5, fig. 5 is a schematic flow chart of constructing the hyperedge and the hypergraph in one embodiment. Wherein, hypergraph (Hypergraph) is a generalized graph, and one edge of Hypergraph can be connected with any number of vertexes. Formally hypergraph H is a set group h= (X, E), where X is a finite set, the elements of set X are referred to as nodes or vertices, and E is a set of non-empty subsets of X, set E is referred to as a hyperedge. In the embodiment of the application, the superside includes indirect superside and direct superside. Because the superside can be connected with a plurality of nodes or vertexes, the server 104 can be used for obtaining the association relation A between the historical user and the historical product ui Association relation A between history package and history product bi And connecting the history user u and the history package b which have association relation with the same history product i, and modeling as indirect superside. The indirect superside characterizes an indirect association relation generated by a historical user through a historical product and a historical package. The calculation formula of the indirect superside is shown in the following formula (5):
wherein H is i Representing indirect superb, A ui Representing the association relationship between the historical user and the historical product, A bi And representing the association relationship between the history package and the history product.
Step 440, constructing a direct superside according to the association relation between the history user and the history package.
Alternatively, the process may be carried out in a single-stage,first, the server 104 may determine the association A between the history user and the history package ub Calculating a first higher-order association relation S uu . Wherein, the first higher-order association relation S uu Representing the relationship between two historical users who purchased the same historical package. First higher order association relation S uu The calculation formula of (2) is shown in the following formula (6):
S uu =A ub @(A ub .T) (6)
wherein S is uu Representing a first higher-order association relation, A ub Representing the association relationship between the history user and the history package, A ub T is matrix A ub Is denoted by @ is a transposed matrix of matrix multiplication.
Second, since the higher-order association relationship representing the similarity relationship is weaker than the direct association relationship, the server 104 can respond to the first higher-order association relationship S uu Binarization processing is carried out to generate a first higher-order association relation S after binarization processing uu . In the present embodiment, the binarization method is used, with 10 as a limit, a value smaller than 10 is set to 0, and a value larger than 10 is set to 1. Of course, the embodiment of the present application does not limit the manner of binarization.
Again, the server 104 may obtain a second higher-order association S between the history user and the history package bb . Wherein the second higher-order association S bb Representing the relationship between two historical packages purchased by the same historical user. Server 104 may then determine, based on association a between the historical user and the historical packages ub A first higher-order association relation S after binarization processing uu A second higher-order association S bb And constructing a direct superside. Wherein the direct superside characterizes a direct association of the relationship between the historical user and the historical package. The direct association includes association A between the history user and the history package ub And a higher-order association between the historical user and the historical package. The high-order association between the history user and the history package represents the association between similar history users, and the high-order association between the history user and the history packageThe relationship includes a first higher-order association S uu A second higher-order association S bb . The calculation formula of the direct superside is shown in the following formula (7):
wherein H is d Representing direct superb, A ub Representing the association relationship between the history user and the history package, A ub T is matrix A ub Transposed matrix of S uu Representing a first higher-order association relation S bb Representing a second higher order association.
Step 460, according to the indirect superside and the direct superside, a supergraph between the history user and the history package is constructed.
Alternatively, server 104 may rely on indirect superside H that characterizes the association between historical users, historical products, and historical packages i And direct superside H for representing association relation between history user and history package d And constructing a hypergraph H between the historical user and the historical package. The calculation formula of the hypergraph is shown in the following formula (8):
H=[H i H d ] (8)
wherein H represents hypergraph, H i Represents indirect superb, H d Representing a direct superside.
In the embodiment, firstly, an indirect superside is constructed according to the association relation between a historical user and a historical product and the association relation between a historical package and the historical product; secondly, constructing a direct superside according to the association relation between the historical user and the historical package; and then, according to the indirect superside and the direct superside, a supergraph between the history user and the history package is constructed, and the association relationship between the history user and the history package can be represented through the constructed supergraph, so that the history characteristic information of the history user and the history package can be accurately represented.
In one embodiment, as shown in fig. 6, training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model includes:
And 620, inputting the initial embedded vector and the hypergraph into a first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to perform hypergraph convolutional processing, and generating an intermediate embedded vector of the first hypergraph convolutional layer.
Optionally, as shown in fig. 7, fig. 7 is a schematic flow diagram of training an initial hypergraph convolutional neural network model in one embodiment. Because for each hypergraph, the message transmission path in the hypergraph is transmitted from the node or the vertex to the hyperedge, and then transmitted from the hyperedge to the node or the vertex, firstly, the server 104 can normalize the hypergraph between the constructed historical user and the historical package, and generate the hypergraph between the normalized historical user and the historical package. The calculation formula of the normalized hypergraph is shown in the following formula (9):
wherein, the liquid crystal display device comprises a liquid crystal display device,
representing normalized hypergraph, D
v Represents a first diagonal matrix, D
e Representing a second diagonal matrix, H representing the hypergraph.
Then, the server 104 may input the initial embedded vector corresponding to the history user and the history package and the hypergraph between the normalized history user and the history package to the first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to perform the hypergraph convolutional processing, so as to generate the intermediate embedded vector of the first hypergraph convolutional layer. The calculation formula of the hypergraph convolution processing is shown in the following formula (10):
Wherein E is
(l+1) Representing an intermediate embedded vector output after the first layer convolution is finished; sigma represents the activation function, typically Relu-excitationThe activation function, of course, is not limited by the embodiment of the present application;
representing normalized hypergraphs; e (E)
(l) Representing an embedded vector input to the first layer; theta (theta)
(l) Is a model parameter that can be learned.
And 640, performing iterative calculation by taking the intermediate embedded vector of the first hypergraph convolutional layer as the initial embedded vector of the next hypergraph convolutional layer until the intermediate embedded vector of the last hypergraph convolutional layer in the initial hypergraph convolutional neural network model is calculated, and generating the intermediate embedded vector of the last hypergraph convolutional layer.
And step 660, generating a target embedded vector corresponding to the initial embedded vector according to the intermediate embedded vector of each hypergraph convolutional layer in the initial hypergraph convolutional neural network model.
Alternatively, first, the server 104 may take the intermediate embedded vector output by the first hypergraph convolutional layer as the initial embedded vector input by the next hypergraph convolutional layer, and perform iterative calculation of the hypergraph convolutional using the formula (10) until the calculation reaches the last hypergraph convolutional layer in the initial hypergraph convolutional neural network model, and generate the intermediate embedded vector output by the last hypergraph convolutional layer. Second, the server 104 may integrate the intermediate embedded vectors output by each layer of the hypergraph convolutional neural network model to generate a target embedded vector corresponding to the initial embedded vector. The target embedded vector corresponding to the initial embedded vector comprises a target embedded sub-vector of the historical user and a target embedded sub-vector of the historical package corresponding to the historical user. The calculation formulas of the target embedding vector are shown in the following formulas (11), (12) and (13):
Wherein E is
u ' target-embedded sub-vector representing historical user, E
b 'represents a target embedded sub-vector of a history package corresponding to a history user, E' represents a target embedded vector corresponding to an initial embedded vector; alpha l is the weight coefficient of the first layer, and is generally ensured to be decreased in sequence;
intermediate embedded sub-vector representing the history user output after the first layer hypergraph convolution process,/>
Representing the middle embedded sub-vector of the history package corresponding to the history user output after the first layer hypergraph convolution processing; l represents the number of layers of the hypergraph convolutional layer.
Server 104 may then use the dot product decoder to generate a predictive score of historical user preferences for each historical package. The calculation formula of the preference prediction score is shown in the following formula (14):
wherein, the liquid crystal display device comprises a liquid crystal display device,
predictive score representing historical user u's preference for historical package b, e
u Target embedded sub-vector E representing a history user
u Elements of' e
b Target embedded sub-vector E representing a history package corresponding to a history user
b Elements in'.
And 680, calculating the value of a loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, and updating model parameters of the initial hypergraph convolutional neural network model according to the value of the loss function to generate a preset package recommendation model.
Alternatively, first, the preference prediction scores of the history user a and the history user B for a certain history package are 60 points, because the decision boundaries of the history users are different, but the decisions of the history package may be different, that is, the decision of the history user a for the history package is purchase, and the decision of the history user B for the history package is purchase rejection. Thus, server 104 may set different decision boundaries for each historical user. The calculation formula of the decision boundary is shown in the following formula (15):
b u =W T E u ’ (15)
wherein b u Representing decision boundaries of each historical user u, E u ' represents the target embedded sub-vector of the history user u, W represents a learnable vector.
And secondly, calculating the value of the loss function of the initial hypergraph convolutional neural network model according to the decision boundary and the preference prediction score. The calculation formula of the loss function of the initial hypergraph convolutional neural network model is shown in the following formula (16):
wherein, the liquid crystal display device comprises a liquid crystal display device,
a loss function representing an initial hypergraph convolutional neural network model, b
u Represents the decision boundary of each history user u, phi represents a first preset parameter, R
+ Representing a set of monitored interactions between a historical user and a historical package, R
- Representing a set of interactions between the history user and the history package not monitored, +. >
Preference predictive score indicating monitored interactions,/->
A preference prediction score representing an unmonitored interaction, a representing a second preset parameter. Of course, the BPR loss function may also be used for model optimization or model training in this embodiment, that is, the loss function is not limited in this embodiment of the present application.
And then training model parameters of the initial hypergraph convolutional neural network model by using a loss function of the initial hypergraph convolutional neural network model, so that the model parameters of the initial hypergraph convolutional neural network model are updated according to the value of the loss function, the preference prediction score of the history package purchased by the history user is as larger as possible than the decision boundary of the history user, the preference prediction score of the history package not purchased by the history user is as smaller as possible than the decision boundary of the history user, and finally, the target model parameters of the initial hypergraph convolutional neural network model are generated, thereby the server 104 can generate a preset package recommendation model according to the target model parameters of the initial hypergraph convolutional neural network model.
In this embodiment, first, an initial embedding vector and a hypergraph are input into an initial hypergraph convolutional neural network model to perform hypergraph convolutional processing, so that an intermediate embedding vector can be generated layer by layer; secondly, integrating and generating a target embedded vector according to the intermediate embedded vector of each layer; and then, calculating a loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, and optimizing model parameters of the initial hypergraph convolutional neural network model according to the loss function, so that a more accurate preset package recommendation model can be generated.
Because the use of manpower during package generation often ignores some product combinations that may lead to increased economic benefits, conventional package generation methods require highly expert knowledge and are difficult to apply on a large scale. Based on this, the embodiment of the application provides a method for generating a preset package set, which is used for providing a plurality of preset package sets for package recommendation processes. In one embodiment, as shown in fig. 8, the package recommendation method further includes:
step 820, for each historical user, calculating initial embedded vectors corresponding to each candidate product in the candidate product set and the historical user; the candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity.
Alternatively, first, the server 104 may calculate the product popularity of the historical product. Wherein the product popularity represents the number of times a historical product is consumed. Since the racking dates for different historical products may be different, and in general, the number of consumption of newly racking historical products is relatively small. Therefore, the present embodiment calculates the product popularity of the historical product in a time-decaying manner. The calculation formula of the product popularity of the historical product is shown in the following formula (17):
Pop_i=count_i/log2(days) (17)
Wherein pop_i represents the product popularity of the historical product i after time decay, count_i represents the number of consumption, and days represents the difference between the date of the historical product on shelf and the current date.
Secondly, because the historical products with the product popularity ranking of the historical products being 10% -20% in the top have enough attractive force, and the historical products with the product popularity ranking of the historical products being 10% -20% in the top have attractive force to be improved, the historical products with the product popularity ranking of the historical products being 10% -20% in the top are selected as candidate products of a preset package, so that a candidate product set is generated, and the product attractive force of the candidate products is further enhanced by utilizing the combined advantage of the package. The candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity. Then, for each historical user, the server 104 may calculate an initial embedded vector for each candidate product in the set of candidate products that corresponds to the historical user.
In step 840, a target embedded vector corresponding to each candidate product and the historical user is calculated according to the hypergraph and the initial embedded vector corresponding to each candidate product and the historical user.
Alternatively, first, based on the constructed hypergraph and the initial embedded vector corresponding to each candidate product and the historical user, the server 104 may calculate the target embedded vector of the hyperedge corresponding to the candidate product. The calculation formulas of the target embedding vectors of the superside are shown in the following formulas (18) and (19):
wherein E_e represents the target embedded vector of the superside corresponding to the candidate product,
representing hypergraph processing, H representing hypergraph, D
v Represents a first diagonal matrix, D
e Representing a second diagonal matrix, E
e And representing initial embedded vectors of each candidate product corresponding to the historical users.
Then, because a part of the supersides in the supergraph represent a single product, the target embedded vector corresponding to each candidate product and the historical user can be determined from the target embedded vectors corresponding to the supersides of the candidate products.
Step 860, calculating the preference degree of each candidate product by the historical user according to the target embedded vector corresponding to each candidate product and the historical user, and determining the target product corresponding to the historical user from each candidate product according to the preference degree of each candidate product by the historical user.
Alternatively, the server 104 may calculate the preference of the historical user for each candidate product based on the target embedded vector for each candidate product corresponding to the historical user. The calculation formula of the preference degree of the historical user for each candidate product is shown as the following formula (20):
Wherein, the liquid crystal display device comprises a liquid crystal display device,
representing a preference predictive score or degree of preference of a historical user u for a candidate product i, the preference predictive score or degree of preference characterizing the appeal of the product to the user, e
u Target embedded sub-vector E representing a history user
u Elements of' e
i And representing each element in the target embedded vector of the candidate product corresponding to the historical user.
Then, the server 104 may select, according to the preference degree of the historical user for each candidate product, a preset number of candidate products that are interested by the historical user from the candidate products, and determine the preset number of candidate products as target products corresponding to the historical user.
In step 880, a plurality of preset packages of each historical user are generated according to the target product corresponding to each historical user, and a preset package set is generated based on the plurality of preset packages.
Alternatively, the server 104 may determine other preset numbers of products to be added to the packages according to the target products corresponding to each historical user, so as to generate a plurality of preset packages of each historical user according to the target products corresponding to each historical user and the other preset numbers of products to be added to the packages, and generate a preset package set capable of performing package recommendation based on the plurality of preset packages.
In this embodiment, first, for each historical user, an initial embedding vector corresponding to each candidate product in the candidate product set and the historical user is calculated, and according to the hypergraph and the initial embedding vector corresponding to each candidate product and the historical user, a target embedding vector corresponding to each candidate product and the historical user is calculated. Then, according to the target embedded vectors corresponding to the candidate products and the historical users, the target products corresponding to the historical users can be accurately determined from the candidate products based on the preference degree of the historical users to the candidate products, then according to the accurate target products corresponding to the historical users, a plurality of preset packages of the historical users can be accurately generated, and a preset package set is generated based on the preset packages, so that the accurate preset package set can be generated through the hypergraph and the initial embedded vectors corresponding to the candidate products and the historical users, and the whole process does not depend on expert knowledge, and has wide applicability.
In one embodiment, as shown in fig. 9, generating a plurality of preset packages for each history user according to a target product corresponding to each history user includes:
step 920, for each historical user, obtaining the preference degree of the historical user for each target product corresponding to the historical user.
Step 940, determining whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the product to be added is greater than a preset difference threshold.
Alternatively, first, for each history user, the server 104 may obtain, from the preference degrees of the history user for each candidate product, the preference degrees of the history user for each target product corresponding to the history user. Then, for each product to be added to the package, the server 104 may calculate the preference degree of the historical user for the target product and the overall product to be added, and determine whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the product to be added is greater than a preset difference threshold. The judgment mode of the preset difference threshold is shown as the following formula (21):
wherein e u Target embedded sub-vector E representing a history user u Elements of' e i Representing each element in the target embedded vector of the candidate product corresponding to the historical user, e j And a represents the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the product to be added, namely whether a is larger than a preset difference threshold value is judged. The preset difference threshold is not limited in the embodiment of the application.
In step 960, if the difference between the preference degree of the historical user for the target product and the preference degree of the historical user for the product to be added is greater than the first preset threshold, the similarity between the product to be added and the target product is calculated.
Optionally, if it is determined that the difference between the preference degree of the historical user for the target product and the preference degree of the historical user for the product to be added is greater than the first preset threshold, the server 104 may calculate the similarity between the product to be added and the target product, that is, determine whether the product to be added is identical to the product in the initial package when the product to be added is not added before. The similarity between the product to be added and the target product can be expressed as sim (e i ,e j ). The sim () represents a similarity calculation method, and a general similarity calculation method uses cosine similarity for calculation, which is not limited in this embodiment of the present application.
Step 980, if the similarity between the product to be added and the target product is smaller than the preset similarity threshold, adding the product to be added into a plurality of initial packages of each history user, and generating a plurality of preset packages of each history user; the plurality of initial packages of the historical user comprise target products corresponding to the historical user.
Optionally, the server 104 may determine whether the similarity between the product to be added and the target product is smaller than a preset similarity threshold, if it is determined that the similarity between the product to be added and the target product is smaller than the preset similarity threshold, it indicates that the product to be added is different from the product in the package when the product to be added is not added before, at this time, the server 104 may add the product to be added to a plurality of initial packages of each historical user until the initial packages reach the maximum package capacity, or a product to be added which can bring about attraction improvement and is different from the product in the initial packages is not found, so as to generate a plurality of preset packages of each historical user. Wherein, the plurality of initial packages of the historical user comprise target products corresponding to the historical user.
In addition, the server 104 may calculate the preference amplitude of the historical package consumed by the historical user, to obtain a preference amplitude calculation result. And then, removing the maximum value and the minimum value in the coupon amplitude calculation result, and generating the coupon amplitude of each preset package in the coupon amplitude interval of the history package corresponding to the history user by using a random algorithm.
In this embodiment, first, for each history user, the preference degree of the history user for each target product corresponding to the history user is obtained; secondly, calculating the similarity between the product to be added and the target product under the condition that the difference between the preference degree of the target product by the historical user and the preference degree of the product to be added by the historical user is larger than a first preset threshold value; if the similarity between the product to be added and the target product is smaller than the preset similarity threshold, adding the product to be added into a plurality of initial packages of each history user, and generating a plurality of preset packages of each history user. By determining the attraction of the product to be added to the package to the historical user and the similarity of the product to be added to the package and the product in the initial package, the product to be added to the initial package is newly added to the initial package, so that a plurality of preset packages of each historical user can be accurately generated.
In an alternative embodiment, as shown in fig. 10, a package recommendation method is provided, which is illustrated by using the method applied to the server 104 in fig. 1 as an example, and includes the following steps:
step 1002, for each historical user, calculating an initial embedded vector corresponding to each candidate product in the candidate product set and the historical user; the candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity;
step 1004, calculating target embedded vectors corresponding to each candidate product and the historical user according to the hypergraph and the initial embedded vectors corresponding to each candidate product and the historical user;
step 1006, calculating the preference degree of each candidate product by the historical user according to the target embedded vector corresponding to each candidate product and the historical user, and determining the target product corresponding to the historical user from each candidate product according to the preference degree of each candidate product by the historical user;
step 1008, for each historical user, obtaining the preference degree of the historical user for each target product corresponding to the historical user;
step 1010, judging whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the product to be added is greater than a preset difference threshold;
Step 1012, if the difference between the preference degree of the historical user for the target product and the preference degree of the historical user for the product to be added is greater than a first preset threshold, calculating the similarity between the product to be added and the target product;
step 1014, if the similarity between the product to be added and the target product is smaller than the preset similarity threshold, adding the product to be added into a plurality of initial packages of each history user, generating a plurality of preset packages of each history user, and generating a preset package set based on the plurality of preset packages; the plurality of initial packages of the historical users comprise target products corresponding to the historical users;
step 1016, obtaining a feature of a preset user and a preset package set;
step 1018, generating initial embedded vectors corresponding to the history user and the history package according to the characteristics of the history user and the characteristics of the history package; the initial embedding vector comprises an initial embedding sub-vector of the history user and an initial embedding sub-vector of a history package corresponding to the history user; the history package contains history products;
step 1020, constructing an indirect superside according to the association relationship between the historical user and the historical product and the association relationship between the historical package and the historical product;
Step 1022, constructing a direct superside according to the association relation between the historical user and the historical package;
step 1024, constructing a hypergraph between the history user and the history package according to the indirect hyperedge and the direct hyperedge;
step 1026, inputting the initial embedded vector and the hypergraph to a first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to perform hypergraph convolutional processing, and generating an intermediate embedded vector of the first hypergraph convolutional layer;
step 1028, performing iterative computation by taking the intermediate embedded vector of the first hypergraph convolutional layer as the initial embedded vector of the next hypergraph convolutional layer until the intermediate embedded vector of the last hypergraph convolutional layer in the initial hypergraph convolutional neural network model is calculated, and generating the intermediate embedded vector of the last hypergraph convolutional layer;
step 1030, generating a target embedded vector corresponding to the initial embedded vector according to the intermediate embedded vector of each hypergraph convolutional layer in the initial hypergraph convolutional neural network model;
step 1032, calculating a value of a loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, and updating model parameters of the initial hypergraph convolutional neural network model according to the value of the loss function to generate a preset package recommendation model;
Step 1034, inputting the features of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products.
In the package recommendation method, the characteristics of a preset user and a preset package set are obtained; inputting the characteristics of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products. Because the preset package recommendation model is generated by training based on the initial hypergraph convolutional neural network model, the preset user characteristics and the preset package set are input into the preset package recommendation model to conduct package recommendation, the relationship between the preset user characteristics and the preset package set can be built through one hypergraph, package recommendation can be conducted on the preset user through the hypergraph convolutional neural network model, and therefore package recommendation results of the preset user can be generated. Therefore, compared with the traditional method that only a plurality of graphs can be used for recommending packages for different users by adopting the graph neural network model, the method can reduce the complexity of package recommendation and can improve the accuracy of package recommendation.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a package recommendation device for realizing the package recommendation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the package recommendation device or devices provided below may be referred to the limitation of the package recommendation method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 11, there is provided a package recommendation apparatus 1100 comprising: an acquisition module 1120 and a package recommendation module 1140, wherein:
the obtaining module 1120 is configured to obtain a feature of a preset user and a preset package set.
The package recommendation module 1140 is configured to input the features of the preset user and the preset package set into a preset package recommendation model to perform package recommendation, and generate a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products.
In one embodiment, package recommendation apparatus 1100 further comprises:
the initial embedded vector generation module is used for generating initial embedded vectors corresponding to the historical user and the historical package according to the characteristics of the historical user and the characteristics of the historical package; the initial embedding vector comprises an initial embedding sub-vector of the history user and an initial embedding sub-vector of a history package corresponding to the history user; the history package contains history products;
the hypergraph construction module is used for constructing a hypergraph between the historical user and the historical package according to the association relationship between the historical user and the historical package, the association relationship between the historical user and the historical product and the association relationship between the historical package and the historical product;
The preset package recommendation model generation module is used for training the initial hypergraph convolutional neural network model according to the initial embedded vector and the hypergraph to generate a preset package recommendation model.
In one embodiment, the hypergraph construction module comprises:
the indirect superside construction unit is used for constructing an indirect superside according to the association relation between the historical user and the historical product and the association relation between the historical package and the historical product;
the direct superside construction unit is used for constructing direct supersides according to the association relation between the historical user and the historical package;
and the hypergraph construction unit is used for constructing hypergraphs between the history user and the history package according to the indirect hyperedges and the direct hyperedges.
In one embodiment, the preset package recommendation model generation module includes:
the first intermediate embedding vector generation unit is used for inputting the initial embedding vector and the hypergraph into a first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to carry out hypergraph convolutional processing and generating an intermediate embedding vector of the first hypergraph convolutional layer;
the intermediate embedding vector generation unit is used for carrying out iterative calculation by taking the intermediate embedding vector of the first hypergraph convolutional layer as the initial embedding vector of the next hypergraph convolutional layer until the initial hypergraph convolutional layer is calculated to the final hypergraph convolutional layer in the initial hypergraph convolutional neural network model, and generating the intermediate embedding vector of the final hypergraph convolutional layer;
The target embedded vector generation unit is used for generating a target embedded vector corresponding to the initial embedded vector according to the intermediate embedded vector of each hypergraph convolutional layer in the initial hypergraph convolutional neural network model;
the preset package recommendation model generation unit is used for calculating the value of the loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, updating the model parameters of the initial hypergraph convolutional neural network model according to the value of the loss function, and generating a preset package recommendation model.
In one embodiment, package recommendation apparatus 1100 further comprises:
the initial embedding vector calculation module is used for calculating initial embedding vectors corresponding to the historical users of each candidate product in the candidate product set aiming at each historical user; the candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity;
the target embedded vector calculation module is used for calculating target embedded vectors corresponding to the candidate products and the historical users according to the hypergraph and the initial embedded vectors corresponding to the candidate products and the historical users;
the target product determining module is used for calculating the preference degree of the historical user on each candidate product according to the target embedded vector corresponding to each candidate product and the historical user, and determining the target product corresponding to the historical user from each candidate product according to the preference degree of the historical user on each candidate product;
The preset package set generating module is used for generating a plurality of preset packages of each historical user according to target products corresponding to each historical user and generating a preset package set based on the preset packages.
In one embodiment, the preset package set generation module includes:
the preference degree obtaining unit is used for obtaining the preference degree of the historical users for each target product corresponding to the historical users aiming at each historical user;
the judging unit is used for judging whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the product to be added is larger than a preset difference threshold value;
the similarity calculation unit is used for calculating the similarity between the product to be added and the target product if the difference between the preference degree of the target product by the historical user and the preference degree of the product to be added by the historical user is larger than a first preset threshold value;
the preset package generating unit is used for adding the product to be added into a plurality of initial packages of each historical user to generate a plurality of preset packages of each historical user if the similarity between the product to be added and the target product is smaller than a preset similarity threshold; the plurality of initial packages of the historical user comprise target products corresponding to the historical user.
The respective modules in the package recommendation apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 12. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store XX data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a package recommendation method.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring the characteristics of a preset user and a preset package set;
inputting the characteristics of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products.
In one embodiment, the processor when executing the computer program further performs the steps of:
generating initial embedded vectors corresponding to the historical user and the historical package according to the characteristics of the historical user and the characteristics of the historical package; the initial embedding vector comprises an initial embedding sub-vector of the history user and an initial embedding sub-vector of a history package corresponding to the history user; the history package contains history products;
According to the incidence relation between the history user and the history package, the incidence relation between the history user and the history product and the incidence relation between the history package and the history product, a hypergraph between the history user and the history package is constructed;
training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model.
In one embodiment, the hypergraph between the history user and the history package is constructed according to the association relationship between the history user and the history package, the association relationship between the history user and the history product, and the association relationship between the history package and the history product, and the processor further realizes the following steps when executing the computer program:
according to the association relation between the history user and the history product and the association relation between the history package and the history product, an indirect superside is constructed;
constructing a direct superside according to the association relation between the historical user and the historical package;
and according to the indirect superside and the direct superside, building a supergraph between the historical user and the historical package.
In one embodiment, training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model, and the processor further realizes the following steps when executing the computer program:
Inputting the initial embedded vector and the hypergraph into a first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to carry out hypergraph convolutional processing, and generating an intermediate embedded vector of the first hypergraph convolutional layer;
performing iterative computation by taking the intermediate embedded vector of the first hypergraph convolutional layer as the initial embedded vector of the next hypergraph convolutional layer until the intermediate embedded vector of the last hypergraph convolutional layer in the initial hypergraph convolutional neural network model is calculated, and generating the intermediate embedded vector of the last hypergraph convolutional layer;
generating a target embedded vector corresponding to the initial embedded vector according to the intermediate embedded vector of each hypergraph convolutional layer in the initial hypergraph convolutional neural network model;
and calculating the value of a loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, and updating model parameters of the initial hypergraph convolutional neural network model according to the value of the loss function to generate a preset package recommendation model.
In one embodiment, the processor when executing the computer program further performs the steps of:
for each historical user, calculating initial embedded vectors corresponding to each candidate product in the candidate product set and the historical user; the candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity;
Calculating target embedded vectors corresponding to the candidate products and the historical users according to the hypergraph and the initial embedded vectors corresponding to the candidate products and the historical users;
calculating the preference degree of the historical user for each candidate product according to the target embedded vector corresponding to each candidate product and the historical user, and determining the target product corresponding to the historical user from each candidate product according to the preference degree of the historical user for each candidate product;
and generating a plurality of preset packages of each historical user according to the target product corresponding to each historical user, and generating a preset package set based on the preset packages.
In one embodiment, the method further comprises generating a plurality of preset packages for each historical user according to the target product corresponding to each historical user, and the processor executing the computer program further comprises:
aiming at each historical user, obtaining the preference degree of the historical user for each target product corresponding to the historical user;
judging whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the products to be added is larger than a preset difference threshold value or not;
if the difference between the preference degree of the historical user for the target product and the preference degree of the historical user for the product to be added is larger than a first preset threshold value, calculating the similarity between the product to be added and the target product;
If the similarity between the product to be added and the target product is smaller than a preset similarity threshold, adding the product to be added into a plurality of initial packages of each history user to generate a plurality of preset packages of each history user; the plurality of initial packages of the historical user comprise target products corresponding to the historical user.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring the characteristics of a preset user and a preset package set;
inputting the characteristics of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products.
In one embodiment, the computer program when executed by the processor further performs the steps of:
generating initial embedded vectors corresponding to the historical user and the historical package according to the characteristics of the historical user and the characteristics of the historical package; the initial embedding vector comprises an initial embedding sub-vector of the history user and an initial embedding sub-vector of a history package corresponding to the history user; the history package contains history products;
According to the incidence relation between the history user and the history package, the incidence relation between the history user and the history product and the incidence relation between the history package and the history product, a hypergraph between the history user and the history package is constructed;
training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model.
In one embodiment, according to the association relationship between the history user and the history package, the association relationship between the history user and the history product, and the association relationship between the history package and the history product, a hypergraph between the history user and the history package is constructed, and when the computer program is executed by the processor, the following steps are further implemented:
according to the association relation between the history user and the history product and the association relation between the history package and the history product, an indirect superside is constructed;
constructing a direct superside according to the association relation between the historical user and the historical package;
and according to the indirect superside and the direct superside, building a supergraph between the historical user and the historical package.
In one embodiment, training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model, the computer program when executed by the processor further performs the steps of:
Inputting the initial embedded vector and the hypergraph into a first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to carry out hypergraph convolutional processing, and generating an intermediate embedded vector of the first hypergraph convolutional layer;
performing iterative computation by taking the intermediate embedded vector of the first hypergraph convolutional layer as the initial embedded vector of the next hypergraph convolutional layer until the intermediate embedded vector of the last hypergraph convolutional layer in the initial hypergraph convolutional neural network model is calculated, and generating the intermediate embedded vector of the last hypergraph convolutional layer;
generating a target embedded vector corresponding to the initial embedded vector according to the intermediate embedded vector of each hypergraph convolutional layer in the initial hypergraph convolutional neural network model;
and calculating the value of a loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, and updating model parameters of the initial hypergraph convolutional neural network model according to the value of the loss function to generate a preset package recommendation model.
In one embodiment, the computer program when executed by the processor further performs the steps of:
for each historical user, calculating initial embedded vectors corresponding to each candidate product in the candidate product set and the historical user; the candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity;
Calculating target embedded vectors corresponding to the candidate products and the historical users according to the hypergraph and the initial embedded vectors corresponding to the candidate products and the historical users;
calculating the preference degree of the historical user for each candidate product according to the target embedded vector corresponding to each candidate product and the historical user, and determining the target product corresponding to the historical user from each candidate product according to the preference degree of the historical user for each candidate product;
and generating a plurality of preset packages of each historical user according to the target product corresponding to each historical user, and generating a preset package set based on the preset packages.
In one embodiment, a plurality of preset packages for each historical user are generated according to the target product corresponding to each historical user, and the computer program when executed by the processor further performs the steps of:
aiming at each historical user, obtaining the preference degree of the historical user for each target product corresponding to the historical user;
judging whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the products to be added is larger than a preset difference threshold value or not;
if the difference between the preference degree of the historical user for the target product and the preference degree of the historical user for the product to be added is larger than a first preset threshold value, calculating the similarity between the product to be added and the target product;
If the similarity between the product to be added and the target product is smaller than a preset similarity threshold, adding the product to be added into a plurality of initial packages of each history user to generate a plurality of preset packages of each history user; the plurality of initial packages of the historical user comprise target products corresponding to the historical user.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
acquiring the characteristics of a preset user and a preset package set;
inputting the characteristics of the preset user and the preset package set into a preset package recommendation model to conduct package recommendation, and generating a package recommendation result of the preset user; the method comprises the steps that a preset package set and a preset package recommendation model are generated by training based on an initial hypergraph convolutional neural network model; the preset package set comprises a plurality of preset packages, and the preset packages comprise a plurality of preset products.
In one embodiment, the computer program when executed by the processor further performs the steps of:
generating initial embedded vectors corresponding to the historical user and the historical package according to the characteristics of the historical user and the characteristics of the historical package; the initial embedding vector comprises an initial embedding sub-vector of the history user and an initial embedding sub-vector of a history package corresponding to the history user; the history package contains history products;
According to the incidence relation between the history user and the history package, the incidence relation between the history user and the history product and the incidence relation between the history package and the history product, a hypergraph between the history user and the history package is constructed;
training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model.
In one embodiment, according to the association relationship between the history user and the history package, the association relationship between the history user and the history product, and the association relationship between the history package and the history product, a hypergraph between the history user and the history package is constructed, and when the computer program is executed by the processor, the following steps are further implemented:
according to the association relation between the history user and the history product and the association relation between the history package and the history product, an indirect superside is constructed;
constructing a direct superside according to the association relation between the historical user and the historical package;
and according to the indirect superside and the direct superside, building a supergraph between the historical user and the historical package.
In one embodiment, training the initial hypergraph convolutional neural network model according to the initial embedding vector and the hypergraph to generate a preset package recommendation model, the computer program when executed by the processor further performs the steps of:
Inputting the initial embedded vector and the hypergraph into a first hypergraph convolutional layer of the initial hypergraph convolutional neural network model to carry out hypergraph convolutional processing, and generating an intermediate embedded vector of the first hypergraph convolutional layer;
performing iterative computation by taking the intermediate embedded vector of the first hypergraph convolutional layer as the initial embedded vector of the next hypergraph convolutional layer until the intermediate embedded vector of the last hypergraph convolutional layer in the initial hypergraph convolutional neural network model is calculated, and generating the intermediate embedded vector of the last hypergraph convolutional layer;
generating a target embedded vector corresponding to the initial embedded vector according to the intermediate embedded vector of each hypergraph convolutional layer in the initial hypergraph convolutional neural network model;
and calculating the value of a loss function of the initial hypergraph convolutional neural network model according to the target embedded vector, and updating model parameters of the initial hypergraph convolutional neural network model according to the value of the loss function to generate a preset package recommendation model.
In one embodiment, the computer program when executed by the processor further performs the steps of:
for each historical user, calculating initial embedded vectors corresponding to each candidate product in the candidate product set and the historical user; the candidate product set is a set of candidate products which are screened from a plurality of historical products and accord with popularity;
Calculating target embedded vectors corresponding to the candidate products and the historical users according to the hypergraph and the initial embedded vectors corresponding to the candidate products and the historical users;
calculating the preference degree of the historical user for each candidate product according to the target embedded vector corresponding to each candidate product and the historical user, and determining the target product corresponding to the historical user from each candidate product according to the preference degree of the historical user for each candidate product;
and generating a plurality of preset packages of each historical user according to the target product corresponding to each historical user, and generating a preset package set based on the preset packages.
In one embodiment, a plurality of preset packages for each historical user are generated according to the target product corresponding to each historical user, and the computer program when executed by the processor further performs the steps of:
aiming at each historical user, obtaining the preference degree of the historical user for each target product corresponding to the historical user;
judging whether the difference between the preference degree of the historical user for each target product and the preference degree of the historical user for the products to be added is larger than a preset difference threshold value or not;
if the difference between the preference degree of the historical user for the target product and the preference degree of the historical user for the product to be added is larger than a first preset threshold value, calculating the similarity between the product to be added and the target product;
If the similarity between the product to be added and the target product is smaller than a preset similarity threshold, adding the product to be added into a plurality of initial packages of each history user to generate a plurality of preset packages of each history user; the plurality of initial packages of the historical user comprise target products corresponding to the historical user.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to comply with the related laws and regulations and standards of the related countries and regions.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples represent only a few embodiments of the present application, which are described in more detail and are not thereby to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.