A traditional Chinese medicine knowledge graph construction method and system, and a storage medium

By constructing a TCM knowledge graph and utilizing text mining models and the Neo4j database, the problem of the high level of specialization in TCM knowledge graphs was solved, enabling the association of TCM and Western medicine terms and personalized recommendations, thus improving the user experience.

CN116049426BActive Publication Date: 2026-04-24HANGZHOU PULSE HEALTH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU PULSE HEALTH TECH CO LTD
Filing Date
2022-12-19
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing TCM knowledge graphs are too technical and difficult for ordinary people to understand. They also lack connections between TCM and Western medicine terms, resulting in limited information access and difficulty in making connections.

Method used

By performing regular expression extraction and review on the original text, a text mining model is trained. A knowledge graph of traditional Chinese medicine is constructed using the Neo4j graph database. Relationships between entities are used as edges and explanatory attributes are extended. Similarity calculation is performed in conjunction with a personalized recommendation module to achieve the association between Chinese and Western medicine terms.

Benefits of technology

This makes the TCM knowledge graph easier to understand and use, connects TCM and Western medicine terms, provides personalized recommendation functions, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116049426B_ABST
    Figure CN116049426B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a traditional Chinese medicine knowledge graph construction method and system and a storage medium. The method comprises the following steps: performing regular extraction on the obtained original text to obtain initial entity and relationship data converted into traditional Chinese medicine, and performing auditing on part of the data to obtain text training data; training based on the text training data to obtain a text mining model; then, the remaining part of the initial entity and relationship data is sent into the text mining model for prediction to obtain predicted entity and relationship data; a Neo4j graph database is used, and corresponding traditional Chinese medicine knowledge graphs are generated according to the predicted entity and relationship data; the effect is that the relationship and attribute between each entity are embodied; and therefore, the application of the user is more convenient, and the defects that the technology is too professional and there is no association between Chinese and Western medical terms in the prior art are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of knowledge graph technology, specifically relating to a method, system, and storage medium for constructing a traditional Chinese medicine knowledge graph. Background Technology

[0002] Currently, although some TCM knowledge graphs have emerged, existing TCM knowledge graphs are too technical and difficult for ordinary people to understand and use. Furthermore, they lack connections between TCM and Western medicine terms, and existing technologies offer fewer explanations of TCM terms compared to Western medicine terms, resulting in users obtaining limited information and difficulty in making connections and correspondences. Summary of the Invention

[0003] In view of the shortcomings of the prior art, the present invention provides a method, system and storage medium for constructing a traditional Chinese medicine knowledge graph, so as to overcome the shortcomings of the prior art which is too professional and does not have the connection between Chinese and Western medical terms.

[0004] In a first aspect, the present invention provides a method for constructing a traditional Chinese medicine knowledge graph, the method comprising:

[0005] The original text was extracted using regular expressions to obtain initial entity and relation data for traditional Chinese medicine, and some of the data was reviewed to obtain text training data.

[0006] The text mining model is trained based on the text training data to obtain the model.

[0007] The remaining portion of the initial entity and relation data is then fed into the text mining model for prediction to obtain the predicted entity and relation data.

[0008] Using the Neo4j graph database, a corresponding TCM knowledge graph is generated based on the predicted entity and relation data. The TCM knowledge graph is constructed with the relationships between entities as edges, and the entities are extended and interpreted as corresponding attributes. The entities include symptoms, diseases, syndromes, locations, treatment methods, herbs, medicinal properties, prescriptions, books, places of origin, and Western medicine disease terms.

[0009] The text mining model is trained through the following steps:

[0010] S1, perform BERT encoding on the sentences in the input text data to obtain the sentence vector h;

[0011] S2, use sentence vector h to predict possible relationships in the sentence, and obtain vector r;

[0012] S3, use vector h to predict whether there is a subject-object relationship between each word in the sentence, and obtain an n*n matrix;

[0013] S4, [h,r] are concatenated and then pointers are used to identify the subject and object;

[0014] S5, based on the annotations in step S4, find r and determine whether the relationship is effective;

