Knowledge graph construction method and device in medical field, medium and product

By fine-tuning the large language model and applying clustering models, medical literature is processed automatically, and an efficient and accurate medical knowledge graph is constructed. This solves the problems of manual annotation and rule dependence in existing technologies, and realizes automated and high-quality knowledge graph construction.

CN121579703AInactive Publication Date: 2026-02-27SHANGHAI JUNYI YUEYUAN HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511774222.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing knowledge graph construction methods in medical literature rely heavily on manual annotation and rules, which are costly, have limited applicability, and struggle to handle complex sentence structures and informal language.

Method used

We fine-tuned a pre-trained large language model using open-source medical data, combined GPT-NER and prompt word engineering for named entity recognition and entity relation extraction, and used the SentenceBERT model and hierarchical clustering algorithm for alignment and deduplication to construct a knowledge graph in the medical field.

Benefits of technology

It reduces human intervention, improves the accuracy and efficiency of knowledge graph construction, ensures entity consistency, avoids duplication and redundancy, and is applicable to medical literature of various text types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

The invention discloses a knowledge graph construction method and device in the medical field, a medium and a product, and relates to the technical field of wisdom medical treatment, and the method comprises the steps: obtaining a medical paper data set and open-source medical data; performing fine adjustment on a pre-trained large language model by adopting the open source medical data to obtain a large model in the medical field; adopting a GPT-NER method to perform named entity recognition on the medical paper data set based on the large model in the medical field to obtain a named entity set; performing entity relationship extraction on the medical paper data set based on the large model of the medical field and the named entity set by adopting a cue word project to obtain an entity relationship set; and carrying out alignment and duplicate removal on the basic concepts in the named entity set and the entity relationship set by adopting a clustering model to obtain a knowledge graph in the medical field. According to the method, manual intervention can be reduced, the working efficiency is improved, and the knowledge graph construction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart healthcare technology, and in particular to a method, device, medium, and product for constructing a knowledge graph in the medical field. Background Technology

[0002] The existing methods for extracting knowledge graphs from medical literature can be roughly divided into the following categories: 1. Manual collection; 2. Named entity (point) recognition + entity relationship (edge) extraction.

[0003] Named Entity Recognition (NER) is typically achieved by training a deep bidirectional language representation model based on Transformers (BERT) or a combined model of Long Short-Term Memory (LSTM) and Conditional Random Field (CRF) using manually labeled data. However, this approach is costly due to the extensive need for manual annotation.

[0004] Entity relation extraction can be broadly categorized into supervised and unsupervised methods. Due to the large number of medical named entities and the substantial amount of data involved in research papers, unsupervised entity relation extraction is often employed. In the field of unsupervised entity relation extraction, existing technologies generally employ either trigger-based pattern extraction or dependency-based extraction. Trigger-based pattern extraction involves using regular expressions and grammatical rules to find keywords corresponding to the subject, predicate, and object. However, this method is generally only suitable for simple sentence structures and not for complex ones. Dependency-based extraction first constructs a syntax tree using an algorithm and then finds the subject, predicate, and object based on the relationships between nodes in the syntax tree. This method can handle more complex sentence structures, but its drawbacks include limitations on the accuracy of the syntax tree construction algorithm and the need for extensive manual annotation to create rules for each relation type, which may not be suitable for informal or rigorous language. Summary of the Invention

[0005] The purpose of this application is to provide a method, device, medium, and product for constructing knowledge graphs in the medical field, which can reduce manual intervention, improve work efficiency, and enhance the accuracy of knowledge graph construction.

[0006] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for constructing a knowledge graph in the medical field, including: Obtain medical paper datasets and open-source medical data; The pre-trained large language model was fine-tuned using the aforementioned open-source medical data to obtain a large model in the medical field. The GPT-NER method is used to perform named entity recognition on the medical paper dataset based on a large model in the medical field, resulting in a set of named entities. Using prompt word engineering, entity relations are extracted from the medical paper dataset based on the large model of the medical field and the named entity set to obtain an entity relation set. A clustering model is used to align and deduplicate the basic concepts in the named entity set and the entity relation set to obtain a knowledge graph in the medical field.

[0007] Optionally, the pre-trained large language model is the Llama3 large model; the open-source medical data includes: patient complaint and consultation record datasets and biomedical related paper datasets.

