Dai medicine knowledge graph construction method based on bidirectional entity relationship joint extraction model

Through the joint extraction model based on the two-way entity relationship, the limitations of the dispersion and extraction of Dai medicine are solved, and a clear knowledge map is built to support the research and application of Dai medicine and promote its integration with modern medicine.

CN119252511APending Publication Date: 2025-01-03KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411368807.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Dai medicine knowledge is scattered and difficult to effectively integrate and utilize. The existing knowledge graph construction method has limitations in Dai medicine entities and relationship extraction, especially when dealing with complex two-way entity relationships.

Method used

Using a joint extraction model based on bidirectional entity relationships, it uses data acquisition, preprocessing, manual annotation and model construction, and uses multi-layer perceptron and pre-trained text decoder Chinese-BERT to extract features, combined with negative sample generation and multi-task learning to construct Output the Dai medicine knowledge map.

Benefits of technology

It has achieved efficient extraction of entities and relationships from a large amount of Dai medicine text data, constructed a clear knowledge map, supported the research, teaching and clinical application of Dai medicine, promoted the integration of Dai medicine and modern medicine, and promoted the inheritance and development of Dai medicine. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119252511A_ABST
    Figure CN119252511A_ABST
Patent Text Reader

Abstract

The invention relates to a Dai medicine knowledge map construction method based on a bidirectional entity relationship joint extraction model, and belongs to the technical field of medicine knowledge maps. According to the combined extraction model based on the two-way entity relationship, entities and relationships can be efficiently extracted from a large amount of Dai medicine related text data at the same time, and the Dai medicine knowledge graph is constructed. The knowledge graph can clearly present the complex relationship among various entities such as medicinal materials, diseases and symptoms in the Dai medicine, provides powerful support and decision basis for the research, teaching, clinical application and the like of the Dai medicine, is helpful for promoting the inheritance and development of the Dai medicine, and improves the status and value of the Dai medicine in the field of modern medicine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical knowledge graphs, and specifically relates to a method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model. Background Art

[0002] As a shining pearl in the treasure house of traditional Chinese medicine, Dai medicine has accumulated rich theoretical knowledge and clinical experience after thousands of years of inheritance and development. With its unique diagnostic methods, treatment methods and drug formulas, it has played an irreplaceable role in maintaining the health of the Dai people.

[0003] However, in today's rapidly developing information age, the inheritance and development of Dai medicine knowledge faces a series of severe challenges. First of all, Dai medicine knowledge is scattered in a large number of ancient books and documents, ancient manuscripts, folk legends, clinical diagnosis and treatment records, expert experience summaries, and modern scientific research results. Due to the lack of effective integration methods, this valuable knowledge is difficult to be comprehensively and systematically sorted out and utilized. The traditional method of document sorting mainly relies on manual reading and excerpting, which is not only inefficient, but also prone to omissions and errors. When faced with a huge amount of Dai medicine knowledge, this method seems to be powerless.

[0004] Secondly, with the rapid development of modern medicine and the continuous improvement of people's health needs, higher requirements have been put forward for the research and application of Dai medicine. As a traditional medical system, Dai medicine's unique theories and methods need to be combined with modern science and technology to better play its advantages. In order to achieve this goal, a tool that can systematically organize and display Dai medicine knowledge is needed so that researchers, clinicians and ordinary people can more conveniently obtain and use Dai medicine knowledge.

[0005] At present, although some research results have been achieved in the field of knowledge graph construction, the construction of knowledge graphs for the field of Dai medicine is still in its infancy. Existing knowledge graph construction methods often have certain limitations in the extraction of Dai medicine entities and relationships. On the one hand, due to the professionalism and particularity of Dai medicine knowledge, general entity and relationship extraction methods are difficult to accurately identify various entities and relationships in the field of Dai medicine. For example, for some special medicinal material names, disease descriptions, and unique treatment methods in Dai medicine, general methods may misjudge or omit them. On the other hand, existing methods are not flexible and accurate enough when dealing with complex bidirectional entity relationships. The entities and relationships in Dai medicine knowledge are often interrelated and mutually influential. An extraction model that can simultaneously consider bidirectional entity relationships is needed to comprehensively and accurately construct a Dai medicine knowledge graph.

[0006] In summary, the development of a Dai medicine knowledge graph system based on a two-way entity relationship joint extraction model has extremely important practical significance. It can not only effectively integrate the scattered Dai medicine knowledge and provide strong support for the research, teaching, and clinical application of Dai medicine, but also promote the integration of Dai medicine and modern medicine, promote the inheritance and development of Dai medicine in the new era, and make greater contributions to human health. Summary of the invention

