Medical question and answer method based on graph path search and semantic index and related device
By using graph path search and semantic indexing technologies, a medical question-answering system was built, which solved the problem of insufficient accuracy in medical question-answering systems, achieved higher accuracy and recall, and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PENG CHENG LAB
- Filing Date
- 2022-12-29
- Publication Date
- 2026-04-21
AI Technical Summary
Existing medical question-and-answer systems lack accuracy in the medical field and cannot provide timely and rapid answers, resulting in a poor user experience.
This method employs graph path search and semantic indexing to obtain target entities and intents from target texts. It utilizes a graph constructed from triple relationships annotated by professionals and data from medical books to determine the existence of intents and obtain the shortest connected path in the graph. By combining deep learning and semantic indexing techniques, it improves the accuracy and recall of answers.
It improved the accuracy and recall rate of the medical question-and-answer system in the medical field, reduced quality control reminders, and enhanced the user experience.
Smart Images

Figure CN116072308B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic question answering technology, and in particular to a medical question answering method, system, terminal, and storage medium based on graph path search and semantic indexing. Background Technology
[0002] Medical question-and-answer systems automatically search, process, and interpret users' medical questions to generate answers. These systems take user-initiated questions and a high-quality question-and-answer resource library as input. After processing by the intelligent system, they output direct answers to the user's questions, along with several most relevant suggestion answers. With the continuous development of artificial intelligence technology, medical question-and-answer systems have gained significant attention in recent years and are considered one of the first technologies in the medical field where AI can be implemented.
[0003] The development and improvement of medical question-and-answer technology will have a profound impact on the integration of artificial intelligence and healthcare, providing great convenience for users. Currently, in the context of "Internet + Healthcare," many online medical question-and-answer communities have emerged. The main format is that users, such as patients and their families, ask questions, and doctors then provide the answers. This presents two problems: 1) Labor costs: Providing high-quality answers requires paying doctors, a cost primarily borne by users and internet platforms; 2) Response speed: Doctors often cannot provide timely answers, requiring users to wait one or two days or even longer, significantly impacting the user experience. If a medical question-and-answer system can replace or partially replace the work of doctors and automatically generate answers, it will greatly improve the efficiency of question-and-answer scenarios, generating significant economic benefits and benefiting society.
[0004] Although automated question answering technology has been developed for many years, due to the special nature of the medical field, its accuracy is still insufficient and it cannot achieve satisfactory results. Therefore, new technologies and methods are needed to solve the challenges and problems faced by automated question answering in the medical field.
[0005] Therefore, existing technologies still need to be improved and enhanced. Summary of the Invention
[0006] To address the aforementioned shortcomings of existing technologies, this paper provides a medical question-answering method and related equipment based on graph path search and semantic indexing, aiming to solve the problem of insufficient accuracy of existing question-answering systems when applied to the medical field.
[0007] A first aspect of the present invention provides a medical question-answering method based on graph path search and semantic indexing, comprising:
[0008] Obtain the target text, and extract the target entities from the target text, wherein there are at least two target entities;
[0009] Obtain the target intent from the target text and determine whether the target intent is in the target graph;
[0010] If the target graph contains the target intent, then the target answer is obtained based on the target entity and the target intent;
[0011] If the target map does not contain the target intent, then obtain the shortest connected path of the target entity in the target map;
[0012] Determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, give an affirmative answer; if it is not higher than the first target threshold, provide a quality control reminder.
[0013] The medical question-answering method based on graph path search and semantic indexing, wherein extracting target entities from the target text includes:
[0014] The target text is segmented to obtain multiple target words;
[0015] Extract medical-related terms from the plurality of target terms;
[0016] The medical-related terms are classified into entity categories to obtain different types of target entities.
[0017] The medical question-answering method based on graph path search and semantic indexing, wherein the types of the target entities include symptoms, diseases, examinations, tests, surgeries, and drugs.
[0018] The medical question-answering method based on graph path search and semantic indexing, wherein obtaining the target intent in the target text includes:
[0019] Obtain multiple intent training data sets with clearly labeled intents;
[0020] The classification model is trained based on the intended training data to obtain the target classification model;
[0021] Based on the target classification model, the target intent in the target text is obtained.
[0022] The medical question-answering method based on graph path search and semantic indexing is described in which the target graph is constructed by combining triple relationships annotated by professionals with data mined from medical books and drug instructions.
[0023] The medical question-answering method based on graph path search and semantic indexing, wherein the target graph is a three-dimensional spatial graph, which is formed by multiple label nodes forming connected paths. The connected paths contain relationship information between labels, wherein the label nodes correspond to entity information, and the relationship information between labels contains intent information.
[0024] The medical question-answering method based on graph path search and semantic indexing, wherein determining whether the target intent is in the target graph includes:
[0025] Obtain the label in the target map that is the same as the target entity as the target label corresponding to the target entity;
[0026] Obtain the relationship information between the target tags, and determine whether there is relationship information that is the same as the target intent. If there is, determine that the target map contains the target intent; if not, determine that the target map does not contain the target intent.
[0027] The medical question-answering method based on graph path search and semantic indexing, wherein obtaining the shortest connected path of the target entity in the target graph if the target intent is not contained in the target graph includes:
[0028] Obtain the first target entity and the second target entity related to the target intent from the target entity;
[0029] The breadth-first traversal algorithm is used to determine whether there is a connected path between the first target entity and the second target entity in the target graph.
[0030] If a connected path exists, obtain the shortest connected path between the first target entity and the second target entity;
[0031] If no connecting path exists, a quality control alert will be issued.
[0032] The medical question-answering method based on graph path search and semantic indexing, wherein determining whether the score of the shortest connected path is higher than a first target threshold includes:
[0033] The shortest connected path is linearly weighted based on its edge weights to obtain a score for the shortest connected path.
[0034] The medical question-answering method based on graph path search and semantic indexing, wherein after extracting the target entities from the target text, further includes:
[0035] Determine whether the target entity is in the target graph. If the target entity is not in the target graph, calculate and obtain the question and answer with the highest semantic similarity to the target text in the question and answer library based on the semantic index as the target question and answer.
[0036] The similarity between the target question and the target text is determined. If the similarity between the target question and the target text is higher than or equal to a second target threshold, the target question and the target text is used as the answer to the target text. If the similarity between the target question and the target text is lower than the second target threshold, no answer is given for the target text, and the N questions and answers in the question and answer database that are most semantically similar to the target text are used as reference answers.
[0037] A second aspect of the present invention provides a medical question-answering system based on graph path search and semantic indexing, comprising:
[0038] An entity extraction module is used to acquire target text and extract target entities from the target text, wherein the target entities are at least two.
[0039] An intent determination module is used to obtain the target intent in the target text and determine whether the target intent is in the target graph.
[0040] If the target graph contains the target intent, then the target answer is obtained based on the target entity and the target intent;
[0041] If the target map does not contain the target intent, then obtain the shortest connected path of the target entity in the target map;
[0042] The path judgment module is used to determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, an affirmative answer is given; if it is not higher than the first target threshold, a quality control reminder is given.
[0043] A third aspect of the present invention provides a terminal, the terminal including a processor and a computer-readable storage medium communicatively connected to the processor, the computer-readable storage medium being adapted to store a plurality of instructions, the processor being adapted to invoke the instructions in the computer-readable storage medium to perform the steps of implementing the medical question-answering method based on graph path search and semantic indexing as described in any of the preceding claims.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the medical question-answering method based on graph path search and semantic indexing as described in any of the preceding claims.
[0045] Beneficial Effects: Compared with existing technologies, this invention provides a medical question-answering method and related equipment based on graph path search and semantic indexing. In the medical question-answering method provided by this invention, target text is acquired, target entities are extracted from the target text (at least two target entities are identified), and then the target intent in the target text is obtained. It is determined whether the target intent is present in the target graph. If the target graph contains the target intent, the target answer is obtained based on the target entity and the target intent. If the target graph does not contain the target intent, the shortest connected path of the target entity in the target graph is obtained. After obtaining the shortest connected path, it is further determined whether the score of the shortest connected path is higher than a first target threshold. If it is higher than the first target threshold, a positive answer is given; if it is not higher than the first target threshold, a quality control reminder is provided. The medical question-answering method based on graph path search and semantic indexing provided by this invention improves the accuracy and recall rate of question-answering systems in the medical field. Attached Figure Description
[0046] Figure 1 A flowchart illustrating an embodiment of the medical question-answering method based on graph path search and semantic indexing provided by the present invention;
[0047] Figure 2 A flowchart of the question-answering system in an embodiment of the medical question-answering method based on graph path search and semantic indexing provided by the present invention;
[0048] Figure 3 The LSTM+CRF model structure diagram is shown in the embodiment of the medical question-answering method based on graph path search and semantic indexing provided by the present invention.
[0049] Figure 4 This is a schematic diagram illustrating the structure of an embodiment of the medical question-answering system based on graph path search and semantic indexing provided by the present invention.
[0050] Figure 5 A schematic diagram of the structure of an embodiment of the terminal provided by the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0052] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0053] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0054] The medical question-answering method based on graph path search and semantic indexing provided by this invention can be applied to terminals with computing capabilities. The terminal can execute the medical question-answering method based on graph path search and semantic indexing provided by this invention to answer medical questions in target text.
[0055] Example 1
[0056] This embodiment provides a medical question-answering method based on graph path search and semantic indexing.
[0057] One of the key technologies for the widespread application of question-answering systems in industry is retrieval-based question-answering (IR-QA). Existing information retrieval-based question-answering technologies first require building a question-answering database, containing as many user queries as possible previously generated on the platform. Then, indexes are created on the Questions and Answers in the database using information retrieval methods. During a query, the relevance between the user's question and the Questions or Answers in the database is calculated, and the answer corresponding to the Question with the highest relevance is returned to the user.
[0058] This embodiment is an improvement for question-answering systems. By using graph path search technology and semantic retrieval technology, question-answering technology can perform better in the medical field and solve the special needs of the medical field: high accuracy, authority, and explainability.
[0059] like Figure 1 As shown, the medical question-answering method based on graph path search and semantic indexing provided by this invention includes the following steps:
[0060] S100. Obtain the target text and extract the target entities from the target text, wherein there are at least two target entities.
[0061] The target text is a user-submitted query, and the target entity is a medical entity. The target entity is extracted from the target text to segment out the medical entity for subsequent processing.
[0062] The extraction of target entities from the target text includes:
[0063] S110. Perform word segmentation on the target text to obtain multiple target words.
[0064] like Figure 2 As shown, firstly, the user's query is processed using natural language processing, starting with word segmentation. For example, if the target text is: "I have a cough, headache, stomachache, and a bit of a cold today", the target text is segmented as: "I / today / cough / headache / stomachache / , / a bit / cold / ".
[0065] S120. Obtain medical-related terms from the plurality of target terms.
[0066] After segmenting the target text, obtain the segmented text and extract medical entities from the multiple segmented words.
[0067] S130. Classify the medical-related terms into entities to obtain different types of target entities.
[0068] The acquired medical terms are categorized to obtain different types of target entities. For example: "I / today / cough [symptom] / headache [symptom] / stomach ache [symptom] / slight / cold [disease]".
[0069] Specifically, in this embodiment, the types of the target entities include, but are not limited to, symptoms, diseases, examinations, tests, surgeries, and drugs.
[0070] Specifically, the natural language processing technology used in this embodiment is based on a deep learning-based method. One possible implementation is based on Bi-LSTM (Bidirectional Long Short-Term Memory) + Attention + CRF (Conditional Random Field). (Refer to...) Figure 3 The deep network model based on Bi-LSTM+CRF used in this embodiment, compared with the traditional neural network (DNN, RNN) framework, takes into account the order relationship between words in a sentence, which is more in line with the basic assumption of natural language processing (word order affects semantic expression). On the other hand, the method based on Long Short-Term Memory (LSTM) effectively solves the gradient explosion and gradient vanishing problems of traditional recurrent neural networks (RNN), making the model training more stable.
[0071] S200: Obtain the target intent in the target text and determine whether the target intent is in the target map.
[0072] The step of obtaining the target intent in the target text includes:
[0073] S210. Obtain multiple labeled intent training data;
[0074] S220. Train the classification model based on the intention training data to obtain the target classification model;
[0075] S230. Based on the target classification model, obtain the target intent in the target text.
[0076] To accurately answer the user's question, intent detection is needed on the target text, i.e., the user query. In this embodiment, a deep learning-based semantic method is used to obtain the target intent from the target text.
[0077] Deep learning-based semantic methods require data support. This is addressed by modeling it as a classification problem and training a classification model. In this embodiment, for an open medical question-answering system, user queries are diverse, and the model training method exhibits good generalization. Medical experts define a fixed range of intents, label a batch of data, and use classification methods to classify the intent, thus completing the intent detection of the query. Specifically, multiple labeled intent training data are obtained, and then the classification model is trained based on this training data to obtain a target classification model. Finally, based on the target classification model, the target intent in the target text is obtained.
[0078] Furthermore, the intent detection of the target text can be obtained using rule-based methods. Rule-based methods are relatively simple in concept; some pre-defined dialogue templates or keywords can be used to identify the intent in the dialogue based on matching methods. This method is easy to implement and allows for rapid verification of its effectiveness.
[0079] After obtaining the target intent in the target text, it is determined whether the target intent is in the target graph.
[0080] The target map is constructed by combining triplet relationships annotated by professionals with data mined from medical books and drug instructions.
[0081] Specifically, the constructed target map consists of two parts: one part is the triplet relationships annotated by professionals, such as <diabetes, food, fish>, etc., and the other part is the relationships mined based on authoritative guidelines such as medical books or drug instructions, such as <diabetes, symptoms, polyuria>, etc.
[0082] The target map is a three-dimensional spatial map, which is formed by multiple label nodes forming connected paths. The connected paths contain relationship information between labels, wherein the label nodes correspond to entity information, and the relationship information between labels includes intent information.
[0083] Specifically, to address the issue of incomplete target graphs leading to missing relationships, this embodiment introduces label nodes to form connected paths and determine relationships. Specifically, this is equivalent to introducing a label space, mapping entities to the same label space, calculating the distance between entities in the label space, and thus predicting whether a relationship exists between them. Here, the label nodes correspond to entity information, and the relationship information between the labels includes intent information.
[0084] Specifically, in this embodiment, a deep semantic classification model is used, employing supervised learning to enable the model to classify labels based on knowledge. There are many implementations of deep semantic classification models; this embodiment uses the ERNIE deep semantic model. The input to the ERNIE deep semantic model is entities and their related descriptions, such as the drug name and instructions for use for drugs, and the disease name and its alternative names for diseases. By training on classification samples, the model can determine which labels exist for drugs or diseases from multiple label spaces and calculate the probability (p) of label K. k If the probability pk is low, it is considered that the disease or drug is not associated with label K; otherwise, it is.
[0085] The step of determining whether the target intent is in the target map includes:
[0086] S240. Obtain the label in the target map that is the same as the target entity as the target label corresponding to the target entity;
[0087] S250. Obtain the relationship information between the target tags, and determine whether there is relationship information that is the same as the target intent. If there is, determine that the target map contains the target intent; if not, determine that the target map does not contain the target intent.
[0088] S300. If the target map contains the target intent, then obtain the target answer based on the target entity and the target intent.
[0089] Specifically, if the target graph contains the target intent, then the relevant nodes in the target graph are searched directly to provide an answer. For example, in one embodiment, there is a disease-related target entity: diabetes, and the target intent is: food. Then, the triple <diabetes, food, node B> is searched directly, and the content of node B is simply combined to obtain the answer to the target text.
[0090] S400. If the target map does not contain the target intent, then obtain the shortest connected path of the target entity in the target map.
[0091] If the target map does not contain the target intent, then obtaining the shortest connected path of the target entity in the target map includes:
[0092] S410. Obtain the first target entity and the second target entity related to the target intent from the target entities;
[0093] S420. Determine whether there is a connected path between the first target entity and the second target entity in the target graph using a breadth-first traversal algorithm.
[0094] Specifically, a breadth-first search (BFS) algorithm is used to determine whether there is a relationship between the first target entity (node A) and the second target entity (node B). The traversal begins at node A, searching for a connected path between it and node B; if no path exists, a quality control alert is issued.
[0095] S430. If a connected path exists, obtain the shortest connected path between the first target entity and the second target entity.
[0096] S440. If no connected path exists, a quality control reminder will be issued.
[0097] If a connected path exists, the shortest connected path p between the first target entity and the second target entity is obtained, and the score of the shortest connected path (p) is calculated. dTaking a disease and a drug as examples, suppose the first target entity is a disease and the second target entity is a drug. If the probability p d If the level is low, and it is believed that the patient's symptoms are not related to the medication prescribed by the doctor, then a quality control reminder should be issued.
[0098] S500. Determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, give an affirmative answer. If it is not higher than the first target threshold, provide a quality control reminder.
[0099] The step of determining whether the score of the shortest connected path is higher than the first target threshold includes:
[0100] The shortest connected path is linearly weighted based on its edge weights to obtain a score for the shortest connected path.
[0101] In this embodiment, a linear weighting process is performed based on the edge weights. Assume the shortest connected path is formed by V. drug V tag V disease It consists of three nodes, where P drug-tag Representative node V drug and V tag The edge weights between them can be V. drug The probability that a node belongs to that label, similarly, P disease-tag This could be the probability of the label to which the symptom node belongs, α (>=1) represents the decay factor of the path length (when α>1, the longer the path, the faster the final score decays), and the final result P is calculated based on path weighting. In this embodiment, a path with 3 nodes is used as an example, forming two edges. In practical applications, edges consisting of more nodes can be considered.
[0102] P reminder =(P drug-tag +P disease-tag ) / N α ;
[0103] Among them, P reminder The score is the score for the shortest connected path, where N represents the number of nodes in the connected path. The larger N is, the longer the path is, which means the lower the probability value and the lower the score.
[0104] After extracting the target entities from the target text, the process further includes:
[0105] Determine whether the target entity is in the target graph. If the target entity is not in the target graph, calculate and obtain the question and answer with the highest semantic similarity to the target text in the question and answer library based on the semantic index as the target question and answer.
[0106] The similarity between the target question and the target text is determined. If the similarity between the target question and the target text is higher than or equal to a second target threshold, the target question and the target text is used as the answer to the target text. If the similarity between the target question and the target text is lower than the second target threshold, no answer is given for the target text, and the N questions and answers in the question and answer database that are most semantically similar to the target text are used as reference answers.
[0107] Specifically, after extracting the target entity from the target text, if the target entity is not in the target graph, then semantic indexing technology is used to calculate and obtain the question and answer in the question and answer library that has the highest semantic similarity to the target text as the target question and answer.
[0108] Semantic indexing leverages the advantages of deep learning models, generating implicit vector spaces from user queries and question / answer responses in a question-and-answer database, facilitating similarity calculation. In this embodiment's question-and-answer system, two main methods are used: query-question matching (qq matching) and query-Answer matching (qa matching).
[0109] When performing QQ matching, the similarity between the user's query and the questions in the question-and-answer database is calculated. The top N questions with the highest similarity are selected, and the answer to the question with the highest similarity is taken as the correct answer. The answer to the question with the highest similarity is then returned along with N-1 other similar questions as reference answers.
[0110] When performing QQ matching, the similarity between the user's query and the answers in the question-and-answer database is calculated. The top N answers with the highest similarity are selected as the correct answer, and they are returned as reference answers along with N-1 other similar questions.
[0111] Meanwhile, in this embodiment, a similarity threshold is set in the question-and-answer system. In this embodiment, the similarity threshold is a second target threshold, which is given based on experience and accuracy requirements. When the similarity is higher than the second target threshold, the answer to the question is given directly; when it is lower than the second target threshold, only the top N relevant questions are displayed for user reference, without providing an answer. That is, if the similarity between the target question-and-answer and the target text is higher than or equal to the second target threshold, the target question-and-answer is used as the answer to the target text; if the similarity between the target question-and-answer and the target text is lower than the second target threshold, no answer is given for the target text, and the N questions and answers in the question-and-answer database with the highest semantic similarity to the target text are used as reference answers.
[0112] This embodiment combines graph path search and semantic indexing. Graph path search improves the application of graph-based question answering in the medical field, while semantic retrieval technology enhances the generalization of the medical question answering system's understanding of user queries, thereby increasing the coverage of medical question answering while maintaining accuracy.
[0113] In summary, the medical question-answering method based on graph path search and semantic indexing provided in this embodiment obtains target text, extracts target entities from the target text (at least two target entities), then obtains the target intent from the target text and determines whether the target intent is in the target graph. If the target graph contains the target intent, the target answer is obtained based on the target entity and the target intent; if the target graph does not contain the target intent, the shortest connected path of the target entity in the target graph is obtained. After obtaining the shortest connected path, it is also necessary to determine whether the score of the shortest connected path is higher than a first target threshold. If it is higher than the first target threshold, a positive answer is given; if it is not higher than the first target threshold, a quality control reminder is provided. The medical question-answering method based on graph path search and semantic indexing provided by this invention improves the accuracy and recall rate of the question-answering system in the medical field through graph path search.
[0114] It should be understood that although the steps in the flowcharts shown in the accompanying drawings are displayed sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of the steps in this invention, and these steps can be executed in other orders. Moreover, at least a portion of the steps in this invention may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0116] Example 2
[0117] Based on the above embodiments, the present invention also provides a medical question-answering system based on graph path search and semantic indexing, the functional module diagram of which is shown below. Figure 4 As shown, this medical question-answering system based on graph path search and semantic indexing includes:
[0118] An entity extraction module is used to acquire target text and extract target entities from the target text. The target entities are at least two, as described in Embodiment 1.
[0119] The intent determination module is used to obtain the target intent in the target text and determine whether the target intent is in the target graph, as specifically described in Embodiment 1.
[0120] If the target map contains the target intent, then the target answer is obtained based on the target entity and the target intent, as described in Embodiment 1;
[0121] If the target map does not contain the target intent, then the shortest connected path of the target entity in the target map is obtained, as described in Embodiment 1.
[0122] The path determination module is used to determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, an affirmative answer is given; if it is not higher than the first target threshold, a quality control reminder is given, as described in Embodiment 1.
[0123] Example 3
[0124] Based on the above embodiments, the present invention also provides a terminal, such as... Figure 5 As shown, the terminal includes a processor 10 and a memory 20. Figure 5 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0125] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard. Furthermore, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a medical question-and-answer program 30 based on graph path search and semantic indexing, which can be executed by the processor 10 to implement the medical question-and-answer method based on graph path search and semantic indexing in this application.
[0126] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other chip, used to run program code stored in the memory 20 or process data, such as executing the medical question-and-answer method based on graph path search and semantic indexing.
[0127] In one embodiment, when the processor 10 executes the medical question-answering program 30 based on graph path search and semantic indexing in the memory 20, the following steps are performed:
[0128] Obtain the target text, and extract the target entities from the target text, wherein there are at least two target entities;
[0129] Obtain the target intent from the target text and determine whether the target intent is in the target graph;
[0130] If the target graph contains the target intent, then the target answer is obtained based on the target entity and the target intent;
[0131] If the target map does not contain the target intent, then obtain the shortest connected path of the target entity in the target map;
[0132] Determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, give an affirmative answer; if it is not higher than the first target threshold, provide a quality control reminder.
[0133] The medical question-answering method based on graph path search and semantic indexing, wherein extracting target entities from the target text includes:
[0134] The target text is segmented to obtain multiple target words;
[0135] Extract medical-related terms from the plurality of target terms;
[0136] The medical-related terms are classified into entity categories to obtain different types of target entities.
[0137] The medical question-answering method based on graph path search and semantic indexing, wherein the types of the target entities include symptoms, diseases, examinations, tests, surgeries, and drugs.
[0138] The medical question-answering method based on graph path search and semantic indexing, wherein obtaining the target intent in the target text includes:
[0139] Obtain multiple intent training data sets with clearly labeled intents;
[0140] The classification model is trained based on the intended training data to obtain the target classification model;
[0141] Based on the target classification model, the target intent in the target text is obtained.
[0142] The medical question-answering method based on graph path search and semantic indexing is described in which the target graph is constructed by combining triple relationships annotated by professionals with data mined from medical books and drug instructions.
[0143] The medical question-answering method based on graph path search and semantic indexing, wherein the target graph is a three-dimensional spatial graph, which is formed by multiple label nodes forming connected paths. The connected paths contain relationship information between labels, wherein the label nodes correspond to entity information, and the relationship information between labels contains intent information.
[0144] The medical question-answering method based on graph path search and semantic indexing, wherein determining whether the target intent is in the target graph includes:
[0145] Obtain the label in the target map that is the same as the target entity as the target label corresponding to the target entity;
[0146] Obtain the relationship information between the target tags, and determine whether there is relationship information that is the same as the target intent. If there is, determine that the target map contains the target intent; if not, determine that the target map does not contain the target intent.
[0147] The medical question-answering method based on graph path search and semantic indexing, wherein obtaining the shortest connected path of the target entity in the target graph if the target intent is not contained in the target graph includes:
[0148] Obtain the first target entity and the second target entity related to the target intent from the target entity;
[0149] The breadth-first traversal algorithm is used to determine whether there is a connected path between the first target entity and the second target entity in the target graph.
[0150] If a connected path exists, obtain the shortest connected path between the first target entity and the second target entity;
[0151] If no connecting path exists, a quality control alert will be issued.
[0152] The medical question-answering method based on graph path search and semantic indexing, wherein determining whether the score of the shortest connected path is higher than a first target threshold includes:
[0153] The shortest connected path is linearly weighted based on its edge weights to obtain a score for the shortest connected path.
[0154] The medical question-answering method based on graph path search and semantic indexing, wherein after extracting the target entities from the target text, further includes:
[0155] Determine whether the target entity is in the target graph. If the target entity is not in the target graph, calculate and obtain the question and answer with the highest semantic similarity to the target text in the question and answer library based on the semantic index as the target question and answer.
[0156] The similarity between the target question and the target text is determined. If the similarity between the target question and the target text is higher than or equal to a second target threshold, the target question and the target text is used as the answer to the target text. If the similarity between the target question and the target text is lower than the second target threshold, no answer is given for the target text, and the N questions and answers in the question and answer database that are most semantically similar to the target text are used as reference answers.
[0157] Example 4
[0158] The present invention also provides a storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the medical question-answering method based on graph path search and semantic indexing described in the above embodiments.
[0159] 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 of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A medical question-answering method based on graph path search and semantic indexing, characterized in that, include: Obtain the target text, and extract the target entities from the target text, wherein there are at least two target entities; Obtain the target intent from the target text and determine whether the target intent is in the target graph; If the target graph contains the target intent, then the target answer is obtained based on the target entity and the target intent; If the target map does not contain the target intent, then obtain the shortest connected path of the target entity in the target map; Determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, give an affirmative answer. If it is not higher than the first target threshold, provide a quality control reminder. The target map is constructed by combining triplet relationships annotated by professionals with data mined from medical books and drug instructions; The target map is a three-dimensional spatial map, which is formed by multiple label nodes forming connected paths. The connected paths contain relationship information between labels, wherein the label nodes correspond to entity information, and the relationship information between labels contains intent information. The step of determining whether the target intent is in the target map includes: Obtain the label in the target map that is the same as the target entity as the target label corresponding to the target entity; Obtain the relationship information between the target tags, determine whether there is relationship information that is the same as the target intent, if there is, determine that the target map contains the target intent, if not, determine that the target map does not contain the target intent; If the target map does not contain the target intent, then obtaining the shortest connected path of the target entity in the target map includes: Obtain the first target entity and the second target entity related to the target intent from the target entity; The breadth-first traversal algorithm is used to determine whether there is a connected path between the first target entity and the second target entity in the target graph. If a connected path exists, obtain the shortest connected path between the first target entity and the second target entity; If no connecting path exists, a quality control alert will be issued.
2. The medical question-answering method based on graph path search and semantic indexing according to claim 1, characterized in that, The extraction of target entities from the target text includes: The target text is segmented to obtain multiple target words; Extract medical-related terms from the plurality of target terms; The medical-related terms are classified into entity categories to obtain different types of target entities.
3. The medical question-answering method based on graph path search and semantic indexing according to claim 1, characterized in that, The types of target entities include symptoms, diseases, examinations, tests, surgeries, and medications.
4. The medical question-answering method based on graph path search and semantic indexing according to claim 1, characterized in that, The step of obtaining the target intent in the target text includes: Obtain multiple intent training data sets with clearly labeled intents; The classification model is trained based on the intended training data to obtain the target classification model; Based on the target classification model, the target intent in the target text is obtained.
5. The medical question-answering method based on graph path search and semantic indexing according to claim 1, characterized in that, The step of determining whether the score of the shortest connected path is higher than the first target threshold includes: The shortest connected path is linearly weighted based on its edge weights to obtain a score for the shortest connected path.
6. The medical question-answering method based on graph path search and semantic indexing according to claim 1, characterized in that, After extracting the target entities from the target text, the process further includes: Determine whether the target entity is in the target graph. If the target entity is not in the target graph, calculate and obtain the question and answer with the highest semantic similarity to the target text in the question and answer library based on the semantic index as the target question and answer. The similarity between the target question and the target text is determined. If the similarity between the target question and the target text is higher than or equal to a second target threshold, the target question and the target text is used as the answer to the target text. If the similarity between the target question and the target text is lower than the second target threshold, no answer is given for the target text, and the N questions and answers in the question and answer database that are most semantically similar to the target text are used as reference answers.
7. A medical question-answering system based on graph path search and semantic indexing, characterized in that, The system includes: An entity extraction module is used to acquire target text and extract target entities from the target text, wherein the target entities are at least two. An intent determination module is used to obtain the target intent in the target text and determine whether the target intent is in the target graph. If the target graph contains the target intent, then the target answer is obtained based on the target entity and the target intent; If the target map does not contain the target intent, then obtain the shortest connected path of the target entity in the target map; The path judgment module is used to determine whether the score of the shortest connected path is higher than the first target threshold. If it is higher than the first target threshold, a positive answer is given; if it is not higher than the first target threshold, a quality control reminder is fed back. The target map is constructed by combining triplet relationships annotated by professionals with data mined from medical books and drug instructions; The target map is a three-dimensional spatial map, which is formed by multiple label nodes forming connected paths. The connected paths contain relationship information between labels, wherein the label nodes correspond to entity information, and the relationship information between labels contains intent information. The step of determining whether the target intent is in the target map includes: Obtain the label in the target map that is the same as the target entity as the target label corresponding to the target entity; Obtain the relationship information between the target tags, determine whether there is relationship information that is the same as the target intent, if there is, determine that the target map contains the target intent, if not, determine that the target map does not contain the target intent; If the target map does not contain the target intent, then obtaining the shortest connected path of the target entity in the target map includes: Obtain the first target entity and the second target entity related to the target intent from the target entity; The breadth-first traversal algorithm is used to determine whether there is a connected path between the first target entity and the second target entity in the target graph. If a connected path exists, obtain the shortest connected path between the first target entity and the second target entity; If no connecting path exists, a quality control alert will be issued.
8. A terminal, characterized in that, The terminal includes: a processor and a computer-readable storage medium communicatively connected to the processor, the computer-readable storage medium being adapted to store multiple instructions, and the processor being adapted to invoke the instructions in the storage medium to execute the steps of implementing the medical question-answering method based on graph path search and semantic indexing as described in any one of claims 1-6.
9. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the medical question-answering method based on graph path search and semantic indexing as described in any one of claims 1-6.
Citation Information
Patent Citations
Medical intelligent question and answer processing method and system based on knowledge graph reasoning
CN112650840A
Medical plan recommendation system and method based on knowledge graph representation learning
WO2021189971A1