A Service Recommendation Method Based on Deep Matrix Factorization and Knowledge Graph

Through the combination of deep matrix decomposition and knowledge graph, a government service recommendation model is built, which solves the problem of sparse user data and insufficient utilization of heterogeneous multi-source data in government services, and achieves more accurate and interpretable personalized recommendations.

CN116662564BActive Publication Date: 2025-07-29CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310584709.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2025-07-29
Estimated Expiration
2043-05-23

Smart Images

  • Figure CN116662564B_ABST
    Figure CN116662564B_ABST
Patent Text Reader

Abstract

The present invention relates to a service recommendation method based on deep matrix factorization and knowledge graph. This method constructs a government service knowledge graph using government service item data, models the entity context and entity description text information of the knowledge graph through a knowledge representation method, and combines knowledge representation learning and personalized recommendation in a joint learning manner to obtain an optimal GKGR model. Finally, the scores of each pair of users and service items are predicted, and service items with higher scores are recommended to users in the form of a recommendation list. This method uses a neural network to extract features of users and service items, makes full use of user behavior data, and effectively alleviates the problem of data sparsity; models the entity context and entity description text information through a knowledge representation method, jointly learns the knowledge representation task and the personalized recommendation task, improves the accuracy and interpretability of the recommendation results, and effectively alleviates the cold start problem of government service recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of government service recommendation, and particularly to a service recommendation method based on deep matrix factorization and knowledge graph. Background Art

[0002] "Internet + government service" combines traditional government service methods with modern Internet technologies, realizing convenient interaction and information exchange between the government and citizens, improving the efficiency, transparency, and fairness of government services, and also promoting digital transformation and smart city construction. However, with the construction of city-level one-stop service platforms, government service resources are huge, scattered, diverse in types, and complex in levels. Government services are provided to citizen users and often require personalized information services. How to filter out the required service items from a vast amount of urban government services and recommend them to users is a pain point and difficult problem faced by one-stop city service platforms. In personalized recommendation technology, traditional collaborative filtering recommendation algorithms are widely used and technically mature, but they are difficult to handle the data sparsity problem faced in the personalized recommendation scenario of government services. Summary of the Invention

[0003] The purpose of the present invention is to provide a service recommendation method based on deep matrix factorization and knowledge graph, aiming to solve the problems of sparse user data and the failure to fully utilize a large amount of heterogeneous, multi-source, and loosely organized data when making government service recommendations.

[0004] To solve the above technical problems, the present invention adopts the following technical solutions: A service recommendation method based on deep matrix factorization and knowledge graph, comprising the following steps:

[0005] S1: Obtain an initial user vector based on the behavioral data generated during the interaction between the user and service items, and input the initial user vector into a fully connected layer, and the output is the user vector u i :

[0006] According to the behavioral data generated during the interaction between the user and service items, quantify the user behavioral data according to the measurement rules, and construct a user-service item behavior matrix where each row of the matrix represents an initial user vector, and the value R in the matrix ij represents the number of clicks of user i on service item j.

[0007] Construct a government service knowledge graph G, and represent the service item entities and relationships in a graph structure. Each service item entity is regarded as a node in the graph, and the relationship is regarded as an edge;

[0008] S2: Construct and train the GKGR model, and the GKGR model includes:

[0009] S2-1: Obtain the service item entity vector e according to the defined entity context information of the government service knowledge graph s ;

[0010] S2-2: Obtain the second service item entity vector e according to the defined entity description text of the government service knowledge graph d ;

[0011] S2-3: Obtain the final service item vector e according to the service item entity vector e s and the service item entity vector e d ;

[0012] S2-4: Given user i, service item entity j, and user-service item behavior matrix R ij , construct the user-service item preference pair <i, j, j'>, indicating that user i has an interaction with service item entity j and no interaction with service item j', that is, user i has a demand for service item j. Find the triples and entity description texts related to j and j' from G. Learn e s through the knowledge representation method of entity context, and learn the service item entity vector e d using Bi-LSTM. Fuse the two entity vectors through a gating mechanism, and input the user vector u i and the service item vector into the personalized ranking model.

[0013] When the objective function is maximized and no longer changes, the training ends, and the optimal GKGR model is obtained at this time;

