Query processing method and device based on medical knowledge base

By using the combination of knowledge graph and subgraph index in the medical knowledge base, the problem of low query accuracy of medical knowledge base in the existing technology is solved, achieving higher accuracy and the ability to adapt to complex medical scenarios.

CN118132680BActive Publication Date: 2024-09-03ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410545207.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2024-09-03
Estimated Expiration
2044-04-30

AI Technical Summary

Technical Problem

Existing medical knowledge bases rely on unstructured term libraries and semantic vector matching when querying, and are easily affected by noise, resulting in low accuracy of query results.

Method used

A query processing method based on the knowledge graph is used to extract medical terms, query the knowledge graph, obtain related word and entry query results, calculate the correlation score based on the subgraph index, determine the target entry, and combine graph query and index matching to improve accuracy sex.

Benefits of technology

It improves the accuracy of query results, adapts to reasoning in complex medical scenarios, effectively eliminates interfering information, and achieves more accurate term matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118132680B
    Figure CN118132680B
Patent Text Reader

Abstract

The embodiments of this specification provide a query processing method and device based on a medical knowledge base, wherein the medical knowledge base includes a knowledge graph, and the nodes in the knowledge graph include standard word nodes and entry nodes, and each entry node has a corresponding subgraph as its entry index. The method includes: extracting a number of medical terms from a query request; based on the several medical terms, querying the knowledge graph to obtain associated word query results and entry query results, the associated word query results at least include the queried standard word nodes, and the entry query results include several candidate entry nodes; according to the associated word query results, determining the relevance score of the subgraph corresponding to the query request and the several candidate entry nodes; according to the relevance score, determining the target entry, and classifying the corresponding entry content into the query processing result. It can improve the accuracy of the queried entries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the computer field, and in particular, to a query processing method and device based on a medical knowledge base. Background Art

[0002] Medical knowledge bases provide detailed facts, data, and information, which may contain private data. Medical knowledge bases can be structured, such as databases, knowledge graphs, etc., or unstructured, such as professional websites, literature libraries, etc. By querying the medical knowledge base, you can obtain facts, data, and information in the medical field.

[0003] In the prior art, an unstructured term library is usually used as a medical knowledge base. When querying the medical knowledge base, semantic vector matching is relied upon to retrieve terms that are semantically similar to the query request. This method is easily affected by noise, and the retrieved terms do not actually meet the requirements of the query request. In other words, the accuracy of the retrieved terms is low. Summary of the invention

[0004] One or more embodiments of the present specification describe a query processing method and device based on a medical knowledge base, which can improve the accuracy of queried entries.

[0005] In a first aspect, a query processing method based on a medical knowledge base is provided, wherein the medical knowledge base includes a knowledge graph, the nodes in the knowledge graph include standard word nodes and entry nodes, and each entry node has a corresponding subgraph as its entry index; the method includes:

[0006] extracting several medical terms from the query request;

[0007] Based on the several medical terms, query the knowledge graph to obtain associated word query results and term query results, wherein the associated word query results at least include the queried standard word nodes, and the term query results include several candidate term nodes;

[0008] Determining, according to the associated word query result, a relevance score between the query request and the subgraphs corresponding to the plurality of candidate entry nodes;

[0009] According to the relevance score, a target term is determined, and the corresponding term content is included in the query processing result.

[0010] In a possible implementation, obtaining the associated word query result and the term query result includes:

[0011] Determining in the knowledge graph a target standard word node that matches any one of the plurality of medical terms;

[0012] In the knowledge graph, term nodes having a preset association relationship with the target standard term node are determined and classified into the plurality of candidate term nodes.

[0013] Furthermore, the knowledge graph also includes a vocabulary list, which records the standard words and their synonyms corresponding to each standard word node; determining a target standard word node matching any medical term in the knowledge graph includes:

[0014] Using any of the medical terms to search the vocabulary list, obtaining a target standard word and several synonyms matching the medical term;

[0015] The target standard word node is determined according to the target standard word, and the plurality of synonyms are classified into the associated word query result.

[0016] Furthermore, the knowledge graph also includes a vocabulary list, in which the hierarchical relationship between each standard word is recorded; determining a target standard word node matching any medical term in the knowledge graph includes:

[0017] Starting from the preset layer of the hierarchical structure and going upwards layer by layer, any medical term is matched with each standard word of the current layer, and the first matched standard word is used as the target standard word;

[0018] The target standard word node is determined according to the target standard word, and a plurality of superordinate standard words and / or a plurality of subordinate standard words of the target standard word are included in the associated word query result.

[0019] In a possible implementation, the term index is obtained in the following manner:

