Medical knowledge graph completion method and system, terminal and medium

By combining large language models, comparative learning and conditional variational autoencoder methods, the problem of manual operation time-consuming and labor-intensive and automated technology prediction performance reduction in medical knowledge graph update and completion is solved, and accurate inference and completion of relationships not seen in medical knowledge graph are achieved, and the integrity and application efficiency of medical knowledge graph are improved.

CN119808927APending Publication Date: 2025-04-11SHANGHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510196824.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Existing medical knowledge graph updates and completion methods rely on manual operation by experts, are time-consuming and difficult to quickly and accurately reflect the latest medical knowledge, and automation technology reduces predictive performance and accuracy in the face of emerging medical entities and relationships.

Method used

Using a method based on large language model (LLM), contrast learning and conditional variational autoencoder (C-VAE), medical text descriptions are generated through large language models, initial embedding vectors of entities and relationships are extracted, and relationship embedding generation models are established using conditional variational autoencoder, and model parameters are optimized through comparison learning to achieve automatic inference and completion of relationships not seen in the medical knowledge graph.

Benefits of technology

It realizes accurate inference and completion of missing relationships in the medical knowledge graph, improves the integrity and application efficiency of the medical knowledge graph, reduces medical errors, assists in improving diagnostic efficiency, and supports the development of personalized medical services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808927A_ABST
    Figure CN119808927A_ABST
Patent Text Reader

Abstract

The invention provides a medical knowledge graph completion method and system, and the method and system achieve the precise deduction of medical entities and relationships through the combination of a large language model, comparative learning and a conditional variation auto-encoder. Wherein a plurality of rich text descriptions of the relationship are generated by utilizing a large language model, and semantic expression is enhanced; establishing a conditional distribution model of the relationship by adopting a conditional variation auto-encoder to realize knowledge migration from a known relationship to an unknown relationship; and the embedding space is optimized in combination with comparative learning, so that the relationship categories are more separated, and the categories are more compact. According to the invention, the model can be dynamically adjusted to adapt to a constantly changing medical data environment, and rapid response and complementation of new medical conditions are realized. According to the method, the integrity of the medical knowledge graph and the accuracy of auxiliary diagnosis support are remarkably improved, and solid technical support is provided for personalized medical services and intelligent auxiliary diagnosis and treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical information processing technology, and in particular, to a medical knowledge graph completion method, system, terminal and medium based on a large language model (LLM), contrastive learning and conditional variational autoencoder (C-VAE). Background Art

[0002] In the medical industry, knowledge graphs, as a key technology for integrating a variety of medical information (such as symptoms, treatment plans, drug reactions and their interactions), have been widely used in clinical decision support, medical research, and patient education. By constructing and analyzing complex relationships between entities, knowledge graphs can support advanced queries and data analysis, thereby improving the quality and efficiency of medical services. However, with the continuous deepening of medical research and the dynamic development of clinical practice, new medical discoveries and treatment methods continue to emerge, resulting in the existing medical knowledge graphs facing the problem of lagging information updates and missing relationships.

[0003] Traditional knowledge graph update and completion methods mainly rely on manual operations by experts, which is not only time-consuming and labor-intensive, but also difficult to quickly and accurately reflect the latest medical knowledge. In addition, although existing automated technologies (such as embedded representation learning and statistical inference methods) perform well in certain scenarios, these methods are mostly optimized for known data, and their prediction performance and accuracy are significantly reduced for newly emerging and unseen medical entities and relationships. This is because these technologies lack effective generalization capabilities, especially when faced with sparse data and emerging medical conditions, and it is difficult to provide reliable inferences.

[0004] In recent years, zero-shot learning has made significant progress in the fields of image and text processing as an effective means to solve the problem of category extrapolation. The core idea is to learn the deep features of existing categories and generalize this knowledge to unseen categories. However, directly applying these methods to medical knowledge graphs faces challenges: medical data is highly specialized and semantically complex, requiring the model to capture more detailed features and relationships. At present, no description or report of similar technologies to the present invention has been found, and similar materials at home and abroad have not been collected. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a medical knowledge graph completion method, system, terminal and medium based on a large language model (LLM), contrastive learning and conditional variational autoencoder (C-VAE), which aims to deal with the problem of unseen relationships in the knowledge graph, realize accurate inference of medical entities and relationships, and thus improve the integrity and application efficiency of the medical knowledge graph.

[0006] According to one aspect of the present invention, a method for completing a medical knowledge graph is provided, comprising:

[0007] Use a large language model to generate multiple rich medical text descriptions for each relationship;