[0014] S3: For a user, use S1 to obtain the user vector and input it into the optimal GKGR model. The optimal GKGR model calculates the association degree between the user and all service items, sorts them in descending order according to the association degree values, and outputs the service item sequence corresponding to the association degree values.

[0015] Preferably, the process of obtaining the service item entity vector e s in S2-1 is as follows:

[0016] The entity context information C(h, r, t) includes the neighbor context C n (h) and the path context C p (h, t).

[0017] The neighbor context C n (h) refers to the set of other nodes directly connected to the given node.

[0018] The path context C p (h, t) refers to the context information composed of all paths connected to the given node, that is, C(h, r, t) = C n (h) ∪ Cp (h, t).

[0019] The neighbor context of the service item entity h is defined by the following formula, where G represents the government service knowledge graph.

[0020]

[0021] Among them, h and t represent different service item entities, and r represents the relationship;

[0022] The path context of the service item entities h and t is defined by the following formula:

[0023]

[0024] Among them, p i is the relationship sequence from h to the entity t, L is the maximum length among all relationship paths, r1, represents other relationships passed by h to reach the entity t, e1, represents other entities passed by h to reach the entity t, and l i represents the i-th relationship.

[0025] The probability that the triple (h, r, t) holds is shown in the following formula.

[0026] f(h, r, t) = P((h, r, t)|C(h, r, t); θ) (3)

[0027] Among them, θ represents the parameters of the model. The higher the score of the scoring function f(·), the greater the probability that the triple holds.

[0028] For the pre-trained model TransE, when the triple (h, r, t) is input into TransE and the value of f(h, r, t) is the largest, the output of TransE is the service item entity vector e s .

[0029] Preferably, the following method is used to optimize the scoring function f(·):

[0030] By decomposing f(h, r, t) through conditional probability, the following can be obtained:

[0031] f(h, r, t) = P(h|C(h, r, t); θ) · P(t|C(h, r, t), h; θ) · P(r|C(h, r, t), h, t; θ) (4)

[0032] Among them, P(h|C(h, r, t); θ) represents the conditional probability of h appearing. Since the entity h is related to its neighbor context, P(h|C(h, r, t); θ) can be directly approximated as P(h|C n(h); θ) is defined as shown in the following formula.

[0033]

[0034] Where represents the degree of association between any entity and the context of the neighbors of entity h;

[0035] represents any head entity;

[0036] P(t|C(h,r,t),h; θ) represents the probability of entity t, and uses the path context to measure the degree of association between the head entity and the tail entity. P(t|C(h,r,t),h; θ) is approximately represented as P(t|C p (h,t),h; θ), which is defined as shown in the following formula.

[0037]

[0038] Among them, ε represents the set of tail entities, represents any tail entity;

[0039] P(r|C(h,r,t),h,t; θ) represents the conditional probability of the occurrence of relationship r. Since the entities h and t are determined and the entity context has been introduced, therefore, the entity context C(h,r,t) in P(r|C(h,r,t),h,t; θ) is omitted as shown in the following formula.

[0040]

[0041] P(h|C(h,r,t); θ), P(t|C(h,r,t),h; θ) and P(r|C(h,r,t),h,t; θ) in the scoring function are approximately represented as P(h|C n (h); θ), P(t|C p (h,t),h; θ) and P(r|h,t; θ), as shown in the following formula.

[0042] f(h,r,t) ≈ P(h|C n (h); θ) · P(t|C p (h,t),h; θ) · P(r|h,t; θ) (8)

[0043] Optimize the vector of entity context information by maximizing the scoring function f(h,r,t) = P((h,r,t)|C(h,r,t); θ).

[0044] Preferably, the process of obtaining the service item entity vector e d by the S2-2 from the entity description text of the government affairs knowledge graph is as follows:

[0045] Based on the constructed government service knowledge graph G, entity description texts are defined for service item entities, and the entity description texts include entity names, relationship names associated with the entities, and tail entity names;

[0046] The weight of the i-th position of the entity description text for a given relationship r is defined as α i (r), as shown in the following formula.

[0047]

[0048] Among them, among them, is the relationship vector obtained through representation learning, is the output of the i-th position, W a and U a are parameter matrices, is the parameter vector. e i (r) is the correlation between z i and the relationship r, and n represents the length of the entity description text.

[0049] The service item entity vector e d is defined as shown in the following formula.