[0020] According to the knowledge graph, extract multiple triples from the content of any term, each triple corresponding to two nodes in the knowledge graph and the connecting edge between the nodes;

[0021] The nodes and connecting edges corresponding to the multiple triples are extracted from the knowledge graph, and the obtained subgraph is used as the entry index of the entry.

[0022] In a possible implementation, determining the relevance scores of the query request and the subgraphs corresponding to the plurality of candidate term nodes respectively includes:

[0023] Obtaining the number of vocabulary of standard words commonly contained in the associated word query result and any subgraph;

[0024] The relevance score between the query request and the subgraph is determined according to the number of words, the number of terms in the plurality of medical terms, and the number of subgraph entities contained in any subgraph.

[0025] Further, determining the relevance score between the query request and the subgraph according to the number of words, the number of terms of the plurality of medical terms, and the number of subgraph entities contained in any subgraph includes:

[0026] Determining a ratio of the number of words to the number of terms in the plurality of medical terms as a first proportional value;

[0027] Determine the ratio of the number of words to the number of subgraph entities contained in any subgraph to obtain a second ratio value;

[0028] A correlation score between the query request and the subgraph is determined according to the first ratio value and the second ratio value.

[0029] In a possible implementation, the medical knowledge base further includes a rule base, the query processing result further includes a rule query result, and the method further includes:

[0030] Determining whether the plurality of medical terms contain a preset rule trigger word;

[0031] When it is determined that the plurality of medical terms contain a preset rule trigger word, the first rule corresponding to the rule trigger word is used as the rule query result; or,

[0032] Determining whether the plurality of medical terms meet a preset rule triggering condition; the rule triggering condition is associated with a first connecting edge in the knowledge graph;

[0033] When it is determined that the plurality of medical terms meet the preset rule triggering condition, the second rule corresponding to the rule triggering condition is used as the rule query result.

[0034] Furthermore, the rule query result includes at least one of the following rules:

[0035] Medical priority rules, medical short logic rules, and medical conclusion inference rules.

[0036] In a possible implementation, the query processing result is used to construct prompt words of a large language model, so that the large language model generates text for the query request according to the prompt words.

[0037] In a possible implementation, determining the target term according to the relevance score includes:

[0038] The k terms with the highest relevance ranking are used as the target terms.

[0039] In a second aspect, a query processing device based on a medical knowledge base is provided, wherein the medical knowledge base includes a knowledge graph, the nodes in the knowledge graph include standard word nodes and entry nodes, and each entry node has a corresponding subgraph as its entry index; the device includes:

[0040] An extraction unit, used for extracting a number of medical terms from a query request;

[0041] A graph query unit, configured to query the knowledge graph based on the medical terms obtained by the extraction unit to obtain an associated word query result and an entry query result, wherein the associated word query result at least includes the queried standard word node, and the entry query result includes a number of candidate entry nodes;

[0042] A relevance determination unit, configured to determine, based on the associated word query result obtained by the graph query unit, a relevance score between the query request and the subgraphs corresponding to the plurality of candidate entry nodes obtained by the graph query unit;

[0043] The term determination unit is used to determine the target term according to the relevance score obtained by the relevance determination unit, and classify the corresponding term content into the query processing result.

[0044] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.

[0045] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.

[0046] Through the method and device provided in the embodiments of this specification, firstly, several medical terms are extracted from the query request; then, based on the several medical terms, the knowledge graph is queried to obtain the associated word query results and the term query results, wherein the associated word query results at least include the queried standard word nodes, and the term query results include several candidate term nodes; then, based on the associated word query results, the correlation scores of the subgraphs corresponding to the query request and the several candidate term nodes are determined; finally, based on the correlation scores, the target term is determined, and the corresponding term content is included in the query processing result. As can be seen from the above, in the embodiments of this specification, the medical knowledge base includes a structured knowledge graph, wherein the nodes in the knowledge graph include standard word nodes and term nodes, and the term nodes have term indexes, and the term indexes are not based on the semantic vectors of the term content, but on the subgraphs corresponding to the term nodes. For a query request, the graph query and index matching are combined to jointly determine the target term. Since the structured knowledge used in the knowledge graph has a clear and unique meaning, and the knowledge is interconnected in the entire knowledge base in a network-like structure, it is more accurate when adapting to complex medical scenarios for reasoning. In addition, compared with the traditional vector index, the subgraph index of the term can more effectively eliminate interference information and achieve more accurate term matching. In summary, the accuracy of the queried terms can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0048] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;

[0049] Figure 2 A flowchart of a query processing method based on a medical knowledge base according to an embodiment is shown;

[0050] Figure 3 A diagram showing a query processing framework based on a medical knowledge base according to one embodiment;