[0008] Perform feature extraction on medical text descriptions to obtain initial embedding vectors of entities and relations;

[0009] A relation embedding generation model based on a conditional variational autoencoder is provided, wherein the relation embedding generation model is used to take a medical entity embedding vector as input and output a property prediction result of an unknown medical relationship;

[0010] The initial embedding vectors of the entities and relationships are used to train the relationship embedding generation model through a contrastive learning algorithm, and the parameters of the relationship embedding generation model are continuously optimized according to the output results of the relationship embedding generation model to obtain a medical knowledge graph completion model;

[0011] The medical knowledge graph completion model is used to predict the properties of the unknown medical relationships corresponding to the input medical entities, and the relationship states of each entity in the knowledge graph are obtained, which is then used to complete the medical knowledge graph.

[0012] According to another aspect of the present invention, a medical knowledge graph completion system is provided, comprising:

[0013] A rich text description generation module, which is used to generate multiple rich medical text descriptions for each relationship using a large language model;

[0014] Basic data acquisition module, which is used to extract features from medical text descriptions and obtain initial embedding vectors of entities and relationships;

[0015] A relation embedding generation model module, which is used to provide a relation embedding generation model based on a conditional variational autoencoder, wherein the relation embedding generation model is used to take a medical entity as input and output a property prediction result of an unknown medical relationship;

[0016] A model training module, which uses the initial embedding vectors of the entities and relationships to train the relationship embedding generation model through a contrastive learning algorithm, and continuously optimizes the parameters of the relationship embedding generation model according to the results output by the relationship embedding generation model to obtain a medical knowledge graph completion model;

[0017] A relationship prediction module uses the medical knowledge graph completion model to predict the properties of the unknown medical relationship corresponding to the input medical entity, obtains the relationship status of each entity in the knowledge graph, and then uses it to complete the medical knowledge graph.

[0018] According to a third aspect of the present invention, there is provided a computer terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, can be used to execute any one of the methods described above in the present invention, or to run the system described above in the present invention.

[0019] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can be used to execute any of the methods described above in the present invention, or to run the system described above in the present invention.

[0020] Due to the adoption of the above technical solution, the present invention has at least one of the following beneficial effects compared with the prior art:

[0021] The medical knowledge graph completion method, system, terminal and medium provided by the present invention focus on the completion of missing relationships in the medical knowledge graph, and adopt analysis and processing technology based on large language model (LLM), contrastive learning and conditional variational autoencoder (C-VAE) to realize automatic inference and completion of missing relationships in the medical knowledge graph, which not only helps to reduce medical errors and assist in improving diagnostic efficiency, but also supports the development of personalized medical services and promotes higher quality medical decisions and services.

[0022] The medical knowledge graph completion method, system, terminal and medium provided by the present invention effectively solve the problem of unknown relationships in the prior art, realize accurate inference and real-time monitoring of medical entities and relationships, and effectively improve the accuracy of medical diagnosis and the integrity of the knowledge graph.

[0023] The medical knowledge graph completion method, system, terminal and medium provided by the present invention combine the innovative data processing technology of large language model (LLM) contrastive learning and conditional variational autoencoder (C-VAE), use the large language model to generate rich text descriptions of relationships, enhance semantic expression; use conditional variational autoencoder to establish a conditional distribution model of relationships, realize knowledge transfer from known to unknown relationships; combine contrastive learning to optimize the embedding space, make the relationship categories more separated, and the categories more compact. Thus, the unseen relationships in the medical knowledge graph can be accurately predicted and completed.

[0024] The medical knowledge graph completion method, system, terminal and medium provided by the present invention significantly improve the real-time update capability and knowledge discovery efficiency of the medical knowledge graph, provide medical institutions with more accurate diagnosis and more efficient treatment support, and have important application value.

[0025] The medical knowledge graph completion method, system, terminal and medium provided by the present invention are not only innovative in the design of the algorithm model, but also break through the limitations of traditional methods in the integration of medical knowledge and algorithms; by combining rich medical data with algorithms that combine large language models, contrastive learning and conditional variational autoencoders, it is possible to more effectively identify and respond to complex problems in the medical field, thereby achieving comprehensive and accurate completion and expansion of the medical knowledge graph, and promoting the development of personalized medicine and intelligent diagnosis and treatment. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0027] Figure 1 This is a workflow diagram of a medical knowledge graph completion method in one embodiment of the present invention.

[0028] Figure 2 This is a working diagram of a medical knowledge graph completion method in a preferred embodiment of the present invention.