[0050]

[0051] x1, x n represent the positions where the length of the entity description text is 1 and n respectively.

[0052] Preferably, the process of obtaining the final service item vector e by the S2-3 according to the service item entity vector e s and the service item entity vector e d is as follows:

[0053] e s and e d are fused through a gating mechanism to obtain e, which is defined as shown in the following formula.

[0054] e = β⊙e s +(1 - β)⊙e d (12)

[0055] Among them, β ∈ [0, 1] represents the gate for balancing the weights of the two representations.

[0056] Preferably, the objective function L is:

[0057]

[0058] v j = β⊙e sj +(1 - β)⊙e dj (15)

[0059] Among them, u i is the vector representation of user i, and v j , v j′ are the vector representations of government service item entities j and j′ respectively, and z represents the regularization term.

[0060]

[0061] Among them, f(h, r, t; g h , g t ) represents the scoring function of the knowledge representation learning part, and g h , g t are the gating sizes of the head entity and the tail entity respectively, h s , t s are the vectors of the entity context information of h and t respectively, and h d , t d are the vectors of the entity description text knowledge of h and t.

[0062] Compared with the prior art, the present invention has at least the following advantages:

[0063] S1 analyzes the characteristics of user behavior, constructs a user-service item behavior matrix, and uses a neural network to extract features of users and service items. It makes full use of user behavior data and effectively alleviates the problem of data sparsity. It solves the problems of insufficient personalization of government service recommendation methods and the sparsity of the traditional collaborative filtering technology for the user-service item matrix.

[0064] S2 uses government resource data to construct a government service knowledge graph, models entity context and entity description text information through knowledge representation methods, jointly learns knowledge representation tasks and personalized recommendation tasks, improves the accuracy and interpretability of recommendation results, and effectively alleviates the cold start problem of government service recommendation. It solves the problems of heterogeneous and multi-source government information resources and loose organization that have not been fully utilized. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 Knowledge-based government service recommendation example.

[0066] Figure 2 Steps for constructing a government ontology.

[0067] Figure 3 Government ontology structure.

[0068] Figure 4 Using protégé to construct a government ontology.

[0069] Figure 5 Partial RDF triples.

[0070] Figure 6 It is a structure diagram for describing text information of entities.

[0071] Figure 7 It is an architecture diagram of the method of the present invention.

[0072] Figure 8 It is an example diagram of triples. Specific implementation manners

[0073] The present invention will be further described in detail below.

[0074] By modeling user behavior, the present invention proposes a service recommendation method based on deep matrix factorization and knowledge graph (BDMF). Through a neural network, features of users and service items are extracted, and deep collaborative filtering is used to predict the degree of user demand for un-interacted service items. This BDMF does not consider the impact of service item-related information on user demand. In the government service scenario, each service item includes various information such as acceptance conditions, handling entities, exercise levels, service objects, etc. User demand is closely related to the above-mentioned item information. Reasonably using this service item information can effectively improve the recommendation accuracy of BDMF. As Figure 1 shown, when a user clicks on the "Enterprise Social Insurance Registration" service item, the acceptance condition of this item is "registration is required in the market supervision department", and the recommendation algorithm should consider this information to recommend service items with the implementing entity being the Market Supervision and Administration Bureau and related to enterprises for the user, such as: "Establishment registration of domestic-funded enterprises and branches (Company establishment registration)", "Establishment registration of foreign-funded enterprises and branches (Establishment registration of foreign-invested enterprises)", etc. In government service recommendation, the more similar the service item information is, the higher the reference value for user demand. Reasonably using the similarity between service item information can improve the accuracy of the algorithm and effectively alleviate the cold start problem of government service recommendation.

[0075] In the government service recommendation scenario, the potential demand of users is related to service item information. However, government service resources are huge, scattered, diverse in types, and complex in levels. Government service recommendation faces problems such as heterogeneous and multi-source government information resources, loose organization, and insufficient utilization. As a heterogeneous network containing rich semantic information, the knowledge graph can effectively represent entities and relationships in the knowledge graph in a low-dimensional continuous vector space by using knowledge representation methods, can reasonably utilize government resource data, and at the same time endow the knowledge graph with the capabilities of fusion, reasoning, and application, so as to improve the accuracy of government service recommendation.