[0051] Figure 4 A schematic block diagram of a query processing device based on a medical knowledge base according to an embodiment is shown. DETAILED DESCRIPTION

[0052] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0053] Figure 1This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. The implementation scenario involves query processing based on a medical knowledge base. Figure 1 The medical knowledge base used in the embodiments of this specification includes multiple components such as knowledge graph, terms and rules. Specifically:

[0054] The knowledge graph aims to describe various entities or concepts and their relationships that exist in the real world. It constitutes a huge semantic network diagram. Nodes represent entities or concepts, which can also be represented as entities: concepts, instances, and edges are composed of attributes or relationships.

[0055] The knowledge graph is a structured data form that includes standard triple relationships. It can be understood that the triple relationship is embodied as two nodes and the connecting edges between the nodes. In the embodiment of this specification, there are at least two types of nodes, one type is the standard word node corresponding to the standard word of the medical term, and the other type is the entry node corresponding to the entry. An entry node can have a connecting edge with one or more standard word nodes, and a standard word node can have a connecting edge with one or more entry nodes. The knowledge graph can also include a vocabulary list, which records the standard words and their synonyms corresponding to each standard word node, and / or, in which the hierarchical structure records the upper and lower relationships between each standard word. The knowledge graph contains the synonym relationship and the hierarchical structure of the upper and lower levels of each standard word, which can meet the detailed requirements of medical information query.

[0056] An entry is a form of unstructured data, which consists of entry content and entry index. A medical knowledge base may contain multiple entries for query. It is understandable that the entry content is text, which may include multiple medical terms, specifically a paragraph describing a disease. For example, an entry content includes "heart disease is a relatively common circulatory system disease. The circulatory system is composed of the heart, blood vessels, and neurohumoral tissues that regulate blood circulation. Circulatory system diseases are also called cardiovascular diseases, including diseases of all the above tissues and organs. They are common diseases in internal medicine, among which heart disease is the most common and can significantly affect the patient's labor force." The entry content involves multiple medical terms such as heart disease, circulatory system diseases, cardiovascular diseases, and internal medicine diseases. In the embodiment of this specification, the entry index is not based on the semantic vector of the entry content, but is a subgraph composed of multiple triples extracted from the entry content, which will be used for index matching.

[0057] A rule is a form of semi-structured data. In the embodiments of this specification, three types of medical rules are distinguished: the first is the medical priority rule, for example, when a patient has multiple possible diseases at the same time, the more serious disease should be given priority; or when faced with multiple examination options, non-invasive examinations should be given priority. The second is the medical short logic rule, such as if the patient has symptoms of urinary retention, catheterization should be performed immediately. The third category is the medical conclusion inference rule, which is used for accurate inference of specific situations such as cancer staging and typing.

[0058] In the embodiments of this specification, this comprehensive medical knowledge base can more accurately meet the complex needs of medical information retrieval and improve the retrieval quality and efficiency.

[0059] In the embodiments of this specification, query and retrieval have the same meanings, and query processing based on a medical knowledge base can be applied, but is not limited to, in a retrieval enhancement generation process.

[0060] Retrieval-augmented generation (RAG) can be embodied as a neural network model that combines retrieval and generation, which is designed to improve the factual accuracy and information richness of language models when generating text.

[0061] Optionally, query processing based on the medical knowledge base can be applied to large language model information retrieval systems, which refer to systems that use large pre-trained language models to enhance information retrieval tasks. These systems combine traditional information retrieval techniques with the latest natural language processing techniques to improve retrieval relevance and accuracy by understanding and processing natural language queries.

[0062] The medical knowledge base provided in the embodiments of this specification can be used as a large language model with external knowledge base, which is a system that combines a large pre-trained language model and an external knowledge base. In this system, pre-trained language models, such as GPT-3, BERT, etc., are used to understand and generate natural language text, while the external knowledge base provides detailed facts, data, and information to support the accuracy and depth of the language model when generating content. The knowledge base provides the language model with domain-specific information and facts that are usually not included in the original training data of the language model.

[0063] The system of large language model plug-in knowledge base allows the language model to not only rely on the internal learned patterns when answering questions or performing specific tasks, but also dynamically reference the latest and authoritative external information, thereby improving the quality and credibility of the output. This system is particularly suitable for scenarios that require accurate expertise, such as medical scenarios. Medical large models especially need external knowledge bases. In addition to the above reasons, it also includes the fact that doctors' experience can be easily edited into the external knowledge base. The knowledge of the large model referencing the knowledge base can effectively avoid hallucinations and make the output conclusions relatively stable.

[0064] The embodiments of this specification provide a medical knowledge base and a corresponding query processing solution based on the medical knowledge base, which can improve the query accuracy and meet the needs of the medical big model.