[0029] Figure 3 This is a schematic diagram of the component modules of the medical knowledge graph completion system in one embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] Since medical data is highly specialized and semantically complex, directly applying traditional knowledge graph technology to medical knowledge graphs faces challenges, and higher requirements are placed on the existing models' ability to capture features and relationships. In response to this requirement, an embodiment of the present invention provides a medical knowledge graph completion method that combines a large language model, contrastive learning, and a conditional variational autoencoder, wherein a large language model is used to generate multiple rich text descriptions of relationships, thereby enhancing semantic expression; contrastive learning enhances the model's ability to distinguish by maximizing the similarity between similar entities and minimizing the similarity between dissimilar entities; and the conditional variational autoencoder establishes a conditional distribution model of relationships, thereby realizing knowledge transfer from known to unknown relationships. This method can not only automatically complete missing information in the knowledge graph, but also adapt to the complexity and dynamic changes of medical data, thereby achieving rapid response and accurate completion of emerging medical conditions and treatment methods.

[0032] Specifically, Figure 1 As shown, the medical knowledge graph completion method provided in this embodiment may include the following operations:

[0033] S1, combine a large language model to generate multiple rich medical text descriptions for each relationship (i.e., medical relationship rich text descriptions), extract features from the medical text descriptions, and obtain the initial embedding vectors of entities (e.g., disease "diabetes", drug "metformin", symptom "thirst", examination indicator "increased blood sugar") and relationships (e.g., "treatment methods", "complications", "diagnostic basis", "drug indications");

[0034] S2, providing a relation embedding generation model based on a conditional variational autoencoder, wherein the relation embedding generation model is used to take a medical entity embedding vector as input and output a property prediction result of an unknown medical relationship;

[0035] S3, using the initial embedding vectors of entities and relationships to train the relation embedding generation model through a contrastive learning algorithm, and continuously optimizing the parameters of the relation embedding generation model according to the output of the relation embedding generation model to obtain a medical knowledge graph completion model;

[0036] S4, using the medical knowledge graph completion model to predict the properties of the unknown medical relationships corresponding to the input medical entities, obtain the relationship states of each entity in the knowledge graph, and then use it to complete the medical knowledge graph.

[0037] In some preferred implementations, the above S1, using a large language model to generate multiple medical text descriptions for each relationship, may further include:

[0038] S11, obtaining the required data or text materials, and performing preprocessing and generating rich text descriptions; wherein:

[0039] Preprocessing, including: data cleaning;

[0040] Rich text description generation includes: integrating a large language model to generate multiple (e.g., 5) different medical relationship rich text descriptions with detailed and rich context descriptions for each relationship, including but not limited to: relationship types, relationship attributes, and interaction methods between entities.

[0041] In some preferred implementations, the above S1, extracting features from the medical text description to obtain initial embedding vectors of entities and relationships, may further include the following operations:

[0042] S12, converting medical text description into prediction vector p s , expressed as:

[0043]

[0044] Among them, d i is the i-th rich text description, To use the word embedding function to describe the rich text d i The vector obtained by conversion, TE(·) is the designed text encoder;

[0045] S13, feature extraction, is used to extract effective information that can reflect entities and relationships from the original data, and combined with S12 to obtain the initial embedding vectors of entities and relationships.

[0046] In some preferred embodiments, the above S2, the relationship embedding generation model based on the conditional variational autoencoder, may further include: a conditional variational autoencoder module, the conditional variational autoencoder module is used to take the medical entity embedding vector as input and output the property prediction result of the unknown medical relationship; wherein:

[0047] The conditional variational autoencoder module, whose encoder is used to map the input feature vector x to a latent variable distribution z, generates a conditional probability q φ (z|x) is:

[0048]

[0049] In the formula, μ φ (x) and denote the mean and variance of the latent variables, respectively;

[0050] Conditional variational autoencoder module, whose decoder generates an output feature vector x according to the latent variables ′ , the output feature vector x ′ The conditional distribution p θ (x′|z) is:

[0051]

[0052] In the formula, μ θ (z) and denote the mean and variance of the output feature vector based on the latent variable distribution z, respectively.

[0053] In some preferred implementations, the above S3, using the initial embedding vectors of entities and relationships to train the relationship embedding generation model through a contrastive learning algorithm, and continuously optimizing the parameters of the relationship embedding generation model according to the results output by the relationship embedding generation model, may further include the following operations:

[0054] S31, construct a training sample set using the initial embedding vectors of entities and relations, where the training sample set contains normal relation instances and potential unseen relation instances;