[0076] Construction of government service knowledge graph

[0077] The knowledge graph can be logically divided into a schema layer and a data layer. The schema layer is the core of the knowledge graph, storing refined knowledge and defining and standardizing the data hierarchy and categories in the domain. An ontology library is usually used to manage the schema layer of the graph, and the rules, axioms, constraints, etc. in the ontology library are used to standardize the associations between entities, relationships, and the types and attributes of entities in the graph.

[0078] The data layer is responsible for the specific storage of specific triples in the knowledge graph. Structurally, it is below the schema layer and is the actual manifestation of the entire knowledge graph. In the data layer, triples are stored in a graph database through two expression forms: <entity, relationship, entity> and <entity, attribute, value>, as Figure 8 shown.

[0079] The construction process of the knowledge graph starts from obtaining the original knowledge data, and uses knowledge processing techniques (including automatic or semi-automatic) to extract the required knowledge elements from the original data. Storage is performed according to the definitions of the schema layer and the data layer. A large amount of heterogeneous knowledge forms a huge entity relationship network through the structure definition of the schema layer and the processing of the data layer, thus constructing the knowledge graph. The knowledge graph is constructed based on the prior knowledge of domain experts.

[0080] A service recommendation method based on deep matrix factorization and knowledge graph includes the following steps:

[0081] S1: Obtain an initial user vector based on the behavior data generated during the interaction between the user and the service item, and input the initial user vector into the fully connected layer. The output is the user vector u i :

[0082] Obtain the user vector based on user behavior and deep matrix factorization. According to the behavior data generated during the interaction between the user and the service item, quantify the user behavior data according to the measurement rules to construct a user-service item behavior matrix where each row of the matrix represents an initial user vector, and the value R in the matrix ij represents the number of clicks of user i on service item j.

[0083] Construct a government service knowledge graph G, and represent the relationship between service item entities with a graph structure. Each service item entity is regarded as a node in the graph, and the relationship is regarded as an edge;

[0084] S2: Construct and train the GKGR model, and the GKGR model includes:

[0085] S2-1: Obtain the service item entity vector e according to the defined entity context information of the government service knowledge graph s ;

[0086] S2-2: Obtain the second service item entity vector e according to the entity description text defined by the government service knowledge graph d ;

[0087] S2-3: According to the service item entity vector e s and the service item entity vector e d obtain the final service item vector e;

[0088] S2-4: Adopt the method of joint training, and learn the vector representations of users, service item entities, and relationships by combining user-service item behavior data and government affairs knowledge graph data. Given user i, service item entity j, and the user-service item behavior matrix R ij , construct the user-service item preference pair <i, j, j'>, indicating that user i interacts with service item entity j and does not interact with service item j', that is, user i has a demand for service item j. Find the triples and entity description texts related to j and j' from G. Learn e s through the knowledge representation method of entity context, and use Bi-LSTM to learn the service item entity vector e d . Fuse the two entity vectors through a gating mechanism, and input the user vector and the service item vector into the personalized ranking model. The personalized ranking model adopts Bayesian personalized ranking, transforms the recommendation problem into a ranking problem, ranks all the items to be recommended in the system for each user, ranks the items liked by the user as far forward as possible, and finally recommends the top-K items in the sequence to the user.

[0089] When the objective function is maximized and no longer changes, the training ends, and the optimal GKGR model is obtained at this time;

[0090] S3: For a user, use S1 to obtain the user vector and input it into the optimal GKGR model. The optimal GKGR model calculates the association degree between the user and all service items, sorts them in descending order according to the size of the association degree value, and outputs the service item sequence corresponding to the association degree value.

[0091] Specifically, the process of obtaining the service item entity vector e s in S2-1 is as follows:

[0092] The entity context information includes neighbor context and path context. In the government service knowledge graph, given a service item entity, its neighbor context nodes include the type of service item, the implementing entity, the exercise level, etc. Introduce the knowledge representation method of entity context to encode the semantic information associated with the entity into a high-dimensional vector representation, which improves the representation ability of the model. Secondly, introducing the knowledge representation of entity context can better understand the semantic relationship between entities, such as the similarity and hierarchical structure between entities, and improve the interpretability of the recommendation system.

[0093] The entity context information C(h, r, t) includes the neighbor context C n (h) and the path context C p (h, t).