[0015] S6. Repeat steps S4 and S5 until the training effect is achieved.

[0016] Preferably, the construction includes relationships between entities as edges, and the entities are further interpreted and used as corresponding attributes, specifically including:

[0017] The disease entity is associated with symptoms, syndromes, prescriptions, treatment methods, Western medical disease terms, herbs, and disease types.

[0018] This confirms the physical relationship between the entity and the symptoms, syndromes, prescriptions, herbs, treatment methods, location, and disease type;

[0019] The symptom entity is associated with the syndrome and disease type entity;

[0020] The location of the affected area is related to the symptoms and the type of herb.

[0021] Herbs are associated with medicinal properties, diseases, symptoms, and prescription entity types;

[0022] Prescriptions are associated with disease, syndrome, herbs, and medical book entity types;

[0023] Among them, the pathogenic entity has seven extended attributes: overview, clinical manifestations, treatment methods, etiology, prevention, prognosis and origin;

[0024] The confirmed substance has six extended attributes: origin, overview, clinical manifestations, etiology, treatment methods, and key points of dialectical analysis;

[0025] Herbal entities have fifteen extended attributes: efficacy, chemical composition, original morphology, source, remarks, meridian tropism, morphological identification, precautions, processing, physicochemical identification, usage, medicinal properties, pharmacology, storage, harvesting and storage, and prescriptions.

[0026] The prescription entity has four extended attributes: indications, dosage and usage, method and source.

[0027] Preferably, the TCM knowledge graph is also used for personalized recommendations, specifically including:

[0028] First, the entity and relation contained in the user request information are extracted using the text mining model;

[0029] Then, the data is fed into the knowledge graph, and the overlap similarity of the relationships between knowledge graph nodes is calculated to obtain a node similarity ranking; wherein, the formula for calculating the overlap similarity is:

[0030]

[0031] Where, the denominator n O(0) It is used as a normalization factor; g(x) i y i This is called the common dimension function; O(x) i y i ) represents the overlap function; X and Y represent the selected entities; n is the number of dimensions;

[0032] The final score will determine the order of recommendations.

[0033] Secondly, the present invention also provides a system for constructing a traditional Chinese medicine knowledge graph, comprising:

[0034] The data processing module is used to perform regular expression extraction on the acquired raw text to obtain the initial entity and relation data for traditional Chinese medicine, and to review some of the data to obtain text training data.

[0035] The text mining module is used for:

[0036] The text mining model is trained based on the text training data to obtain the model.

[0037] The remaining portion of the initial entity and relation data is then fed into the text mining model for prediction to obtain the predicted entity and relation data.

[0038] The knowledge graph construction module is used to generate a corresponding TCM knowledge graph based on the Neo4j graph database and the predicted entity and relation data. The TCM knowledge graph is constructed with the relationships between entities as edges, and the entities are extended and interpreted as corresponding attributes. The entities include symptoms, diseases, syndromes, locations, treatment methods, herbs, medicinal properties, prescriptions, books, places of origin, and Western medicine disease terms.

[0039] The text mining model is trained through the following steps:

[0040] S1, perform BERT encoding on the sentences in the input text data to obtain the sentence vector h;

[0041] S2, use sentence vector h to predict possible relationships in the sentence, and obtain vector r;

[0042] S3, use vector h to predict whether there is a subject-object relationship between each word in the sentence, and obtain an n*n matrix;

[0043] S4, [h,r] are concatenated and then pointers are used to identify the subject and object;

[0044] S5, based on the annotations in step S4, find r and determine whether the relationship is effective;

[0045] S6. Repeat steps S4 and S5 until the training effect is achieved.

[0046] Preferably, the system for constructing a traditional Chinese medicine knowledge graph further includes a personalized recommendation module, which is used for:

[0047] First, the entity and relation contained in the user request information are extracted using the text mining model;

[0048] Then, the data is fed into the knowledge graph, and the overlap similarity of the relationships between knowledge graph nodes is calculated to obtain a node similarity ranking; wherein, the formula for calculating the overlap similarity is:

[0049]

