CN115687431A - Food safety policy recommendation method, device and equipment based on meta-path - Google Patents

Food safety policy recommendation method, device and equipment based on meta-path Download PDF

Info

Publication number
CN115687431A
CN115687431A CN202211073023.6A CN202211073023A CN115687431A CN 115687431 A CN115687431 A CN 115687431A CN 202211073023 A CN202211073023 A CN 202211073023A CN 115687431 A CN115687431 A CN 115687431A
Authority
CN
China
Prior art keywords
user
food
data
food safety
recommendation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211073023.6A
Other languages
Chinese (zh)
Inventor
吴永宁
马大燕
潘登
张朝正
杨柳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China National Center For Food Safety Risk Assessment
Original Assignee
China National Center For Food Safety Risk Assessment
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China National Center For Food Safety Risk Assessment filed Critical China National Center For Food Safety Risk Assessment
Priority to CN202211073023.6A priority Critical patent/CN115687431A/en
Publication of CN115687431A publication Critical patent/CN115687431A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a food safety policy recommendation method, device and equipment based on a meta-path, relates to the technical field of machine learning, and aims to solve the problems that personalized recommendation of a food safety policy cannot be performed for a user in the prior art, and data sparsity and cold start exist in the prior art. The method comprises the following steps: respectively constructing a first composition corresponding to the user data and a second composition corresponding to the food data by adopting a meta-path; fusing the two isomorphic images serving as additional information with a bipartite image of a user-food safety policy to obtain a fused target heteromorphic image; inputting the recommendation probability of each piece of food safety policy information into a recommendation model; and recommending the food safety policy information for the user according to the recommendation probability. The method can realize personalized recommendation of food safety policies, enrich the representation of user and food policy information, and improve the accuracy of the model, thereby improving the reasoning ability of a recommendation system, and simultaneously relieving the problems of data sparsity and cold start.

Description