[0065] Figure 2 A flowchart of a query processing method based on a medical knowledge base according to an embodiment is shown, wherein the medical knowledge base includes a knowledge graph, the nodes in the knowledge graph include standard word nodes and entry nodes, each entry node has a corresponding subgraph as its entry index, and the method can be based on Figure 1 The implementation scenario shown in Figure 1 is as follows. Figure 2 As shown, the query processing method based on the medical knowledge base in this embodiment includes the following steps: Step 21, extracting several medical terms from the query request; Step 22, based on the several medical terms, querying the knowledge graph to obtain the associated word query result and the term query result, the associated word query result at least includes the queried standard word node, and the term query result includes several candidate term nodes; Step 23, according to the associated word query result, determining the relevance score of the subgraph corresponding to the query request and the several candidate term nodes; Step 24, according to the relevance score, determining the target term, and classifying the corresponding term content into the query processing result. The specific execution method of each of the above steps is described below.

[0066] First, several medical terms are extracted from the query request in step 21. It is understandable that the query request may correspond to a patient's medical inquiry statement, which may include a description of symptoms, a description of examination results, or a description of a possible disease name.

[0067] In the embodiments of this specification, the query request may contain some words that are not related to medical treatment, such as personal pronouns "I", "you", etc., or auxiliary words "of", etc. These are noises that are irrelevant to query processing. The words of the type of medical terms can be identified from the query request by entity recognition to eliminate the interference of noise. The above medical terms can include words that express symptoms, words that express test results, or words that express disease names, etc.

[0068] For example, the query request corresponds to a patient's medical statement: "I have had shoulder pain and palpitations recently. Do I have a heart disease?" Multiple medical terms can be extracted from the query request, including shoulder pain, palpitations, and heart disease.

[0069] Then, in step 22, based on the several medical terms, the knowledge graph is queried to obtain associated word query results and term query results, wherein the associated word query results at least include the queried standard word nodes, and the term query results include several candidate term nodes. It can be understood that a medical term may have multiple expressions, which can be divided into standard words and their synonyms. The standard word node corresponds to the standard word. When the medical term extracted in the query request is a synonym of the standard word, its corresponding standard word node can also be queried.

[0070] In one example, obtaining the associated word query results and the term query results includes:

[0071] Determining in the knowledge graph a target standard word node that matches any one of the plurality of medical terms;

[0072] In the knowledge graph, term nodes having a preset association relationship with the target standard term node are determined and classified into the plurality of candidate term nodes.

[0073] In this example, the target standard word node is first determined, and then the entry node having a preset association relationship with the target standard word node is searched, wherein the preset association relationship may include but is not limited to a connecting edge between the two, for example, the entry node is a first-order neighbor node of the target standard word node.

[0074] Furthermore, the knowledge graph also includes a vocabulary list, which records the standard words and their synonyms corresponding to each standard word node; determining a target standard word node matching any medical term in the knowledge graph includes:

[0075] Using any of the medical terms to search the vocabulary list, obtaining a target standard word and several synonyms matching the medical term;

[0076] The target standard word node is determined according to the target standard word, and the plurality of synonyms are classified into the associated word query result.

[0077] In this example, since the correspondence between each standard word and its synonym is recorded in the vocabulary list, when a medical term is a synonym of a standard word, its corresponding standard word can also be determined and the corresponding standard word node can be found.

[0078] Furthermore, the knowledge graph also includes a vocabulary list, in which the hierarchical relationship between each standard word is recorded; determining a target standard word node matching any medical term in the knowledge graph includes:

[0079] Starting from the preset layer of the hierarchical structure and going upwards layer by layer, any medical term is matched with each standard word of the current layer, and the first matched standard word is used as the target standard word;

[0080] The target standard word node is determined according to the target standard word, and a plurality of superordinate standard words and / or a plurality of subordinate standard words of the target standard word are included in the associated word query result.

[0081] In this example, since the hierarchical relationship between each standard word is recorded in the vocabulary list, each standard word with a hierarchical relationship shows different levels from details to macro concepts, so that it is possible to give priority to the vocabulary at the detail level in medical queries. If the information at the detail level cannot be found, a more macro level is considered, so as to locate the standard word node corresponding to the lower-level standard word as much as possible.

[0082] Then, in step 23, the correlation scores of the subgraphs corresponding to the query request and the plurality of candidate term nodes are determined according to the associated word query result. It can be understood that the associated word query result at least includes the queried standard word nodes, and the number of the plurality of medical terms extracted from the query request and the number of the queried standard word nodes may be equal or unequal.

[0083] In the embodiment of this specification, each term node has a corresponding subgraph as its term index, that is, the term index of a term is a subgraph of the knowledge graph.