[0007] The present invention aims to provide a method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model, and integrate Dai medicine knowledge through the knowledge graph to solve the current problem that Dai medicine knowledge is scattered and difficult to effectively integrate and utilize.

[0008] The present invention achieves the above-mentioned purpose by adopting the following technical solutions:

[0009] A method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model includes the following steps:

[0010] Step 1: Data collection: collect text data related to Dai medicine;

[0011] We collected Dai medicine-related knowledge from ancient medicine classics, relevant research papers, and online medical data to ensure the comprehensiveness and accuracy of the knowledge.

[0012] Step 2: Data preprocessing: cleaning and word segmentation of the collected text data;

[0013] The collected Dai medicine text data can be preprocessed using the corresponding appropriate natural language processing method, so that the text data can be optimized to match the subsequent model.

[0014] Step 3: Manual labeling: define entities and relationships in the cleaned data, and manually label the entities and relationships in the sentence;

[0015] Due to the uniqueness of Dai medicine-related knowledge, manual annotation can most accurately annotate entities and related relationships, providing reliable annotation data for the subsequent construction of knowledge graphs.

[0016] Step 4: Build a bidirectional entity-relationship joint extraction model, and use the model to simultaneously extract entity and relationship triplets from the preprocessed text data. This mainly includes the following aspects:

[0017] 1. Original feature extraction

[0018] According to the characteristics of Dai medicine text, the text is input into the original feature extractor to extract the original features of each modality, and the pre-trained text decoder Chinese-BERT is used to extract the original text features to capture the semantics of the text.

[0019] 2. Bidirectional extraction framework based on multi-layer perceptron

[0020] The bidirectional extraction framework has a bidirectional framework for extracting triples from the following two directions: (1) S2T direction: first extract the head entity, then extract the tail entity and its relations conditioned on the extracted head entity. (2) The reverse O2T direction, first extract the tail entity and then extract the head entity and its relations. The extraction in these two directions shares the encoder component. In order to improve the expressiveness of the model and learn more complex features, a multi-layer perceptron is used before the entity tagger in both directions to enhance the entity features.

[0021] 3. Relationship recognition based on multi-layer perceptron

[0022] For an entity pair, we first obtain the representation vectors of the two entities and then calculate the possibility that the entity pair has the i-th relationship.

[0023] 4. Negative Sample Generation

[0024] In order to alleviate the problem of exposure bias, a negative sample strategy is used to randomly generate some negative samples to add to all training sets. During inference, the total sample containing negative samples can simulate real scenes, improve the robustness and recognition accuracy of the model in natural scenes, and greatly alleviate the problem of exposure bias.

[0025] 5. Loss Function

[0026] This model is a bidirectional extraction model, in which all modules in both directions work in multi-task learning. In the training process based on multi-task learning, each task and the encoder module form a relatively independent extraction task. The binary cross entropy loss function is used in each module, and finally the loss functions of all modules are added together to obtain the final loss function.

[0027] Through the bidirectional entity relationship joint extraction model, we input a large amount of unlabeled data into the model and output it as triplets of entity relationships, providing data support for the subsequent knowledge graph construction.

[0028] Step 5: Construct a knowledge graph. Construct a Dai medicine knowledge graph based on the extracted entity and relationship triplets.

[0029] According to the entity and relationship triples extracted by the model, these triples are stored in a graphical database in the form of a graphical knowledge graph. This storage method can efficiently organize and manage Dai medicine knowledge and facilitate subsequent query and analysis.

[0030] Beneficial effects:

[0031] The proposed joint extraction model based on bidirectional entity relationships can efficiently extract entities and relationships from a large amount of Dai medicine-related text data and construct a Dai medicine knowledge graph. This knowledge graph can clearly present the complex relationships between various entities in Dai medicine, such as medicinal materials, diseases, symptoms, etc., and provide strong support and decision-making basis for the research, teaching, and clinical application of Dai medicine, which will help promote the inheritance and development of Dai medicine and enhance the status and value of Dai medicine in the field of modern medicine. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is the bidirectional entity relationship joint extraction model diagram in this embodiment. DETAILED DESCRIPTION

[0033] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0034] Example

[0035] A method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model includes the following steps:

[0036] Step 1: Data Collection