[0008] Optionally, the GPT-NER method is used to perform named entity recognition on the medical paper dataset based on a large model in the medical field, resulting in a named entity set, specifically including: The GPT-NER method is used to transform the sequence labeling task of named entity recognition into the task of generating large models in the medical field. Based on the medical texts, tag examples, and recognition instructions in the aforementioned medical paper dataset, determine the prompt words for named entity recognition; Based on the prompts for named entity recognition, named entity recognition is performed on the medical paper dataset using a large model in the medical field to obtain a set of named entities.

[0009] Optionally, prompt word engineering is employed to extract entity relations from the medical paper dataset based on the large model of the medical field and the named entity set, resulting in an entity relation set, specifically including: The prompt word engineering is adopted to determine the prompt words for entity relation extraction based on the medical passages in the medical paper dataset, the named entity set, the predefined predicate relation set, and the extraction instructions. Based on the prompts extracted from the entity relations, entity relations are extracted from the medical paper dataset using a large model in the medical field to obtain an entity relation set.

[0010] Optionally, the clustering model consists of the SentenceBERT model, a hierarchical clustering algorithm, a disjoint-set data structure path compression algorithm, and a large model for the medical field.

[0011] Optionally, a clustering model is used to align and deduplicate the basic concepts in the named entity set and the entity relation set to obtain a knowledge graph in the medical field, specifically including: The SentenceBERT model is used to extract vectorized representations of named entities in the named entity set; A hierarchical clustering algorithm is used to coarsely cluster the named entities in the named entity set based on the vectorized representation of the named entities, resulting in a coarsely clustered named entity set. The deduplication prompt words are determined based on the named entity set of the coarse cluster and the deduplication instruction; Based on the deduplication prompts, the named entity set of the coarse cluster is deduplicated according to the large model of the medical field to obtain the deduplicated named entity set. A similarity calculation method is used to determine synonymous named entities based on the vectorized representations of named entities in the named entity sets before and after deduplication. The path compression algorithm of disjoint set is used to deduplicate the entity relation set according to the synonymous named entities, so as to obtain the deduplicated entity relation set. A knowledge graph for the medical field is constructed based on the deduplicated set of named entities and the deduplicated set of entity relationships.

[0012] Optionally, the similarity calculation method represents the similarity by calculating the squared distance or cosine distance between the vectorized representations of named entities in the named entity set before and after deduplication; the smaller the distance, the higher the similarity.

[0013] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the knowledge graph construction method in the medical field.

[0014] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the knowledge graph construction method in the medical field.

[0015] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the knowledge graph construction method in the medical field.

[0016] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides a method, device, medium, and product for constructing a knowledge graph in the medical field. By fine-tuning a pre-trained large language model using open-source medical data, a large model in the medical field is obtained, enabling it to more accurately understand and process the complex semantics in medical literature, thereby improving the accuracy of knowledge graph construction. Through the application of the large language model and prompt word engineering, a large amount of medical literature can be automatically extracted and processed, reducing manual intervention and improving work efficiency. By using a clustering model to align and deduplicate basic concepts, the consistency of entities in the knowledge graph can be ensured, avoiding duplicate and redundant information, thereby improving the quality and practicality of the knowledge graph. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart of the medical knowledge graph construction method provided for this application; Figure 2 This is a structural schematic diagram of the Llama3 large model provided in this application; Figure 3 A schematic diagram illustrating the principle of the SentenceBERT model provided in this application. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] In one exemplary embodiment, this application provides a method for constructing a knowledge graph in the medical field. This method is executed by a computer device, specifically a terminal or server, or both. In this embodiment, for example… Figure 1 As shown, the method includes steps 1 to 5.

[0022] Step 1: Obtain medical paper datasets and open-source medical data.

[0023] The open-source medical data includes: a dataset of patient complaints and consultation records, and a dataset of biomedical-related research papers. Specifically, the dataset of patient complaints and consultation records is a dataset containing patient complaints and consultation records published by the University of California, San Diego (UCSD); the dataset of biomedical-related research papers is a dataset of biomedical-related research papers extracted from the Arxiv dataset.

[0024] Step 2: Fine-tune the pre-trained large language model using the open-source medical data to obtain a large model in the medical field.

[0025] Preferably, the pre-trained large language model is the Llama3 large model. The Llama3 large model is a large language model based on the Transformer model. The Transformer model and its core self-attention mechanism are key technologies in modern Natural Language Processing (NLP). They significantly improve the performance of text understanding and generation through efficient architecture and computational methods. Compared to the classic Transformer model, the Llama3 large model only uses the encoder part, which is the so-called Generative Pre-Trained (GPT) structure.

