Intelligent question answering system based on traditional Chinese medicine processing knowledge graph
By constructing a knowledge graph for Chinese medicine preparation and using the BERT-CAN-NER model, the multi-sense problem of the term in the field of Chinese medicine preparation is solved, and rapid and accurate query of user problems and efficient information extraction are achieved.
Patent Information
- Application Number
- CN202411614574.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-28
AI Technical Summary
When the prior art deals with the multi-sense phenomenon of the term in the field of traditional Chinese medicine preparation, it is difficult for the attention mechanism and the gate mechanism to effectively distinguish different meanings, resulting in inaccurate information extraction and reduced accuracy of entity and intention recognition.
By constructing a knowledge graph for Chinese medicine preparation, combining entity node information and question templates, the Chinese medicine question training corpus is automatically constructed, and the sentences are encoded using the BERT-CAN-NER model to improve the recognition accuracy of named entities and intentions.
It realizes rapid retrieval and accurate answers of user questions, improves the accuracy and efficiency of information query for traditional Chinese medicine, and improves the user experience.
Smart Images

Figure CN119537544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Chinese medicine intelligent systems, and in particular to an intelligent question-answering system based on a Chinese medicine processing knowledge graph. Background Art
[0002] As an important part of traditional Chinese medicine, Chinese medicine processing has a long history and a profound theoretical basis. Processing technology can effectively improve the efficacy of drugs, reduce toxic side effects, and improve the storage and use performance of drugs through the processing and treatment of Chinese medicinal materials. It has extremely high research and application value.
[0003] With the rapid development of Internet technology, it is more convenient to obtain Chinese medicine knowledge through the Internet. At present, users mainly obtain information through Chinese medicine processing related websites and traditional search engines such as Baidu. However, the information provided by these channels is usually large and complex, lacks pertinence, and it is difficult to ensure the accuracy and scientificity of the knowledge.
[0004] There are a lot of polysemous words in the field of Chinese medicine preparation. The existing Slot-Gated model uses the attention mechanism to focus on relevant information, but when faced with polysemous words, the attention mechanism may not be able to effectively distinguish different meanings, resulting in inaccurate information extraction. Although the gating mechanism can help the model better control the flow of information, it may not be able to fully cope with highly ambiguous words, resulting in a decrease in the accuracy of entity and intent recognition. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides an intelligent question-answering system based on a knowledge graph of traditional Chinese medicine preparation. The present invention automatically constructs a training corpus of traditional Chinese medicine questions by combining the entity node information in the knowledge graph with the question template, and uses the BERT-CAN-NER model to encode the sentences, thereby improving the recognition accuracy of named entities and intentions in the questions, and realizing rapid retrieval and accurate answers to user questions.
[0006] The technical solution of the present invention is: an intelligent question-answering system based on a knowledge graph of traditional Chinese medicine processing, comprising:
[0007] The TCM processing knowledge graph construction module is used to collect text data related to TCM processing and extract entities, attributes, and relationships from the text data to construct a TCM processing knowledge graph;
[0008] The large language model training module is used to train and fine-tune the large language model using the TCM processing knowledge graph, so that it can understand natural questions and generate text related to TCM processing;
[0009] The intelligent question-answering module is used to collect users' natural language questions about Chinese medicine preparation, and use the trained and fine-tuned large language model to understand the questions and retrieve information in the knowledge graph to generate and return accurate, natural and useful answers.
[0010] Preferably, the entities extracted by the TCM processing knowledge graph construction module include the name of the TCM, processing method, processing efficacy, processing auxiliary materials, and medicinal material properties.
[0011] Preferably, the Chinese medicine preparation knowledge graph construction module adopts the natural language processing technology NLP to perform word segmentation, part-of-speech tagging, and dependency analysis on text data related to medicine preparation.
[0012] Preferably, the TCM preparation knowledge graph construction module uses the BERT-CAN-NER model to extract entities from text data related to TCM preparation, captures deep contextual information of user consultation question text through the BERT model, and considers entity context through the CAN-NER model.
[0013] Preferably, the Chinese medicine preparation knowledge graph construction module adopts a CNN-LSTM hybrid neural network model to extract the relationships and attributes between entities; extracts local features of the text through a convolutional neural network CNN of the CNN-LSTM hybrid neural network model; and uses a long short-term memory network LSTM to capture contextual information, process sequential text data and capture long-distance dependencies, so as to more accurately extract the semantic relationships between entities.
[0014] Preferably, the TCM preparation knowledge graph construction module represents entities, relationships, and attributes in the form of triple data, and organizes the obtained triple data and transmits them to the graph database Neo4j for storage to obtain a TCM preparation knowledge graph.
[0015] Preferably, the intelligent question-answering module uses natural language processing technology NLP to parse the consulting questions input by the user and then extracts keywords in the consulting questions through TF-IDF or TextRank technology.
[0016] Preferably, the intelligent question-answering module uses a large language model to understand user consultation questions and divides user consultation questions into entities to be queried and / or relationships to be queried.
[0017] Preferably, the large language model searches in the Chinese medicine preparation knowledge graph based on the entities to be queried and / or the relations to be queried to obtain candidate triples corresponding to the entities to be queried and / or the relations to be queried, and the large language model generates answers corresponding to the user consultation questions based on the candidate triples and the user consultation questions.
[0018] The beneficial effects of the present invention are:
[0019] 1. The present invention uses natural language processing technology and deep learning algorithms to extract entities such as Chinese medicine, processing methods, and processing excipients from the data, and extracts the relationships between the entities, thereby constructing a knowledge graph of Chinese medicine processing and presenting it in a structured and visual form;
[0020] 2. The present invention provides users with processing knowledge more quickly and efficiently based on the traditional Chinese medicine processing knowledge graph and large language model;
[0021] 3. The present invention improves the accuracy and efficiency of querying information on traditional Chinese medicine processing, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a framework structure diagram of the system of the present invention;
[0023] Figure 2 A framework diagram for extracting entities from a knowledge graph construction module for Chinese medicine processing of the present invention;
[0024] Figure 3 This is a framework diagram of the intelligent question-answering module of the present invention. DETAILED DESCRIPTION
[0025] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings:
[0026] like Figure 1 As shown, this embodiment provides an intelligent question-answering system based on a knowledge graph of traditional Chinese medicine preparation, including:
[0027] The TCM processing knowledge graph construction module is used to collect text data related to TCM processing and extract entities, attributes, and relationships from the text data to construct a TCM processing knowledge graph;
[0028] The large language model training module is used to train and fine-tune the large language model using the TCM processing knowledge graph, so that it can understand natural questions and generate text related to TCM processing;
[0029] The intelligent question-answering module is used to collect users' natural language questions about Chinese medicine preparation, and use the trained and fine-tuned large language model to understand the questions and retrieve information in the knowledge graph to generate and return accurate, natural and useful answers.
[0030] As preferred in this embodiment, the text data related to the processing of traditional Chinese medicines are derived from ancient books and documents related to the processing of traditional Chinese medicines, modern research materials, expert experience and other data. Duplicate, erroneous and incomplete information is removed, and the acquired data is formatted to meet the requirements of subsequent analysis, such as unifying the data format and marking key information.
[0031] As a preferred embodiment of this embodiment, the entities extracted by the Chinese medicine processing knowledge graph construction module include the name of the Chinese medicine, processing method, processing efficacy, processing auxiliary materials, and medicinal material properties.
[0032] As a preferred embodiment of the present invention, the natural language processing technology NLP is used to perform word segmentation, part-of-speech tagging, and dependency analysis on the text data related to drug preparation.
[0033] As preferred in this embodiment, Figure 2 As shown, the TCM processing knowledge graph construction module uses the BERT-CAN-NER model to extract entities from the text data related to TCM processing, captures the deep context information of the user consultation question text through the BERT model, and considers the entity context through the CAN-NER model. Then the CNN-LSTM hybrid neural network model is used to extract the relationship and attributes between entities; the convolutional neural network CNN of the CNN-LSTM hybrid neural network model is used to extract the local features of the text; and the long short-term memory network LSTM is used to capture the context information, process the sequential text data and capture the long-distance dependency relationship, so as to more accurately extract the semantic relationship between entities. For example: "drug-effect", "processing method-drug". Then the entities, relationships, and attributes are represented in the form of triple data, and the obtained triple data is sorted and transmitted to the graph database Neo4j for storage, so as to obtain the TCM processing knowledge graph, which is represented by structured and visual representation.
[0034] In this embodiment, by clarifying the definitions of various processing methods, the concepts of different medicinal materials, etc., the relevant attributes are determined, including the attributes of Chinese medicine (such as nature and taste, meridians, etc.), effects (such as efficacy, pharmacological effects, etc.), and the relationships between entities are sorted out. These entities, attributes and relationships are organized in the form of triples, such as: <Chinese medicinal materials, processing methods, processed products>, showing the corresponding relationship between Chinese medicinal materials, processing methods and processed products, as shown in Table 1:
[0035] Table 1 TCM processing entities to be queried and attribute definition table of entities to be queried
[0036]
[0037]
[0038] Table 2 shows examples of specific Chinese medicines, quality requirements, storage methods, specific processing methods and processing effects.
[0039]
[0040]
[0041] Secondly, it is necessary to clarify the basic concepts in the field of prescription system, such as the names of various prescriptions, the medicines they make, etc., determine the relevant attributes, including the attributes of the constituent medicines (such as nature, taste, meridians, etc.), the requirements for drug preparations, sort out the relationships between entities, and organize these entities, attributes and relationships in the form of triples, for example: <prescription-preparation of the medicines contained-efficacy>, which shows the correspondence between the prescription, the preparation of the medicines contained and the efficacy achieved.
[0042] Table 3 Definition of prescription query entity and attribute of query entity
[0043] Query Entities Property Definition Prescription Name The specific name of the prescription, such as Siwu Decoction, Mahuang Decoction, etc. Composition of drugs The names of all Chinese medicines included in the prescription. Indications The disease or symptoms that the prescription mainly treats. Efficacy and characteristics A description of the overall efficacy of the prescription, such as clearing heat and cooling blood, warming yang and dispersing cold, etc. Drug preparation requirements Appropriate preparations of each medicine in the prescription, such as raw Rehmannia root, cooked Rehmannia root, etc. Compatibility principles The rules and characteristics of drug compatibility in prescriptions. Clinical application cases Specific cases of using this prescription in actual clinical practice.
[0044] In this embodiment, the nodes in the graph database Neo4j are entities of the traditional Chinese medicine processing knowledge graph, and the edges in the graph database Neo4j are relationships in the traditional Chinese medicine processing knowledge graph.
[0045] At the same time, the nodes in the graph database Neo4j are the entities of the traditional Chinese medicine knowledge graph, and the edges are the relationships in the traditional Chinese medicine knowledge graph.
[0046] By representing entity-relationships in the form of nodes and edges in the graph database Neo4j, and using its efficient graph processing capabilities and flexible query language Cypher for data storage and complex query operations, effective management of large-scale TCM knowledge data can be achieved.
[0047] As preferred in this embodiment, the large language model adopts GPT, BERT, and XLNet, and the model is configured according to the characteristics of the field of traditional Chinese medicine preparation, including adjusting the model structure, parameter settings, etc.
[0048] As preferred in this embodiment, Figure 3 As shown in the figure, we extract entities, attributes and relationship data related to Chinese medicine processing from the graph database Neo4j and build a training data set; and use the training data set to train the large language model; during the training process, we focus on the performance of the large language model, such as loss function, accuracy and other indicators; and adjust the training strategy in real time according to the training results, such as learning rate, batch size, etc., to optimize the performance of the large language model. After the training is completed, the large language model is tested with the test set to ensure that the large language model meets expectations.
[0049] As preferred in this embodiment, the intelligent question-and-answer module has a user interface to facilitate users to ask questions and answer questions, and the user consultation questions are questions related to Chinese medicine processing, Chinese medicine prescriptions, medicinal materials, etc. input by users. In this embodiment, the user inputs the user consultation questions in text form or voice form through the user interface, and the questions input by the user are parsed through natural language processing technology (NLP), including word segmentation, part-of-speech tagging, dependency analysis, etc., for example, determining that "a certain medicinal material" in "how to prepare a certain medicinal material?" is a noun phrase and "processing" is a verb. In order to understand the intent and key information of the question. The questions raised by users may contain texts of varying lengths. In order to accurately capture the user's query intentions, the intelligent question-and-answer module uses TF-IDF and TextRank technology to extract keywords in the parsed consultation questions.
[0050] The intelligent question-answering module uses the trained large language model to understand the user's consulting questions, and then divides the consulting questions into entities to be queried and relationships to be queried. The large language model searches in the Chinese medicine processing knowledge graph based on the entities to be queried and / or the relationships to be queried, and obtains candidate triples corresponding to the entities to be queried and / or the relationships to be queried. For example, taking "Huangqi" as the entity to be queried and "the processing method is" as the relationship to be queried, searching in the Chinese medicine processing knowledge graph can obtain two candidate triples, namely <Huangqi, the processing method is, roasted Huangqi> and <Huangqi, the processing method is, Huangqi charcoal>. For another example, taking the prescription "Buzhong Yiqi Decoction" as the query entity and taking "which processed product to choose as the query relationship" in the knowledge graph combining prescription science and processing science can obtain the candidate triple <Buzhong Yiqi Decoction, which processed product to choose, roasted Huangqi>.
[0051] Then, based on the candidate triples, determine the answer corresponding to the user's consultation question. For example, if the candidate triple is <Astragalus, the processing method is, roasted Astragalus>, then the answer "What is the processing method of Astragalus" corresponding to the user's consultation question "What is the processing method of Astragalus" can be generated according to the candidate triple. "The processing method of Astragalus is roasted Astragalus".
[0052] In this embodiment, there may be multiple candidate triples, and the intelligent question-answering module can directly use these candidate triples to generate multiple answers to the user's consultation questions. In addition, the intelligent question-answering module can further screen the candidate triples to determine the candidate triple that best matches the user's consultation question, and then generate answers based on this. For example, based on the key information in the candidate triples, options are displayed to the user, and the user provides further input information based on these options. Based on the user's input, the candidate triple that is closest to the user's intention is determined, and useful content is extracted. The large language model generates answers corresponding to the user's consultation questions based on the candidate triples and the user's consultation questions.
[0053] The above embodiments and descriptions are only for illustrating the principles and best embodiments of the present invention. Without departing from the spirit and scope of the present invention, the present invention may be subject to various changes and improvements, all of which fall within the scope of the present invention to be protected.
Claims
1. An intelligent question-answering system based on a knowledge graph of traditional Chinese medicine processing, characterized in that: The system comprises: The TCM processing knowledge graph construction module is used to collect text data related to TCM processing and extract entities, attributes, and relationships from the text data to construct a TCM processing knowledge graph; The large language model training module is used to train and fine-tune the large language model using the TCM processing knowledge graph, so that it can understand natural questions and generate text related to TCM processing; The intelligent question-answering module is used to collect users' natural language questions about Chinese medicine preparation, and use the trained and fine-tuned large language model to understand the questions and retrieve information in the knowledge graph to generate and return accurate, natural and useful answers.
2. An intelligent question-answering system based on a knowledge graph of traditional Chinese medicine processing according to claim 1, characterized in that: The TCM preparation knowledge graph construction module uses the BERT-CAN-NER model to extract entities from text data related to TCM preparation, captures the deep contextual information of the user's consultation question text through the BERT model, and considers the entity context through the CAN-NER model.
3. An intelligent question-answering system based on a knowledge graph of traditional Chinese medicine processing according to claim 2, characterized in that: The Chinese medicine preparation knowledge graph construction module adopts the CNN-LSTM hybrid neural network model to extract the relationship and attributes between entities; the convolutional neural network CNN of the CNN-LSTM hybrid neural network model is used to extract local features of the text; The long short-term memory network (LSTM) is used to capture contextual information, process sequential text data and capture long-distance dependencies, so as to more accurately extract the semantic relationships between entities.
4. The intelligent question-answering system based on the knowledge graph of Chinese medicine processing according to claim 3 is characterized in that: The Chinese medicine processing knowledge graph construction module represents entities, relationships, and attributes in the form of triple data, and transmits the obtained triple data to the graph database Neo4j for storage after sorting, thereby obtaining a Chinese medicine processing knowledge graph.
5. An intelligent question-answering system based on a knowledge graph of traditional Chinese medicine processing according to claim 4, characterized in that: The entities extracted by the Chinese medicine processing knowledge graph construction module include the name of the Chinese medicine, processing method, processing efficacy, processing auxiliary materials, and medicinal material properties.
6. The intelligent question-answering system based on the knowledge graph of Chinese medicine processing according to claim 5, characterized in that: The Chinese medicine preparation knowledge graph construction module adopts natural language processing technology NLP to perform word segmentation, part-of-speech tagging, and dependency analysis on text data related to medicine preparation, and then extracts entities, relationships, and attributes through the BERT-CAN-NER model and the CNN-LSTM hybrid neural network model.
7. An intelligent question-answering system based on a knowledge graph of traditional Chinese medicine processing according to claim 6, characterized in that: The large language model training module extracts entities, attributes and relationship data related to Chinese medicine processing from the Chinese medicine processing knowledge graph in the graph database Neo4j and constructs a training data set; The large language model is trained using the training data set, and the training strategy is adjusted based on the loss function and accuracy to optimize the performance of the large language model.
8. The intelligent question-answering system based on the knowledge graph of Chinese medicine processing according to claim 1, characterized in that: The intelligent question-answering module extracts keywords from the consulting questions input by the user through TF-IDF or TextRank technology after parsing using natural language processing technology NLP.
9. An intelligent question-answering system based on a knowledge graph of Chinese medicine processing according to claim 8, characterized in that: The intelligent question-answering module uses the large language model to understand the user's consulting questions and then divides the user's consulting questions into entities to be queried and relationships to be queried.
10. The intelligent question-answering system based on the knowledge graph of Chinese medicine processing according to claim 9, characterized in that: The large language model searches in the Chinese medicine preparation knowledge graph based on the entities to be queried and / or the relationships to be queried to obtain candidate triples corresponding to the entities to be queried and / or the relationships to be queried. The large language model generates answers corresponding to user consultation questions based on the candidate triples and the user consultation questions.
Citation Information
Cited By
Traditional Chinese medicine teacher following learning assisting method and system, electronic equipment and storage medium
CN120072237A