Food safety policy recommendation method, device and equipment based on meta-path
Technical Field
The invention relates to the technical field of machine learning, in particular to a food safety policy recommendation method, device and equipment based on a meta-path.
Background
The personalized recommendation refers to recommending information or commodities which are possibly interested by a user to the user by analyzing and mining user behaviors and discovering personalized requirements and interest characteristics of the user. The recommendation algorithm can automatically mine the interest and the preference of the user according to the historical behaviors of the user, so that personalized recommendation is provided for the user. The conventional recommendation algorithm (such as a collaborative filtering algorithm) generally has the problems of data sparsity and cold start.
People eat food as day and eat as first, so that the food safety is a big thing. The food safety risk factors are complicated and intricate, and relate to illegal additives, pesticide residues, microbial pollution, food raw material mildew and the like. The corresponding food safety policy and regulation types are various and comprise aspects of food safety risk monitoring, evaluation, communication, standard system revision and the like. Particularly, in the face of the rapid development of the domestic food industry and the deepening of food safety problems brought by international trade, the promotion and guidance of the food safety policy on the industry are urgently needed to be exerted.
In the internet era of continuous development and popularization, it is becoming a trend to use technical processing means such as big data and cloud computing to deeply mine user demands and conveniently and quickly provide accurate push of food security policies for the public. With the rapid development of artificial intelligence technology, how to perform user portrayal aiming at personal characteristics, social attributes and preferences in the society and realize accurate push of food safety policies becomes a key problem.
Therefore, a more reliable meta-path based food safety policy recommendation scheme is provided.
Disclosure of Invention
The invention aims to provide a food safety policy recommendation method, a device and equipment based on a meta-path, which are used for solving the problems that personalized recommendation of a food safety policy cannot be performed for a user in the prior art, and data sparsity and cold start exist in the prior art.
In order to achieve the above purpose, the invention provides the following technical scheme:
in a first aspect, the invention provides a meta-path-based food safety policy recommendation method, which includes:
acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
respectively constructing a first composition corresponding to the user data and a second composition corresponding to the food data by adopting a meta-path based on the user data and the food data;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information;
and recommending food safety policy information for the user according to the recommendation probability.
Optionally, before the fused target heteromorphic graph is input into the trained recommendation model and the recommendation probability of each food safety policy information is obtained, the method may further include:
performing graph representation learning on the nodes of the bipartite graph by adopting TransR, and determining output results as initial vector representations of the first isomorphic graph, the second isomorphic graph and the bipartite graph;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information, wherein the recommendation probability specifically comprises the following steps:
extracting node characteristics of the target abnormal graph by adopting a graph neural network; and based on the node characteristics, calculating by splicing and inner product to obtain the recommendation probability of each food safety policy information.
Optionally, the bipartite graph includes point information and side information, where the point information includes first point information and second point information; the first point information is used for representing a user, and the second point information is used for representing a food safety policy; the side information is used for representing the interactive information between the user and the food safety policy;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition, specifically comprising:
on the basis of the bipartite graph, adding 2 types of nodes and 2 types of relations to form a target abnormal graph with 4 types of nodes and 3 types of relations; wherein, the 4 kinds of nodes respectively represent users, food safety policies, user categories and food policy categories; the 3-type relations respectively represent the attribution relations between the user categories and the users, the interaction relations between the users and the food policies, and the attribution relations between the food policy categories and the food policies.
Optionally, the method uses a double-layer GNN network to extract node features;
the extracting the node features of the target abnormal graph by using the graph neural network specifically may include:
the formula is adopted:
Figure BDA0003829976290000031
performing graph convolution calculation to obtain node characteristics of the target abnormal graph; wherein the content of the first and second substances,
Figure BDA0003829976290000032
representing the input of GNN at layer l-1,
Figure BDA0003829976290000033
representing the output.
Optionally, before performing the graph convolution calculation, the method may further include:
the formula is adopted:
e N =max({e t ,t∈N(u)})
completing the aggregation of the neighbor nodes, wherein N (u) represents the set of the neighbor nodes of the node u, e t Representing the representation of the neighbor node t, the max function representing the maximum value obtained according to the vector column dimension direction, e N Representing the representation after the feature aggregation of the neighbor nodes;
the formula is adopted:
Figure BDA0003829976290000034
and finishing the aggregation between the node and the calculated representation after the feature aggregation of the neighbor node, wherein,
Figure BDA0003829976290000035
represents the output of the l-1 layer header entity, l represents the index of the layer, W u Representing the parameter to be trained.
Optionally, after extracting the node features of the target abnormal graph by using the graph neural network, the method may further include:
the outputs of the different layers need to be integrated to generate a final representation of user and food policy information:
Figure BDA0003829976290000036
Figure BDA0003829976290000037
wherein the content of the first and second substances,
Figure BDA0003829976290000038
in order to be represented by the end-user,
Figure BDA0003829976290000039
for final food policy information representation, | | | represents splicing operation;
using a formula
Figure BDA00038299762900000310
A recommendation prediction is made wherein,
Figure BDA00038299762900000311
indicating a recommended prediction result between the user and the food policy information.
Optionally, recommending food safety policy information for the user according to the recommendation probability may specifically include:
sorting the food safety policies from large to small according to the recommended probability to obtain a sorting result;
recommending the top N food safety policies meeting preset conditions in the sequencing result to the user, wherein N is a positive integer greater than or equal to 1.
In a second aspect, the present invention provides a meta-path based food safety policy recommendation apparatus, comprising:
the data acquisition module is used for acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
the graph building module is used for building a first homologous graph corresponding to the user data and a second homologous graph corresponding to the food data respectively by adopting a meta-path based on the user data and the food data;
the additional information adding module is used for fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target abnormal composition;
the recommendation probability determination module is used for inputting the fused target abnormal composition into a trained recommendation model to obtain the recommendation probability of each piece of food safety policy information;
and the food safety policy information recommendation module is used for recommending the food safety policy information for the user according to the recommendation probability.
In a third aspect, the present invention provides a meta-path based food security policy recommendation apparatus, comprising:
a communication unit/interface for acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
the processing unit/processor is used for respectively constructing a first homogeneous composition corresponding to the user data and a second homogeneous composition corresponding to the food data by adopting a meta-path based on the user data and the food data;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information;
and recommending food safety policy information for the user according to the recommendation probability.
In a fourth aspect, the present invention provides a computer storage medium having instructions stored therein, which when executed, implement the above-mentioned meta-path based food security policy recommendation method.
Compared with the prior art, the invention provides a food safety policy recommendation scheme based on a meta-path. Respectively constructing a first homologous composition corresponding to the user data and a second homologous composition corresponding to the food data by adopting a meta-path based on the acquired user data and the food data; fusing the two isomorphic images serving as additional information with a bipartite image of a user-food safety policy to obtain a fused target heteromorphic image; inputting the target abnormal figure into a recommendation model to obtain recommendation probability, and specifically adopting a figure neural network to extract node characteristics of the target abnormal figure; based on the node characteristics, calculating by splicing and inner product to obtain the recommendation probability of each food safety policy information; and recommending the food safety policy information for the user according to the recommendation probability. According to the method, the user data and the food data are based on, accurate user portrayal is conducted on the user, personalized recommendation of a food safety policy can be achieved, a plurality of new graph information are introduced into a user-food policy information bipartite graph, expression of the user and food policy information is enriched, accuracy of a model is improved, and accordingly reasoning capability of a recommendation system is improved. The idea based on the meta-path can enrich the node representation of the bipartite graph of the user-food safety policy information to a certain extent, and alleviate the problems of data sparsity and cold start.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a meta-path-based food security policy recommendation method according to the present invention;
FIG. 2 is a bipartite user-food safety policy provided by the present invention;
FIG. 3 is a schematic diagram of a meta-path based food security policy recommendation process provided by the present invention;
FIG. 4 is a target relief map provided by the present invention;
FIG. 5 is a schematic diagram of meta-paths in the meta-path-based food security policy recommendation method according to the present invention;
FIG. 6 is a schematic diagram of a principle of constructing a homogeneous graph based on meta-paths according to the present invention;
FIG. 7 is a schematic structural diagram of a meta-path-based food security policy recommendation apparatus according to the present invention;
fig. 8 is a schematic structural diagram of a meta-path-based food security policy recommendation apparatus according to the present invention.
Detailed Description
In order to facilitate clear description of technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish the same items or similar items having substantially the same functions and actions. For example, the first threshold and the second threshold are only used for distinguishing different thresholds, and the sequence order of the thresholds is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It is intended that the words "exemplary" or "such as" and "like" be used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b combination, a and c combination, b and c combination, or a, b and c combination, wherein a, b and c can be single or multiple.
In the prior art, the traditional recommendation algorithm (such as a collaborative filtering algorithm and the like) cannot well solve the problems of data sparsity and cold start.
In this regard, the present invention provides meta-path based food safety policy recommendations. The method is applied to a policy recommendation scene of a food security portal. In order to fully utilize rich interactive information in a recommendation scene, the method is based on a meta-path technology, and two isomorphic graphs of 'user-user' and 'food safety policy-food safety risk category' are generated as new inputs of a model through user data, food safety policy data, user category data and food policy category data. The construction of two isomorphic graphs provides beneficial information supplement for a user-food safety policy bipartite graph, thereby relieving the problems of data sparsity and cold start.
In order to simultaneously process two different types of graph data of a same graph and a bipartite graph (a heterogeneous graph), the invention provides a multi-task learning model which comprises two task modules, namely a recommended task (RS) module and a graph representation learning task (KGE) module, wherein the two task modules are alternately trained. And (3) performing graph representation learning on the nodes of the bipartite graph by using TransR, wherein the obtained node representations are used as initial vector representations of the three graphs, and then performing feature extraction by using a GNN (graph neural network) model. And finally, accurately applying the three types of graph representation information to the recommendation task, and improving the accuracy of recommendation. The model disclosed by the invention can be applied to the field of food safety policy information recommendation, track the food safety risk information concerned by the user, recommend the most reasonable food safety policy for the user, correctly play the promotion and guidance functions of the food safety policy on the industry and build a food safety protection wall together.
Next, the scheme provided by the embodiments of the present specification will be described with reference to the accompanying drawings:
fig. 1 is a schematic flow chart of a meta-path-based food security policy recommendation method provided by the present invention, and as shown in fig. 1, the flow chart may include the following steps:
step 110: acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data.
In step 110, the user category may be set according to different objectives, such as classification according to the topic label of food safety: such as nutrition and health, risk management, risk assessment, food-borne disease monitoring, illegal additives and the like; as classified by age: children (under 6 years old), teenagers (7-14 years old), young (15-35 years old), middle-aged (36-60 years old), and old (over 61 years old), such as browsing, clicking, and long-term access according to user behavior.
The food policy category can also be set according to different objectives, such as classifying according to the subject direction of the food security policy: such as nutrition legislation, risk exchange, risk assessment, food-borne disease monitoring, food safety strategies, etc. Such as according to nutrition Gu Shulei (staple food), animal food (meat), nuts, vegetables, fruits and bacteria algae, pure energy food, etc.; such as by processed food category: dairy products, beverages, instant foods, food additives and the like. As classified by food safety risk factors: including illegal additives, pesticide residues, microbial contamination, mildew of food materials, and the like.
Step 120: and respectively constructing a first homogeneous composition corresponding to the user data and a second homogeneous composition corresponding to the food data by adopting a meta-path based on the user data and the food data.
Two isomorphic graphs are generated by defining two meta paths of 'user-user category-user', 'food policy information-food policy information category-food policy information': the "user-user" diagram and the "food policy information-food policy information" diagram. Then, the user-food policy information bipartite graph is fused together and input into a recommendation model.
Step 130: and fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition.
On the basis of a bipartite graph of a user-food safety policy, additional information is introduced, and in the prior art, the additional information cannot be effectively utilized by a traditional recommendation algorithm, such as a collaborative filtering-based method, a cross-feature algorithm (FM, NFM, wide & Deep) and the like. In step 130 of the method, a first composition corresponding to the user data and a second composition corresponding to the food data are respectively constructed by adopting a meta-path as additional information, and the construction of the two compositions provides beneficial information supplement for a user-food safety policy bipartite graph, thereby relieving the problems of data sparsity and cold start.
Step 140: and inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information.
The recommendation model may be a model trained in advance based on historical data, such as: and training the obtained recommendation model based on the historical user data and the food data.
In order to simultaneously process two different types of graph data of a same graph and a bipartite graph (a heterogeneous graph), the invention provides a multi-task learning model which comprises two task modules, namely a recommended task (RS) module and a graph representation learning task (KGE) module, wherein the two task modules are alternately trained. And (3) performing graph representation learning on the nodes of the bipartite graph by using TransR, wherein the obtained node representations are used as initial vector representations of the three graphs, and then performing feature extraction by using a GNN (graph neural network) model. And finally, accurately applying the three types of graph representation information to the recommendation task, and improving the accuracy of recommendation. The model disclosed by the invention can be applied to the field of food safety policy information recommendation, track the food safety risk information concerned by the user, recommend the most reasonable food safety policy for the user, correctly play the promotion and guidance functions of the food safety policy on the industry and build a food safety protection wall together.
Step 150: and recommending food safety policy information for the user according to the recommendation probability.
When recommending, sorting the food safety policies from large to small according to the recommendation probability to obtain a sorting result; recommending the top N food safety policies meeting preset conditions in the sequencing result to the user, wherein N is a positive integer greater than or equal to 1. For example: and recommending the first three food safety policies to the user after sorting.
The method in fig. 1, by using meta-paths to respectively construct a first homogeneous composition corresponding to user data and a second homogeneous composition corresponding to food data based on the obtained user data and food data; fusing the two isomorphic images serving as additional information with a bipartite image of a user-food safety policy to obtain a fused target heteromorphic image; extracting node characteristics of the target abnormal graph by adopting a graph neural network; based on the node characteristics, calculating by splicing and inner product to obtain the recommendation probability of each food safety policy information; and recommending food safety policy information for the user according to the recommendation probability. According to the method, the user data and the food data are based on, accurate user portrayal is conducted on the user, personalized recommendation of a food safety policy can be achieved, a plurality of new graph information are introduced into a user-food policy information bipartite graph, expression of the user and food policy information is enriched, accuracy of a model is improved, and accordingly reasoning capability of a recommendation system is improved. The idea based on the meta-path can enrich the node representation of the bipartite graph of the user-food safety policy information to a certain extent, and alleviate the problems of data sparsity and cold start.
Based on the method of fig. 1, the embodiments of the present specification also provide some specific implementations of the method, which are described below.
Optionally, the bipartite graph referred to in the present invention is a bipartite graph formed by a user-food safety policy, as shown in fig. 2, where the edges of the graph are interaction information of the two, and the present invention constructs multiple graphs to predict user preferences according to user interactions with the food safety policy. The bipartite graph comprises point information and side information, wherein the point information comprises first point information and second point information; the first point information is used for representing a user, and the second point information is used for representing a food safety policy; the side information is used for representing the interaction information between the user and the food safety policy.
In practical application, the specific implementation process of the scheme can be described with reference to fig. 3: firstly, two isomorphic graphs are generated by defining two meta-paths of 'user-user category-user', 'food safety policy-food safety policy category-food policy information' based on a meta-path technology, and the two graphs of 'user-food safety policy' are combined together to be used as the input of a model. Graph representation learning is carried out on the bipartite graph by adopting TransR, the obtained node representation is used as an initial vector representation of the three graphs, and then feature extraction is carried out by adopting a GNN (graph neural network) model. And obtaining final node representation of the user and food policy information through vector splicing, and then obtaining recommendation probability through inner product calculation.
More specifically, the graphical representation learning and the user-food safety policy recommendation are treated as two separate, but related tasks, and a multi-task learning framework is adopted for alternate learning, and the work flow is shown in fig. 3:
(1) Graph construction
The invention introduces additional information into the recommendation system, integrates the additional information with the bipartite graph data of the user-food safety policy, and provides accurate, various and interpretable recommendations for users.
Firstly, on the basis of a user-food safety policy bipartite graph, the invention adds 2 types of nodes and 2 types of relations to form a heterogeneous graph of 4 types of nodes and 3 types of relations, as shown in figure 4. The 4 types of nodes are user, food policy Information, user category FUservers and food policy category CInformation respectively. In FIG. 4, from top to bottom, f i Representing user class node, u i Represents a user node, i i Representing food policy node, c i Representing a food policy category node. r is 1 Representing the affiliation between the user category and the user, r 2 Representing the interaction between the user and the food policy information (browse, click, long-term access, etc.), r 3 Representing an affiliation between the food policy category and the single policy information.
The invention converts the heterogeneous graph of fig. 4 into three different types of graphs based on meta-path technology. Two meta paths are defined, as shown in fig. 5, "policy information (Item) -policy category (CItem) -policy information (Item)" and "User (User) -User category (FUser) -User (User)", respectively. The two meta paths have different relationships except for the nodes. Through the relationship defined in the two meta-paths, two new isomorphism schemes can be constructed for the food safety policy and the user, as shown in fig. 6.
In the specific implementation process, the representation of each node and edge can be learned on the three types of graphs, and recommendation prediction can be made based on the representations.
(2) Graph representation learning
Aiming at the two-part graph of 'user-food safety policy' to carry out graph representation learning, the invention uses a TransR method applied to the field of knowledge graph, and the following relations between nodes and edges in the graph are assumed:
e h +e r ≈e t (1)
in the formula (1), e h Is the head entity vector, e r Is a relation vector, e t Is the tail entity vector. Calculating likelihood scores for the triplets (h, r, t) as follows:
Figure BDA0003829976290000111
in the formula (2), W r Is the parameter to be trained.
In order to make the nodes and edges in the graph satisfy the relationship of formula (1), the nodes and edges in the graph need to be constrained by the idea of distinguishing valid triples (h, r, t) from invalid triples (h, r, t'). Thus, the graph represents the loss function of the learning task as follows:
L KG =∑ (h,rt,t′)∈τ -lnσ(g(h,r,t′)-g(h,r,t)) (3)
in the formula (3), h and t represent a head entity and a tail entity respectively, t is a node (positive sample) adjacent to h, r represents a relation (edge) between the two, t' represents a tail entity (negative sample) not directly connected with h, and sigma is an activation function.
TransR can learn the representation of the point in the graph node, which can be the initial value of the node of the three graphs of 'user-food policy information', 'user-user', 'food safety policy-food safety policy category', namely
Figure BDA0003829976290000112
And
Figure BDA0003829976290000113
(3) Graph convolution calculation
Aiming at a bipartite graph of 'user-food safety policy' and two isomorphic graphs of 'user-user' and 'food safety policy-food safety policy category', the invention adopts a Graph Neural Network (GNN) to extract high-order characteristic information, and enhances the representation of user and food policy information nodes, thereby improving the performance of a recommendation model.
The GNN adopted by the invention mainly comprises two steps: the first step is as follows: aggregation of neighbor nodes; the second step is that: aggregation of aggregated representations of itself and neighboring nodes.
Taking the "user-food policy information" graph as an example, the feature aggregation process of the neighboring nodes of the user node u can be expressed as:
e N =max({e t ,t∈N(u)}) (4)
Figure BDA0003829976290000121
in formula (4), N (u) represents a set of nodes adjacent to node u, e t Representing the representation of the neighbor node t, the max function representing the maximum value obtained according to the vector column dimension direction, e N Representing the aggregated representation of the characteristics of the neighboring nodes. In the formula (5), the first and second groups,
Figure BDA0003829976290000122
is the output of the l-1 layer header entity, l is the index of the layer, W u Is the parameter to be trained. That is, the graph convolution calculation of the present invention can be generally expressed as:
Figure BDA0003829976290000123
in the formula (6), the reaction mixture is,
Figure BDA0003829976290000124
for the input of GNN at layer l-1,
Figure BDA0003829976290000125
is the output. Similarly, a food safety policy information node representation of the graph may be obtained
Figure BDA0003829976290000126
Then, the method is applied to the processing of the same composition of 'user-user' and 'food safety policy-food safety policy category' to obtain the node representation of the graph
Figure BDA0003829976290000127
And
Figure BDA0003829976290000128
the node characteristics can be extracted by using a double-layer GNN network in the scheme.
(4) Node association prediction
The outputs of the different layers need to be integrated to generate a final representation of user and food policy information:
Figure BDA0003829976290000129
Figure BDA00038299762900001210
in the formula (7), the reaction mixture is,
Figure BDA00038299762900001211
in order to be represented by the end-user,
Figure BDA00038299762900001212
for final food policy information representation, | | represents the splicing operation. And after the two expressions are obtained, recommendation prediction can be carried out:
Figure BDA00038299762900001213
in the formula (8), the reaction mixture is,
Figure BDA0003829976290000131
indicating a recommended prediction result between the user and the food policy information.
Thus, the penalty function for the recommended task is:
Figure BDA0003829976290000132
in equation (9), the food policy information i is from a positive sample, with interaction with user u; the food policy information j comes from a negative example, with no interaction with user u.
(5) Loss function
In conjunction with equations (3) and (9), the loss function of the model of the present invention can be expressed as:
Figure BDA0003829976290000133
in the formula (10), β and λ are adjustment parameters. L is a radical of an alcohol CF Loss function for the recommended task, L KG To represent the loss function of the learning task, L reg For penalty terms, O represents the set of user-food policy information pairs and τ represents the set of all nodes and edges in the graph. Theta generally refers to all parameters to be trained in model training, and the term realizes L2 regularization of model parameters, reduces model complexity and avoids the occurrence of overfitting.
The above scheme is explained in combination with an actual application scenario:
the graph structure may be a two-part graph, which is constructed by adding user categories (FUsers) and food policy information categories (cities), and actually provides attribute information for the user and food policy information. Various types of attribute information have been explained in the foregoing, and are not described in detail here.
Two isomorphic graphs are generated by defining two meta paths of 'user-user category-user', 'food safety policy-food safety policy category-food policy information': a "user-user" diagram, a "food safety policy-food safety policy category" diagram. And then input into the model of the invention together with a user-food safety policy bipartite graph.
Then, a recommendation model is trained, and the three graphs are input into the recommendation model. The graph representation learning can be performed on a graph of 'user-food policy information', the output representation of a user node and a food policy node is taken as the initial representation of three graph nodes of 'user-food policy information', 'user-user', 'food security policy-food security policy category', and the initial representation is brought into a graph neural network for feature extraction, and the recommendation probability is obtained through splicing and inner product calculation. Through model training, food policy information recommended by a user can be directly obtained.
And finally, sorting the food policy information recommended by the user according to the evaluation indexes, and outputting Top N to feed back to the user.
The scheme provided by the invention is applied to the policy recommendation task of the food security portal website, and the corresponding technical effects can comprise that:
1) User portrayal is carried out according to personal characteristics, social attributes and preferences in the society, accurate user portrayal can be carried out for users, personalized recommendation of food safety policies is achieved, and accurate pushing of the food safety policies is achieved.
2) And a multi-task learning framework is constructed, and the accuracy, diversity and interpretability of a recommendation algorithm are enhanced.
3) The recommendation model is a multitask model and comprises two modules, namely a recommendation task (RS) and a graph representation learning task (KGE), wherein the two modules are alternately trained. The meta-path technology introduces new information representation for the recommendation model, and the accuracy of the model is improved.
4) Based on the meta-path technology, two isomorphic graphs of 'user-user' and 'food safety policy-food safety policy category' are generated through user data, food safety policy data, user category data and food policy category data and are used as new inputs of a model. And a plurality of new graph information is introduced into the user-food safety policy bipartite graph, so that the representation of user and food policy information is enriched, and the reasoning capability of the recommendation system is improved. Beneficial information supplementation is provided for a user-food safety policy bipartite graph, thereby alleviating data sparsity and cold start problems.
5) The method is applied to the field of food safety policy information recommendation, the food safety risk information concerned by the user is tracked, the most reasonable food safety policy is recommended for the user, the promotion and guidance effects of the food safety policy on the industry are correctly exerted, and the food safety protection wall is built together.
Based on the same idea, the present invention further provides a meta-path-based food safety policy recommendation apparatus, as shown in fig. 7, the apparatus may include:
a data acquisition module 710 for acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
a graph construction module 720, configured to construct a first homologous graph corresponding to the user data and a second homologous graph corresponding to the food data by using a meta-path based on the user data and the food data, respectively;
an additional information adding module 730, configured to fuse the first composition and the second composition as additional information with a second composition of a user-food security policy to obtain a fused target composition;
the recommendation probability determination module 740 is configured to input the fused target heteromorphic image into a trained recommendation model to obtain recommendation probabilities of the food safety policy information;
and the food safety policy information recommending module 750 is configured to recommend the food safety policy information to the user according to the recommendation probability.
Based on the device in fig. 7, some specific implementation units may also be included:
optionally, the apparatus may further include:
the graph representation learning module is used for carrying out graph representation learning on the nodes of the bipartite graph by adopting TransR and determining output results as the first congruent graph, the second congruent graph and initial vector representation of the bipartite graph;
the recommendation probability determining module 740 may specifically include:
the node feature extraction unit is used for extracting the node features of the target abnormal graph by adopting a graph neural network; and based on the node characteristics, calculating by splicing and inner product to obtain the recommendation probability of each food safety policy information.
Optionally, the bipartite graph may include point information and side information, where the point information may include first point information and second point information; the first point information can be used for representing a user, and the second point information can be used for representing a food safety policy; the side information can be used for representing interaction information between a user and a food safety policy;
the additional information adding module 730 may be specifically configured to:
on the basis of the bipartite graph, adding 2 types of nodes and 2 types of relations to form a target heterogeneous graph with 4 types of nodes and 3 types of relations; wherein, the 4 kinds of nodes respectively represent users, food safety policies, user categories and food policy categories; the 3-type relations respectively represent the attribution relations between the user categories and the users, the interaction relations between the users and the food policies, and the attribution relations between the food policy categories and the food policies.
Optionally, the method uses a double-layer GNN network to extract node features; the node feature extraction unit may be specifically configured to:
the formula is adopted:
Figure BDA0003829976290000161
performing graph convolution calculation to obtain node characteristics of the target abnormal graph; wherein the content of the first and second substances,
Figure BDA0003829976290000162
representing the input of GNN at layer l-1,
Figure BDA0003829976290000163
representing the output.
Optionally, the node feature extraction unit may be further configured to:
the formula is adopted:
e N =max({e t ,t∈N(u)})
completion of neighborAggregation of nodes, where N (u) represents a set of nodes adjacent to node u, e t Representing the representation of the neighbor node t, the max function representing the maximum value obtained according to the vector column dimension direction, e N Representing the aggregated representation of the characteristics of the neighbor nodes;
the formula is adopted:
Figure BDA0003829976290000164
and finishing the aggregation between the node and the calculated representation after the feature aggregation of the neighbor node, wherein,
Figure BDA0003829976290000165
represents the output of the l-1 layer header entity, l represents the index of the layer, W u Representing the parameter to be trained.
Optionally, the apparatus may be further configured to:
the outputs of the different layers need to be integrated to generate a final representation of user and food policy information:
Figure BDA0003829976290000166
Figure BDA0003829976290000167
wherein the content of the first and second substances,
Figure BDA0003829976290000168
in order to be represented by the end-user,
Figure BDA0003829976290000169
for final food policy information representation, | | | represents splicing operation;
using a formula
Figure BDA00038299762900001610
A recommendation prediction is made wherein,
Figure BDA00038299762900001611
indicating a recommended prediction result between the user and the food policy information.
Optionally, the food safety policy information recommending module 750 may specifically include:
the sorting unit is used for sorting the food safety policy from large to small according to the recommended probability to obtain a sorting result;
and the food safety policy information recommending unit is used for recommending the first N food safety policies meeting the preset conditions in the sequencing result to the user, wherein N is a positive integer greater than or equal to 1.
Based on the same idea, the embodiment of the specification further provides a food safety policy recommendation device based on the meta-path. As shown in fig. 8. The method can comprise the following steps:
a communication unit/interface for acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
the processing unit/processor is used for respectively constructing a first homogeneous composition corresponding to the user data and a second homogeneous composition corresponding to the food data by adopting a meta-path based on the user data and the food data;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information;
and recommending food safety policy information for the user according to the recommendation probability.
As shown in fig. 8, the terminal device may further include a communication line. The communication link may include a path for transmitting information between the aforementioned components.
Optionally, as shown in fig. 8, the terminal device may further include a memory. The memory is used for storing computer-executable instructions for implementing the inventive arrangements and is controlled by the processor for execution. The processor is used for executing the computer execution instructions stored in the memory, thereby realizing the method provided by the embodiment of the invention.
As shown in fig. 8, the memory may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to. The memory may be separate and coupled to the processor via a communication link. The memory may also be integral to the processor.
Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in this embodiment of the present invention.
In one implementation, as shown in FIG. 8, a processor may include one or more CPUs, such as CPU0 and CPU1 in FIG. 8, for example.
In one embodiment, as shown in fig. 8, the terminal device may include a plurality of processors, such as the processor in fig. 8. Each of these processors may be a single core processor or a multi-core processor.
Based on the same idea, embodiments of the present specification further provide a computer storage medium corresponding to the foregoing embodiments, where the computer storage medium stores instructions, and when the instructions are executed, the method in the foregoing embodiments is implemented.
The above description mainly introduces the scheme provided by the embodiment of the present invention from the perspective of interaction between the modules. It is understood that each module, in order to implement the above functions, includes a corresponding hardware structure and/or software unit for performing each function. Those of skill in the art will readily appreciate that the present invention can be implemented in hardware or a combination of hardware and computer software, with the exemplary elements and algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed in hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The functional modules may be divided according to the above method examples, for example, the functional modules may be divided corresponding to the functions, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The memory may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and coupled to the processor via a communication link. The memory may also be integral to the processor.
Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in this embodiment of the present invention. In one possible implementation, a computer-readable storage medium is provided, in which instructions are stored, which when executed, are configured to implement the above-mentioned method.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims.
In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A food safety policy recommendation method based on a meta-path is characterized by comprising the following steps:
acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
respectively constructing a first composition corresponding to the user data and a second composition corresponding to the food data by adopting a meta-path based on the user data and the food data;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information;
and recommending food safety policy information for the user according to the recommendation probability.
2. The method according to claim 1, wherein before inputting the fused target profile into the trained recommendation model and obtaining the recommendation probability of each food safety policy information, the method further comprises:
performing graph representation learning on the nodes of the bipartite graph by adopting TransR, and determining output results as the first congruent graph, the second congruent graph and initial vector representation of the bipartite graph;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information, wherein the recommendation probability specifically comprises the following steps:
extracting node characteristics of the target abnormal graph by adopting a graph neural network; and based on the node characteristics, calculating by splicing and inner product to obtain the recommendation probability of each food safety policy information.
3. The method of claim 1, wherein the bipartite graph comprises point information and side information, wherein the point information comprises first point information and second point information; the first point information is used for representing a user, and the second point information is used for representing a food safety policy; the side information is used for representing the interactive information between the user and the food safety policy;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition, specifically comprising:
on the basis of the bipartite graph, adding 2 types of nodes and 2 types of relations to form a target abnormal graph with 4 types of nodes and 3 types of relations; wherein, the 4 kinds of nodes respectively represent users, food safety policies, user categories and food policy categories; the 3-type relations respectively represent the attribution relations between the user categories and the users, the interaction relations between the users and the food policies, and the attribution relations between the food policy categories and the food policies.
4. The method of claim 2, wherein the method uses a two-layer GNN network to extract node features;
extracting the node characteristics of the target abnormal graph by adopting a graph neural network, which specifically comprises the following steps:
the formula is adopted:
Figure FDA0003829976280000021
performing graph convolution calculation to obtain node characteristics of the target abnormal graph; wherein the content of the first and second substances,
Figure FDA0003829976280000022
representing the input of GNN at layer l-1,
Figure FDA0003829976280000023
representing the output.
5. The method of claim 4, further comprising, prior to performing the graph convolution calculation:
the formula is adopted:
e N =max({e t ,t∈N(u)})
completing the aggregation of the neighbor nodes, wherein N (u) represents the set of the neighbor nodes of the node u, e t Representing the representation of the neighbor node t, the max function representing the maximum value obtained according to the vector column dimension direction, e N Representing the aggregated representation of the characteristics of the neighbor nodes;
the formula is adopted:
Figure FDA0003829976280000024
the aggregation between the node itself and the computed representation after the feature aggregation of the neighboring nodes is completed, wherein,
Figure FDA0003829976280000025
represents the output of the l-1 layer header entity, l represents the index of the layer, W u Representing the parameter to be trained.
6. The method of claim 4, after extracting the node features of the target anomaly map using a map neural network, further comprising:
integrating the outputs of different layers to generate final representation of user and food policy information:
Figure FDA0003829976280000026
Figure FDA0003829976280000031
wherein the content of the first and second substances,
Figure FDA0003829976280000032
in order to be represented by the end-user,
Figure FDA0003829976280000033
policy information for end foodRepresenting, | | represents a splicing operation;
using a formula
Figure FDA0003829976280000034
A recommendation prediction is made wherein,
Figure FDA0003829976280000035
indicating a recommended prediction result between the user and the food policy information.
7. The method according to claim 1, wherein recommending food safety policy information for the user according to the recommendation probability specifically comprises:
sorting the food safety policies from large to small according to the recommended probability to obtain a sorting result;
recommending the top N food safety policies meeting preset conditions in the sequencing result to the user, wherein N is a positive integer greater than or equal to 1.
8. A meta-path based food safety policy recommendation apparatus, the apparatus comprising:
the data acquisition module is used for acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
the graph building module is used for building a first composition corresponding to the user data and a second composition corresponding to the food data respectively by adopting a meta-path based on the user data and the food data;
the additional information adding module is used for fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target abnormal composition;
the recommendation probability determination module is used for inputting the fused target abnormal composition into a trained recommendation model to obtain the recommendation probability of each piece of food safety policy information;
and the food safety policy information recommendation module is used for recommending the food safety policy information for the user according to the recommendation probability.
9. A meta-path based food safety policy recommendation apparatus, the apparatus comprising:
a communication unit/interface for acquiring user data and food data; the user data at least comprises user basic data and user category data; the food data at least comprises food safety policy data and food policy category data;
the processing unit/processor is used for respectively constructing a first homogeneous composition corresponding to the user data and a second homogeneous composition corresponding to the food data by adopting a meta-path based on the user data and the food data;
fusing the first composition and the second composition as additional information with a bipartite graph of a user-food safety policy to obtain a fused target composition;
inputting the fused target abnormal picture into a trained recommendation model to obtain the recommendation probability of each food safety policy information;
and recommending food safety policy information for the user according to the recommendation probability.
10. A computer storage medium having instructions stored thereon that, when executed, implement the meta-path based food security policy recommendation method of any of claims 1-7.
CN202211073023.6A 2022-09-02 2022-09-02 Food safety policy recommendation method, device and equipment based on meta-path Pending CN115687431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211073023.6A CN115687431A (en) 2022-09-02 2022-09-02 Food safety policy recommendation method, device and equipment based on meta-path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211073023.6A CN115687431A (en) 2022-09-02 2022-09-02 Food safety policy recommendation method, device and equipment based on meta-path