[0037] This step mainly collects text data related to Dai medicine. As an important part of traditional Chinese medicine, the knowledge of Dai medicine is scattered in ancient medicine books, related research papers, and online medical data. In order to build a comprehensive and accurate knowledge graph of Dai medicine, it is necessary to widely collect relevant text information from these data sources.

[0038] Specifically, we can collect data from the following aspects:

[0039] 1. Ancient medicine records: Search and collect medical books and materials related to Dai medicine. These materials usually contain detailed information on all aspects of Dai medicine.

[0040] 2. Related research papers: Extensively search academic databases to collect research papers related to Dai medicine. These papers often contain the latest research results, innovative applications and in-depth theoretical analysis of Dai medicine, injecting cutting-edge scientific connotations into the knowledge graph.

[0041] 3. Internet resources: Using web crawler technology, collect Dai medicine-related articles, discussion posts and user experience sharing from professional medical websites, forums, blogs and other platforms.

[0042] Through data collection through the above multiple channels, we can obtain rich Dai medicine-related text data, providing a solid foundation for the subsequent construction of the knowledge graph.

[0043] Step 2: Data preprocessing

[0044] In the Dai medicine knowledge graph system, data preprocessing is a crucial step. This step mainly includes operations such as cleaning and word segmentation to improve the quality and availability of data and lay a good foundation for subsequent entity and relationship labeling and model extraction.

[0045] First, we need to clean the text. In the collected Dai medicine-related text data, there are often impurities such as irrelevant characters, garbled characters, and repeated content, which will affect the accuracy and efficiency of subsequent processing. Therefore, we use specific algorithms and rules to remove these impurities and ensure the purity of the text. For example, for irrelevant characters and garbled characters, regular expressions can be used to match and delete them; for repeated content, hash algorithms can be used to detect and remove them.

[0046] Then we proceed to word segmentation. Dai medicine texts usually contain complex language structures and professional terms. In order to better understand the structure and semantics of the text, we need to use advanced natural language processing technology to segment the text into meaningful word units. We can use mature word segmentation tools, such as Jieba word segmentation, combined with professional dictionaries in the field of Dai medicine, to accurately segment the text. After word segmentation, the text will be converted into independent words, which is convenient for subsequent analysis and processing.

[0047] Finally, since a single cleaned text may be too long, we use ChatGPT to reorganize the cleaned long text into short text that can be recognized by the model. In this way, the form of the data can be further optimized to make it more in line with the input requirements of the model.

[0048] Through the above data preprocessing steps, the collected Dai medicine text data can be converted into a clean, standardized, and easy-to-analyze form, providing high-quality data support for subsequent manual annotation and model extraction.

[0049] Step 3: Manual labeling

[0050] In the Dai medicine knowledge graph system, manual annotation is one of the key steps in building an accurate knowledge graph.

[0051] First, based on the professional knowledge and characteristics of Dai medicine, we determined the possible entity types. Dai medicine knowledge is rich and unique. After in-depth research and analysis, the following entity types were determined: Dai medicine name, which is one of the core entities for building a knowledge graph, covering the specific names of various Dai medicines; altitude, reflecting the altitude information of the growth environment of Dai medicine; environment, including the natural environmental conditions for the growth of Dai medicine; location, clarifying the specific growth location of Dai medicine; part, referring to the specific part used for Dai medicine in medicine; season, that is, the harvesting season of Dai medicine; nature and taste, reflecting the nature and taste characteristics of Dai medicine; disease, the type of disease treated by Dai medicine; syndrome, syndrome manifestations related to the disease; family, the classification of the plant family to which Dai medicine belongs.

[0052] At the same time, the possible relationships between different entities are clarified. These relationships include growth altitude, which describes the relationship between Dai medicine and the growth altitude; growth environment, which shows the relationship between Dai medicine and the growth environment; growth location, which determines the relationship between the growth geographical location of Dai medicine; medicinal parts, which reflects the relationship between the used parts of Dai medicine and the whole; harvesting season, which reflects the relationship between the harvesting time of Dai medicine; medicinal material properties and flavors, which shows the relationship between the properties and flavor characteristics of Dai medicine; functions and indications, which explains the relationship between the main functions and therapeutic effects of Dai medicine; main diseases, which clarifies the therapeutic relationship of Dai medicine to specific diseases; categories, which reflects the classification of the plant family to which Dai medicine belongs.