[0055] S32, using the training sample set, the relation embedding generation model is trained by the contrastive learning algorithm; wherein the contrastive learning algorithm enhances the clustering of entity pairs with the same relation in the latent space by minimizing the loss function, and separates entity pairs with different relations at the same time. The loss function L contrastive It is expressed as:

[0056]

[0057] In the formula, sim(z i ,z j ) represents the similarity function between vectors, τ is the temperature parameter, z i and z j Represents the latent vector z of positive samples of the same class respectively k The latent vector representing the negative sample;

[0058] S33, the optimization goal of the conditional variational autoencoder module is to maximize the reconstruction accuracy and minimize the KL divergence between the potential distribution of the encoder output and the standard normal distribution. The reconstruction loss function L of the conditional variational autoencoder module is cvae for:

[0059]

[0060] Where, L cvae represents the total loss function of the conditional variational autoencoder module, which consists of two parts: reconstruction loss and KL divergence; p(z) represents the prior distribution of the latent variable distribution z;

[0061] S35, by jointly optimizing the above loss function L contrastive and L cvae , adjust the parameters of each encoder and decoder of the relation embedding generation model to obtain the medical knowledge graph completion model.

[0062] In some preferred implementations, the above S4, using the medical knowledge graph completion model to predict the properties of the unknown medical relationship corresponding to the input medical entity to obtain the relationship status of each entity in the knowledge graph, may further include the following operations:

[0063] S41, using the medical knowledge graph completion model to predict the properties of the unknown medical relationship corresponding to the input medical entity to obtain a relationship prediction result;

[0064] S42, process the relationship prediction results, and divide the processed relationship prediction results into normal and abnormal categories according to a preset threshold, obtain the relationship status of each entity in the knowledge graph, and identify possible abnormal situations and relationship error types.

[0065] In some preferred implementations, the above S42, processing the relationship prediction result, may further include the following operations:

[0066] S421, dividing the relationship states in the knowledge graph into different categories or states according to the relationship prediction results;

[0067] S422, performing fault diagnosis on the relationship in the knowledge graph according to the relationship prediction result;

[0068] S423, monitoring the relationships in the knowledge graph in real time according to the relationship prediction results;

[0069] S424, identifying and analyzing the relationships in the knowledge graph based on the relationship prediction results.

[0070] The technical solutions and design principles provided by the above embodiments of the present invention as well as the beneficial effects that can be obtained are further described in detail below.

[0071] Figure 2 The working diagram of the medical knowledge graph completion method provided by the above embodiment of the present invention is as follows: Figure 2 As shown, the medical knowledge graph completion method includes the following working process:

[0072] First, a large language model (LLM) is used to generate detailed and context-rich multiple different medical text descriptions for each medical relationship, including but not limited to the relationship type, attributes, and interaction methods between entities, which provides the model with a deeper semantic understanding of the relationships. Then, by analyzing the medical text descriptions, the initial embedding vectors of entities and relationships are extracted. These embedding vectors represent important medical concepts and their relationships in the medical knowledge graph, providing basic data for subsequent relationship predictions.

[0073] Next, a relation embedding generation model is constructed using the Conditional Variational Autoencoder (C-VAE). C-VAE accepts medical entity pairs as input, learns latent distribution features through the encoder, and generates relation embeddings using the decoder. In this process, C-VAE achieves accurate prediction of unknown medical relationships through contrast loss optimization and structured representation of the latent space. The close integration of these modules with the knowledge graph enables it to maintain efficient and accurate prediction performance in a constantly changing medical data environment. This approach ensures that the model can not only adapt to the complexity and dynamic changes of medical data, but also play an important role in real-time diagnosis support.

[0074] Finally, the model output is further optimized. The model parameters are adjusted through the gradient descent method, and the model performance is evaluated and optimized by combining cross-validation and other techniques to ensure that the final output relationship prediction results are accurate, thereby achieving accurate completion and expansion of the medical knowledge graph.

[0075] Through the above innovative design, the present invention constructs a dynamically adaptive and highly accurate medical knowledge graph completion method, which can effectively support the updating and discovery of medical knowledge and significantly improve the quality and efficiency of medical services.

[0076] Specifically, the medical knowledge graph completion method is based on the large language model (LLM), contrastive learning and conditional variational autoencoder (C-VAE), and specifically includes the following steps:

[0077] First, the collected medical data or text materials are preprocessed, rich text descriptions are generated, and features are extracted. Preprocessing includes steps such as data cleaning to ensure the quality and availability of the data. Rich text description generation uses a large language model (LLM) to generate multiple different text descriptions for each relationship that are detailed and context-rich, providing the model with a deeper semantic understanding of the relationship. Feature extraction focuses on extracting effective information from the raw data that can reflect the characteristics of entities and relationships, such as symptoms, treatment methods, and drug responses.