[0050] Where, the denominator n O(0) It is used as a normalization factor; g(x) i y i This is called the common dimension function; O(x) i y i ) represents the overlap function; X and Y represent the selected entities; n is the number of dimensions;

[0051] The final score will determine the order of recommendations.

[0052] Preferably, the overlap similarity is an extension of Jaccard similarity, which uses the intersection of two sets divided by the size of the smaller of the two sets to represent the degree of similarity between the two sets.

[0053] Thirdly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a method for constructing a traditional Chinese medicine knowledge graph as described in the first aspect.

[0054] By implementing the embodiments of the present invention, entities and relationships related to traditional Chinese medicine are obtained through a trained text mining model. At the same time, the graph database Neo4j is used to construct a knowledge graph of traditional Chinese medicine, which reflects the relationships and attributes between entities. This makes the application more convenient for users and overcomes the shortcomings of existing technologies that are too professional and do not have the connection between Chinese and Western medical terms. Attached Figure Description

[0055] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0056] Figure 1 A flowchart illustrating a method for constructing a traditional Chinese medicine knowledge graph, as provided in an embodiment of the present invention;

[0057] Figure 2 This is a schematic diagram illustrating the interaction process of a method for constructing a traditional Chinese medicine knowledge graph according to an embodiment of the present invention.

[0058] Figure 3 This is a schematic diagram of the structure of a system for constructing a traditional Chinese medicine knowledge graph, provided in an embodiment of the present invention. Detailed Implementation

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

[0060] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0061] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0062] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0063] Example 1:

[0064] This invention provides a method for constructing a traditional Chinese medicine knowledge graph, such as... Figures 1 to 2 As shown, the method includes:

[0065] S101, perform regular expression extraction on the acquired raw text to obtain initial entity and relation data for traditional Chinese medicine, and review some of the data to obtain text training data.

[0066] Specifically, the original texts include TCM textbooks, case texts, etc.

[0067] First, by using regular expression extraction, the text data is initially transformed into TCM entities and relationships, thereby reducing the cost of subsequent manual proofreading.

[0068] The data is then divided into two parts, one of which is the aforementioned portion of the data and is subject to manual review.

[0069] The calibrated portion of the data was used for model training.

[0070] S102, Train the text based on the text training data to obtain a text mining model.

[0071] Specifically, during implementation, the calibrated data is used for mining and training to obtain a text mining model.

[0072] S103, the remaining part of the initial entity and relation data is then fed into the text mining model for prediction to obtain the predicted entity and relation data.

[0073] When applied, the text mining model is trained through the following steps:

[0074] S1, perform BERT encoding on the sentences in the input text data to obtain the sentence vector h;

[0075] S2, use sentence vector h to predict possible relations in the sentence, and obtain vector r; where 0 indicates no relation and 1 indicates a relation.

[0076] S3, use vector h to predict whether there is a subject-object relationship between each word in the sentence, and obtain an n*n matrix;

[0077] S4, [h,r] are concatenated and then pointers are used to identify the subject and object;

[0078] S5, based on the annotations in step S4, find r and determine whether the relationship is effective;

[0079] S6. Repeat steps S4 and S5 to perform multiple training sessions until the desired training effect is achieved, forming the final model.

[0080] It should be noted that the output results will be manually proofread, the error types will be summarized, and the corresponding text will be modified accordingly. If there are few errors or they are within the preset range, the training effect can be considered achieved.

[0081] S104, using the Neo4j graph database, and generating a corresponding TCM knowledge graph based on the predicted entity and relation data; wherein, the TCM knowledge graph constructs the relationships between entities as edges, and provides extended explanations for the entities, which are used as corresponding attributes; the entities include symptoms, diseases, syndromes, locations, treatment methods, herbs, medicinal properties, prescriptions, books, places of origin, and Western medicine disease terms.

[0082] Specifically, the ontology of the TCM knowledge graph is determined by constructing relationships between entities as edges, providing extended interpretations of the entities, and using these interpretations as corresponding attributes. This includes:

[0083] The disease entity is associated with symptoms, syndromes, prescriptions, treatment methods, Western medical disease terms, herbs, and disease types.

[0084] This confirms the physical relationship between the entity and the symptoms, syndromes, prescriptions, herbs, treatment methods, location, and disease type;

[0085] The symptom entity is associated with the syndrome and disease type entity;

[0086] The location of the affected area is related to the symptoms and the type of herb.

[0087] Herbs are associated with medicinal properties, diseases, symptoms, and prescription entity types;

[0088] Prescriptions are associated with disease, syndrome, herbs, and medical book entity types;

[0089] Among them, the pathogenic entity has seven extended attributes: overview, clinical manifestations, treatment methods, etiology, prevention, prognosis and origin;

[0090] The confirmed substance has six extended attributes: origin, overview, clinical manifestations, etiology, treatment methods, and key points of dialectical analysis;

[0091] Herbal entities have fifteen extended attributes: efficacy, chemical composition, original morphology, source, remarks, meridian tropism, morphological identification, precautions, processing, physicochemical identification, usage, medicinal properties, pharmacology, storage, harvesting and storage, and prescriptions.

[0092] The prescription entity has four extended attributes: indications, dosage and usage, method and source.

[0093] Furthermore, such as Figure 2 As shown, when new text exists, it is processed to obtain the corresponding entity and relation, and then sent into the knowledge graph; the new text includes user interaction information or query information, etc.

[0094] Similarly, the output of the knowledge graph will also be manually reviewed, and errors will be corrected to update the graph.

[0095] Furthermore, to provide disease identification functions for users and novice TCM practitioners, the TCM knowledge graph is also used for personalized recommendations, specifically including:

[0096] First, the entity and relation contained in the user request information are extracted using the text mining model; wherein, the user request information is generated based on the user's business needs such as learning, querying, and consulting a doctor;

[0097] Then, the data is fed into the knowledge graph, and the overlap similarity of the relationships between knowledge graph nodes is calculated to obtain a node similarity ranking; wherein, the formula for calculating the overlap similarity is:

[0098]

[0099] Where, the denominator n O(0) It is used as a normalization factor; g(x) i y i This is called the common dimension function; O(x) i y i ) represents the overlap function; X and Y represent the selected entities; R n Represents the entire set, a collection of entities of a certain type; n is the number of dimensions;

[0100] Finally, the recommendation order is determined by the final score; the overlap similarity is an extension of Jaccard similarity, which uses the intersection of two sets divided by the size of the smaller set to represent the degree of similarity between the two sets.

[0101] In this embodiment, the text mining model trained is used to obtain entities and relationships related to traditional Chinese medicine. At the same time, the graph database Neo4j is used to construct a knowledge graph of traditional Chinese medicine, which reflects the relationships and attributes between entities. This makes the application more convenient for users and overcomes the shortcomings of existing technologies that are too professional and do not have the connection between Chinese and Western medical terms.

[0102] Example 2:

[0103] This embodiment also provides a system for constructing a traditional Chinese medicine knowledge graph, such as... Figure 3 As shown, it includes:

[0104] The data processing module is used to perform regular expression extraction on the acquired raw text to obtain the initial entity and relation data for traditional Chinese medicine, and to review some of the data to obtain text training data.

[0105] The text mining module is used for:

[0106] The text mining model is trained based on the text training data to obtain the model.

[0107] The remaining portion of the initial entity and relation data is then fed into the text mining model for prediction to obtain the predicted entity and relation data.

[0108] The knowledge graph construction module is used to generate a corresponding TCM knowledge graph based on the Neo4j graph database and the predicted entity and relation data. The TCM knowledge graph is constructed with the relationships between entities as edges, and the entities are extended and interpreted as corresponding attributes. The entities include symptoms, diseases, syndromes, locations, treatment methods, herbs, medicinal properties, prescriptions, books, places of origin, and Western medicine disease terms.

[0109] Furthermore, in this embodiment, the text mining model is trained through the following steps:

[0110] S1, perform BERT encoding on the sentences in the input text data to obtain the sentence vector h;