[0094] The neighbor context C n (h) refers to the set of other nodes directly connected to a given node.

[0095] The path context C p (h, t) refers to the context information composed of all paths connected to a given node, that is, C(h, r, t) = C n (h) ∪ C p (h, t).

[0096] The neighbor context of the service item entity h is defined as shown in the following formula, where G represents the government service knowledge graph.

[0097]

[0098] Among them, h, t represent different service item entities, and r represents the relationship;

[0099] The path context of the service item entities h and t is defined as shown in the following formula:

[0100]

[0101] Among them, p i is the relationship sequence from h to the entity t, L is the maximum length among all relationship paths, r1, represents other relationships passed by h to reach the entity t, e1, represents other entities passed by h to reach the entity t, l i represents the i-th relationship. The probability that the triple (h, r, t) holds is shown in the following formula.

[0102] f(h, r, t) = P((h, r, t)|C(h, r, t); θ) (3) Among them, θ represents the parameters of the model. The higher the score of the scoring function f(·), the greater the probability that the triple holds.

[0103] For the pre-trained model transE, when the triple (h, r, t) is input into transE and the value of f(h, r, t) is the largest, the output of transE is the service item entity vector e s .

[0104] Specifically, the following method is used to optimize the scoring function f(·):

[0105] By decomposing f(h, r, t) through conditional probability, we can obtain:

[0106] f(h, r, t) = P(h|C(h, r, t); θ) · P(t|C(h, r, t), h; θ) · P(r|C(h, r, t), h, t; θ) (4)

[0107] Among them, P(h|C(h, r, t); θ) represents the conditional probability of h occurring. Since the entity h is contextually related to its neighbors, P(h|C(h, r, t); θ) can be directly approximated as P(h|C n (h); θ), which is defined as shown in the following formula.

[0108]

[0109] Among them represents the degree of association between any entity and the neighbor context of entity h.

[0110] represents any head entity

[0111] P(t|C(h, r, t), h; θ) represents the probability of entity t. The degree of association between the head entity and the tail entity is measured using the path context. P(t|C(h, r, t), h; θ) is approximately represented as P(t|C p (h, t), h; θ), which is defined as shown in the following formula.

[0112]

[0113] Among them, ε represents the set of tail entities represents any tail entity

[0114] P(r|C(h, r, t), h, t; θ) represents the conditional probability of the relationship r occurring. Since the entities h and t are determined and the entity context has been introduced, the entity context C(h, r, t) in P(r|C(h, r, t), h, t; θ) is omitted as shown in the following formula

[0115]

[0116] In the scoring function, P(h|C(h, r, t); θ), P(t|C(h, r, t), h; θ), and P(r|C(h, r, t), h, t; θ) are approximately represented as P(h|C n (h); θ), P(t|C p (h, t), h; θ), and P(r|h, t; θ), as shown in the following formula

[0117] f(h, r, t) ≈ P(h|C n (h); θ) · P(t|Cp (h, t), h; θ)·P(r|h, t; θ) (8) Optimize the vector of entity context information by maximizing the scoring function f(h, r, t) = P((h, r, t)|C(h, r, t); θ).

[0118] Specifically, the S2-2 obtains the service item entity vector e according to the entity description text of the government affairs knowledge graph d The process is as follows:

[0119] Based on the constructed government affairs service knowledge graph G, define the entity description text for the service item entity. The entity description text includes the entity name, the relationship name associated with the entity, and the tail entity name;

[0120] The weight of the i-th position of the entity description text for the given relationship r is defined as α i (r), as shown in the following formula.

[0121]

[0122] Among them, among them, is the relationship vector obtained through representation learning, is the output of the i-th position, W a and U a are parameter matrices, is the parameter vector. e i (r)z i and the correlation of the relationship r, n represents the length of the entity description text.

[0123] The service item entity vector e d is defined as shown in the following formula.

[0124]

[0125] x1, x n respectively represent the positions where the length of the entity description text is 1 and n.

[0126] Specifically, the S2-3 obtains the final service item vector e according to the service item entity vector e s and the service item entity vector e d The process is as follows:

[0127] Fuse e s and e d through a gating mechanism to obtain e, which is defined as shown in the following formula.

[0128] e = β⊙e s +(1 - β)⊙e d (12)