[0078] Then, the conditional variational autoencoder (C-VAE) is used to perform density estimation and probability modeling on the extracted features, thereby revealing the distribution law and potential structure of the data.

[0079] The working mechanism of C-VAE can be described as follows: the encoder maps the input feature x to a latent variable distribution z, and the generated conditional probability is:

[0080]

[0081] Among them, μ φ (x) and Denote the mean and variance of the latent variables respectively. The decoder generates the output feature z according to the latent variables ′ , its conditional distribution is:

[0082]

[0083] The goal of C-VAE is to maximize the reconstruction accuracy and minimize the KL divergence between the latent distribution of the encoder output and the standard normal distribution:

[0084]

[0085] Through the conditional variational autoencoder, the model can effectively capture the complex nonlinear relationships between entities and relations, thereby making more accurate predictions of unknown relations.

[0086] After completing preprocessing and feature extraction, a training sample set is constructed based on the obtained data, which contains normal relationship instances and potential unseen relationship instances. Using these sample data, a feature encoder is constructed through a contrastive learning algorithm to learn and optimize the feature representation of entities and relationships, so that the model can adaptively adjust the network structure in a complex feature space and better express the intrinsic characteristics of the data.

[0087] The goal of contrastive learning is to enhance the clustering of entity pairs of the same relation in the latent space by optimizing the contrastive loss function, while separating entity pairs of different relations. Specifically, contrastive learning uses the following loss function:

[0088]

[0089] Among them, sim(z i ,z j ) represents the similarity function between vectors (e.g., cosine similarity), τ is the temperature parameter, and z i and z j They represent the potential vectors of positive samples of the same class, and z k Then is the latent vector of the negative sample. By minimizing the contrast loss, the model can effectively enhance the similarity of entity pairs of the same relationship and separate entity pairs of different relationships in the latent space.

[0090] In this way, the model can not only dynamically adapt to complex changes in medical data, but also capture and analyze important changes in health records during the processing, thereby providing a solid foundation for relationship inference and knowledge graph completion.

[0091] By combining key medical parameters (such as diseases and symptoms) with the algorithm's preprocessing and feature extraction steps, important changes in health records can be captured and analyzed in real time. This combination enables the algorithm to not only process static data, but also dynamically adapt to the actual application status of medical knowledge, laying a solid foundation for subsequent relationship inference and knowledge graph completion.

[0092] Based on the construction of multiple rich text descriptions of the relationship, the conditional variational autoencoder (C-VAE) is used to perform density estimation and probability modeling for each entity-relationship pair. C-VAE encodes the input entity and relationship pairs, learns the distribution characteristics in the latent space, quantifies the similarity and connection between entity pairs, and reconstructs the data through a generative model. This probabilistic modeling process can better reveal the complex nonlinear connections between entities and relationships, and further improve the topological structure of the knowledge graph.

[0093] This method, which integrates a large language model and a conditional variational autoencoder, effectively improves the model's ability to understand the deeper semantics of relationships and capture relationship features, enabling it to more accurately model relationships in knowledge graphs, thereby providing stronger support for the inference of unknown relationships and the completion of knowledge graphs.

[0094] The data after preprocessing, relation rich text description generation and feature extraction are input into the constructed contrastive learning and conditional variational autoencoder (C-VAE) for joint training. During the training process, the model optimizes the feature encoder through contrastive learning to maximize the similarity between samples of the same relationship and minimize the similarity between samples of different relationships, thereby enhancing the model's ability to distinguish relationships.

[0095] During the training process, C-VAE uses the encoder to probabilistically model the input entity relationship pairs, learns their potential distribution, and reconstructs these relationship pairs through the decoder. The target loss of C-VAE includes reconstruction loss and KL divergence loss, which are used to ensure that the generated relationship embedding is consistent with the original input data while avoiding excessive concentration or diffusion of the distribution in the latent space. Its loss function is as follows:

[0096]

[0097] By jointly optimizing the contrast loss and C-VAE loss, the model not only captures complex relational structures, but also further improves the model's ability to distinguish different relations. The contrast loss ensures that entity pairs of the same relation are clustered in the latent space, while entity pairs of different relations are effectively separated, thereby improving the prediction ability of unseen relations.

[0098] During the training process, the model uses cross-validation technology to adjust and optimize parameters to ensure the stability and efficiency of the model under various data distributions. Through such multi-level loss optimization, the model can not only accurately complete known relationships, but also effectively infer unknown relationships, thereby improving the overall integrity and application value of the knowledge graph.