[0111] S2, use sentence vector h to predict possible relationships in the sentence, and obtain vector r;

[0112] S3, use vector h to predict whether there is a subject-object relationship between each word in the sentence, and obtain an n*n matrix;

[0113] S4, [h,r] are concatenated and then pointers are used to identify the subject and object;

[0114] S5, based on the annotations in step S4, find r and determine whether the relationship is effective;

[0115] S6. Repeat steps S4 and S5 until the training effect is achieved.

[0116] Furthermore, to achieve personalized recommendations and provide disease identification functions for users and novice TCM practitioners, the TCM knowledge graph construction system further includes a personalized recommendation module, which is used for:

[0117] First, the entity and relation contained in the user request information are extracted using the text mining model;

[0118] Then, the data is fed into the knowledge graph, and the overlap similarity of the relationships between knowledge graph nodes is calculated to obtain a node similarity ranking; wherein, the formula for calculating the overlap similarity is:

[0119]

[0120] Where, the denominator n O(0) It is used as a normalization factor; g(x) i y i This is called the common dimension function; O(x) i y i) represents the overlap function; X and Y represent the selected entities; n is the number of dimensions;

[0121] The final score will determine the order of recommendations.

[0122] It should be noted that the specific implementation methods in the above system embodiments can be referred to the description of the method embodiments above, and will not be repeated here.

[0123] In summary, the above system makes the application more convenient for users, overcomes the shortcomings of existing technologies that are too technical and lack the connection between Chinese and Western medical terms, and enables personalized recommendations.

[0124] In this embodiment, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, it causes the processor to perform the steps of the embodiment of the method for constructing a traditional Chinese medicine knowledge graph as described above.

[0125] Specifically, the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0126] The code of the computer program can be in the form of source code, object code, executable file, or some intermediate form.

[0127] Computer-readable storage media may include cache, high-speed random access memory (RAM), such as the common double data rate synchronous dynamic random access memory (DDR SDRAM), and may also include non-volatile memory (NVRAM), such as one or more read-only memories (ROM), disk storage devices, flash memory devices, or other non-volatile solid-state storage devices such as optical discs (CD-ROM, DVD-ROM), floppy disks, or data tapes.

[0128] Those skilled in the art will recognize that the systems and methods described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0129] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the above division of steps is merely a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple steps may be combined into one step, or one step may be split into multiple steps. Alternatively, some or all of the steps may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.

Claims

1. A method for constructing a knowledge graph of Traditional Chinese Medicine, characterized in that, The method includes: The original text was extracted using regular expressions to obtain initial entity and relation data for traditional Chinese medicine, and some of the data was reviewed to obtain text training data. The text mining model is trained based on the text training data. The remaining portion of the initial entity and relation data is then fed into the text mining model for prediction to obtain the predicted entity and relation data. Using the Neo4j graph database, a corresponding TCM knowledge graph is generated based on the predicted entity and relation data. The TCM knowledge graph is constructed with the relationships between entities as edges, and the entities are extended and interpreted as corresponding attributes. The entities include symptoms, diseases, syndromes, locations, treatment methods, herbs, medicinal properties, prescriptions, books, places of origin, and Western medicine disease terms. The text mining model is trained through the following steps: S1, perform BERT encoding on the sentences in the input text data to obtain the sentence vector h; S2, use sentence vector h to predict possible relationships in the sentence, and obtain vector r; S3, use vector h to predict whether there is a subject-object relationship between each word in the sentence, and obtain an n*n matrix; S4, [h,r] are concatenated and then labeled with pointers to identify the subject and object; S5, based on the annotations in step S4, find r and determine whether the relationship is effective; S6. Repeat steps S4 and S5 until the training effect is achieved.