[0053] Then, manual annotation is performed. The manual annotation process requires rigor and meticulousness, and the annotators need to have professional knowledge in the field of Dai medicine and rich annotation experience. During the annotation process, each sentence must be carefully analyzed, the entities and relationships therein must be accurately identified, and then annotated. In order to ensure the accuracy and consistency of annotation, we have developed detailed annotation specifications and standards, and trained and guided the annotators. At the same time, a annotation review mechanism is established to repeatedly review and revise the annotation results to ensure the reliability of the annotation data.

[0054] Through manual labeling, we provide reliable labeled data for subsequent model training and knowledge graph construction, laying a solid foundation for building a high-quality Dai medicine knowledge graph.

[0055] Step 4: Bidirectional entity relationship joint extraction model

[0056] 1. Original feature extraction

[0057] According to the characteristics of Dai medicine text, the text is input into the original feature extractor to extract the original features of each modality. The pre-trained text decoder Chinese-BERT is used to extract the original text features, and the head entity features, tail entity features and relationship features are further extracted based on the text features. The mathematical definitions are shown in formulas (1 to 4).

[0058] h i =BERT(x 1 ,x 2 ,...,x n ) (1)

[0059]

[0060] Among them, h i is the representation of the ith token in the sentence, and h is the context representation, is a trainable matrix, is the bias vector, d h is the dimension.

[0061] 2. Bidirectional extraction framework based on multi-layer perceptron

[0062] The bidirectional extraction framework has a bidirectional framework for extracting triple pairs from the following two directions: (1) S2T direction: first extract the head entity, and then extract the tail entity and its relationship conditioned on the extracted head entity. (2) The reverse O2T direction of first extracting the tail entity and then extracting the head entity and its relationship. The extraction in these two directions shares the encoder component. Among them, in order to improve the expressive power of the model and learn more complex features, a multi-layer perceptron is used before the entity tagger in both directions to enhance the entity features. The internal structures of the two directions are similar, so only the S2T direction is introduced here. The mathematical definition is shown in formulas (5~10).

[0063]

[0064] Among them, MLP() represents a multi-layer perceptron, in which RELU is used as the activation function and dropout is used to avoid overfitting of the model. and denote the probabilities of the start tag and end tag of the head entity in the i-th sentence, respectively. Represents the vector representation of the start tag to the end tag of the kth head entity. Here, the maximum pooling is selected to process the head entity features, so can be regarded as the representation of the k-th head entity. and represents the probability of the start tag and end tag of the tail entity related to the kth head entity in the ith sentence, and ⊙ represents the Hadamard product. is a trainable matrix, is the bias vector, and σ represents the sigmoid activation function.

[0065] 3. Relationship recognition based on multi-layer perceptron

[0066] For an entity pair, first obtain the representation vectors of the two entities and Then calculate the entity pair (s k ,o j )The probability of having the i-th relationship The mathematical definitions are shown in formulas (11 to 15).

[0067]

[0068] in, Header Entity and tail entity The entity pair obtained by concatenation. concat represents the concatenated feature fusion method, ⊙ represents the Hadamard product, is a trainable matrix, is the bias vector.

[0069] 4. Negative Sample Generation

[0070] In order to alleviate the problem of exposure bias, a negative sample strategy is used to randomly generate some negative samples to add to all training sets. During inference, the total sample containing negative samples can simulate real scenes, improve the robustness and recognition accuracy of the model in natural scenes, and greatly alleviate the problem of exposure bias.

[0071] 5. Loss Function

[0072] This model is a bidirectional extraction model, in which all modules in both directions work in multi-task learning. In the training process based on multi-task learning, each task and the encoder module form a relatively independent extraction task. The binary cross entropy loss function is used in each module, and finally the loss functions of all modules are added together to obtain the final loss function. The mathematical definition is shown in formula (16~10).

[0073] ce(p,t)=-[tlogp+(1-t)log(1-p)] (16)

[0074]

[0075] where ce(p,t) is the binary cross entropy loss function, p is the predicted probability, t is the true label, and l is the number of tokens in the input sentence. and are the predicted head entity probability and tail entity probability, and are the real head entity tags and tail entity tags, represents the loss of the head entity tagger, is the loss of the tail entity marker based on the head entity. There are also two marker losses in the O2T direction, which are calculated in the same way as formulas (16-18). They are expressed as and R is a set of predefined relations, and |R| is the total number of relations, is the predicted relationship probability, is a real relationship label, is the loss of the relation recognition module, Represents the loss function of the entire model.