[0026] The structure of the Llama3 large model is as follows: Figure 2 As shown, the Llama model consists of three main layers: Embedding, RMS Norm, Self-Attention, Feed-Forward, Linear, and Softmax. The Embedding layer transforms character input into word vectors; the RMS Norm layer ensures the stability of the input data feature distribution; the Self-Attention layer represents the relationships between words in a single text segment; the Feed-Forward layer uses a standard fully connected neural network to increase network depth and enhance the non-linearity and representability of the neural network; the Linear layer reduces dimensionality, simplifying the complex representation into a single output dimension; and the Softmax layer transforms the final output real-number representation (any real number) into a probability distribution representation (all positive real numbers, summing to 1). Furthermore, Figure 2 The plus sign in the diagram indicates that two vectors are added together.

[0027] It is important to note that during the training (fine-tuning) phase, the input section here consists of medical-related data segments (X1...X). n The vectorized representation of ) and the output part is the next word X n+1 The predicted probability vector. During training, by maximizing the probability of the known next word, a larger medical model that better fits the distribution of medical-related data can be obtained. This larger model will be used in the following steps; its input is the medical-related data segment (X1...X...). n The vectorized representation of ) and the output part is the next word X n+1 The predicted probability vector. Since the prediction of the next word can be repeated continuously, a prediction of a passage can be given, thus completing the continuation task. Since different continuations of the passage can be completed by prompting words, other tasks can be categorized as continuation tasks.

[0028] After fine-tuning the open-source Llama3 model using open-source medical data, a large model for the medical field was obtained.

[0029] Step 3: Using the GPT-NER method, name entity recognition is performed on the medical paper dataset based on the large model in the medical field to obtain a name entity set.

[0030] Specifically, the GPT-NER method is used to transform the sequence labeling task of named entity recognition into the task of generating a large model in the medical field; prompt words for named entity recognition are determined based on medical passages, labeled examples, and recognition instructions in the medical paper dataset; and named entity recognition is performed on the medical paper dataset based on the prompt words and the large model in the medical field to obtain a set of named entities.

[0031] Based on the large-scale medical model obtained in step 2, the GPT-NER method is used to transform the sequence labeling task of NER into a large-scale model generation task, which can then be used to extract named entities. Specifically, the prompts require that academic named entities in the text be identified using the special symbol "". <st>"and" <en>The prefix and suffix are marked as such; and the larger model is shown how to process named entities in the text according to the rules in a few-shot manner (i.e., a few examples are given).

[0032] Example Input: Diabetes mellitus is a chronic disease characterized by hyperglycemia, caused by absolute or relative insulin deficiency and impaired insulin utilization. It is mainly classified into three types: type 1, type 2, and gestational diabetes. The etiology is primarily attributed to the combined effects of genetic and environmental factors, including decreased insulin secretion due to pancreatic islet cell dysfunction, or insensitivity to insulin, or both, resulting in the ineffective utilization and storage of glucose in the blood.

[0033] Example output: <st>diabetes <en>It is a kind of <st>insulin <en>Caused by absolute or relative secretion deficiency and utilization disorders, <st>High blood sugar <en>This is a chronic disease characterized by its predisposition to disease. It is mainly classified into type 1, type 2, and type 3. <st>Gestational diabetes <en>Three types. The etiology is mainly attributed to the combined effects of genetic and environmental factors, including... <st>pancreatic islet cell dysfunction <en>caused by <st>insulin <en>Decreased secretion, or the body's response to <st>Insulin <en>resistant to the action of or both, such that the blood of <st>glucose <en>cannot be effectively utilized and stored.

[0034] Note that the model allows for the case of missing labels, as the goal is to collect, then accuracy is less important. See Table 1 for the specific forms of the prompt words for named entity recognition.

[0035] Table 1 Table of specific forms of prompt words for named entity recognition

[0036] Through this method, the set of named entities in a single article can be obtained. After scanning the paper dataset one by one, the total preliminary named entity set can be obtained.

[0037] Step 4: Using the prompt engineering, performing entity relationship extraction on the medical paper dataset based on the large model of the medical field and the named entity set, to obtain an entity relationship set.

[0038] Specifically, using the prompt engineering, the prompt words for entity relationship extraction are determined according to the medical text segments in the medical paper dataset, the named entity set, the pre-defined predicate relationship set and the extraction instructions; based on the large model of the medical field, the medical paper dataset is subjected to entity relationship extraction according to the prompt words for entity relationship extraction, to obtain an entity relationship set.