Publications (1)

Publication Number Publication Date
CN115687431A true CN115687431A (en) 2023-02-03

Family

ID=85061045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211073023.6A Pending CN115687431A (en) 2022-09-02 2022-09-02 Food safety policy recommendation method, device and equipment based on meta-path

Country Status (1)

Country Link
CN (1) CN115687431A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112182424A (en) * 2020-11-11 2021-01-05 重庆邮电大学 Social recommendation method based on integration of heterogeneous information and isomorphic information networks
CN113239264A (en) * 2021-04-07 2021-08-10 中国人民解放军战略支援部队信息工程大学 Personalized recommendation method and system based on meta-path network representation learning
US20210248651A1 (en) * 2019-10-31 2021-08-12 Huawei Technologies Co., Ltd. Recommendation model training method, recommendation method, apparatus, and computer-readable medium
CN114496165A (en) * 2022-01-27 2022-05-13 国家食品安全风险评估中心 Food diet recommendation method based on heteromorphic graph

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210248651A1 (en) * 2019-10-31 2021-08-12 Huawei Technologies Co., Ltd. Recommendation model training method, recommendation method, apparatus, and computer-readable medium
CN112182424A (en) * 2020-11-11 2021-01-05 重庆邮电大学 Social recommendation method based on integration of heterogeneous information and isomorphic information networks
CN113239264A (en) * 2021-04-07 2021-08-10 中国人民解放军战略支援部队信息工程大学 Personalized recommendation method and system based on meta-path network representation learning
CN114496165A (en) * 2022-01-27 2022-05-13 国家食品安全风险评估中心 Food diet recommendation method based on heteromorphic graph