[0084] In one example, the term index is obtained in the following manner:

[0085] According to the knowledge graph, extract multiple triples from the content of any term, each triple corresponding to two nodes in the knowledge graph and the connecting edge between the nodes;

[0086] The nodes and connecting edges corresponding to the multiple triples are extracted from the knowledge graph, and the obtained subgraph is used as the entry index of the entry.

[0087] In this example, the term index is not based on the semantic vector of the term content, but rather uses a subgraph based on the term content. The subgraph does not contain noise that is not related to medical care, which helps to improve the accuracy of index matching to obtain terms.

[0088] In one example, determining the relevance scores of the query request and the subgraphs corresponding to the plurality of candidate term nodes respectively includes:

[0089] Obtaining the number of vocabulary of standard words commonly contained in the associated word query result and any subgraph;

[0090] The relevance score between the query request and the subgraph is determined according to the number of words, the number of terms in the plurality of medical terms, and the number of subgraph entities contained in any subgraph.

[0091] In this example, the associated word query result includes the standard word nodes queried from the knowledge graph for the query request. Any subgraph contains standard word nodes corresponding to the content of the entry. The size of the intersection of the two is the above-mentioned number of words, which reflects the relevance of the query request to the subgraph, that is, it reflects the relevance of the query request to the entry corresponding to the subgraph.

[0092] Further, determining the relevance score between the query request and the subgraph according to the number of words, the number of terms of the plurality of medical terms, and the number of subgraph entities contained in any subgraph includes:

[0093] Determining a ratio of the number of words to the number of terms in the plurality of medical terms as a first proportional value;

[0094] Determine the ratio of the number of words to the number of subgraph entities contained in any subgraph to obtain a second ratio value;

[0095] A correlation score between the query request and the subgraph is determined according to the first ratio value and the second ratio value.

[0096] In this example, the subgraph entity corresponds to a standard word node. The first proportional value reflects the proportion of the number of words relative to the number of medical terms in the query request. The second proportional value reflects the proportion of the number of words relative to the number of standard word nodes in the subgraph. The correlation score obtained by combining the first proportional value and the second proportional value can better reflect the correlation between the query request and the subgraph.

[0097] For example, based on several medical terms extracted from the query request, the knowledge graph is queried. It is assumed that the queried standard word nodes constitute the first set. If the standard word nodes contained in a subgraph constitute the second set, the number of standard word nodes contained in the intersection of the first set and the second set is the aforementioned vocabulary number n, the number of terms in the several medical terms is N, and the number of subgraph entities contained in the subgraph is M. Then the correlation score between the query request and the subgraph can be calculated as (n / N)(n / M).

[0098] Finally, in step 24, target terms are determined based on the relevance scores, and the corresponding terms are included in the query processing results. It is understandable that the number of target terms can be one or more.

[0099] In one example, the medical knowledge base further includes a rule base, the query processing result further includes a rule query result, and the method further includes:

[0100] Determining whether the plurality of medical terms contain a preset rule trigger word;

[0101] When it is determined that the plurality of medical terms contain a preset rule trigger word, the first rule corresponding to the rule trigger word is used as the rule query result; or,

[0102] Determining whether the plurality of medical terms meet a preset rule triggering condition; the rule triggering condition is associated with a first connecting edge in the knowledge graph;

[0103] When it is determined that the plurality of medical terms meet the preset rule triggering condition, the second rule corresponding to the rule triggering condition is used as the rule query result.

[0104] In this example, rule queries are divided into two situations: one is to query based on specific rule trigger words, such as cancer staging and typing will trigger related medical conclusion inference rules; the other is based on rules triggered by specific conditions, such as men over 50 years old with a PSA value greater than 10 have a higher risk of prostate cancer and should undergo MRI or puncture examination.

[0105] Furthermore, the rule query result includes at least one of the following rules:

[0106] Medical priority rules, medical short logic rules, and medical conclusion inference rules.

[0107] In the embodiments of this specification, medical rules are the essence of doctors' clinical experience, which are organized and applied in the form of a rule library. This management method is more suitable for the application needs of medical scenarios.

[0108] In one example, the query processing result is used to construct prompt words of a large language model, so that the large language model generates text for the query request according to the prompt words.

[0109] For example, the query request corresponds to a patient's medical inquiry statement, the query processing result can be used as background knowledge, and the large language model can generate a corresponding diagnosis report.

[0110] In one example, determining the target term according to the relevance score includes:

[0111] The k terms with the highest relevance ranking are used as the target terms.

[0112] For example, a score threshold may be set in advance to filter out terms with relevance scores greater than the score threshold as target terms; or, a number k may be set in advance to sort the candidate terms corresponding to each candidate term node by relevance score, and then the top k terms are selected according to the sort as target terms.