[0099] This method of integrating large language models, contrastive learning, and conditional variational autoencoders enables the model to more accurately cope with complex relationships and data changes in knowledge graphs, providing a strong technical foundation for knowledge graph completion and relationship inference.

[0100] Compare the results of the relational embedding generation model output and perform further follow-up operations. The detailed operations are as follows: Based on the output of the relational embedding generation model, count and analyze the status information of each knowledge graph entity relationship, and divide the relationship status into normal and abnormal categories according to the pre-set threshold. By analyzing the relationship status of each entity in the knowledge graph, possible abnormal situations and relationship error types can be effectively identified. To improve the accuracy and robustness of the analysis. Specifically, the following methods can be used to process the results of the model output:

[0101] Classification: Based on the model output, the relationship status in the knowledge graph is divided into different categories or states. For example, the relationship status between entities is divided into normal, abnormal, unknown and other categories for subsequent processing and analysis.

[0102] Fault diagnosis: Based on the model output, perform fault diagnosis on the relationships in the knowledge graph. Determine whether there are anomalies or errors in certain relationships, and further determine the type and cause of the error.

[0103] Real-time monitoring: Use the output results to monitor the relationships in the knowledge graph in real time. By continuously inputting new entity data and inferring and analyzing their relationships, the integrity and accuracy of the knowledge graph can be more accurately monitored in real time, and potential problems and anomalies can be discovered and handled in a timely manner.

[0104] Decision support: Based on the model output results, provide decision support for the expansion and maintenance of the knowledge graph. By identifying and analyzing the relationships in the knowledge graph, more accurate reference opinions and suggestions can be provided for the operation and management of the knowledge graph, helping to improve the application efficiency and accuracy of the knowledge graph.

[0105] By closely combining the large language model with the comparative zero-shot relationship learning model, the model can not only accurately identify conventional relationships, but also adjust the recognition strategy in a timely manner when abnormal changes occur in data characteristics. This combination of real-time monitoring and knowledge graph data, especially by using the large language model to generate rich text descriptions of medical relationships, effectively improves the accuracy and response speed of knowledge graph completion, ensuring the integrity and practicality of the knowledge graph.

[0106] Based on the same inventive concept, an embodiment of the present invention also provides a medical knowledge graph completion system.

[0107] Specifically, Figure 3 As shown, the medical knowledge graph completion system provided in this embodiment may include the following modules:

[0108] Rich text description generation module, which uses a large language model to generate multiple rich text descriptions for each relationship, including but not limited to the relationship type, attributes, and interaction methods between entities;

[0109] Basic data acquisition module, which is used to extract features from medical text descriptions and obtain initial embedding vectors of entities and relationships;

[0110] A relation embedding generation model module, which is used to provide a relation embedding generation model based on a conditional variational autoencoder, and the relation embedding generation model is used to take a medical entity as input and output a property prediction result of an unknown medical relationship;

[0111] The model training module uses the initial embedding vectors of entities and relationships to train the relationship embedding generation model through a contrastive learning algorithm, and continuously optimizes the parameters of the relationship embedding generation model according to the output of the relationship embedding generation model to obtain a medical knowledge graph completion model;

[0112] The relationship prediction module uses the medical knowledge graph completion model to predict the properties of the unknown medical relationship corresponding to the input medical entity, obtains the relationship status of each entity in the knowledge graph, and then uses it to complete the medical knowledge graph.

[0113] It should be noted that the steps in the method provided by the present invention can be implemented by using corresponding modules, devices, units, etc. in the system. Those skilled in the art can refer to the technical solution of the method to realize the composition of the system, that is, the embodiments in the method can be understood as preferred examples for constructing the system, which will not be elaborated here.

[0114] An embodiment of the present invention further provides a computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the processor can be used to execute any method of the above-mentioned embodiments of the present invention, or to run any system of the above-mentioned embodiments of the present invention.

[0115] Optionally, the memory is used to store programs; the memory may include volatile memory (English: volatile memory), such as random access memory (English: random-access memory, abbreviated: RAM), such as static random access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory is used to store computer programs (such as applications, functional modules, etc. that implement the above method), computer instructions, etc., and the above computer programs, computer instructions, etc. can be partitioned and stored in one or more memories. And the above computer programs, computer instructions, data, etc. can be called by the processor.

[0116] The above-mentioned computer programs, computer instructions, etc. may be stored in one or more memories in partitions, and the above-mentioned computer programs, computer instructions, data, etc. may be called by a processor.