[0129] Among them, β ∈ [0, 1] represents a gate for balancing the weights of the two representations.

[0130] Specifically, the objective function L is:

[0131]

[0132] v j = β ⊙ e sj + (1 - β) ⊙ e dj (15)

[0133] Among them, u i is the vector representation of user i, v j , v j′ are the vector representations of government service item entities j and j′ respectively, and z represents the regularization term.

[0134]

[0135] Among them, f(h, r, t; g h , g t ) represents the scoring function of the knowledge representation learning part, g h , g t are the gating sizes of the head entity and the tail entity respectively, h s , t s are the vectors of the entity context information of h and t respectively, h d , t d are the vectors of the entity description text knowledge of h and t. h s , r, t s are pre-trained through the TransE-based representation learning method, and h d , t d are obtained by performing representation learning on the entity description text.

[0136] Table 1 GKGR training process

[0137]

[0138] Experimental design and analysis

[0139] The present invention uses the service recommendation method based on user behavior and deep matrix factorization as the experimental baseline, analyzes the impact on the service recommendation result after adding the knowledge representation module, and verifies the recommendation method integrating the government service knowledge graph.

[0140] 1. Dataset

[0141] Construction method of negative example triples: Randomly select a service item that a user has never interacted with from the user-service item behavior data, search for the triples containing the entity of this service item in the government service knowledge graph, and perform negative sampling on it. The way of negative sampling is to replace the head entity or the tail entity in the triple to obtain triples and entity description texts that do not exist in the knowledge graph. By increasing the diversity of negative example samples, the algorithm can better learn the relationships between positive example triples and improve the accuracy of recommendations. Finally, the sampled negative examples and positive examples are used together to train and test the algorithm, and the positive-negative ratio is 1:3.

[0142] 2. Evaluation metrics

[0143] To ensure the consistency of the experiment, the evaluation metrics are the same as those used in the experiment of the service recommendation method based on user behavior and deep matrix factorization, namely HR, Precision, Recall, and F1 value.

[0144] In the experiment, the dimension of each model vector is set to 64. The network parameters are initialized using a Gaussian distribution with a mean of 0 and a variance of 0.001. The batch size is set to 64, the positive-negative sample ratio is 1:3, the learning rate is set to 0.01, the regularization coefficient is 0.001 for all, and the Adam optimizer is used for parameter optimization.

[0145] BDMF: The method proposed in the present invention.

[0146] BDMF+TransE: Use the TransE model to represent entities.

[0147] CKE: A recommendation system method based on collaborative knowledge base embedding.

[0148] ① Compare the differences in the recommendation effects between the method of the present invention and the comparative methods

[0149] The experimental results of each model under the HR, Precision, Recall, and F1 metrics are shown in Table 2 respectively.

[0150] Table 2 Comparative experiment results

[0151]

[0152] According to the analysis of experimental results, after integrating the government service knowledge graph, the GKGR, CKE, and BDMF+TransE models are all higher than the BDMF method in four indicators. Among them, the GKGR model proposed in this invention has increased by 5.08%, 17.53%, 10.58%, and 22.87% respectively in Precision, Recall, F1, and HR. In the models integrating the government service knowledge graph, the BDMF+TransE method is lower than the GKGR model and the CKE model in relevant indicators because it does not model the entity description text. The CKE model introduces entity description text on the basis of representing the government service knowledge graph by TransE, and the recommendation effect has been improved to a certain extent. The GKGR model proposed in this invention realizes the representation of entity path context and neighbor context through the knowledge representation of entity context on the basis of CKE. Compared with CKE, Precision, Recall, F1, and HR have increased by 5.76%, 3.77%, 5.6%, and 9.95% respectively, improving the government service recommendation effect, indicating that integrating the entity context of the government service knowledge graph can further improve the performance.

[0153] In the government service recommendation scenario, if the path context and neighbor context of two government service item entities are similar in the knowledge graph, the entity vector representations will be closer accordingly. When handling business on the government service platform, users usually find the pre-service of the service item according to information such as the acceptance conditions and exercise levels of the service item. By representing the entity description text of the service item, the semantic representation ability of the knowledge graph is enhanced. The recommendation model integrating the government service knowledge graph proposed in this invention makes full use of the relationships between government service item entities, introduces the entity context and entity description text of the government service knowledge graph, and balances the weights of entity description text and entity context information through a gating mechanism, which can achieve a better recommendation effect.