[0113] Figure 3 FIG. 1 shows a query processing framework diagram based on a medical knowledge base according to an embodiment. Figure 3 , the medical knowledge base contains multiple components such as knowledge graph, terms and rules. Accordingly, the query processing based on the medical knowledge base includes graph query, term retrieval and rule query. Among them, graph query mainly includes triple-based relationship query and standard term query based on vocabulary list. Through graph query, the structured data with exact matching is obtained, including standard term nodes and several candidate term nodes; term retrieval mainly includes determining the relevance score based on the subgraph. Through term retrieval, the term with the highest relevance is found from several candidate terms; rule query mainly includes trigger term query rule and trigger condition query rule. Through rule query, medical rules are obtained; then, this information can be integrated into a template to generate prompts, which can play a role in the reasoning process of large language models.

[0114] Through the method provided in the embodiment of this specification, firstly, several medical terms are extracted from the query request; then, based on the several medical terms, the knowledge graph is queried to obtain the associated word query results and the term query results, wherein the associated word query results at least include the queried standard word nodes, and the term query results include several candidate term nodes; then, based on the associated word query results, the correlation scores of the subgraphs corresponding to the query request and the several candidate term nodes are determined; finally, based on the correlation scores, the target term is determined, and the corresponding term content is included in the query processing result. As can be seen from the above, in the embodiment of this specification, the medical knowledge base contains a structured knowledge graph, wherein the nodes in the knowledge graph include standard word nodes and term nodes, and the term nodes have term indexes, and the term indexes are not based on the semantic vectors of the term content, but on the subgraphs corresponding to the term nodes. For a query request, the graph query and index matching are combined to jointly determine the target term. Since the structured knowledge used in the knowledge graph has a clear and unique meaning, and the knowledge is interconnected in the entire knowledge base in a network-like structure, it is more accurate when adapting to complex medical scenarios for reasoning. In addition, compared with the traditional vector index, the subgraph index of the term can more effectively eliminate interference information and achieve more accurate term matching. In summary, the accuracy of the queried terms can be improved.

[0115] According to another aspect of the embodiment, a query processing device based on a medical knowledge base is also provided, wherein the medical knowledge base includes a knowledge graph, the nodes in the knowledge graph include standard word nodes and entry nodes, each entry node has a corresponding subgraph as its entry index, and the device is used to execute the method provided in the embodiment of this specification. Figure 4 FIG. 1 is a schematic block diagram of a query processing device based on a medical knowledge base according to an embodiment. Figure 4 As shown, the device 400 includes:

[0116] An extraction unit 41, used to extract a number of medical terms from a query request;

[0117] A graph query unit 42, configured to query the knowledge graph based on the medical terms obtained by the extraction unit 41, and obtain an associated word query result and an entry query result, wherein the associated word query result at least includes the queried standard word node, and the entry query result includes a number of candidate entry nodes;

[0118] A relevance determination unit 43, used to determine, based on the associated word query result obtained by the graph query unit 42, a relevance score between the query request and the subgraphs corresponding to the plurality of candidate term nodes obtained by the graph query unit;

[0119] The term determination unit 44 is used to determine the target term according to the relevance score obtained by the relevance determination unit 43, and to include the corresponding term content in the query processing result.

[0120] Optionally, as an embodiment, the graph query unit 42 includes:

[0121] A first query subunit is used to determine in the knowledge graph a target standard word node that matches any one of the plurality of medical terms;

[0122] The second query sub-unit is used to determine in the knowledge graph the term nodes that have a preset association relationship with the target standard term node obtained by the first query sub-unit, and classify them into the plurality of candidate term nodes.

[0123] Furthermore, the knowledge graph also includes a vocabulary list, which records the standard words and their synonyms corresponding to each standard word node; the first query sub-unit is specifically used to use any medical term to query the vocabulary list to obtain a target standard word and several synonyms that match the medical term; determine the target standard word node based on the target standard word, and classify the several synonyms into the associated word query result.

[0124] Furthermore, the knowledge graph also includes a vocabulary list, in which the hierarchical structure records the upper and lower relationships between each standard word; the first query sub-unit is specifically used to match any medical term with each standard word of the current level, starting from a preset layer of the hierarchical structure and going up level by level, and taking the first matched standard word as the target standard word; determining the target standard word node according to the target standard word, and including several upper standard words and / or several lower standard words of the target standard word into the associated word query result.

[0125] Optionally, as an embodiment, the term index is obtained in the following manner:

[0126] According to the knowledge graph, extract multiple triples from the content of any term, each triple corresponding to two nodes in the knowledge graph and the connecting edge between the nodes;