[0117] The processor is used to execute the computer program stored in the memory to implement the various steps of the method or various modules of the system involved in the above embodiments. For details, please refer to the relevant descriptions in the above method and system embodiments.

[0118] The processor and the memory may be independent structures or integrated structures. When the processor and the memory are independent structures, the memory and the processor may be coupled and connected via a bus.

[0119] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it can be used to execute any method of the above embodiments of the present invention, or to run any system of the above embodiments of the present invention.

[0120] Among them, computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a user device. Of course, the processor and the storage medium can also be present in a communication device as discrete components.

[0121] The medical knowledge graph completion method, system, terminal and medium provided by the above-mentioned embodiments of the present invention accurately infer medical entities and relationships by combining a large language model, contrastive learning and conditional variational autoencoder. Among them, a large language model is used to generate multiple rich text descriptions of the relationship to enhance semantic expression; a conditional variational autoencoder is used to establish a conditional distribution model of the relationship to achieve knowledge transfer from known to unknown relationships; contrastive learning is combined to optimize the embedding space to make the relationship categories more separated and the categories more compact. The present invention can dynamically adjust the model to adapt to the ever-changing medical data environment, and achieve rapid response and completion of newly emerging medical conditions. Through the present invention, the integrity of the medical knowledge graph and the accuracy of auxiliary diagnosis support are significantly improved, providing solid technical support for personalized medical services and intelligent auxiliary diagnosis and treatment.

[0122] The medical knowledge graph completion method, system, terminal and medium provided by the above embodiments of the present invention closely combine the large language model (LLM), contrastive learning and conditional variational autoencoder (C-VAE) model, so that the model can not only accurately identify conventional relationships, but also timely adjust the recognition strategy when abnormal changes occur in data characteristics. This combination of real-time monitoring and knowledge graph data, especially by generating rich text descriptions of medical relationships using a large language model, effectively improves the accuracy and response speed of knowledge graph completion, and ensures the integrity and practicality of the knowledge graph. These adjustments include dynamically optimizing model parameters to adapt to new medical data, automatically completing missing relationship information, and adjusting the prediction strategy of the diagnostic model to ensure the latest and accuracy of medical knowledge. This collaborative processing method not only significantly improves the efficiency and accuracy of graph completion, but also enhances the system's responsiveness to dynamic medical data, and achieves accurate expansion of medical knowledge. Through innovative algorithm design, the large language model, contrastive learning and generative modeling technology are combined to effectively solve the shortcomings of traditional knowledge graph construction methods in dealing with complex data distribution and completing unseen relationships. It can automatically adapt to the dynamic changes of medical data, which is of great significance to improving the efficiency and reliability of medical diagnosis.

[0123] All matters not covered in the above embodiments of the present invention are well known in the art.

[0124] Finally, it should be noted that the above contents are only preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art may adjust and improve the above embodiments in accordance with the spirit and principles of the present invention, and all such modifications and equivalent substitutions are within the protection scope of the present invention.

Claims

1. A method for completing a medical knowledge graph, characterized in that: include: Using a large language model to generate multiple medical text descriptions for each relationship; Perform feature extraction on medical text descriptions to obtain initial embedding vectors of entities and relations; A relation embedding generation model based on a conditional variational autoencoder is provided, wherein the relation embedding generation model is used to take a medical entity embedding vector as input and output a property prediction result of an unknown medical relationship; The initial embedding vectors of the entities and relationships are used to train the relationship embedding generation model through a contrastive learning algorithm, and the parameters of the relationship embedding generation model are continuously optimized according to the output results of the relationship embedding generation model to obtain a medical knowledge graph completion model; The medical knowledge graph completion model is used to predict the properties of the unknown medical relationships corresponding to the input medical entities, and the relationship states of each entity in the knowledge graph are obtained, which is then used to complete the medical knowledge graph.

2. The medical knowledge graph completion method according to claim 1, characterized in that: The method uses a large language model to generate multiple medical text descriptions for each relationship, including: Obtain the required data or text materials, perform preprocessing and generate rich text descriptions; where: The preprocessing includes: data cleaning; The rich text description generation includes: integrating a large language model to generate multiple different text descriptions with context descriptions for each relationship, including: relationship types, relationship attributes and interaction methods between entities.

3. The medical knowledge graph completion method according to claim 1, characterized in that: The feature extraction of the medical text description to obtain the initial embedding vectors of entities and relationships includes: Convert the medical text description into a prediction vector p s , expressed as: Among them, d i is the i-th rich text description, To use the word embedding function to describe the rich text d i The vector obtained by conversion, TE(·) is the designed text encoder; Extract effective information to reflect the characteristics of entities and relations, and obtain the initial embedding vectors of entities and relations.