Similar Documents

Publication Publication Date Title
CN111931062B (en) Training method and related device of information recommendation model
CN107330115B (en) Information recommendation method and device
CN111797321B (en) Personalized knowledge recommendation method and system for different scenes
CN110619081B (en) News pushing method based on interactive graph neural network
CN112418525B (en) Method and device for predicting social topic group behaviors and computer storage medium
CN113918832B (en) Graph convolution collaborative filtering recommendation system based on social relationship
CN113918834B (en) Graph convolution collaborative filtering recommendation method fusing social relations
CN113918833A (en) Product recommendation method realized through graph convolution collaborative filtering of social network relationship
CN112699310A (en) Cold start cross-domain hybrid recommendation method and system based on deep neural network
CN114496165A (en) Food diet recommendation method based on heteromorphic graph
Shaalan et al. Detecting singleton spams in reviews via learning deep anomalous temporal aspect-sentiment patterns
CN117390266B (en) Project recommendation method based on high-order neighbor generation algorithm and heterogeneous graph neural network
CN112364236A (en) Target object recommendation system, method and device, and data processing method and device
Yang et al. Birds of a feather linked together: A discriminative topic model using link-based priors
Mounika et al. Detection of stress levels in students using social media feed
Pasricha et al. A new approach for book recommendation using opinion leader mining
Sangeetha et al. Predicting personalized recommendations using GNN
CN115329215A (en) Recommendation method and system based on self-adaptive dynamic knowledge graph in heterogeneous network
CN115687431A (en) Food safety policy recommendation method, device and equipment based on meta-path
CN115809339A (en) Cross-domain recommendation method, system, device and storage medium
Yedjour et al. Extraction of the association rules from artificial neural networks based on the multiobjective optimization
Pariserum Perumal et al. FIRMACA-Fuzzy intelligent recommendation model using ant clustering algorithm for social networking
Aleksandrova Matrix factorization and contrast analysis techniques for recommendation
CN115062230B (en) Data processing method, apparatus, device, medium, and program product
CN115422470B (en) Relation perception news recommendation method, system and equipment based on news heterogeneous network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Ma Dayan

Inventor after: Pan Deng

Inventor after: Zhang Chaozheng

Inventor after: Wu Yongning

Inventor after: Yang Liu

Inventor before: Wu Yongning

Inventor before: Ma Dayan

Inventor before: Pan Deng

Inventor before: Zhang Chaozheng

Inventor before: Yang Liu

CB03 Change of inventor or designer information
RJ01 Rejection of invention patent application after publication

Application publication date: 20230203

RJ01 Rejection of invention patent application after publication