[0127] The nodes and connecting edges corresponding to the multiple triples are extracted from the knowledge graph, and the obtained subgraph is used as the entry index of the entry.

[0128] Optionally, as an embodiment, the correlation determination unit 43 includes:

[0129] An acquisition subunit, used to acquire the number of vocabulary of standard words commonly included in the associated word query result and any subgraph;

[0130] The determination subunit is used to determine the relevance score between the query request and the subgraph according to the number of words acquired by the acquisition subunit, the number of terms of the plurality of medical terms, and the number of subgraph entities contained in any subgraph.

[0131] Furthermore, the determination subunit is specifically used to determine the ratio of the number of words to the number of terms in the plurality of medical terms as a first proportional value; determine the ratio of the number of words to the number of sub-graph entities contained in any sub-graph to obtain a second proportional value; and determine the relevance score of the query request with the sub-graph based on the first proportional value and the second proportional value.

[0132] Optionally, as an embodiment, the medical knowledge base further includes a rule base, the query processing result further includes a rule query result, and the device further includes:

[0133] A first judgment unit, used for judging whether the plurality of medical terms contain a preset rule trigger word;

[0134] A first rule query unit is configured to use a first rule corresponding to a preset rule trigger word as the rule query result when the first judgment unit judges that the plurality of medical terms contain a preset rule trigger word; or

[0135] A second judgment unit is used to judge whether the plurality of medical terms meet a preset rule triggering condition; the rule triggering condition is associated with a first connecting edge in the knowledge graph;

[0136] The second rule query unit is used to use the second rule corresponding to the rule triggering condition as the rule query result when the second judgment unit judges that the plurality of medical terms meet the preset rule triggering condition.

[0137] Furthermore, the rule query result includes at least one of the following rules:

[0138] Medical priority rules, medical short logic rules, and medical conclusion inference rules.

[0139] Optionally, as an embodiment, the query processing result is used to construct prompt words of a large language model, so that the large language model generates text for the query request according to the prompt words.

[0140] Optionally, as an embodiment, the term determination unit 44 is specifically configured to select k terms with top relevance rankings as the target terms.

[0141] Through the device provided in the embodiment of this specification, first, the extraction unit 41 extracts several medical terms from the query request; then the graph query unit 42 queries the knowledge graph based on the several medical terms to obtain the associated word query results and the term query results, the associated word query results at least include the queried standard word nodes, and the term query results include several candidate term nodes; then the relevance determination unit 43 determines the relevance score of the subgraph corresponding to the query request and the several candidate term nodes according to the associated word query results; finally, the term determination unit 44 determines the target term according to the relevance score, and classifies the corresponding term content into the query processing result. As can be seen from the above, in the embodiment of this specification, the medical knowledge base contains a structured knowledge graph, wherein the nodes in the knowledge graph include standard word nodes and term nodes, and the term nodes have term indexes, which are not based on the semantic vectors of the term content, but on the subgraphs corresponding to the term nodes. For a query request, the graph query and index matching are combined to jointly determine the target term. Since the structured knowledge used in the knowledge graph has a clear and unique meaning, and the knowledge is interconnected in the entire knowledge base in a network-like structure, it is more accurate when adapting to complex medical scenarios for reasoning. In addition, compared with the traditional vector index, the subgraph index of the term can more effectively eliminate interference information and achieve more accurate term matching. In summary, the accuracy of the queried terms can be improved.

[0142] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.

[0143] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.

[0144] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0145] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A query processing method based on a medical knowledge base, wherein: The medical knowledge base includes a knowledge graph, the nodes in the knowledge graph include standard word nodes and entry nodes, and each entry node has a corresponding subgraph as its entry index; the method includes: extracting several medical terms from the query request; Based on the several medical terms, query the knowledge graph to obtain associated word query results and term query results, wherein the associated word query results at least include the queried standard word nodes, and the term query results include several candidate term nodes; Determining, according to the associated word query result, a relevance score between the query request and the subgraphs corresponding to the plurality of candidate entry nodes; Determine the target term according to the relevance score, and classify the corresponding term content into the query processing result; The obtaining of the associated word query results and the term query results includes: Determining in the knowledge graph a target standard word node that matches any one of the plurality of medical terms; Determine in the knowledge graph the entry nodes that have a preset association relationship with the target standard word node, and classify them into the plurality of candidate entry nodes; The term index is obtained in the following way: According to the knowledge graph, extract multiple triples from the content of any term, each triple corresponding to two nodes in the knowledge graph and the connecting edge between the nodes; Extracting nodes and connecting edges corresponding to the multiple triples from the knowledge graph, and using the obtained subgraph as the entry index of the entry; The step of determining the relevance scores of the subgraphs corresponding to the query request and the plurality of candidate entry nodes includes: Obtaining the number of vocabulary of standard words commonly contained in the associated word query result and any subgraph; The relevance score between the query request and the subgraph is determined according to the number of words, the number of terms in the plurality of medical terms, and the number of subgraph entities contained in any subgraph.

