Internet insurance product recommendation method and device based on neighbor enhancement graph attention network
By introducing a method based on neighbor-enhanced graph attention network in the field of Internet insurance, combining multi-layer perceptrons and graph attention networks, the problem of social inconsistency is solved, more accurate user preference prediction and insurance product recommendations are achieved, and recommendations are improved. System effect.
Patent Information
- Application Number
- CN202411419774.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-31
AI Technical Summary
The existing social recommendation model has failed to effectively solve the problem of social inconsistency in the field of Internet insurance, resulting in user preference prediction errors, and lack of specialized solutions and neighbor enhancement mechanisms for the field of Internet insurance.
Using a method based on neighbor-enhanced graph attention network, a multi-layer perceptron and graph attention network is introduced by building a user-product interaction matrix and user-user social relationship diagram, combining product aggregation and social aggregation network to generate user and product representations. vectors and predict through the score prediction unit to reduce the error caused by social inconsistency.
This method can more accurately understand the complex relationship between users and neighbors, reduce errors caused by social inconsistencies, provide more accurate recommendations for insurance products, and improve the accuracy and user experience of the recommendation system.
Smart Images

Figure CN119228505A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of product recommendation, and in particular to a method and device for recommending Internet insurance products based on a neighbor-enhanced graph attention network. Background Art
[0002] With the popularization and development of the Internet, the insurance industry has gradually transformed from the traditional offline model to the online model. In this process, a large amount of insurance-related data has been generated, including users' personal information, browsing behavior, purchase history, etc. As a special field, Internet insurance has both Internet characteristics and insurance characteristics. Internet insurance recommendations need to process a large amount of data and complex user relationships. The social recommendation model can effectively integrate and analyze this information to better adapt to the requirements of rapid decision-making and personalized services in the Internet environment. Social recommendations can comprehensively consider users' social relationships, behaviors, and interaction information to more comprehensively understand users' backgrounds and needs. By analyzing social factors such as users' social circles and professional relationships, it is possible to infer the risks and protection needs that users may face, thereby providing more accurate insurance recommendations.
[0003] Social recommendation uses the preferences of users' social neighbors to enhance user modeling. It is an algorithm that combines the interaction information between users and products and the social relationships between users to generate recommendations. Due to the role of homogeneity and social influence, social relationships can obviously effectively understand users' preferences. Therefore, social recommendation is becoming more and more important.
[0004] The data involved in social recommendation include user-product interaction graph and user-user social relationship graph. Existing social recommendation research usually uses two different strategies to combine the information in these two graphs to obtain better user representation. The first strategy is to obtain the user representation of the two graphs separately, and then fuse them to form the final user representation vector; the second strategy is to fuse the two graphs into one graph and obtain the user representation through the fused graph.
[0005] Most of the current social recommendation models apply deep learning technology to social relationship networks, such as graph neural networks, autoencoders, and generative adversarial networks. User-product interaction relationships and user-user social relationships can be naturally represented as graph data, so social recommendations based on graph neural networks are also gaining more and more attention. Current graph neural network social recommendations mainly focus on how to effectively combine user-product interaction graphs and user-user social relationship graphs, but ignore the problem of social inconsistency in social relationships. Since the cost of forming social relationship links on the Internet is low, there are different link strengths in social relationship networks, which means that users and their friends may have different preferences, which is social inconsistency.
[0006] In some past studies, explorations have been conducted from multiple perspectives to address the problem of social inconsistency in social relations. For example, DiffNet++ introduces an attention mechanism based on graph neural networks to predict user preferences by assigning different weights to products that users have interacted with and users' neighbors. SEFrame uses heterogeneous graph networks to fuse knowledge from social relations, user-product interactions, and product conversions in heterogeneous graphs, and propagates using a two-level attention network. GC-MC first adopts the GCN architecture to complete the user-product rating matrix. It uses GCN as an encoder to train user / product embeddings, which are input into a fully connected neural network to predict ratings. PinSAGE proposed using the GraphSAGE backbone to learn product embeddings on attributed product graphs, and later proposed NGCF to explicitly model collaborative signals on user-product interaction graphs by applying a GNN model. DGCF observed the oscillation problem when applying GNN on a bipartite graph and solved it with a cross-hop propagation layer. SoRec is a recommendation model based on graph neural networks. SoReg combines a regularization term on the basis of the graph neural network model to directly minimize the difference in user latent features between two trusted users. SocialMF obtains the user's embedding representation by aggregating the user's social relations, and finally predicts the missing rating data through matrix decomposition. Unlike the MF method, the GNN method directly infers node embeddings from the graph and has proven its effectiveness from recent social recommendation work. GraphRec and GraphRec+ use graph attention networks to learn user and product embeddings for recommendation.
[0007] So far, there is no evidence that any model can better solve the problem of social inconsistency. The above methods are not targeted at the field of Internet insurance, nor do they introduce a neighbor enhancement mechanism. The neighbor enhancement mechanism can better capture the complex relationship between users and their neighbors, thereby more accurately understanding and predicting user behavior and preferences and reducing errors caused by social inconsistency. Summary of the invention
[0008] The purpose of this application is to propose an Internet insurance product recommendation method and device based on a neighbor-enhanced graph attention network to address the above-mentioned technical problems.
[0009] In a first aspect, the present invention provides an Internet insurance product recommendation method based on a neighbor-enhanced graph attention network, comprising the following steps:
[0010] Obtain a user set and an Internet insurance product set and construct a user-product interaction matrix, where the elements in the user-product interaction matrix are the known or unknown rating data of the user on the product, and construct a user-user social relationship graph based on the user set;
[0011] Constructing and training a rating data prediction model to obtain a trained rating data prediction model, wherein the trained rating data prediction model includes a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit;
[0012] Input the user-product interaction matrix and the user-user social relationship graph into the trained rating data prediction model, obtain the neighbor set of each user according to the user-user social relationship graph, obtain the interactive product set of each user and the rating user set of each product according to the user-product interaction matrix, and obtain the user embedding vector, product embedding vector and rating embedding vector according to the user-product interaction matrix; input the user embedding vector, product embedding vector, rating embedding vector and the neighbor set of each user into the user representation vector generation unit, perform product aggregation based on the first multi-layer perceptron according to the product embedding vector and the rating embedding vector to obtain the first user potential representation vector, perform social aggregation based on the second multi-layer perceptron according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain the second user potential representation vector, and concatenate the first user potential representation vector and the second user potential representation vector and pass them through the third multi-layer perceptron to obtain the user representation vector; input the user embedding vector and the rating embedding vector into the product representation vector generation unit to perform user aggregation based on the fourth multi-layer perceptron to obtain the product representation vector; input the user representation vector and the product representation vector into the rating prediction unit to perform rating prediction based on the fifth multi-layer perceptron to obtain the predicted values of all unknown rating data in the user-product interaction matrix;
[0013] Based on the predicted values of all unknown rating data in the user-product interaction matrix and all known rating data in the user-product interaction matrix, Top-k recommendations are made for the rating data corresponding to each user to obtain a recommended product sequence for each user.
[0014] Preferably, the user set is represented as:
[0015] U={u1,u2,…,u n};
[0016] The set of Internet insurance products is represented as:
[0017] V={v1,v2,…,v m};
[0018] Among them, U represents the user set, V represents the Internet insurance product set, and u i represents the i-th user, i=1,2,...,n, n represents the total number of users, v j represents the jth product, j = 1, 2, ..., m, and m represents the total number of products;
[0019] The user-product interaction matrix is expressed as:
[0020]
[0021] in, represents the user-product interaction matrix, represents a set of real numbers, representing the i-th user u i For the jth product v j The rating data, r ij ∈[0,1,2,3,4,5], when r ij = 0 represents the i-th user u i For the jth product v j The rating data is unknown. ij ∈[1,2,3,4,5] represents the i-th user u i For the jth product v j The rating data of is known;
[0022] The user-user social relationship graph is represented as:
[0023]
[0024] in, Represents a user-user social relationship graph. The user-user social relationship graph is an undirected graph. Each node in the point set of the undirected graph represents a user. Each edge in the edge set of the undirected graph connects two nodes, representing the social relationship between two users. If the i-th user u i With the oth user u o If there is a social relationship, then t io =1, otherwise t io = 0, on the diagonal of the user-user social relationship graph, t ii represents the i-th user u i The relationship with itself is represented by a self-loop, that is, t ii =1;
[0025] The neighbor set of the i-th user is the neighbor set of the i-th user u i The set of users with direct social connections, denoted as N(i);
[0026] The interactive product set of the i-th user is the i-th user u i The set of Internet insurance products that have been rated is denoted as C(i);
[0027] The set of users who rated the jth product is the set of users who rated the jth product v j The set of rated users, denoted as B(j);
[0028] The elements of the i-th row in the user-product interaction matrix constitute the user embedding vector of the i-th user
[0029] The elements of the jth column in the user-product interaction matrix constitute the product embedding vector of the jth product
[0030] The low-dimensional vector obtained by embedding the rating data of the i-th user on the j-th product in the user-product interaction matrix is the rating embedding vector of the i-th user on the j-th product.
[0031] Preferably, product aggregation based on a first multi-layer perceptron is performed according to the product embedding vector and the rating embedding vector to obtain a first user potential representation vector, social aggregation based on a second multi-layer perceptron is performed according to the product embedding vector, the rating embedding vector and each user's neighbor set to obtain a second user potential representation vector, and the first user potential representation vector and the second user potential representation vector are concatenated and passed through a third multi-layer perceptron to obtain a user representation vector, specifically including:
[0032] The user representation vector generation unit includes a product aggregation network and a social aggregation network, wherein the product aggregation network includes a first concatenation layer, a first multi-layer perceptron, and a first graph attention network connected in sequence;
[0033] The product embedding vector q of the ath product in the interactive product set C(i) of the i-th user is a And the rating embedding vector of the i-th user for the a-th product After the input is concatenated in the first concatenation layer and then passes through the first multi-layer perceptron, the interactive representation x of the rating of the i-th user on the a-th product is obtained. ia , as follows:
[0034]
[0035] Among them, g v represents the function corresponding to the first multi-layer perceptron, Indicates splicing;
[0036] Denote the rating interaction of the i-th user on the a-th product as x ia and the i-th user u i The user embedding vector is input into the first graph attention network to obtain the score interaction representation x ia The importance factor is as follows:
[0037]
[0038] Among them, p i represents the i-th user u iThe user embedding vector, b (1) 1 and b (1) 2 are the two bias vectors in the first image attention network, W (1) 1 represents the weight matrix in the first graph attention network, w x represents the weight vector in the first graph attention network, T represents the transpose, represents the score interaction x ia The unnormalized importance factor of , σ represents the ReLU activation function;
[0039] The score interaction represents x ia The unnormalized importance factor of is normalized to obtain the score interaction representation x ia The importance factor α ia , as shown below:
[0040]
[0041] The product aggregation function aggregates the score interaction representation of each product in the interactive product set C(i) of the i-th user and its corresponding importance factor to obtain the i-th user u i The first user potential representation vector of:
[0042]
[0043] in, represents the i-th user u i The first user potential representation vector, W (1) and b (1) Represent the weight matrix and bias in the product aggregation function respectively;
[0044] The social aggregation network includes a second splicing layer, a linear transformation layer, a neighbor sampling layer, a second multi-layer perceptron, and a second graph attention network;
[0045] The user embedding vector p of the i-th user i and the product embedding vector q of the product that has been rated by the yth user in the i-th user's neighbor set N(i) y After the second concatenation layer is input for concatenation and then passes through the linear transformation layer, the query embedding vector of the i-th user for the product that has been rated by the y-th user in the neighbor set N(i) is obtained, as shown in the following formula:
[0046]
[0047] Among them, Q iy represents the query embedding vector of the i-th user for the product that has been rated by the y-th user in his neighbor set N(i), Represents the weight matrix of the linear transformation layer;
[0048] The user embedding vector of the i-th user and the y-th user u in the i-th user's neighbor set N(i) y The user embedding vector of is input into the second multi-layer perceptron to obtain the yth user u in the neighbor set N(i) of the i-th user y Hidden embedding representation of layer l2 in the second multi-layer perceptron;
[0049] The query embedding vector of the i-th user for the product that has been rated by the y-th user in the neighbor set N(i) is input into the neighbor sampling layer, and the sampling probability of the y-th user in the i-th user's neighbor set N(i) in the l2th layer of the second multi-layer perceptron is obtained, as shown in the following formula:
[0050]
[0051] in, represents the yth user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron and the query embedding vector Q iy The consistency score between them, ||·||2 represents the l2 norm, Represents the hidden embedding representation of the yth user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron, l2 = 1, 2, ..., L2, L2 represents the total number of hidden layers in the second multilayer perceptron;
[0052] The following formula is used to calculate the yth user u in the neighbor set N(i) of the i-th user: y The sampling probability of the l2th layer in the second multilayer perceptron is:
[0053]
[0054] in, represents the yth user u in the neighbor set N(i) of the ith user y The sampling probability of the l2th layer in the second multilayer perceptron, Represents the y'th user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron and the query embedding vector Q iy The consistency scores between
[0055] The following formula is used to calculate the total number of neighbors U sampled by the neighbor set N(i) of the i-th user in the second multi-layer perceptron:
[0056]
[0057] According to the yth user u in the neighbor set N(i) of the i-th user y The hidden embedding representation of the l2-1th layer in the second multilayer perceptron and the yth user u in the neighbor set N(i) of the ith user y The rating embedding vector of the j-th product is calculated through the second graph attention network to obtain the y-th user u in the neighbor set N(i) of the ith user y The weights of the l2 layer of the second multilayer perceptron As shown below:
[0058]
[0059] in, represents the yth user u in the neighbor set N(i) of the ith user y The rating embedding vector for the jth product, represents the trainable parameters of the second graph attention network, represents the yth user u in the neighbor set N(i) of the ith user y The hidden embedding representation of the l2-1th layer in the second multi-layer perceptron is, Represents the hidden embedding representation of the ψth user among the sampled neighbors in the neighbor set N(i) of the ith user in the l2-1th layer of the second multilayer perceptron;
[0060] Through the neighbor aggregation function, the hidden embedding representation of each product in the neighbor set N(i) of the i-th user in the L2-1 layer of the second multi-layer perceptron and the weight in the L2 layer of the second multi-layer perceptron are aggregated to obtain the i-th user u i The second user potential representation vector is as follows:
[0061]
[0062] in, represents the i-th user u i The second user potential representation vector, The weight matrix representing the neighbor aggregation function;
[0063] The i-th user u i The first user potential representation vector and the second user potential representation vector are concatenated and input into the third multi-layer perceptron to obtain the i-th user u i The user representation vector h i , as shown below:
[0064]
[0065] Where c1 represents the i-th user u iThe vector obtained by concatenating the first user potential representation vector and the second user potential representation vector is Respectively represent the output of each hidden layer in the third multi-layer perceptron, Respectively represent the weight matrix of each hidden layer in the third multi-layer perceptron, They respectively represent the bias terms of each hidden layer in the third multi-layer perceptron, and L3 represents the total number of hidden layers in the third multi-layer perceptron.
[0066] Preferably, the user embedding vector and the rating embedding vector are input into a product representation vector generating unit for user aggregation based on a fourth multi-layer perceptron to obtain a product representation vector, which specifically includes:
[0067] The product representation vector generation unit includes a third concatenation layer, a fourth multi-layer perceptron, and a third graph attention network connected in sequence;
[0068] The user embedding vector p of the τth user in the rating user set B(j) of the jth product τ And the rating embedding vector of the i-th user for the j-th product After the input is concatenated in the third concatenation layer and then passes through the fourth multi-layer perceptron, the rating perception interaction vector f of the τth user for the jth product is obtained. τj , as follows:
[0069]
[0070] Among them, g u Represents the function corresponding to the fourth multi-layer perceptron, Indicates splicing;
[0071] The rating perception interaction vector f of the τth user on the jth product is τj and the product embedding vector q of the j-th product j Input the third graph attention network to obtain the score-aware interaction vector f τj The importance factor is as follows:
[0072]
[0073] Among them, p i represents i users u i The user embedding vector, b (4) 1 and b (4) 2 represents the two bias vectors in the third graph attention network, W (4) 1 represents the weight matrix in the third-graph attention network, w2 represents the weight vector in the third-graph attention network, T represents transposition, represents the score-aware interaction vector f τjThe unnormalized importance factor of , σ represents the ReLU activation function;
[0074] Rating-aware interaction vector f τj The unnormalized importance factor of is normalized to obtain the score-aware interaction vector f τj The importance factor μ jτ , as shown below:
[0075]
[0076] The rating perception interaction vector of each user in the rating user set B(j) of the jth product and its corresponding importance factor are aggregated through the user aggregation function to obtain the product representation vector of the jth product:
[0077] z j =σ(W (4) ·{∑ τ∈B(j) μ τj f τj}+b (4) );
[0078] Among them, z j The product representation vector for the j-th product, W (4) and b (4) Represents the weight matrix and bias of the user aggregation function.
[0079] Preferably, the user representation vector and the product representation vector are input into a rating prediction unit to perform rating prediction based on a fifth multi-layer perceptron to obtain predicted values of all unknown rating data in the user-product interaction matrix, specifically including:
[0080] The i-th user u i The user representation vector h i The product of the j-th product is represented by the vector z j After concatenation, it is input into the fifth multi-layer perceptron to obtain the i-th user u i The predicted value of the rating data for the jth product is shown in the following formula:
[0081]
[0082] Among them, r ij ' represents the i-th user u i The predicted value of the rating data of the jth product, g1 represents the i-th user u i The user representation vector h i The product of the j-th product is represented by the vector z j The vector obtained after splicing is Respectively represent the output of each hidden layer in the fifth multi-layer perceptron, Respectively represent the weight matrix of each hidden layer in the fifth multi-layer perceptron, Respectively represent the bias term of each hidden layer in the fifth multilayer perceptron, L5 represents the total number of hidden layers in the fifth multilayer perceptron, and w represents the weight vector in the fifth multilayer perceptron.
[0083] As a preference, the loss function Loss of the rating data prediction model is:
[0084]
[0085] Where |O| is the number of observed ratings, r ij ' represents the i-th user u i The predicted value of the rating data for the jth product, r ij represents the i-th user u i The true value of the rating data for the j-th product.
[0086] In a second aspect, the present invention provides an Internet insurance product recommendation device based on a neighbor-enhanced graph attention network, comprising:
[0087] A data acquisition module is configured to acquire a user set and an Internet insurance product set and construct a user-product interaction matrix, wherein the elements in the user-product interaction matrix are known or unknown rating data of the user on the product, and a user-user social relationship graph is constructed based on the user set;
[0088] A model building module is configured to build and train a rating data prediction model to obtain a trained rating data prediction model, wherein the trained rating data prediction model includes a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit;
[0089] The prediction module is configured to input the user-product interaction matrix and the user-user social relationship graph into the trained rating data prediction model, obtain the neighbor set of each user according to the user-user social relationship graph, obtain the interactive product set of each user and the rating user set of each product according to the user-product interaction matrix, and obtain the user embedding vector, product embedding vector and rating embedding vector according to the user-product interaction matrix; the user embedding vector, product embedding vector, rating embedding vector and the neighbor set of each user are input into the user representation vector generation unit, product aggregation based on the first multi-layer perceptron is performed according to the product embedding vector and the rating embedding vector to obtain the first user potential representation vector, social aggregation based on the second multi-layer perceptron is performed according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain the second user potential representation vector, and the first user potential representation vector and the second user potential representation vector are concatenated and passed through the third multi-layer perceptron to obtain the user representation vector; the user embedding vector and the rating embedding vector are input into the product representation vector generation unit to perform user aggregation based on the fourth multi-layer perceptron to obtain the product representation vector; the user representation vector and the product representation vector are input into the rating prediction unit to perform rating prediction based on the fifth multi-layer perceptron to obtain the predicted values of all unknown rating data in the user-product interaction matrix;
[0090] The recommendation module is configured to perform Top-k recommendations on the rating data corresponding to each user based on the predicted values of all unknown rating data in the user-product interaction matrix and all known rating data in the user-product interaction matrix, and obtain a recommended product sequence for each user.
[0091] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0092] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0093] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0094] Compared with the prior art, the present invention has the following beneficial effects:
[0095] (1) The Internet insurance product recommendation method based on neighbor-enhanced graph attention network proposed in this paper introduces a neighbor enhancement mechanism on the basis of graph attention network to solve the problem of social inconsistency. Compared with other recommendation algorithms, this method introduces a neighbor enhancement mechanism, which can better capture the complex relationship between users and neighbors, thereby more accurately understanding and predicting user behaviors and preferences, and reducing errors caused by social relationship inconsistency.
[0096] (2) The neighbor enhancement mechanism proposed in the Internet insurance product recommendation method based on the neighbor enhancement graph attention network proposed in the present invention is mainly reflected in the linear transformation layer and the neighbor sampling layer. The linear transformation layer first concatenates the user embedding vector with the product embedding vector of the product that the user has rated in the corresponding neighbor set to generate a query embedding vector. The neighbor sampling layer first calculates a preference value based on the query embedding vector, and then performs a probability operation on the preference value and the preference value of all query embedding vectors to obtain the sampling probability of the user's neighbors, and selects the neighbors according to the sampling probability. Then, consistent with the product aggregation method, the attention mechanism is used to assign different importance factors to different neighbors. Finally, the second user potential representation vector is obtained through the neighbor aggregation function, and then combined with the first user potential representation vector obtained by product aggregation to obtain the user representation vector. The user representation vector is combined with the product representation vector to predict the missing rating data, and finally the Top-k recommendation is performed based on the predicted rating data. The proposed method provides new ideas and possibilities for the further development of rating prediction and recommendation systems, and also provides useful exploration and practice for solving social inconsistency problems.
[0097] (3) The Internet insurance product recommendation method based on the neighbor-enhanced graph attention network proposed in the present invention analyzes the user's preference for products from the perspective of the user's social relationship, and recommends a product sequence for the user based on this. As a special field, Internet insurance has both Internet characteristics and insurance field characteristics, and its user relationships are complex and diverse. In terms of user social relationships, the real insurance data collected by the present invention includes both the user's friend data on the insurance platform and the relationship data between the policyholder and the insured. The present invention can better handle this complex relationship structure and fully mine and utilize the information therein. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0099] Figure 1A flowchart of an Internet insurance product recommendation method based on a neighbor-enhanced graph attention network according to an embodiment of the present application;
[0100] Figure 2 A schematic diagram of a model structure of an Internet insurance product recommendation method based on a neighbor-enhanced graph attention network according to an embodiment of the present application;
[0101] Figure 3 A schematic diagram of an Internet insurance product recommendation device based on a neighbor-enhanced graph attention network according to an embodiment of the present application;
[0102] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0103] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0104] Figure 1 An Internet insurance product recommendation method based on a neighbor-enhanced graph attention network provided by an embodiment of the present application is shown, comprising the following steps:
[0105] S1, obtain the user set and the Internet insurance product set and construct a user-product interaction matrix. The elements in the user-product interaction matrix are the known or unknown rating data of the user on the product. A user-user social relationship graph is constructed based on the user set.
[0106] In a specific embodiment, the user set is represented as:
[0107] U={u1,u2,…,u n};
[0108] The set of Internet insurance products is represented as:
[0109] V={v1,v2,…,v m};
[0110] Among them, U represents the user set, V represents the Internet insurance product set, and u i represents the i-th user, i=1,2,...,n, n represents the total number of users, v j represents the jth product, j = 1, 2, ..., m, and m represents the total number of products;
[0111] The user-product interaction matrix is expressed as:
[0112]
[0113] in, represents the user-product interaction matrix, represents a set of real numbers, representing the i-th user u i For the jth product v j The rating data, r ij ∈[0,1,2,3,4,5], when r ij = 0 represents the i-th user u i For the jth product v j The rating data is unknown. ij ∈[1,2,3,4,5] represents the i-th user u i For the jth product v j The rating data of is known;
[0114] The user-user social relationship graph is represented as:
[0115]
[0116] in, Represents a user-user social relationship graph. The user-user social relationship graph is an undirected graph. Each node in the point set of the undirected graph represents a user. Each edge in the edge set of the undirected graph connects two nodes, representing the social relationship between two users. If the i-th user u i With the oth user u o If there is a social relationship, then t io =1, otherwise t io = 0, on the diagonal of the user-user social relationship graph, t ii represents the i-th user u i The relationship with itself is represented by a self-loop, that is, t ii =1;
[0117] The neighbor set of the i-th user is the neighbor set of the i-th user u i The set of users with direct social connections, denoted as N(i);
[0118] The interactive product set of the i-th user is the i-th user u i The set of Internet insurance products that have been rated is denoted as C(i);
[0119] The set of users who rated the jth product is the set of users who rated the jth product v j The set of rated users, denoted as B(j);
[0120] The elements of the i-th row in the user-product interaction matrix constitute the user embedding vector of the i-th user
[0121] The elements of the jth column in the user-product interaction matrix constitute the product embedding vector of the jth product
[0122] The low-dimensional vector obtained by embedding the rating data of the i-th user on the j-th product in the user-product interaction matrix is the rating embedding vector of the i-th user on the j-th product.
[0123] Specifically, the products mentioned in the embodiments of the present application are Internet insurance products as examples. In other embodiments, other types of products can be selected. In addition, the user's rating of the product is collectively referred to as interaction, and the rating data can be regarded as the user's opinion on the product. The goal of the embodiment of the present application is to predict the missing rating data of any user in the user-product interaction matrix R, and perform Top-k recommendations based on the rating data.
[0124] S2, constructing and training a rating data prediction model to obtain a trained rating data prediction model, wherein the trained rating data prediction model includes a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit.
[0125] Specifically, refer to Figure 2 The trained rating data prediction model proposed in the embodiment of the present application consists of three parts: a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit. The user representation vector generation unit based on the neighbor-enhanced graph attention network is used to generate a user representation vector, the product representation vector generation unit based on the graph attention network is used to generate a product representation vector, and the rating prediction unit is used to predict the missing rating data based on the user representation vector and the generated product representation vector.
[0126] S3, input the user-product interaction matrix and the user-user social relationship graph into the trained rating data prediction model, obtain the neighbor set of each user according to the user-user social relationship graph, obtain the interactive product set of each user and the rating user set of each product according to the user-product interaction matrix, and obtain the user embedding vector, product embedding vector and rating embedding vector according to the user-product interaction matrix; input the user embedding vector, product embedding vector, rating embedding vector and the neighbor set of each user into the user representation vector generation unit, perform product aggregation based on the first multi-layer perceptron according to the product embedding vector and the rating embedding vector to obtain the first user potential representation vector, perform social aggregation based on the second multi-layer perceptron according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain the second user potential representation vector, and concatenate the first user potential representation vector and the second user potential representation vector and pass them through the third multi-layer perceptron to obtain the user representation vector; input the user embedding vector and the rating embedding vector into the product representation vector generation unit for user aggregation based on the fourth multi-layer perceptron to obtain the product representation vector; input the user representation vector and the product representation vector into the rating prediction unit for rating prediction based on the fifth multi-layer perceptron to obtain the predicted values of all unknown rating data in the user-product interaction matrix.
[0127] In a specific embodiment, product aggregation based on a first multi-layer perceptron is performed according to the product embedding vector and the rating embedding vector to obtain a first user potential representation vector, social aggregation based on a second multi-layer perceptron is performed according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain a second user potential representation vector, and the first user potential representation vector and the second user potential representation vector are concatenated and passed through a third multi-layer perceptron to obtain a user representation vector, which specifically includes:
[0128] The user representation vector generation unit includes a product aggregation network and a social aggregation network, wherein the product aggregation network includes a first concatenation layer, a first multi-layer perceptron, and a first graph attention network connected in sequence;
[0129] The product embedding vector q of the ath product in the interactive product set C(i) of the i-th user is a And the rating embedding vector of the i-th user for the a-th product After the input is concatenated in the first concatenation layer and then passes through the first multi-layer perceptron, the interactive representation x of the rating of the i-th user on the a-th product is obtained. ia , as follows:
[0130]
[0131] Among them, g v represents the function corresponding to the first multi-layer perceptron, Indicates splicing;
[0132] Denote the rating interaction of the i-th user on the a-th product as x ia and the i-th user u i The user embedding vector is input into the first graph attention network to obtain the score interaction representation x ia The importance factor is as follows:
[0133]
[0134] Among them, p i represents the i-th user u i The user embedding vector, b (1) 1 and b (1) 2 are the two bias vectors in the first image attention network, W (1) 1 represents the weight matrix in the first graph attention network, w x represents the weight vector, T represents the transpose, represents the score interaction x ia The unnormalized importance factor of , σ represents the ReLU activation function;
[0135] The score interaction represents x ia The unnormalized importance factor of is normalized to obtain the score interaction representation x ia The importance factor α ia , as shown below:
[0136]
[0137] The product aggregation function aggregates the score interaction representation of each product in the interactive product set C(i) of the i-th user and its corresponding importance factor to obtain the i-th user u i The first user potential representation vector of:
[0138]
[0139] in, represents the i-th user u i The first user potential representation vector, W (1) and b (1) Represent the weight matrix and bias in the product aggregation function respectively;
[0140] The social aggregation network includes a second splicing layer, a linear transformation layer, a neighbor sampling layer, a second multi-layer perceptron, and a second graph attention network;
[0141] The user embedding vector p of the i-th user i and the product embedding vector q of the product that has been rated by the yth user in the i-th user's neighbor set N(i)y After the second concatenation layer is input for concatenation and then passes through the linear transformation layer, the query embedding vector of the i-th user for the product that has been rated by the y-th user in the neighbor set N(i) is obtained, as shown in the following formula:
[0142]
[0143] Among them, Q iy represents the query embedding vector of the i-th user for the product that has been rated by the y-th user in his neighbor set N(i), Represents the weight matrix of the linear transformation layer;
[0144] The user embedding vector of the i-th user and the y-th user u in the i-th user's neighbor set N(i) y The user embedding vector of is input into the second multi-layer perceptron to obtain the yth user u in the neighbor set N(i) of the i-th user y Hidden embedding representation of layer l2 in the second multi-layer perceptron;
[0145] The query embedding vector of the i-th user for the product that has been rated by the y-th user in the neighbor set N(i) is input into the neighbor sampling layer, and the sampling probability of the y-th user in the i-th user's neighbor set N(i) in the l2th layer of the second multi-layer perceptron is obtained, as shown in the following formula:
[0146]
[0147] in, represents the yth user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron and the query embedding vector Q iy The consistency score between them, ||·||2 represents the l2 norm, Represents the hidden embedding representation of the yth user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron, l2 = 1, 2, ..., L2, L2 represents the total number of hidden layers in the second multilayer perceptron;
[0148] The following formula is used to calculate the yth user u in the neighbor set N(i) of the i-th user: y The sampling probability of the l2th layer in the second multilayer perceptron is:
[0149]
[0150] in, represents the yth user u in the neighbor set N(i) of the ith user y The sampling probability of the l2th layer in the second multilayer perceptron, Represents the y'th user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron and the query embedding vector Q iy The consistency scores between
[0151] The following formula is used to calculate the total number of neighbors U sampled by the neighbor set N(i) of the i-th user in the second multi-layer perceptron:
[0152]
[0153] According to the yth user u in the neighbor set N(i) of the i-th user y The hidden embedding representation of the l2-1th layer in the second multilayer perceptron and the yth user u in the neighbor set N(i) of the ith user y The rating embedding vector of the j-th product is calculated through the second graph attention network to obtain the y-th user u in the neighbor set N(i) of the ith user y The weights of the l2 layer of the second multilayer perceptron As shown below:
[0154]
[0155] in, represents the yth user u in the neighbor set N(i) of the ith user y The rating embedding vector for the jth product, represents the trainable parameters of the second graph attention network, represents the yth user u in the neighbor set N(i) of the ith user y The hidden embedding representation of the l2-1th layer in the second multi-layer perceptron is, Represents the hidden embedding representation of the ψth user among the sampled neighbors in the neighbor set N(i) of the ith user in the l2-1th layer of the second multilayer perceptron;
[0156] Through the neighbor aggregation function, the hidden embedding representation of each product in the neighbor set N(i) of the i-th user in the L2-1 layer of the second multi-layer perceptron and the weight in the L2 layer of the second multi-layer perceptron are aggregated to obtain the i-th user u i The second user potential representation vector is as follows:
[0157]
[0158] in, represents the i-th user u i The second user potential representation vector, The weight matrix representing the neighbor aggregation function;
[0159] The i-th user u i The first user potential representation vector and the second user potential representation vector are concatenated and input into the third multi-layer perceptron to obtain the i-th user u i The user representation vector h i , as shown below:
[0160]
[0161] Where c1 represents the i-th user u i The vector obtained by concatenating the first user potential representation vector and the second user potential representation vector is Respectively represent the output of each hidden layer in the third multi-layer perceptron, Respectively represent the weight matrix of each hidden layer in the third multi-layer perceptron, They respectively represent the bias terms of each hidden layer in the third multi-layer perceptron, and L3 represents the total number of hidden layers in the third multi-layer perceptron.
[0162] Specifically, the user representation vector generation unit is designed to learn the user representation vector. The main difficulty of this part is to learn the user representation vector from different perspectives, and there is inconsistency in social relations from a social perspective. How to solve this problem is the research focus of this part. In order to solve this difficulty, the embodiment of the present application first uses a multi-layer perceptron (MLP) to aggregate the products that the user has interacted with, and understands the user through all the products that the user has interacted with. Among them, the first user potential representation vector generated by product aggregation uses the symbol express.
[0163] Secondly, users who have social relations with the user are aggregated uniformly using a multi-layer perceptron (MLP) to understand the user through the user's social relations. The second user potential representation vector generated by social aggregation uses the symbol Finally, the first user potential representation vector and the second user potential representation vector are concatenated, and then the obtained vectors are assigned different weight values through the attention mechanism to perform MLP aggregation to obtain the user representation vector of the product space.
[0164] Product aggregation is to aggregate the products that users have interacted with into a first user potential representation vector through the product aggregation function. The input of product aggregation is the product embedding vector and the rating embedding vector between the user and the product. First, the product embedding vector and the rating embedding vector are input into the product aggregation network to obtain the first user potential representation vector in the product space.
[0165] The first user latent representation vector in the product space The mathematical expression formula is defined as follows:
[0166]
[0167] Where C(i) is the i-th user u i The interactive product set C(i), x ia represents the i-th user u i With product v a The score interaction between Aggre items Represents the product aggregation function. The embodiment of this application introduces a score embedding vector The rating embedding vector is a dense low-dimensional vector obtained by embedding the user's rating data for the product, which represents the user's rating preference for the product. The vector obtained by concatenating the product embedding vector and the rating embedding vector is placed in the product space, and the concatenated vector is used as the input data of the first multi-layer perceptron.
[0168] The product aggregation function is expressed as:
[0169]
[0170] The product aggregation function assigns the same importance factor to each element in the interactive product set C(i), α i Fixed to The same importance factor is given to products that users have interacted with, which is obviously contrary to reality. Users must have different interests in each product, so different weight values need to be assigned to the products that have been interacted with for aggregation.
[0171] In order to alleviate the impact of the above problems on user representation, the attention mechanism is used to solve the above problems. a ,u i ) assigns personalized weights. Therefore, the first user potential representation vector in the above product space is The mathematical representation formula is adjusted to obtain the final first user potential representation vector. In this product aggregation network, the first multi-layer perceptron is used to preliminarily process the product embedding vector and the rating embedding vector, while the first graph attention network is used to further refine these representations, so that the model can more flexibly capture the differences in user preferences for different products.
[0172] In order to solve the problem of social relationship inconsistency in social recommendation, the embodiment of the present application aggregates the social space with the i-th user u i Consistent neighbors to learn the i-th user u i The second user latent representation vector in the social space. Since the social inconsistency problem exists both at the context level and at the social relationship level, in order to distinguish each pair of consistent neighbors (u i ,uy ), the embodiment of the present application first generates a query embedding vector Q for querying consistent neighbors iy , the query embedding vector is the concatenation of the user embedding vector of the i-th user and the product embedding vector of the product that has been rated by the y-th user in the i-th user's neighbor set N(i). This makes the user representation in the social space more flexible, and users will be affected by different neighbors when rating different products. Therefore, the i-th user u i The rating data of the products that have been rated by the yth user in the neighbor set N(i) of the i-th user is related to the neighbors who are familiar with the product. In order to dynamically sample neighbors based on the query embedding vectors composed of different products, the embodiment of the present application designs a neighbor sampling layer. The neighbor sampling layer has long been used in graph neural networks to promote training and improve recommendation accuracy. It is also a way to solve the problem of social relationship inconsistency in social recommendations. The neighbor sampling layer first calculates a preference value based on the query embedding vector, and then performs a probability operation on the value and the preference values of all query embedding vectors to obtain the sampling probability of the user's neighbors, and screens the neighbors according to the sampling probability. The specific process in the neighbor sampling layer samples neighbors with consistent preferences by calculating the sampling probability of a certain neighbor. In addition, the number of sampled neighbors is calculated based on the sampling probability.
[0173] An aggregation node can be represented as:
[0174]
[0175] in, represents the neighbor aggregation function;
[0176] In the Internet insurance data, there are social relationships between the insured and the insured, as well as social relationships between users and friends on the platform. Different social relationships have different importance for users. Therefore, when aggregating the neighbors with consistent user preferences, different importance factors need to be assigned to different neighbors. Therefore, in the embodiment of the present application, an attention mechanism is introduced to assign different importance factors to different neighbors. Therefore, the neighbor aggregation function can be expressed as:
[0177]
[0178] After the above derivation, we finally get the potential representation vector of the second user in the social space Mathematical formula of .
[0179] The user-product interaction matrix and the user-user social relationship graph are used to understand users from different perspectives. The first user potential representation vector in the product space and the second user potential representation vector in the social space are concatenated and input into the third multi-layer perceptron to generate a user representation vector.
[0180] In a specific embodiment, the user embedding vector and the rating embedding vector are input into a product representation vector generation unit for user aggregation based on a fourth multi-layer perceptron to obtain a product representation vector, which specifically includes:
[0181] The product representation vector generation unit includes a third concatenation layer, a fourth multi-layer perceptron, and a third graph attention network connected in sequence;
[0182] The user embedding vector p of the τth user in the rating user set B(j) of the jth product τ And the rating embedding vector of the i-th user for the j-th product After the input is concatenated in the third concatenation layer and then passes through the fourth multi-layer perceptron, the rating perception interaction vector f of the τth user for the jth product is obtained. τj , as follows:
[0183]
[0184] Among them, g u Represents the function corresponding to the fourth multi-layer perceptron, Indicates splicing;
[0185] The rating perception interaction vector f of the τth user on the jth product is τj and the product embedding vector q of the j-th product j Input the third graph attention network to obtain the score-aware interaction vector f τj The importance factor is as follows:
[0186]
[0187] Among them, p i represents i users u i The user embedding vector, b (4) 1 and b (4) 2 represents the two bias vectors in the third graph attention network, W (4) 1 represents the weight matrix in the third figure attention network, w2 represents the weight vector, T represents the transpose, represents the score-aware interaction vector f τj The unnormalized importance factor of , σ represents the ReLU activation function;
[0188] Rating-aware interaction vector f τj The unnormalized importance factor of is normalized to obtain the score-aware interaction vector f τj The importance factor μ jτ , as shown below:
[0189]
[0190] The rating perception interaction vector of each user in the rating user set B(j) of the jth product and its corresponding importance factor are aggregated through the user aggregation function to obtain the product representation vector of the jth product:
[0191] z j =σ(W (4) ·{∑ τ∈B(j) μ τj f τj}+b (4) );
[0192] Among them, z j The product representation vector for the j-th product, W (4) and b (4) Represents the weight matrix and bias of the user aggregation function.
[0193] Specifically, the product representation vector generation unit based on the graph attention network is designed to learn the product representation vector. The generation of the product representation vector is obtained by aggregating the user embedding vectors related to the product. The specific aggregation structure is consistent with the product aggregation in the user representation vector generation, and both use a multi-layer perceptron for aggregation. Among them, the input data is a vector spliced by the user embedding vector and the score embedding vector. The product representation vector generation unit is implemented through user aggregation. User aggregation is to aggregate the user embedding vectors that have interacted with the product into a potential representation vector of a product through a user aggregation function. The input of user aggregation is the user embedding vector and the score embedding vector between the user and the product. The user embedding vector and the score embedding vector are spliced to obtain the score-aware interaction vector, and then the obtained score-aware interaction vector is assigned different weight values through the third graph attention network for MLP aggregation to obtain the product representation vector z in the user space. j .
[0194]
[0195] Among them, Aggre users Represents the user aggregation function, which is an average operation. The product represents the vector z. j Further expressed as:
[0196] z j =σ(W (4) ·{Σ τ∈B(j) μ j f τj}+b (4) );
[0197] Among them, μ jis a fixed importance factor, calculated as That is, the same importance factor is given to users who have interacted with the product. This is obviously contrary to reality. The product will have different preference distributions for each user, so different weight values need to be assigned to the interacted users for aggregation.
[0198] In order to alleviate the impact of the above problems on user representation, the attention mechanism is used to solve the above problems. τ ,v j ) assigns personalized weights. Therefore, the product representation vector z j Further adjustments are made to obtain the final mathematical expression.
[0199] In a specific embodiment, the user representation vector and the product representation vector are input into the rating prediction unit to perform rating prediction based on the fifth multi-layer perceptron to obtain the predicted values of all unknown rating data in the user-product interaction matrix, specifically including:
[0200] The i-th user u i The user representation vector h i The product of the j-th product is represented by the vector z j After concatenation, it is input into the fifth multi-layer perceptron to obtain the i-th user u i The predicted value of the rating data for the jth product is shown in the following formula:
[0201]
[0202] Among them, r ij ' represents the i-th user u i The predicted value of the rating data of the jth product, g1 represents the i-th user u i The user representation vector h i The product of the j-th product is represented by the vector z j The vector obtained after splicing is Respectively represent the output of each hidden layer in the fifth multi-layer perceptron, Respectively represent the weight matrix of each hidden layer in the fifth multi-layer perceptron, Respectively represent the bias term of each hidden layer in the fifth multilayer perceptron, L5 represents the total number of hidden layers in the fifth multilayer perceptron, and w represents the weight vector in the fifth multilayer perceptron.
[0203] Specifically, the rating data as the user's explicit feedback can be regarded as the user's preference for the product. i The user representation vector h i The product of the j-th product is represented by the vector z jThen, the connection is made and then input into the fifth multi-layer perceptron for rating prediction to obtain the i-th user u i The predicted value of the rating data for the j-th product.
[0204] In a specific embodiment, the loss function Loss of the rating data prediction model is:
[0205]
[0206] Where |O| is the number of observed ratings, r ij ' represents the i-th user u i The predicted value of the rating data for the jth product, r ij represents the i-th user u i The true value of the rating data for the j-th product.
[0207] Specifically, in order to adjust the model parameters, the embodiment of the present application uses a loss function. In order to optimize the loss function, the embodiment of the present application uses RMSprop as an optimizer and applies the dropout strategy to the model.
[0208] S4, based on the predicted values of all unknown rating data in the user-product interaction matrix and all known rating data in the user-product interaction matrix, a Top-k recommendation is performed on the rating data corresponding to each user to obtain a recommended product sequence for each user.
[0209] Specifically, after using the trained rating data prediction model, the embodiment of the present application will predict all missing rating data in the user-product interaction matrix. After the prediction is completed, Top-k recommendation is used to sort the rating vector of a single user in descending order and select the top k products as their recommended products.
[0210] Further references Figure 3 As an implementation of the methods shown in the above figures, the present application provides an embodiment of an Internet insurance product recommendation device based on a neighbor-enhanced graph attention network. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0211] The embodiment of the present application provides an Internet insurance product recommendation device based on a neighbor-enhanced graph attention network, comprising:
[0212] Data acquisition module 1 is configured to acquire a user set and an Internet insurance product set and construct a user-product interaction matrix, where the elements in the user-product interaction matrix are known or unknown rating data of the user on the product, and a user-user social relationship graph is constructed based on the user set;
[0213] A model building module 2 is configured to build and train a rating data prediction model to obtain a trained rating data prediction model, wherein the trained rating data prediction model includes a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit;
[0214] Prediction module 3 is configured to input the user-product interaction matrix and the user-user social relationship graph into the trained rating data prediction model, obtain the neighbor set of each user according to the user-user social relationship graph, obtain the interactive product set of each user and the rating user set of each product according to the user-product interaction matrix, and obtain the user embedding vector, product embedding vector and rating embedding vector according to the user-product interaction matrix; input the user embedding vector, product embedding vector, rating embedding vector and the neighbor set of each user into the user representation vector generation unit, perform product aggregation based on the first multi-layer perceptron according to the product embedding vector and the rating embedding vector to obtain the first user potential representation vector, perform social aggregation based on the second multi-layer perceptron according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain the second user potential representation vector, and concatenate the first user potential representation vector and the second user potential representation vector and pass them through the third multi-layer perceptron to obtain the user representation vector; input the user embedding vector and the rating embedding vector into the product representation vector generation unit to perform user aggregation based on the fourth multi-layer perceptron to obtain the product representation vector; input the user representation vector and the product representation vector into the rating prediction unit to perform rating prediction based on the fifth multi-layer perceptron to obtain the predicted values of all unknown rating data in the user-product interaction matrix;
[0215] The recommendation module 4 is configured to perform Top-k recommendations on the rating data corresponding to each user based on the predicted values of all unknown rating data in the user-product interaction matrix and all known rating data in the user-product interaction matrix, and obtain a recommended product sequence for each user.
[0216] Figure 4 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 4 As shown, the electronic device of this embodiment includes: a processor 401 and a memory 402; wherein the memory 402 is used to store computer-executable instructions; the processor 401 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0217] Optionally, the memory 402 may be independent or integrated with the processor 401 .
[0218] When the memory 402 is independently provided, the electronic device further includes a bus 403 for connecting the memory 402 and the processor 401 .
[0219] The embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When the processor 401 executes the computer execution instructions, the above method is implemented.
[0220] The embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by the processor 401, the above method is implemented.
[0221] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0222] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0223] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each module may exist physically separately, or two or more modules may be integrated into one unit. The unit formed by the above modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0224] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor 401 to perform some steps of the methods of various embodiments of the present application.
[0225] It should be understood that the processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor 401 may be any conventional processor 401, etc. The steps of the method disclosed in the invention may be directly embodied in the hardware processor 401 for execution, or may be executed by a combination of hardware and software modules in the processor 401.
[0226] The memory 402 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.
[0227] The bus 403 may be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 403 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 403 in the drawings of the present application is not limited to only one bus 403 or one type of bus 403.
[0228] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0229] An exemplary storage medium is coupled to the processor 401, so that the processor 401 can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor 401. The processor 401 and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor 401 and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0230] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0231] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for recommending Internet insurance products based on neighbor-enhanced graph attention network, characterized in that: The following steps are involved: Acquire a user set and an Internet insurance product set and construct a user-product interaction matrix, wherein the elements in the user-product interaction matrix are the known or unknown rating data of the user on the product, and construct a user-user social relationship graph based on the user set; Constructing and training a rating data prediction model to obtain a trained rating data prediction model, wherein the trained rating data prediction model includes a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit; The user-product interaction matrix and the user-user social relationship graph are input into the trained rating data prediction model, and the neighbor set of each user is obtained according to the user-user social relationship graph. The interactive product set of each user and the rating user set of each product are obtained according to the user-product interaction matrix. The user embedding vector, product embedding vector and rating embedding vector are obtained according to the user-product interaction matrix; the user embedding vector, product embedding vector, rating embedding vector and the neighbor set of each user are input into the user representation vector generation unit, and product aggregation based on the first multi-layer perceptron is performed according to the product embedding vector and the rating embedding vector to obtain the first user potential representation vector, social aggregation based on a second multi-layer perceptron is performed according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain a second user potential representation vector, the first user potential representation vector and the second user potential representation vector are concatenated and passed through a third multi-layer perceptron to obtain a user representation vector; the user embedding vector and the rating embedding vector are input into the product representation vector generation unit to perform user aggregation based on a fourth multi-layer perceptron to obtain a product representation vector; the user representation vector and the product representation vector are input into the rating prediction unit to perform rating prediction based on a fifth multi-layer perceptron to obtain predicted values of all unknown rating data in the user-product interaction matrix; Based on the predicted values of all unknown rating data in the user-product interaction matrix and all known rating data in the user-product interaction matrix, Top-k recommendations are made for the rating data corresponding to each user to obtain a recommended product sequence for each user.
2. The Internet insurance product recommendation method based on neighbor-enhanced graph attention network according to claim 1 is characterized in that: The user set is represented as: U={u1,u2,…,u n }; The Internet insurance product set is represented as follows: V={v1,v2,…,v m }; Among them, U represents the user set, V represents the Internet insurance product set, and u i represents the i-th user, i=1,2,...,n, n represents the total number of users, v j represents the jth product, j = 1, 2, ..., m, and m represents the total number of products; The user-product interaction matrix is expressed as: in, represents the user-product interaction matrix, represents a set of real numbers, representing the i-th user u i For the jth product v j The rating data, r ij ∈[0,1,2,3,4,5], when r ij = 0 represents the i-th user u i For the jth product v j The rating data is unknown. ij ∈[1,2,3,4,5] represents the i-th user u i For the jth product v j The rating data of is known; The user-user social relationship graph is represented as: in, represents a user-user social relationship graph, which is an undirected graph. Each node in the point set of the undirected graph represents a user, and each edge in the edge set of the undirected graph connects two nodes, indicating the social relationship between two users. If the i-th user u i With the oth user u o If there is a social relationship, then t io =1, otherwise t io = 0, on the diagonal of the user-user social relationship graph, t ii represents the i-th user u i The relationship with itself is represented by a self-loop, that is, t ii =1; The neighbor set of the i-th user is the neighbor set of the i-th user u i The set of users with direct social connections, denoted as N(i); The interactive product set of the i-th user is the i-th user u i The set of Internet insurance products that have been rated is denoted as C(i); The set of users who rated the jth product is the set of users who rated the jth product v j The set of rated users, denoted as B(j); The elements of the i-th row in the user-product interaction matrix constitute the user embedding vector of the i-th user The elements in the jth column of the user-product interaction matrix constitute the product embedding vector of the jth product The low-dimensional vector obtained by the embedding layer of the rating data of the i-th user on the j-th product in the user-product interaction matrix is the rating embedding vector of the i-th user on the j-th product 3. The Internet insurance product recommendation method based on neighbor-enhanced graph attention network according to claim 2 is characterized in that: The method further comprises: performing product aggregation based on a first multi-layer perceptron according to the product embedding vector and the score embedding vector to obtain a first user potential representation vector; performing social aggregation based on a second multi-layer perceptron according to the product embedding vector, the score embedding vector and each user's neighbor set to obtain a second user potential representation vector; and concatenating the first user potential representation vector and the second user potential representation vector and passing the concatenation through a third multi-layer perceptron to obtain a user representation vector. The user representation vector generation unit includes a product aggregation network and a social aggregation network, wherein the product aggregation network includes a first splicing layer, a first multi-layer perceptron, and a first graph attention network connected in sequence; The product embedding vector q of the ath product in the interactive product set C(i) of the i-th user is a And the rating embedding vector of the i-th user for the a-th product After the input is concatenated in the first concatenated layer and then passes through the first multi-layer perceptron, the interactive representation x of the rating of the i-th user on the a-th product is obtained. ia , as described below: Among them, g v represents the function corresponding to the first multi-layer perceptron, Indicates splicing; Denote the rating interaction of the i-th user on the a-th product by x ia and the i-th user u i The user embedding vector is input into the first graph attention network to obtain the score interaction representation x ia The importance factor is as follows: Among them, p i represents the i-th user u i The user embedding vector, b (1) 1 and b (1) 2 are the two bias vectors in the first image attention network, W (1) 1 represents the weight matrix in the first graph attention network, w x represents the weight vector in the first graph attention network, T represents the transpose, represents the score interaction x ia The unnormalized importance factor of , σ represents the ReLU activation function; The scoring interaction represents x ia The unnormalized importance factor is normalized to obtain the score interaction representation x ia The importance factor α ia , as shown below: The product aggregation function is used to aggregate the score interaction representation of each product in the interactive product set C(i) of the ith user and its corresponding importance factor to obtain the ith user u i The first user potential representation vector of: in, Represents the i-th user u i The first user potential representation vector, W (1) and b (1) Represent the weight matrix and bias in the product aggregation function respectively; The social aggregation network includes a second splicing layer, a linear transformation layer, a neighbor sampling layer, a second multi-layer perceptron, and a second graph attention network; The user embedding vector p of the i-th user i and the product embedding vector q of the product that has been rated by the yth user in the i-th user's neighbor set N(i) y After the second concatenation layer is input for concatenation and then passes through the linear transformation layer, the query embedding vector of the i-th user for the product that has been rated by the y-th user in the neighbor set N(i) is obtained, as shown in the following formula: Among them, Q iy represents the query embedding vector of the i-th user for the product that has been rated by the y-th user in his neighbor set N(i), Represents the weight matrix of the linear transformation layer; The user embedding vector of the i-th user and the y-th user u in the i-th user's neighbor set N(i) y The user embedding vector of is input into the second multi-layer perceptron to obtain the yth user u in the neighbor set N(i) of the ith user y Hidden embedding representation of layer l2 in the second multi-layer perceptron; The query embedding vector of the i-th user for the product that has been rated by the y-th user in the neighbor set N(i) is input into the neighbor sampling layer, and the sampling probability of the y-th user in the i-th user's neighbor set N(i) in the l2th layer of the second multi-layer perceptron is obtained, as shown in the following formula: in, represents the yth user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron and the query embedding vector Q iy The consistency score between them, ||·||2 represents norm, represents the hidden embedding representation of the yth user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron, l2 = 1, 2, ..., L2, L2 represents the total number of hidden layers in the second multilayer perceptron; The following formula is used to calculate the yth user u in the neighbor set N(i) of the i-th user: y The sampling probability of the l2th layer in the second multilayer perceptron is: in, represents the yth user u in the neighbor set N(i) of the ith user y The sampling probability of the l2th layer in the second multilayer perceptron, Represents the y'th user in the neighbor set N(i) of the ith user in the l2th layer of the second multilayer perceptron and the query embedding vector Q iy The consistency scores between The following formula is used to calculate the total number of neighbors U sampled by the neighbor set N(i) of the i-th user in the second multi-layer perceptron: According to the yth user u in the neighbor set N(i) of the ith user y The hidden embedding representation of the l2-1th layer in the second multilayer perceptron and the yth user u in the neighbor set N(i) of the ith user y The rating embedding vector of the jth product is calculated by the second graph attention network to obtain the yth user u in the neighbor set N(i) of the ith user y The weights of the l2 layer of the second multilayer perceptron As shown below: in, represents the yth user u in the neighbor set N(i) of the ith user y The rating embedding vector for the jth product, represents the trainable parameters of the second graph attention network, represents the yth user u in the neighbor set N(i) of the ith user y The hidden embedding representation of the l2-1th layer in the second multi-layer perceptron is, Represents the hidden embedding representation of the ψth user among the sampled neighbors in the neighbor set N(i) of the ith user in the l2-1th layer of the second multilayer perceptron; The hidden embedding representation of each product in the neighbor set N(i) of the ith user in the L2-1th layer of the second multilayer perceptron and the weight of the L2th layer of the second multilayer perceptron are aggregated through the neighbor aggregation function to obtain the ith user u i The second user potential representation vector is as follows: in, represents the i-th user u i The second user potential representation vector, The weight matrix representing the neighbor aggregation function; The i-th user u i The first user potential representation vector and the second user potential representation vector are concatenated and input into the third multi-layer perceptron to obtain the i-th user u i The user representation vector h i , as shown below: Where c1 represents the i-th user u i The vector obtained by concatenating the first user potential representation vector and the second user potential representation vector is Respectively represent the output of each hidden layer in the third multi-layer perceptron, Respectively represent the weight matrix of each hidden layer in the third multi-layer perceptron, They respectively represent the bias term of each hidden layer in the third multi-layer perceptron, and L3 represents the total number of hidden layers in the third multi-layer perceptron.
4. The Internet insurance product recommendation method based on neighbor-enhanced graph attention network according to claim 1 is characterized in that: The user embedding vector and the rating embedding vector are input into the product representation vector generation unit to perform user aggregation based on the fourth multi-layer perceptron to obtain the product representation vector, specifically including: The product representation vector generation unit includes a third splicing layer, a fourth multi-layer perceptron, and a third graph attention network connected in sequence; The user embedding vector p of the τth user in the rating user set B(j) of the jth product τ And the rating embedding vector of the i-th user for the j-th product After being input into the third concatenation layer for concatenation, it passes through the fourth multi-layer perceptron to obtain the rating perception interaction vector f of the τth user for the jth product τj , as described below: Among them, g u Represents the function corresponding to the fourth multi-layer perceptron, Indicates splicing; The rating perception interaction vector f of the τth user on the jth product τj and the product embedding vector q of the j-th product j Input the third graph attention network to obtain the score-aware interaction vector f τj The importance factor is as follows: Among them, p i represents i users u i The user embedding vector, b (4) 1 and b (4) 2 represents the two bias vectors in the third graph attention network, W (4) 1 represents the weight matrix in the third-graph attention network, w2 represents the weight vector in the third-graph attention network, T represents transposition, represents the score-aware interaction vector f τj The unnormalized importance factor of , σ represents the ReLU activation function; The score perception interaction vector f τj The unnormalized importance factor is normalized to obtain the score-aware interaction vector f τj The importance factor μ jτ , as shown below: The rating perception interaction vector of each user in the rating user set B(j) of the jth product and its corresponding importance factor are aggregated through the user aggregation function to obtain the product representation vector of the jth product: z j =σ(W (4) ·{∑ τ∈B(j) m τj f τj }+b (4) ); Among them, z j The product representation vector for the j-th product, W (4) and b (4) Represents the weight matrix and bias of the user aggregation function.
5. The Internet insurance product recommendation method based on neighbor-enhanced graph attention network according to claim 1 is characterized in that: Inputting the user representation vector and the product representation vector into the rating prediction unit to perform rating prediction based on the fifth multi-layer perceptron to obtain predicted values of all unknown rating data in the user-product interaction matrix, specifically including: The i-th user u i The user representation vector h i The product of the j-th product is represented by the vector z j After splicing, it is input into the fifth multi-layer perceptron to obtain the i-th user u i The predicted value of the rating data for the jth product is shown in the following formula: Among them, r ij ' represents the i-th user u i The predicted value of the rating data of the jth product, g1 represents the i-th user u i The user representation vector h i The product of the j-th product is represented by the vector z j The vector obtained after splicing is Respectively represent the output of each hidden layer in the fifth multi-layer perceptron, Respectively represent the weight matrix of each hidden layer in the fifth multilayer perceptron, They respectively represent the bias term of each hidden layer in the fifth multilayer perceptron, L5 represents the total number of hidden layers in the fifth multilayer perceptron, and w represents the weight vector in the fifth multilayer perceptron.
6. The Internet insurance product recommendation method based on neighbor-enhanced graph attention network according to claim 1 is characterized in that: The loss function Loss of the rating data prediction model is: Where |O| is the number of observed ratings, r ij ' represents the i-th user u i The predicted value of the rating data for the jth product, r ij represents the i-th user u i The true value of the rating data for the j-th product.
7. An Internet insurance product recommendation device based on a neighbor-enhanced graph attention network, characterized in that: include: A data acquisition module is configured to acquire a user set and an Internet insurance product set and construct a user-product interaction matrix, wherein the elements in the user-product interaction matrix are the known or unknown rating data of the user on the product, and a user-user social relationship graph is constructed based on the user set; A model building module is configured to build and train a rating data prediction model to obtain a trained rating data prediction model, wherein the trained rating data prediction model includes a user representation vector generation unit based on a neighbor-enhanced graph attention network, a product representation vector generation unit based on a graph attention network, and a rating prediction unit; The prediction module is configured to input the user-product interaction matrix and the user-user social relationship graph into the trained rating data prediction model, obtain the neighbor set of each user according to the user-user social relationship graph, obtain the interactive product set of each user and the rating user set of each product according to the user-product interaction matrix, and obtain the user embedding vector, product embedding vector and rating embedding vector according to the user-product interaction matrix; the user embedding vector, product embedding vector, rating embedding vector and the neighbor set of each user are input into the user representation vector generation unit, and product aggregation based on the first multi-layer perceptron is performed according to the product embedding vector and the rating embedding vector to obtain the first user A potential representation vector is generated by performing social aggregation based on a second multi-layer perceptron according to the product embedding vector, the rating embedding vector and the neighbor set of each user to obtain a second user potential representation vector; the first user potential representation vector and the second user potential representation vector are concatenated and passed through a third multi-layer perceptron to obtain a user representation vector; the user embedding vector and the rating embedding vector are input into the product representation vector generation unit to perform user aggregation based on a fourth multi-layer perceptron to obtain a product representation vector; the user representation vector and the product representation vector are input into the rating prediction unit to perform rating prediction based on a fifth multi-layer perceptron to obtain predicted values of all unknown rating data in the user-product interaction matrix; The recommendation module is configured to perform Top-k recommendations on the rating data corresponding to each user based on the predicted values of all unknown rating data in the user-product interaction matrix and all known rating data in the user-product interaction matrix to obtain a recommended product sequence for each user.
8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