[0154] ② Compare the influence of different knowledge representation methods on the recommendation effect

[0155] To verify the impact of knowledge representation methods on recommendation results, four common TransX series models, namely TransE, TransH, TransR, and TransD, were selected and evaluated using Precision, Recall, F1, and HR evaluation metrics. The recommendation effects after using different knowledge representation methods are shown in Table 3. The experimental results indicate that in the government service recommendation task, the performance of TransH, TransR, and TransD is better than that of TransE. Among them, the TransD knowledge representation method performs best in terms of recommendation accuracy and recall rate, with an F1 value of 0.2897 and an HR value of 0.7661. However, the performance of TransE is not much different from that of TransD, and its model structure is simple and easy to train. Therefore, this experiment mainly focuses on training based on the TransE model.

[0156] Table 3 Influence of Different Representation Methods on Each Index

[0157]

[0158] ③ Compare the differences in the recommendation effects of different models on entity description texts

[0159] To verify the impact of entity description texts on recommendation results, four common models for representing entity description texts, namely Word2Vec, CNN, RNN, and Bi-LSTM, were selected and evaluated using Precision, Recall, F1, and HR evaluation metrics. The recommendation effects using different representation methods are shown in Table 4.

[0160] Table 4 Influence of Different Representation Methods on Each Index

[0161]

[0162] As shown in Table 4, in the modeling of entity description texts, RNN and Bi-LSTM, which are good at processing text sequences, have better effects and stronger abilities to extract features of entity description texts. Among them, Bi-LSTM introduces a gating mechanism on the basis of RNN, has a stronger ability to model entity description texts, and is 6.5% and 9.25% higher than RNN in terms of F1 and HR metrics respectively, improving the accuracy of government service recommendations.