2. The method of claim 1, wherein: The knowledge graph also includes a vocabulary list, which records the standard words and their synonyms corresponding to each standard word node; Determining a target standard word node for matching any medical term in the knowledge graph includes: Using any of the medical terms to search the vocabulary list, obtaining a target standard word and several synonyms matching the medical term; The target standard word node is determined according to the target standard word, and the plurality of synonyms are classified into the associated word query result.

3. The method of claim 1, wherein: The knowledge graph also includes a vocabulary list, in which the hierarchical structure records the upper and lower relationships between each standard word; Determining a target standard word node for matching any medical term in the knowledge graph includes: Starting from the preset layer of the hierarchical structure and going upwards layer by layer, any medical term is matched with each standard word of the current layer, and the first matched standard word is used as the target standard word; The target standard word node is determined according to the target standard word, and a plurality of superordinate standard words and / or a plurality of subordinate standard words of the target standard word are included in the associated word query result.

4. The method of claim 1, wherein: Determining the relevance score between the query request and the subgraph according to the number of words, the number of terms of the plurality of medical terms, and the number of subgraph entities contained in any subgraph includes: Determining a ratio of the number of words to the number of terms in the plurality of medical terms as a first proportional value; Determine the ratio of the number of words to the number of subgraph entities contained in any subgraph to obtain a second ratio value; A correlation score between the query request and the subgraph is determined according to the first ratio value and the second ratio value.

5. The method of claim 1, wherein: The medical knowledge base also includes a rule base, the query processing result also includes a rule query result, and the method further includes: Determining whether the plurality of medical terms contain a preset rule trigger word; When it is determined that the plurality of medical terms contain a preset rule trigger word, the first rule corresponding to the rule trigger word is used as the rule query result; or, Determining whether the plurality of medical terms meet a preset rule triggering condition; the rule triggering condition is associated with a first connecting edge in the knowledge graph; When it is determined that the plurality of medical terms meet the preset rule triggering condition, the second rule corresponding to the rule triggering condition is used as the rule query result.

6. The method of claim 5, wherein: The rule query result includes at least one of the following rules: Medical priority rules, medical short logic rules, and medical conclusion inference rules.

7. The method of claim 1, wherein: The query processing result is used to construct the prompt words of the large language model, so that the large language model generates text for the query request according to the prompt words.

8. The method of claim 1, wherein: Determining a target term according to the relevance score includes: The k terms with the highest relevance ranking are used as the target terms.

9. A query processing device based on a medical knowledge base, wherein: The medical knowledge base includes a knowledge graph, the nodes in the knowledge graph include standard word nodes and entry nodes, and each entry node has a corresponding subgraph as its entry index; The device comprises: An extraction unit, used for extracting a number of medical terms from a query request; A graph query unit, configured to query the knowledge graph based on the medical terms obtained by the extraction unit to obtain an associated word query result and an entry query result, wherein the associated word query result at least includes the queried standard word node, and the entry query result includes a number of candidate entry nodes; A relevance determination unit, configured to determine, based on the associated word query result obtained by the graph query unit, a relevance score between the query request and the subgraphs corresponding to the plurality of candidate entry nodes obtained by the graph query unit; A term determination unit, used to determine a target term according to the relevance score obtained by the relevance determination unit, and to classify the corresponding term content into the query processing result; Wherein, the graph query unit includes: A first query subunit is used to determine in the knowledge graph a target standard word node that matches any one of the plurality of medical terms; A second query sub-unit is used to determine in the knowledge graph the term node having a preset association relationship with the target standard term node obtained by the first query sub-unit, and classify it into the plurality of candidate term nodes; The term index is obtained in the following way: According to the knowledge graph, extract multiple triples from the content of any term, each triple corresponding to two nodes in the knowledge graph and the connecting edge between the nodes; Extracting nodes and connecting edges corresponding to the multiple triples from the knowledge graph, and using the obtained subgraph as the entry index of the entry; Wherein, the correlation determination unit includes: An acquisition subunit, used to acquire the number of vocabulary of standard words commonly included in the associated word query result and any subgraph; The determination subunit is used to determine the relevance score between the query request and the subgraph according to the number of words acquired by the acquisition subunit, the number of terms of the plurality of medical terms, and the number of subgraph entities contained in any subgraph.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 8.

11. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 8 is implemented.