2. The method for constructing a traditional Chinese medicine knowledge graph according to claim 1, characterized in that, The construction includes edges representing relationships between entities, and further explanations of the entities are provided, which are then used as corresponding attributes. Specifically, this includes: The disease entity is associated with symptoms, syndromes, prescriptions, treatment methods, Western medical disease terms, herbs, and disease types. This confirms the physical relationship between the entity and the symptoms, syndromes, prescriptions, herbs, treatment methods, location, and disease type; The symptom entity is associated with the syndrome and disease type entity; The location of the herb is related to the symptoms and the type of herb. Herbs are associated with medicinal properties, diseases, symptoms, and prescription entity types; Prescriptions are associated with disease, syndrome, herbs, and medical book entity types; Among them, the pathogenic entity has seven extended attributes: overview, clinical manifestations, treatment methods, etiology, prevention, prognosis and origin; The confirmed substance has six extended attributes: origin, overview, clinical manifestations, etiology, treatment methods, and key points of dialectical analysis; Herbal entities have fifteen extended attributes: efficacy, chemical composition, original morphology, source, remarks, meridian tropism, morphological identification, precautions, processing, physicochemical identification, usage, medicinal properties, pharmacology, storage, harvesting and storage, and prescriptions. The prescription entity has four extended attributes: indications, dosage and usage, method and source.

3. The method for constructing a traditional Chinese medicine knowledge graph according to claim 1, characterized in that, The TCM knowledge graph is also used for personalized recommendations, specifically including: First, the entity and relation contained in the user request information are extracted using the text mining model; Then, the data is fed into the knowledge graph, and the overlap similarity of the relationships between knowledge graph nodes is calculated to obtain a node similarity ranking; wherein, the formula for calculating the overlap similarity is: Where, the denominator n O(0) It is used as a normalization factor; g(x) i y i This is called the common dimension function; O(x) i y i ) represents the overlap function; X and Y represent the selected entities; n is the number of dimensions; The final score will determine the order of recommendations.

4. A system for constructing a knowledge graph of Traditional Chinese Medicine, characterized in that, include: The data processing module is used to perform regular expression extraction on the acquired raw text to obtain the initial entity and relation data for traditional Chinese medicine, and to review some of the data to obtain text training data. The text mining module is used for: The text mining model is trained based on the text training data. The remaining portion of the initial entity and relation data is then fed into the text mining model for prediction to obtain the predicted entity and relation data. The knowledge graph construction module is used to generate a corresponding TCM knowledge graph based on the Neo4j graph database and the predicted entity and relation data. The TCM knowledge graph is constructed with the relationships between entities as edges, and the entities are extended and interpreted as corresponding attributes. The entities include symptoms, diseases, syndromes, locations, treatment methods, herbs, medicinal properties, prescriptions, books, places of origin, and Western medicine disease terms. The text mining model is trained through the following steps: S1, perform BERT encoding on the sentences in the input text data to obtain the sentence vector h; S2, use sentence vector h to predict possible relationships in the sentence, and obtain vector r; S3, use vector h to predict whether there is a subject-object relationship between each word in the sentence, and obtain an n*n matrix; S4, [h,r] are concatenated and then labeled with pointers to identify the subject and object; S5, based on the annotations in step S4, find r and determine whether the relationship is effective; S6. Repeat steps S4 and S5 until the training effect is achieved.

5. The system for constructing a traditional Chinese medicine knowledge graph according to claim 4, characterized in that, It also includes a personalized recommendation module, which is used for: First, the entity and relation contained in the user request information are extracted using the text mining model; Then, the data is fed into the knowledge graph, and the overlap similarity of the relationships between knowledge graph nodes is calculated to obtain a node similarity ranking; wherein, the formula for calculating the overlap similarity is: Where, the denominator n O(0) It is used as a normalization factor; g(x) i y i This is called the common dimension function; O(x) i y i ) represents the overlap function; X and Y represent the selected entities; n is the number of dimensions; The final score will determine the order of recommendations.

6. The system for constructing a traditional Chinese medicine knowledge graph according to claim 5, characterized in that, The overlap similarity is an extension of the Jaccard similarity, which uses the intersection of two sets divided by the size of the smaller of the two sets to represent the degree of similarity between the two sets.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for constructing a traditional Chinese medicine knowledge graph as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for constructing traditional Chinese medicine knowledge graph

    CN114579755A

  • Knowledge graph construction method and device based on typhoid theory

    CN114996477A