A symptom-disease search method based on a mental health knowledge graph
By using a graph-based relational reasoning method, the mental health knowledge graph is completed, which solves the problems of complex data processing and poor relational reasoning performance, and achieves more accurate symptom-disease search and logical association.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies for building and maintaining knowledge graphs involve complex and costly data processing, making it difficult to guarantee quality. Furthermore, relational reasoning techniques are not effective in completing knowledge graphs, failing to effectively uncover missing information and impacting applications in downstream tasks.
We employ a graph-based relational reasoning approach, utilizing graph structure mining, bidirectional feature enhancement, and high-order graph neural networks to complete the mental health knowledge graph and enable symptom-disease search.
It improves the search accuracy of knowledge graphs, enriches entity semantic features and relation semantic features, enhances the logical connection between mental health diseases and symptoms, and provides reliable knowledge support.
Smart Images

Figure CN116757281B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge graph relational reasoning technology, specifically involving a symptom-disease search method based on a mental health knowledge graph. Background Technology
[0002] The development of knowledge graphs has been rapid in recent years, but it has also encountered many intractable problems. Firstly, current online data is multi-sourced and heterogeneous, and its quality is difficult to guarantee. Manually processing and cleaning data, and then extracting and constructing knowledge using non-intelligent methods, is not only complex and cumbersome but also relatively costly. This hinders the later updating and maintenance of the constructed knowledge graph, necessitating the continuous use of new graph reasoning techniques to uncover missing information. Furthermore, many knowledge graphs in real life lack missing relationships, making relational reasoning a primary method for knowledge graph completion. Relational reasoning mainly involves in-depth mining of existing large amounts of data to infer and complete the relationships within the data, providing knowledge services for many downstream tasks. Relational reasoning also has many application needs, such as information retrieval systems, intelligent question-answering systems, and intelligent search engines. Therefore, researching efficient representation and reasoning of knowledge graphs is essential. Summary of the Invention
[0003] To address the aforementioned shortcomings in existing technologies, the knowledge graph completion method based on graph structure relational reasoning provided by this invention integrates structural features of the mental health knowledge graph, such as neighbor information and relational information, into the representation learning process, thereby achieving higher-performance knowledge graph reasoning and obtaining more accurate search results.
[0004] To achieve the aforementioned objectives, the technical solution adopted by this invention is as follows: a symptom-disease search method based on a mental health knowledge graph, comprising the following steps:
[0005] S1. Graph structure mining is used to extract the directed closed subgraphs around the target nodes of the target entities in the knowledge graph of mental health.
[0006] S2. Combine the semantic relationships between nodes to perform bidirectional feature enhancement on the directed closed subgraph;
[0007] S3. Divide the directed closed subgraph after bidirectional feature enhancement into node subgraphs and edge subgraphs, and update their representations through a high-order graph neural network to obtain node subgraph embeddings and edge subgraph embeddings.
[0008] S4. Concatenate the node subgraph embedding and the edge subgraph embedding to obtain a complete subgraph representation, and calculate the relationship probability between target entity pairs based on it, thereby realizing the completion of the mental health knowledge graph;
[0009] S5. Based on the completed mental health knowledge graph, users can search for disease information associated with a symptom by inputting that symptom, thus completing a symptom-disease search.
[0010] Further, step S1 specifically includes:
[0011] S11. Define the information flow in the triples of the mental health knowledge graph;
[0012] S12. Based on the defined information flow direction, extract all pairs of target entities in the knowledge graph that satisfy the preceding information flow. x Jump or back x Jumped child nodes;
[0013] S13, Settings x The initial value is 1;
[0014] S14. Determine whether the same entity is found between the x-steps of the head entity and the x-steps of the tail entity in the target entity pair.
[0015] If so, proceed to step S15;
[0016] If not, proceed to step S16;
[0017] S15. Determine whether there is a directed subgraph between the target entity and the corresponding target head node and target tail node;
[0018] S16, Order x The value is increased by 1, and the process returns to step S14 until all identical entities between the target entity pairs are found. These entities are then added to the directed subgraph to form a directed closed subgraph.
[0019] Furthermore, in step S2, the bidirectional enhancement of the features of the directed closed subgraph includes node embedding enhancement and edge embedding enhancement, and its implementation method is as follows:
[0020] S21. Based on the semantic relationships between nodes in a directed closed subgraph, calculate its edges. l Attention weight scalar;
[0021] S22, based on edge l The attention weight scalar is used to perform edge self-update and calculate the edge attention embedding after augmentation information;
[0022] S23. Based on edge attention embedding, update the target tail entity, and during the update process, update the embeddings of all nodes from the target head entity to the target tail entity, as well as their relative positions in the path from the target head entity to the target tail entity, thereby achieving node embedding enhancement.
[0023] Wherein, the target head entity and the target tail entity are two entities in the target entity pair to be supplemented that have an information flow relationship;
[0024] S24. Calculate the inverse mapping from the node to the edge after the node embedding enhancement, and then gather the target head entity information, relation information and target tail entity information on the edge to obtain the gathered edge information.
[0025] S25. Enhance the features of the directed closed subgraph by embedding the edge information after aggregation.
[0026] Furthermore, in step S21, the side l Attention weight scalar ;
[0027]
[0028] In the formula, For embedding of target triples in a directed closed subgraph, For the edge l Embedded information, Embedding of the target triple head entity. Embedding of the target triple relation. Embedding of the tail entity of the target triple. Embed the entity on the edge. Embedding of relationships on edges, Embed the tail entity on the edge. For splicing operations;
[0029] In step S22, edge attention embedding for:
[0030]
[0031] In the formula, The attention score is the value at the edge. For the edge after self-renewal l Attention score;
[0032] In step S23, the formula for updating the node embedding is:
[0033]
[0034]
[0035] In the formula, This is the information of the aggregated nodes. This is the adjacency matrix that connects each edge to its target tail entity. For the final node information, The relation matrix represents the node embedding iterations. k Second-rate, It is the first linear aggregation function;
[0036] In step S24, the aggregated edge information for:
[0037]
[0038] In the formula, To aggregate header information onto the edge, To aggregate relational information onto edges, To aggregate tail information onto the edges, T is the transpose matrix. This is the transpose of the relation matrix;
[0039] In step S25, the formula for edge embedding enhancement is:
[0040]
[0041] In the formula, For the enhanced edge embedding, Let be the first linear activation function. is the second linear activation function.
[0042] Further, step S3 specifically includes:
[0043] S3-1. Use a high-order graph neural network to enhance the features of the subgraph to obtain the representation of the subgraph;
[0044] The subgraph includes a node subgraph and an edge subgraph;
[0045] S3-2. Use a high-order graph neural network to enhance the nodes in the subgraph to obtain... k Subgraph representation;
[0046] S3-3, Using Top-k pooling to compress feature information from character images. k The representation information of the subgraph embedding is used to obtain the corresponding subgraph embedding.
[0047] Furthermore, in step S3-1, the representation of the node subgraph... for:
[0048]
[0049] Representation of edge subgraph for:
[0050]
[0051] In the formula, It is a ReLU activation function. Let be the first linear transformation matrix. This is the second linear transformation matrix. The subgraph of nodes is composed of k The neighbor subgraph is composed of neighboring nodes;
[0052] In step S3-2, the node subgraph corresponds to k The subgraph is represented as:
[0053]
[0054] In the formula, For nodes in the node subgraph For nodes in a node subgraph s of k A subgraph consisting of neighboring nodes for Nodes in;
[0055] The corresponding edge subgraph k The subgraph is represented as:
[0056]
[0057] In the formula, For nodes in the node subgraph For nodes in a node subgraph s of k A subgraph consisting of neighboring edges for The edges in;
[0058] In step S3-3, node subgraph embedding for:
[0059]
[0060] In the formula, This is a subgraph of nodes that has been downsampled. , This is a Top-k pooling method;
[0061] Edge subgraph embedding is as follows:
[0062]
[0063] In the formula, This is the downsampled edge subgraph. , This is the Top-k pooling method.
[0064] Further, step S4 specifically includes:
[0065] S41. Embed the node subgraph and edge subgraph embedding The input is processed through a two-layer MLP network to compress features, resulting in compressed node subgraph embeddings. and edge subgraph embedding ;
[0066] S42. Embed the compressed node subgraph and edge subgraph embedding The pieces are then stitched together to obtain the stitched embedding. ;
[0067] S43, embed the spliced parts The input is fed into the classifier to calculate the target entity pair. There is a relationship between them. probability fraction Based on the probability score, the relationship with the higher score is used to fill in the missing relationship between the target entity pairs, thereby completing the mental health knowledge graph.
[0068] Furthermore, in step S41, the compressed node subgraph is embedded. and edge subgraph embedding They are respectively:
[0069]
[0070]
[0071] In the formula, M 1 and M 2 represents two linear transformation matrices in a two-layer MLP network. b 1 and b 2 represents two bias terms in a two-layer MLP network. It is a ReLU activation function. T It is the transpose matrix;
[0072] In step S43, the probability fraction for:
[0073]
[0074] In the formula, For activation function, M 3 is the third linear transformation matrix. b 3 represents the bias term parameter. The beneficial effects of this invention are:
[0075] (1) This invention improves a relation prediction framework based on graph neural networks for inductive relation knowledge graph reasoning. Unlike embedding-based methods, this model can predict the relationship between nodes not seen during training, thereby improving the accuracy of symptom-disease search.
[0076] (2) This invention completes the knowledge graph of mental health, distinguishes the features of the subgraphs according to different graph structures from the perspectives of relationships and nodes, and constructs subgraphs with different structures. Then, it uses a high-order graph neural network to extract the high-order semantic features of subgraphs at different levels and organically integrates the high-order semantic information of subgraphs with different structure types, thereby obtaining more comprehensive entity semantic features and relational semantic features, improving the logical association between mental health diseases and symptoms, and realizing more reliable relational reasoning.
[0077] (3) This invention improves the information transmission mechanism on the graph structure in the mental health knowledge graph and introduces a node-edge bidirectional enhancement mechanism to enhance the information of nodes and edges in the subgraph, enriches the node embedding and edge embedding and semantic information content in the subgraph, realizes bidirectional feature enhancement between nodes and edges, improves the semantic representation quality of entities and relationships in the mental health knowledge graph, and provides reliable knowledge support for downstream tasks (such as psychological status analysis). Attached Figure Description
[0078] Figure 1 The flowchart of the knowledge graph completion method based on graph structure relation reasoning provided by the present invention is shown.
[0079] Figure 2 This is a schematic diagram of the knowledge graph completion method based on graph structure relational reasoning provided by the present invention. Detailed Implementation
[0080] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0081] This invention provides a symptom-disease search method based on a mental health knowledge graph, such as... Figure 1 As shown, it includes the following steps:
[0082] S1. Graph structure mining is used to extract the directed closed subgraphs around the target nodes of the target entities in the knowledge graph of mental health.
[0083] S2. Combine the semantic relationships between nodes to perform bidirectional feature enhancement on the directed closed subgraph;
[0084] S3. Divide the directed closed subgraph after bidirectional feature enhancement into node subgraphs and edge subgraphs, and update their representations through a high-order graph neural network to obtain node subgraph embeddings and edge subgraph embeddings.
[0085] S4. Concatenate the node subgraph embedding and the edge subgraph embedding to obtain a complete subgraph representation, and calculate the relationship probability between target entity pairs based on it, thereby realizing the completion of the mental health knowledge graph;
[0086] S5. Based on the completed mental health knowledge graph, search for disease information related to the symptom by inputting the symptom, and complete the symptom-disease search.
[0087] In this embodiment of the invention, in response to the problems of low quality and complex composition of existing mental health data, a large amount of mental health data is organized and a mental health knowledge graph is constructed. The knowledge graph reasoning method proposed in this invention is used to complete the missing relational information in the mental health knowledge graph. Using the mental health knowledge graph, specific symptoms can be input to search for disease information associated with these symptoms, and the mental state can be analyzed.
[0088] In this embodiment of the invention, in the triples of the knowledge graph, the path from the head node to the tail node through the relation may contain a contextual logical relationship between the head and tail nodes. That is, the path connecting two target nodes contains semantic feature information of the relation to be predicted, and such logical relationships are often irreversible. Therefore, when extracting subgraphs, we consider the directionality of the subgraphs. Based on this, step S1 in this embodiment is specifically as follows:
[0089] S11. Define the information flow direction in triples in a knowledge graph;
[0090] S12. Based on the defined information flow direction, extract all pairs of target entities in the knowledge graph that satisfy the preceding information flow. x Jump or back x Jumped child nodes;
[0091] S13, Settings x The initial value is 1;
[0092] S14. Determine whether the same entity is found between the x-steps of the head entity and the x-steps of the tail entity in the target entity pair.
[0093] If so, proceed to step S15;
[0094] If not, proceed to step S16;
[0095] S15. Determine whether there is a directed subgraph between the target entity and the corresponding target head node and target tail node;
[0096] S16, Order x The value is increased by 1, and the process returns to step S14 until all identical entities between the target entity pairs are found. These entities are then added to the directed subgraph to form a directed closed subgraph.
[0097] Traditional graph neural networks mostly use a one-way approach to enhance node and edge information in the graph structure. For a triple, the embedding information on each edge is unidirectionally enhanced by the head node embedding. However, this one-way information transmission mechanism cannot fully extract the contextual semantic information of the triple when dealing with directed graph structures. It only considers the head node information and ignores the fact that the tail node information and relational information are equally important for the transmission of feature information in the graph structure.
[0098] This invention introduces a bidirectional feature enhancement method. Before classifying the subgraph structure, a bidirectional enhancement mechanism is used to enrich the contextual information of nodes and edges, while considering head, relation and tail entities for context-aware computation.
[0099] Based on this, in step S2 of this embodiment of the invention, the bidirectional enhancement of the features of the directed closed subgraph includes node embedding enhancement and edge embedding enhancement, and its implementation method is as follows:
[0100] S21. Based on the semantic relationships between nodes in a directed closed subgraph, calculate its edges. l Attention weight scalar;
[0101] Among them, the edge l Attention weight scalar ;
[0102]
[0103] In the formula, For embedding of target triples in a directed closed subgraph, For the edge l Embedded information, Embedding of the target triple head entity. Embedding of the target triple relation. Embedding of the tail entity of the target triple. Embed the entity on the edge. Embedding of relationships on edges, Embed the tail entity on the edge. For splicing operations;
[0104] S22, based on edge l The attention weight scalar is used to perform edge self-update and calculate the edge attention embedding after augmentation information;
[0105] Side attention embedding for:
[0106]
[0107] In the formula, The attention score is the value at the edge. For the edge after self-renewal l Attention score;
[0108] S23. Based on edge attention embedding, update the target tail entity, and during the update process, update the embeddings of all nodes from the target head entity to the target tail entity, as well as their relative positions in the path from the target head entity to the target tail entity, thereby achieving node embedding enhancement.
[0109] The target head entity and the target tail entity are two entities in the target entity pair to be supplemented that have an information flow relationship;
[0110] Because the subgraph is directed, the directionality of information transmission must be guaranteed. Information can only flow from the head entity to the tail entity and cannot propagate backwards. In other words, for an edge... The embedding of this edge can only be used to update the tail entity, and cannot be used to update the head entity; therefore, the formula for updating the node embedding is:
[0111]
[0112]
[0113] In the formula, This is the information of the aggregated nodes. This is the adjacency matrix that connects each edge to its target tail entity. For the final node information, The relation matrix represents the node embedding iterations. k Second-rate, It is the first linear aggregation function;
[0114] S24. Calculate the inverse mapping from the node to the edge after the node embedding enhancement, and then gather the target head entity information, relation information and target tail entity information on the edge to obtain the gathered edge information.
[0115] Among them, the aggregated edge information for:
[0116]
[0117] In the formula, To aggregate header information onto the edge, To aggregate relational information onto edges, To aggregate tail information onto the edges, T is the transpose matrix. This is the transpose of the relation matrix;
[0118] S25. Enhance the features of the directed closed subgraph by embedding the edge information after aggregation.
[0119] The formula for edge embedding enhancement is as follows:
[0120]
[0121] In the formula, For the enhanced edge embedding, Let be the first linear activation function. is the second linear activation function.
[0122] In this embodiment of the invention, all target head entities, target relations, and target tail entities of the triple are utilized to enhance the context that has a close logical relationship with the target triple. During the node-edge bidirectional enhancement process in this embodiment, nodes can aggregate neighbor information during interactions to enhance the representation of their own embedded feature information.
[0123] Step S3 in this embodiment of the invention is specifically as follows:
[0124] S31. Use a high-order graph neural network to enhance the features of the subgraph to obtain a representation of the subgraph;
[0125] The subgraph includes a node subgraph and an edge subgraph;
[0126] Specifically, the representation of the node subgraph for:
[0127]
[0128] Representation of edge subgraph for:
[0129]
[0130] In the formula, It is a ReLU activation function. Let be the first linear transformation matrix. This is the second linear transformation matrix. The subgraph of nodes is composed of k The neighbor subgraph is composed of neighboring nodes;
[0131] In step S3-2, the node subgraph corresponds to k The subgraph is represented as:
[0132] S3-2. Use a high-order graph neural network to enhance the nodes in the subgraph to obtain... kSubgraph representation;
[0133] Among them, the node subgraph corresponds to k The subgraph is represented as:
[0134]
[0135] In the formula, For nodes in the node subgraph For nodes in a node subgraph s of k A subgraph consisting of neighboring nodes for Nodes in;
[0136] The corresponding edge subgraph k The subgraph is represented as:
[0137]
[0138] In the formula, For nodes in the node subgraph For nodes in a node subgraph s of k A subgraph consisting of neighboring edges for The edges in;
[0139] S3-3, Using Top-k pooling to compress feature information from character images. k The representation information of the subgraph embedding is used to obtain the corresponding subgraph embedding.
[0140] Among them, node subgraph embedding for:
[0141]
[0142] In the formula, This is a subgraph of nodes that has been downsampled. , This is a Top-k pooling method;
[0143] Edge subgraph embedding is as follows:
[0144]
[0145] In the formula, This is the downsampled edge subgraph. , This is the Top-k pooling method.
[0146] In step S31 of this embodiment, in order to fully explore the graph structure information of the subgraph during the local subgraph reasoning process, starting from a single node in the subgraph, the single node is connected to many relationships and develops into the entire graph network structure. In this method, we select a certain node, divide the neighbors of this node into node type and edge type, construct the node subgraph and edge subgraph of the single node, and then construct all nodes in the subgraph according to this scheme, thereby obtaining the hierarchical structure features of the local subgraph.
[0147] In step S32 of this embodiment, the higher-order graph neural network can better capture higher-order information in the graph structure. It enhances the node information by aggregating the features of the neighboring nodes of the target node in the subgraph and combining them with the feature information of the target node itself. The feature-enhanced subgraph is then classified, and the original subgraph structure is constructed layer by layer according to the above layering method. The constructed layered subgraphs are then input into the higher-order graph neural network layers for training, aggregating the first-order neighbors, second-order neighbors, and third-order neighbors of the subgraph structure respectively. Pooling is then used to compress the features of the subgraph representation trained by the higher-order graph neural network. Finally, the representation is aggregated through an MLP network to obtain the corresponding higher-order subgraph feature representation.
[0148] In step S33 of this embodiment, after updating the features of the node subgraph, since the feature maps of subgraphs of different orders have different sizes after being trained by the high-order graph neural network, the Top-k pooling method is used here to compress the feature maps.
[0149] Step S4 in this embodiment of the invention is specifically as follows:
[0150] S41. Embed the node subgraph and edge subgraph embedding The input is processed through a two-layer MLP network to compress features, resulting in compressed node subgraph embeddings. and edge subgraph embedding ;
[0151] Among them, the compressed node subgraph embedding and edge subgraph embedding They are respectively:
[0152]
[0153]
[0154] In the formula, M 1 and M 2 represents two linear transformation matrices in a two-layer MLP network. b 1 and b 2 represents two bias terms in a two-layer MLP network. It is a ReLU activation function.T It is the transpose matrix;
[0155] S42. Embed the compressed node subgraph and edge subgraph embedding The pieces are then stitched together to obtain the stitched embedding. ;
[0156] in,
[0157] In the formula, To test the skills;
[0158] S43, embed the spliced parts The input is fed into the classifier to calculate the target entity pair. There is a relationship between them. probability fraction Based on the probability score, the relationship to be predicted with the higher score is used to fill in the missing relationship between the target entity pairs, thereby achieving knowledge graph completion.
[0159] Among them, probability fraction for:
[0160]
[0161] In the formula, For activation function, M 3 is the third linear transformation matrix. b 3 represents the bias parameter.
[0162] Example 2:
[0163] This invention provides an experimental example of knowledge graph completion as described in Example 1;
[0164] In this embodiment, experiments were conducted on three different benchmark knowledge graph datasets: FB15k-237, NELL995, and WN18RR. Statistical data for these datasets are shown in Table 1. The datasets contain training and test subgraphs. Before constructing the training subgraph, we randomly selected several nodes among the pairs of target entities to be predicted and collected neighboring nodes (within a maximum of one hop) around these nodes, then merged these collected neighboring nodes. The same method was used to collect the neighboring nodes for generating the test subgraph.
[0165] Table 1: Statistical Data
[0166]
[0167] This experimental example uses AUC-PR, Mean Reverse Rank (MRR), and Hit@k to evaluate the proposed method. AUC-PR is defined as the area under the ROC curve. The binary classification model is evaluated using a rating index, which represents the probability that a predicted positive example will be ranked higher than a negative example. Generally, the higher the AUC value, the better the classifier's performance. MRR refers to the probability that, in a query, the first positive example is ranked higher than the second negative example. n The ranking of the first positive triplet found in a query is considered in the MRR (Mean Relationship Rank). In the specific calculation, a higher MRR value indicates better model performance. Hit@k refers to the ranking of the relation predicted by the inference algorithm. k The higher the proportion of bits occupied by Hit@k, the better the performance.
[0168] In this experiment, the parameters were set to a maximum path hop count of 3 hops. This means that for each target entity to be predicted, its 3-hop neighbors are collected to extract the subgraph. All embedding vectors were set to 64 dimensions, dropout to 0.5, learning rate to 0.0005, and batch size to 128. Additionally, in the higher-order graph neural network module, the top-k pooling ratio was set to 0.8. The test set was split in a 7:3 ratio.
[0169] This method primarily selected the GraIL model, NeuralLP model, DRUM model, and RuleN model to compare and analyze with the inference model proposed in this invention on the following three datasets, as shown in Tables 2, 3, and 4. By comparing with these four baseline models, the effectiveness of this method is verified.
[0170] Table 2: FB15K-237
[0171]
[0172] Table 3: NELL-995
[0173]
[0174] Table 4: WN18RR
[0175]
[0176] As can be seen from the experimental results in Tables 2, 3, and 4, compared with other baseline algorithm models based on logical rules, the inference model proposed in this method performs well on all three datasets, and the results fully demonstrate the effectiveness of the present invention.
[0177] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
[0178] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A symptom-disease search method based on a mental health knowledge graph, characterized in that, Includes the following steps: S1. Graph structure mining is used to extract the directed closed subgraphs around the target nodes of the target entities in the knowledge graph of mental health. S2. Combine the semantic relationships between nodes to perform bidirectional feature enhancement on the directed closed subgraph; S3. Divide the directed closed subgraph after bidirectional feature enhancement into node subgraphs and edge subgraphs, and update their representations through a high-order graph neural network to obtain node subgraph embeddings and edge subgraph embeddings. S4. Concatenate the node subgraph embedding and the edge subgraph embedding to obtain a complete subgraph representation, and calculate the relationship probability between target entity pairs based on it, thereby realizing the completion of the mental health knowledge graph; S5. Based on the completed mental health knowledge graph, users can search for disease information associated with a symptom by inputting that symptom, thus completing the symptom-disease search.
2. The symptom-disease search method based on mental health knowledge graph according to claim 1, characterized in that, Step S1 specifically involves: S11. Define the information flow in the triples of the mental health knowledge graph; S12. Based on the defined information flow, extract all pairs of target entities in the mental health knowledge graph that satisfy the preceding information flow. x Jump or back x Jumped child nodes; S13, Settings x The initial value is 1; S14. Determine whether the same entity is found between the x-steps of the head entity and the x-steps of the tail entity in the target entity pair. If so, proceed to step S15; If not, proceed to step S16; S15. Determine whether there is a directed subgraph between the target entity and the corresponding target head node and target tail node; S16, Order x The value is increased by 1, and the process returns to step S14 until all identical entities between the target entity pairs are found. These entities are then added to the directed subgraph to form a directed closed subgraph.
3. The symptom-disease search method based on mental health knowledge graph according to claim 2, characterized in that, In step S2, the bidirectional enhancement of the features of the directed closed subgraph includes node embedding enhancement and edge embedding enhancement, and its implementation method is as follows: S21. Based on the semantic relationships between nodes in a directed closed subgraph, calculate its edges. l Attention weight scalar; S22, based on edge l The attention weight scalar is used to perform edge self-update and calculate the edge attention embedding after augmentation information; S23. Based on edge attention embedding, update the target tail entity, and during the update process, update the embeddings of all nodes from the target head entity to the target tail entity, as well as their relative positions in the path from the target head entity to the target tail entity, thereby achieving node embedding enhancement. Wherein, the target head entity and the target tail entity are two entities in the target entity pair to be supplemented that have an information flow relationship; S24. Calculate the inverse mapping from the node to the edge after the node embedding enhancement, and then gather the target head entity information, relation information and target tail entity information on the edge to obtain the gathered edge information. S25. Enhance the features of the directed closed subgraph by embedding the edge information after aggregation.
4. The symptom-disease search method based on mental health knowledge graph according to claim 3, characterized in that, In step S21, the side l Attention weight scalar ; In the formula, For embedding of target triples in a directed closed subgraph, For the edge l Embedded information, Embedding of the target triple head entity. Embedding of the target triple relation. Embedding of the tail entity of the target triple. Embed the entity on the edge. Embedding of relationships on edges, Embed the tail entity on the edge. For splicing operations; In step S22, edge attention embedding for: In the formula, The attention score is the value at the edge. For the edge after self-renewal l Attention score; In step S23, the formula for updating the node embedding is: In the formula, This is the information of the aggregated nodes. This is the adjacency matrix that connects each edge to its target tail entity. For the final node information, The relation matrix represents the node embedding iterations. k Second-rate, It is the first linear aggregation function; In step S24, the aggregated edge information for: In the formula, To aggregate header information onto the edge, To aggregate relational information onto edges, To aggregate tail information onto the edges, T is the transpose matrix. This is the transpose of the relation matrix; In step S25, the formula for edge embedding enhancement is: In the formula, For the enhanced edge embedding, Let be the first linear activation function. This is the second linear activation function.
5. The symptom-disease search method based on mental health knowledge graph according to claim 1, characterized in that, Step S3 specifically involves: S3-1. Use a high-order graph neural network to enhance the features of the subgraph to obtain the representation of the subgraph; The subgraph includes a node subgraph and an edge subgraph; S3-2. Use a high-order graph neural network to enhance the nodes in the subgraph to obtain... k Subgraph representation; S3-3, Using Top-k pooling to compress feature information from character images. k The representation information of the subgraph embedding is used to obtain the corresponding subgraph embedding.
6. The symptom-disease search method based on mental health knowledge graph according to claim 5, characterized in that, In step S3-1, the representation of the node subgraph for: Representation of edge subgraph for: In the formula, It is a ReLU activation function. Let be the first linear transformation matrix. This is the second linear transformation matrix. The subgraph of nodes is composed of k The neighbor subgraph is composed of neighboring nodes; In step S3-2, the node subgraph corresponds to k The subgraph is represented as: In the formula, For nodes in the node subgraph For nodes in a node subgraph s of k A subgraph consisting of neighboring nodes for Nodes in; The corresponding edge subgraph k The subgraph is represented as: In the formula, For nodes in the node subgraph For nodes in a node subgraph s of k A subgraph consisting of neighboring edges for The edges in; In step S3-3, node subgraph embedding for: In the formula, This is a subgraph of nodes that has been downsampled. , This is a Top-k pooling method; Edge subgraph embedding is as follows: In the formula, This is the downsampled edge subgraph. , This is the Top-k pooling method.
7. The symptom-disease search method based on mental health knowledge graph according to claim 1, characterized in that, Step S4 specifically involves: S41. Embed the node subgraph and edge subgraph embedding The input is processed through a two-layer MLP network to compress features, resulting in compressed node subgraph embeddings. and edge subgraph embedding ; S42. Embed the compressed node subgraph and edge subgraph embedding The pieces are then stitched together to obtain the stitched embedding. ; S43, embed the spliced parts The input is fed into the classifier to calculate the target entity pair. There is a relationship between them. probability fraction Based on the probability score, the relationship with the higher score is used to fill in the missing relationship between the target entity pairs, thereby completing the mental health knowledge graph.
8. The symptom-disease search method based on mental health knowledge graph according to claim 7, characterized in that, In step S41, the compressed node subgraph is embedded. and edge subgraph embedding They are respectively: In the formula, M 1 and M 2 represents two linear transformation matrices in a two-layer MLP network. b 1 and b 2 represents two bias terms in a two-layer MLP network. It is a ReLU activation function. T It is the transpose matrix; In step S43, the probability fraction for: In the formula, For activation function, M 3 is the third linear transformation matrix. b 3 represents the bias parameter.
Citation Information
Patent Citations
Knowledge graph representation method based on pruning subgraph
CN114780750A
Double-target cross-domain recommendation method and system based on knowledge graph and multi-head attention
CN115760279A