4. The medical knowledge graph completion method according to claim 1, characterized in that: The relationship embedding generation model based on conditional variational autoencoder includes: a conditional variational autoencoder module, which is used to take the medical entity embedding vector as input and output the property prediction result of the unknown medical relationship; wherein: The conditional variational autoencoder module, whose encoder is used to map the input feature vector x to a latent variable distribution z, generates a conditional probability q φ (z|x) is: In the formula, μ φ (x) and Respectively represent the mean and variance of the input feature vector; The conditional variational autoencoder module, whose decoder generates an output feature vector x according to the latent variable ′ , the output feature vector x ′ The conditional distribution p θ (x′|z) is: In the formula, μ θ (z) and denote the mean and variance of the output feature vector based on the latent variable distribution z, respectively.

5. The medical knowledge graph completion method according to claim 4, characterized in that: The initial embedding vectors of the entities and relationships are used to train the relationship embedding generation model through a contrastive learning algorithm, and the parameters of the relationship embedding generation model are continuously optimized according to the output of the relationship embedding generation model, including: Using the initial embedding vectors of the entities and relations, a training sample set is constructed, wherein the training sample set includes normal relation instances and potential unseen relation instances; The relation embedding generation model is trained by using the training sample set through a contrastive learning algorithm; wherein the contrastive learning algorithm enhances the clustering of entity pairs with the same relation in the latent space and separates entity pairs with different relations by minimizing the loss function L contrastive It is expressed as: In the formula, sim(z i ,z j ) represents the similarity function between vectors, τ is the temperature parameter, z i and z j Represents the latent vector z of positive samples of the same class respectively k The latent vector representing the negative sample; The optimization goal of the conditional variational autoencoder module is to maximize the reconstruction accuracy and minimize the KL divergence between the potential distribution of the encoder output and the standard normal distribution. The reconstruction loss function L of the conditional variational autoencoder module is cvae for: Where, L cvae represents the total loss function of the conditional variational autoencoder module, which consists of two parts: reconstruction loss and KL divergence; p(z) represents the prior distribution of the latent variable distribution z; By jointly optimizing the above loss function L contrastive , L cvae , adjust the parameters of each encoder and decoder of the relational embedding generation model to obtain the medical knowledge graph completion model.

6. The medical knowledge graph completion method according to claim 1, characterized in that: The medical knowledge graph completion model is used to predict the properties of the unknown medical relationship corresponding to the input medical entity to obtain the relationship status of each entity in the knowledge graph, including: The medical knowledge graph completion model is used to predict the properties of the unknown medical relationship corresponding to the input medical entity to obtain a relationship prediction result; The relationship prediction results are processed and divided into normal and abnormal categories according to a preset threshold value to obtain the relationship status of each entity in the knowledge graph and identify possible abnormal situations and relationship error types.

7. The medical knowledge graph completion method according to claim 6, characterized in that: Processing the relationship prediction result includes: According to the relationship prediction results, the relationship states in the knowledge graph are divided into different categories or states; According to the relationship prediction results, fault diagnosis is performed on the relationship in the knowledge graph; According to the relationship prediction results, the relationships in the knowledge graph are monitored in real time; Based on the relationship prediction results, the relationships in the knowledge graph are identified and analyzed.

8. A medical knowledge graph completion system, characterized in that: include: A rich text description generation module, which is used to generate multiple medical text descriptions for each relationship using a large language model; Basic data acquisition module, which is used to extract features from medical text descriptions and obtain initial embedding vectors of entities and relationships; A relation embedding generation model module, which is used to provide a relation embedding generation model based on a conditional variational autoencoder, wherein the relation embedding generation model is used to take a medical entity as input and output a property prediction result of an unknown medical relationship; A model training module, which uses the initial embedding vectors of the entities and relationships to train the relationship embedding generation model through a contrastive learning algorithm, and continuously optimizes the parameters of the relationship embedding generation model according to the results output by the relationship embedding generation model to obtain a medical knowledge graph completion model; A relationship prediction module uses the medical knowledge graph completion model to predict the properties of the unknown medical relationship corresponding to the input medical entity, obtains the relationship status of each entity in the knowledge graph, and then uses it to complete the medical knowledge graph.

9. A computer terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it can be used to perform the method described in any one of claims 1 to 7, or to run the system described in claim 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can be used to perform the method described in any one of claims 1 to 7, or to run the system described in claim 8.