[0076] The model was experimentally verified on the Dai medicine dataset, and the model was evaluated according to the F1 score, precision, and recall, which are widely used evaluation indicators in the field of relationship extraction. The F1 score, as the harmonic mean of precision and recall, is a key indicator to measure the overall performance of the model.

[0077] The mathematical definitions are shown in formulas (21 to 23).

[0078]

[0079] Among them, TP is a true positive example, FN is a false negative example, FP is a false positive example, and TN is a true negative example.

[0080] The experimental results are shown in Table 1:

[0081] Table 1 Performance of the model on the Dai medicine dataset

[0082]

[0083] Through the bidirectional entity relationship joint extraction model, we input a large amount of unlabeled data into the model and output it as triplets of entity relationships. A total of 34,082 Dai medicine-related triplets were extracted, providing data support for the subsequent knowledge graph construction.

[0084] Step 5: Knowledge graph construction

[0085] In the Dai medicine knowledge graph system, knowledge graph construction is an important step to achieve Dai medicine knowledge integration and visualization. First, according to the entity and relationship triples extracted by the model, these triples are stored in the Neo4j database in the form of a graphical knowledge graph. There are 6464 nodes in the database, including 1309 Dai medicine materials, 554 altitudes, 996 environments, 263 locations, 180 parts, 4 seasons, 853 syndromes, 2064 diseases and 239 families; there are 30262 relationships, including 811 growth altitudes, 2822 growth environments, 10669 growth locations, 2100 medicinal parts, 1642 growing seasons, 3669 functions and indications, 7278 main diseases, and 1271 drug families.

[0086] This storage method can efficiently organize and manage Dai medicine knowledge, and facilitate subsequent query and analysis. The graphical knowledge graph displays various entities in the field of Dai medicine and the complex relationships between them in an intuitive way, allowing users to quickly understand and grasp the structure of Dai medicine knowledge.

[0087] In short, by constructing a knowledge graph of Dai medicine, an intuitive and powerful tool is provided for the research, teaching, and clinical application of Dai medicine, which will help promote the development and inheritance of the Dai medicine field.

Claims

1. A method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model, characterized in that: The following steps are involved: Step 1: Data collection: collect text data related to Dai medicine; Step 2: Data preprocessing: cleaning and word segmentation of the collected text data; Step 3: Manual labeling: define entities and relationships in the cleaned data, and manually label the entities and relationships in the sentence; Step 4: Build a bidirectional entity relationship joint extraction model, and use the model to simultaneously extract entity and relationship triplets from the preprocessed text data; Step 5: Construct a knowledge graph. Construct a Dai medicine knowledge graph based on the extracted entity and relationship triplets.

2. The method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model according to claim 1 is characterized in that: In step 3, entities include the name of Dai medicine, altitude, environment, location, part, season, nature and taste, disease, syndrome, and family; the relationships between different entities include growth altitude, growth environment, growth location, medicinal part, harvesting season, nature and taste of medicine, main function, main disease, and category of medicine.

3. The method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model according to claim 1 is characterized in that: In step 4, the bidirectional entity relationship joint extraction model includes a bidirectional framework for extracting triple pairs from two directions: (1) S2T direction: first extracting the head entity, and then extracting the tail entity and its relationship conditioned on the extracted head entity; (2) the reverse O2T direction of first extracting the tail entity and then extracting the head entity and its relationship; the extraction in the two directions shares the encoder component; a multi-layer perceptron is used before the entity tagger in the two directions to enhance the entity features, and the internal structure of the two directions is: Among them, MLP() represents a multi-layer perceptron. and denote the probabilities of the start and end tags of the head entity in the i-th sentence, respectively. Represents the vector representation from the start tag to the end tag of the k-th head entity, is the representation of the k-th head entity, and represents the probability of the start and end tags of the tail entity related to the kth head entity in the i-th sentence, ⊙ represents the Hadamard product, is a trainable matrix, is the bias vector, and σ represents the sigmoid activation function.

4. The method for constructing a Dai medicine knowledge graph based on a bidirectional entity relationship joint extraction model according to claim 1 is characterized in that: In step 4, the specific process of using the model to simultaneously extract entity and relationship triplets from the preprocessed text data is as follows: The text is input into the original feature extractor to extract the original features of each modality. The pre-trained text decoder Chinese-BERT is used to extract the original text features, and the head entity features, tail entity features and relationship features are further extracted based on the text features, as shown below: h i =BERT(x1,x2,...,x n ) Among them, h i is the representation of the ith token in the sentence, and h is the context representation, is a trainable matrix, is the bias vector, d h is the dimension.