[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

Claims

1. A service recommendation method based on deep matrix factorization and knowledge graph, characterized in that, It includes the following steps: S1: Obtain the initial user vector based on the behavior data generated during the user's interaction with the service item, and take the initial user vector as the input of the fully connected layer, and the output is the user vector u i : Quantify the user behavior data according to the measurement rules based on the behavior data generated during the interaction between the user and the service item, and construct a user-service item behavior matrix Each row of the matrix represents an initial user vector, and the value R in the matrix ij represents the number of clicks of user i on service item j; Construct a government service knowledge graph G, where the service item entities and relationships are represented by a graph structure. Each service item entity is regarded as a node in the graph, and the relationship is regarded as an edge; S2: Construct and train the GKGR model. The GKGR model includes: S2-1: Obtain the service item entity vector e according to the entity context information defined by the government service knowledge graph s ; S2-2: Obtain the second service item entity vector e according to the entity description text defined by the government service knowledge graph d ; The above-mentioned S2-3, according to the service item entity vector e s and the service item entity vector e d The process of obtaining the final service item vector e is as follows: Fuse e through a gating mechanism s with e d to obtain e, which is defined as shown in the following formula; e = β ⊙ e s + (1 - β) ⊙ e d Among them, β∈[0,1] represents the gate for balancing the weights of the two representations; S2-3: According to the service item entity vector e s and the service item entity vector e d obtain the final service item vector e; S2-4: Given user i, service item entity j, and user-service item behavior matrix R ij , a user-service item preference pair <i, j, j'> is constructed, indicating that user i interacts with service item entity j and does not interact with service item j', that is, user i has a demand for service item j. Triples and entity description texts related to j and j' are found from G, and e is learned through the knowledge representation method of entity context s , and Bi-LSTM is used to learn the service item entity vector e d , the two entity vectors are fused through a gating mechanism, and the user vector u i and the service item vector are input into the personalized ranking model; When the objective function is maximized and no longer changes, the training ends, and the optimal GKGR model is obtained at this time; The objective function L is: v j = β ⊙ e sj + (1 - β) ⊙ e dj Among them, u i is the vector representation of user i, v j , v j′ are the vector representations of government service item entities j and j′ respectively, z represents the regularization term, h and t represent different service item entities, and r represents the relationship; Among them, f(h, r, t; g h , g t ) represents the scoring function of the knowledge representation learning part, g h , g t are the gating sizes of the head entity and the tail entity respectively, h s , t s are the vectors of the entity context information of h and t respectively, h d , t d are the vectors of the entity description text knowledge of h and t; S3: For a user, use S1 to obtain the user vector and input it into the optimal GKGR model. The optimal GKGR model calculates the association degree between the user and all service items, and arranges them in descending order according to the magnitude of the association degree value, and outputs the service item sequence corresponding to the association degree value.

2. The service recommendation method based on deep matrix factorization and knowledge graph according to claim 1, wherein: The process of obtaining the service item entity vector e in S2-1 is as follows: s is as follows: The entity context information C(h, r, t) includes the neighbor context C n (h) and the path context C p (h, t); Neighbor context C n (h) refers to the set of other nodes directly connected to a given node; Path context C p (h, t) refers to the context information composed of all paths connected to a given node, that is, C(h, r, t) = C n (h) ∪ C p (h, t); The neighbor context of the service item entity h is defined as shown in the following formula, where G represents the government service knowledge graph; Among them, h and t represent different service item entities, and r represents the relationship; The path context of the service item entities h and t is defined as shown in the following formula: Among them, p i is the relationship sequence from h to entity t, L is the maximum length among all relationship paths, r1, represents other relationships through which h reaches entity t, e1, represents other entities through which h reaches entity t, l i represents the i-th relationship; The probability that the triple (h,r,t) holds is shown in the following formula; f(h,r,t)=P((h,r,t)|C(h,r,t);θ) (3) Among them, θ represents the parameters of the model. The higher the score of the scoring function f(·), the greater the probability that the triple holds; For the pre-trained model TransE, when the triple (h, r, t) is input into TransE and the value of f(h, r, t) is the largest, the output of TransE is the service matter entity vector e s 。 3. The service recommendation method based on deep matrix factorization and knowledge graph according to claim 2, characterized in that: Optimize the scoring function f(·) by the following method: By decomposing f(h,r,t) through conditional probability, we can get: f(h,r,t)=P(h|C(h,r,t);0)·P(t|C(h,r,t),h;θ)P(r|C(h,r,t),h,t;θ) (4) Among them, P(h|C(h,r,t);θ) represents the conditional probability when h appears, and is defined as shown in the following formula; Among them represents the degree of association between any entity and the context of the h-entity neighbors; Denote any head entity; P(t|C(h,r,t),h; θ) represents the probability of entity t, and uses the path context to measure the degree of association between the head entity and the tail entity. P(t|C(h,r,t),h; θ) is approximately expressed as P(t|C p (h,t),h; θ), which is defined as shown in the following formula; Among them, ε represents the set of tail entities, represents any tail entity; P(r|C(h,r,t),h,t;θ) represents the conditional probability when the relationship r appears. Since the entities h and t are determined and the entity context has been introduced, the entity context C(h,r,t) in P(r|C(h,r,t),h,t;θ) is omitted as shown in the following formula; P(h|C(h,r,t); θ), P(t|C(h,r,t),h; θ), and P(r|C(h,r,t),h,t; θ) in the scoring function are approximately represented as P(h|C n (h); θ), P(t|C p (h,t),h; θ), and P(r|h,t; θ), as shown in the following formula; f(h,r,t)≈P(h|C n (h); θ)·P(t|C p (h,t),h; θ)·P(r|h,t; θ) (8) Optimize the vector of entity context information by maximizing the scoring function f(h,r,t)=P((h,r,t)|C(h,r,t);θ).

4. The service recommendation method based on deep matrix factorization and knowledge graph according to claim 3, wherein: The process of the S2-2 obtaining the service item entity vector e according to the entity description text of the government affairs knowledge graph is as follows: d is as follows: Based on the constructed government service knowledge graph G, define entity description texts for service item entities. The entity description texts include entity names, relationship names associated with the entities, and tail entity names; The weight of the $i$-th position of the entity description text for a given relation $r$ is defined as $\alpha$ i (r), as shown in the following formula; Among them, among them, is the relational vector obtained through representation learning, is the output at the i-th position, W a and U a are parameter matrices, is the parameter vector; e i (r) is the correlation between z i and the relation r, and n represents the length of the entity description text; Service item entity vector e d It is defined as shown in the following formula; x1, x n respectively represent the positions where the lengths of the entity description texts are 1 and n.