[0039] For a single article, the set of entity relationships (i.e. predicate relationships) therein can also be obtained. The named entity set obtained in step 3 is re-used as part of the prompt words, and the large model of the medical field obtained in step 2 is required to output whether these named entities contain predicate relationships such as "belong to", "help", "depend on", etc. Such a set of predicate relationships is defined in advance. See Table 2 for the specific forms of the prompt words for entity relationship extraction.

[0040] Table 2 Table of specific forms of prompt words for entity relationship extraction

[0041] Step 5: Using a clustering model to align and de-duplicate the basic concepts in the named entity set and the entity relationship set, to obtain a knowledge graph of the medical field.

[0042] The clustering model is composed of a SentenceBERT model, a hierarchical clustering algorithm, a path compression algorithm of a union-find set, and a large model in the medical field. Specifically, the SentenceBERT model is used to extract the vectorized representation of the named entities in the named entity set; the hierarchical clustering algorithm is used to perform coarse clustering on the named entities in the named entity set according to the vectorized representation of the named entities, to obtain a coarse-clustering named entity set; the de-duplication instruction is used to determine the de-duplicated prompt word according to the coarse-clustering named entity set; the de-duplicated prompt word is used to perform de-duplication on the coarse-clustering named entity set based on the large model in the medical field, to obtain a de-duplicated named entity set; the similarity calculation method is used to determine the synonymous named entities according to the vectorized representation of the named entities in the named entity set before and after de-duplication; the path compression algorithm of the union-find set is used to perform de-duplication on the entity relationship set according to the synonymous named entities, to obtain a de-duplicated entity relationship set; and the de-duplicated named entity set and the de-duplicated entity relationship set are used to construct a knowledge graph in the medical field.

[0043] It is noted that a large number of semantically repeated medical terms, such as “acne vulgaris” and “acne”, are generated in the foregoing steps. Therefore, it is necessary to perform de-duplication on these medical terms.

[0044] For the obtained named entities, the word vectors of the named entities are first extracted by the SentenceBERT model for coarse clustering. The most important reason is that if the medical large model + prompt word is used for de-duplication, the number of medical named entities is far more than the capacity of the prompt word. Meanwhile, such a model is relatively small and does not need to consume GPU resources, and can quickly cluster the named entities.

[0045] The principle of the SentenceBERT model is shown in Figure 3 During training, two medical named entities A and B are simultaneously input, and the corresponding vectorized representations u and v are obtained after passing through the BERT model and a pooling layer.

[0046] The training method of the model is to optimize the loss function by using the stochastic gradient descent method. In the formula, is a regularization term used to prevent overfitting of the neural network, s a is any medical named entity, s p is any medical named entity synonymous with s a is any medical named entity synonymous with s n is any medical named entity synonymous with s a is any medical named entity synonymous with s a and s p When using synonyms, Figure 3 u is s a v is s p When comparing s a and s n When (antonyms), Figure 3 u is s a v is s n Stochastic gradient descent minimizes the loss function, effectively making the vectorized representations of synonyms as close as possible and the vectorized representations of antonyms as far apart as possible. Here, distance can be defined as squared distance or cosine distance (squared distance is used in practice). The synonym data used for training is obtained by crawling a medical thesaurus, while antonyms are obtained by randomly selecting any non-synonymous word pairs. For the trained model, the input is a medical named entity, and the output is a one-dimensional real vector representing that medical named entity.

[0047] After obtaining the vectorized representation of medical named entities, a hierarchical clustering algorithm is used to obtain clusters of medical named entities, with each cluster containing fewer than 50 words.

[0048] Then, for each named entity in the named entity set of each coarse cluster, the large medical model obtained in step 2 is further called for deduplication. The deduplication prompt contains all the named entities in the cluster and an instruction to output all non-repeating named entities. The expected input is a string array containing all the named entities in the coarse cluster, and the expected output is a string array containing the deduplicated named entities. See Table 3 for the specific form of the deduplication prompt.

[0049] Table 3. Specific Forms of Deduplication Prompts

[0050] Then, for the original named entity It is also necessary to find its synonyms after deduplication of named entities. Establish the correspondence between them. Let... The corresponding vectorized representation is , The corresponding vectorized representation is This step simply requires using the SentenceBERT model described above again for the current original named entities. Enumerate and compute the vectorized representations of all deduplicated medical named entities. The similarity calculation method is used to find the similarity between them. Corresponding vectorized representation The distance (which can be a square distance or a cosine distance, the smaller the distance, the higher the similarity) is the nearest, then this vector is the corresponding medical named entity after deduplication, that is, the medical named entity synonymous with the original named entity. Expressed in formula .

[0051] For the edges (entity relationships, that is, predicate relationships) between the deduplicated nodes (named entities), they also need to be merged. For two deduplicated nodes a' and b', assuming their corresponding pre-deduplication node sets are A and B, respectively, then the edge set C' between a' and b' is all directed edges between a and b that satisfy a∈A and b∈B. In this way, the deduplication of the clustered edges is completed.

[0052] For example, acne and skin disease are "belong to" relationships, acne vulgaris and skin disease are "belong to" relationships, and acne vulgaris and skin disease are "belong to" relationships. Because acne, acne vulgaris, and acne vulgaris are synonyms, and skin disease, skin disease, and skin disease are synonyms, the entire named entity set can be scanned, and the path compression algorithm of the union-find set is compressed into two points and one edge relationship, that is, acne (subject) - skin disease (object) - belong (predicate relationship).

[0053] After the deduplication of points and edges, a medical knowledge graph is finally obtained, which is organized according to the structure of <subject>-<predicate>-<object>, where the subject and object are nouns, and the predicate is the relationship between the nouns. If represented by a graph, the subject and object are nodes, and the predicate is a directed edge, then the knowledge graph is a directed graph. The medical knowledge graph constructed by the present application can be applied to the following scenarios: 1. Clinical decision support: Medical knowledge graph can integrate and analyze a large amount of medical data to help doctors make more accurate decisions in the process of diagnosis and treatment. For example, by matching patient symptoms, medical history and the latest medical research, personalized treatment recommendations can be provided.

[0054] 2. Drug discovery and development: By analyzing the relationship between drugs and diseases, medical knowledge graph can accelerate the process of new drug discovery and development. For example, potential drug targets and drug side effects can be identified to improve the efficiency of drug development.

[0055] 3. Medical education and training: Medical knowledge graph can be used as an educational tool to help medical students and professionals quickly understand complex medical knowledge, conduct case studies and simulation training.

[0056] 4. Electronic Medical Record (EMR) management: Medical knowledge graph can improve downstream electronic medical record system, through semantic analysis and data integration, match and locate patient information, improve the efficiency and accuracy of medical record management.

[0057] The present application can output a knowledge graph containing various medical concepts for an input medical paper data set. Compared with the prior art, in the aspect of named entity recognition, the present application uses an open source medical data to fine-tune a general large language model, which can more accurately locate the named entity without manual annotation. And because of the existence of the deduplication process, the process of manual deduplication can be avoided, and the work efficiency is improved; in the aspect of entity relationship extraction, the present application bypasses the step of constructing a syntax tree, and directly lets the obtained large model in the medical field find the relationship itself, which can be applied to various texts, not just formal and rigorous syntax-compliant cases. At the same time, the manual annotation required for constructing artificial rules is saved. In addition, through node deduplication, the step of manual deduplication is avoided, further reducing the cost of constructing a knowledge graph.

[0058] In summary, the present application has the following characteristics and advantages: 1. Fine-tuning based on open source large model: using a pre-trained large language model and fine-tuning it to make it more accurately understand and process complex semantics in medical literature, thereby improving the accuracy of knowledge graph construction. Compared with traditional knowledge graph extraction algorithms based on fixed named entity sets, this method can expand and maintain a dynamic named entity set online by adding new paper data.

[0059] 2. Cluster model deduplication: align and deduplicate basic concepts through a clustering model to ensure the consistency of entities in the knowledge graph, avoid duplicate and redundant information, and improve the quality and practicality of the knowledge graph.

[0060] 3. High degree of automation: through the application of large language models and prompt word engineering, the system can automatically extract and process a large amount of medical literature, reducing manual intervention and improving work efficiency.

[0061] In an exemplary embodiment, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above method embodiments.

[0062] In an exemplary embodiment, the present application also provides a computer readable storage medium storing a computer program, which is executed by a processor to implement the steps in the above method embodiments.

[0063] In one example embodiment, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the above method embodiments.

[0064] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant legal regulations.

[0065] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments. Any reference to memory, database or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0066] The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0067] Any combination of the technical features in the above embodiments can be made. For the sake of brevity, the foregoing description has not described all possible combinations of the technical features in the above embodiments, however, it is understood that any combination of the technical features is within the scope of the present disclosure as long as there is no contradiction.

[0068] The principles and implementation manners of the present application are described herein by using specific examples, and the above embodiments are only used to help understand the method of the present application and its core idea; meanwhile, according to the idea of the present application, the specific implementation manners and application scopes will be changed by those skilled in the art. In conclusion, the content of the present description should not be understood as a limitation of the present application.< / en> < / st> < / en> < / st> < / en> < / st> < / en> < / st> < / en> < / st> < / en> < / st> < / en> < / st> < / en> < / st> < / en> < / st>

Claims

1. A method for constructing a knowledge graph in the medical field, characterized in that, include: Obtain medical paper datasets and open-source medical data; The pre-trained large language model was fine-tuned using the aforementioned open-source medical data to obtain a large model in the medical field. The GPT-NER method is used to perform named entity recognition on the medical paper dataset based on a large model in the medical field, resulting in a set of named entities. Using prompt word engineering, entity relations are extracted from the medical paper dataset based on the large model of the medical field and the named entity set to obtain an entity relation set. A clustering model is used to align and deduplicate the basic concepts in the named entity set and the entity relation set to obtain a knowledge graph in the medical field.

2. The method for constructing a knowledge graph in the medical field according to claim 1, characterized in that, The pre-trained large language model is the Llama3 large model; The open-source medical data includes: patient complaint and consultation record datasets, as well as biomedical related paper datasets.

3. The method for constructing a knowledge graph in the medical field according to claim 1, characterized in that, The GPT-NER method is used to perform named entity recognition on the medical paper dataset based on a large model in the medical field, resulting in a set of named entities, specifically including: The GPT-NER method is used to transform the sequence labeling task of named entity recognition into the task of generating large models in the medical field. Based on the medical texts, tag examples, and recognition instructions in the aforementioned medical paper dataset, determine the prompt words for named entity recognition; Based on the prompts for named entity recognition, named entity recognition is performed on the medical paper dataset using a large model in the medical field to obtain a set of named entities.

4. The method for constructing a knowledge graph in the medical field according to claim 1, characterized in that, Using prompt word engineering, entity relations are extracted from the medical paper dataset based on the large model of the medical field and the named entity set, resulting in an entity relation set, specifically including: The prompt word engineering is adopted to determine the prompt words for entity relation extraction based on the medical passages in the medical paper dataset, the named entity set, the predefined predicate relation set, and the extraction instructions. Based on the prompts extracted from the entity relations, entity relations are extracted from the medical paper dataset using a large model in the medical field to obtain an entity relation set.

5. The method for constructing a knowledge graph in the medical field according to claim 1, characterized in that, The clustering model consists of the SentenceBERT model, hierarchical clustering algorithm, disjoint-set data structure path compression algorithm, and a large model for the medical field.

6. The method for constructing a knowledge graph in the medical field according to claim 5, characterized in that, Clustering models are used to align and deduplicate basic concepts in the named entity set and the entity relation set to obtain a knowledge graph in the medical field, specifically including: The SentenceBERT model is used to extract vectorized representations of named entities in the named entity set; A hierarchical clustering algorithm is used to coarsely cluster the named entities in the named entity set based on the vectorized representation of the named entities, resulting in a coarsely clustered named entity set. The deduplication prompt words are determined based on the named entity set of the coarse cluster and the deduplication instruction; Based on the deduplication prompts, the named entity set of the coarse cluster is deduplicated according to the large model of the medical field to obtain the deduplicated named entity set. A similarity calculation method is used to determine synonymous named entities based on the vectorized representations of named entities in the named entity sets before and after deduplication. The path compression algorithm of disjoint set is used to deduplicate the entity relation set according to the synonymous named entities, so as to obtain the deduplicated entity relation set. A knowledge graph for the medical field is constructed based on the deduplicated set of named entities and the deduplicated set of entity relationships.

7. The method for constructing a knowledge graph in the medical field according to claim 6, characterized in that, The similarity calculation method represents the similarity by calculating the squared distance or cosine distance between the vectorized representations of named entities in the named entity set before and after deduplication; the smaller the distance, the higher the similarity.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the knowledge graph construction method in the medical field according to any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the knowledge graph construction method in the medical field as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the knowledge graph construction method in the medical field as described in any one of claims 1-7.