Medical AI question and answer method based on retrieval enhancement

By adopting a search-enhanced method in the medical AI Q&A system, using entity recognition model, medical knowledge graph, vector index and full-text search inversion index for multi-channel mixed search, the existing system's problems in scalability, generalization ability and knowledge graph construction cost are solved, and more efficient and accurate medical Q&A is achieved.

CN119541887APending Publication Date: 2025-02-28SICHUAN MEIKANG PHARM SOFTWARE RES & DEV

Patent Information

Application Number
CN202510088808.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing medical Q&A system has poor scalability when processing diversified natural language input, relies on a large amount of labeled data, and has limited generalization capabilities. It also has high cost of building medical knowledge graphs and high requirements for dynamic updates.

Method used

Using a medical AI question-and-answer method based on search enhancement, a mixed search of user questions is performed by combining entity recognition model and medical knowledge graph with vector index and full-text search inverted index, providing accurate context information to support the answers of generative large models.

Benefits of technology

It significantly improves the accuracy and professionalism of the interactive experience of the medical Q&A system and the answers, reduces manual maintenance costs, improves Q&A coverage and user experience, and enhances the reliability of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The invention provides a medical AI question and answer method based on retrieval enhancement, which comprises the following steps: acquiring a medical professional knowledge base, and constructing an entity recognition model and a medical knowledge graph; the method comprises the following steps: splitting a medical professional knowledge base, and creating a vector index and a full-text retrieval reverse index; intention classification is carried out, and initial processing is completed; performing multi-path mixed retrieval on the medical professional knowledge base to obtain a user question related text block; a filtering rule is preset, and the user question related text blocks are filtered; answering the user question according to a preset second prompt word, and answering the user question according to a preset third prompt word when the user question exceeds the range of the medical professional knowledge base or the multi-path mixed retrieval has no result. According to the method, related context information can be accurately searched, reliable reference information is provided for a generative large model to answer professional questions, the interactive experience of a medical question answering system is improved, and the accuracy and specialty of answer generation of the system are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical question answering systems, and in particular to a medical AI question answering method based on retrieval enhancement. Background Art

[0002] The medical question-answering system uses artificial intelligence technologies such as natural language processing (NLP), machine learning, and knowledge graphs to realize AI automatic question-answering functions. The medical question-answering system can break through the traditional query method of the medical knowledge base, allowing medical professionals to easily obtain professional knowledge information through natural language chat, thereby improving their professional skills.

[0003] Methods for implementing medical question-answering systems include: 1) Rule-based methods, which were widely used in early question-answering systems and are suitable for structured medical knowledge bases. However, since they rely on manually formulated rules and templates, they are difficult to handle diverse natural language inputs and have poor scalability. 2) Based on machine learning technology, the ability to understand natural language is improved. However, this type of method relies on a large amount of labeled data, and the generalization ability is limited by the coverage of the training data. 3) Based on knowledge graph technology, by constructing professional knowledge bases into knowledge graphs, relevant information can be quickly located and integrated to provide accurate answers. However, the construction cost of medical knowledge graphs is high, and high requirements are placed on the dynamic update and supplementation of knowledge graphs. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a medical AI question-answering method based on retrieval enhancement, which can accurately search for relevant contextual information and provide reliable reference information for the generative large model to answer professional questions. It not only improves the interactive experience of the medical question-answering system, but also significantly improves the accuracy and professionalism of the answers generated by the system.

[0005] To achieve the above object, the present invention provides the following solution: a medical AI question-answering method based on retrieval enhancement, comprising the following steps: Acquire a professional medical knowledge base, annotate entities and relationships of the professional medical knowledge base, and construct an entity recognition model and a medical knowledge graph using the annotated professional medical knowledge base; Semantically splitting the medical professional knowledge base according to paragraphs to obtain text blocks, storing the text blocks in a vector database, creating a vector index, and then preprocessing the text blocks to create a full-text search inverted index; The input user question is identified using the entity recognition model, the medical knowledge graph, the vector index and the full-text search inverted index, and then the user question is classified according to the preset first prompt word using the open source generative large model to obtain the intent category of the user question and complete the initial processing; Based on the results of the initial processing, a multi-way mixed search is performed on the medical professional knowledge base in a mixed rearrangement and intersection manner to obtain text blocks related to the user's question; Preset filtering rules to filter the text blocks related to the user questions according to the mapping relationship between the intention categories and the semantic title keywords of the text blocks related to the user questions; The context of the filtered user question is obtained, and the user question is answered according to the preset second prompt word. When the user question exceeds the scope of the medical professional knowledge base or there is no result in the multi-channel mixed search, the user question is answered according to the preset third prompt word.

[0006] Optionally, obtaining a medical professional knowledge base, annotating entities and relationships of the medical professional knowledge base, and using the annotated medical professional knowledge base to construct an entity recognition model and a medical knowledge graph, including: Obtain a medical professional knowledge base, manually annotate 20% of the content in advance, obtain partial annotated content, and use the partial annotated content to train a selected BERT model to obtain an entity recognition fine-tuning model; Using the entity recognition fine-tuning model, pre-identify and manually review the remaining unlabeled parts of the medical professional knowledge database; Repeat the step of “using the entity recognition fine-tuning model to pre-recognize and manually review the remaining unlabeled parts in the medical professional knowledge database” until the accuracy of the entity recognition fine-tuning model is more than 98%, thereby obtaining an entity recognition model; The entity and relationship annotations of the medical professional knowledge base are exported to obtain an initial knowledge graph, and then the entity names with the same entity type and consistent meaning are standardized by using entity name similarity calculation and manual verification to perform entity fusion, obtain a medical knowledge graph and a standard terminology library, and create a knowledge graph and a term set index; wherein, in the medical knowledge graph, different weights are assigned according to different entity-relationship types, and the standard terminology library includes standard names and term aliases with mapping relationships.

[0007] Optionally, the medical professional knowledge base is semantically split according to paragraphs to obtain text blocks, the text blocks are stored in a vector database, a vector index is created, and then the text blocks are preprocessed to create a full-text search inverted index, including: According to the paragraph titles, the medical professional knowledge base is segmented to obtain a plurality of paragraphs, and a hierarchical title is set on each paragraph to obtain a plurality of text blocks; Applying the open source vector model to the text block, and vectorizing each article in the medical professional database as an independent unit, and then storing it in the vector database, completing the vectorized storage of the text block, and creating a vector index at the same time; Preprocess irrelevant information in the text block, use the Jieba word segmentation tool to segment the text, record the frequency and position of each keyword, and create a full-text search inverted index.

[0008] Optionally, the input user question is identified using the entity recognition model, the medical knowledge graph, the vector index and the full-text search inverted index, and then the user question is classified according to the intent of the preset first prompt word using an open source generative large model to obtain the intent category of the user question and complete the initial processing, including: Using the entity recognition model to identify entity keywords in user questions, and converting the entity keywords into standard term names through the standard term library; Introduce open source vector models into user questions to vectorize user questions, and then use word segmentation tools to segment user questions; According to the preset first prompt word, the open source generative large model is used to classify the intent of the user question, obtain the intent category of the user question, and complete the initial processing.

[0009] Optionally, based on the result of the initial processing, a multi-way mixed search is performed on the medical professional knowledge base in a mixed rearrangement and intersection manner to obtain a text block related to the user's question, including: According to the standard term name in the user's question, the relationship between the standard term name and the medical professional knowledge base and the term weight are found by using the knowledge graph and term set index to complete the knowledge graph search; According to the vectorization result of the user question, the cosine similarity between the query vector and the vector representation of the text block is calculated, and the vector is searched in the medical professional knowledge base in a manner of sorting in reverse order of similarity values ​​to find the text block related to the query vector; According to the word segmentation results of the user's question, combined with the BM25 algorithm, the full-text search inverted index is used to perform a full-text search on the medical professional knowledge base; Combine the results of vector search and full-text search, and use the re-ranking model to re-rank the combined results to obtain a hybrid re-ranking result; the weight of vector search is set to 0.7, and the weight of full-text search is set to 0.3; According to the article titles of the medical professional knowledge base, the intersection of the knowledge graph index result and the mixed rearrangement result is taken to obtain the retrieval result of the multi-way mixed retrieval.

[0010] Optionally, obtaining the context of the filtered user question, answering the user question according to a preset second prompt word, and when the user question exceeds the scope of the medical professional knowledge base or the multi-channel mixed search has no results, answering the user question according to a preset third prompt word, including: Obtain the context of the filtered user question, input the preset second prompt word and the text block into the generative large model to answer the question and attach a reference link to the original text; When the user's question is classified as non-medical or the multi-channel mixed search has no results, the user's question is answered according to the preset third prompt word.

[0011] The present invention discloses the following technical effects by providing a medical AI question-answering method based on retrieval enhancement: 1. Retrieve enhanced (RAG) context through a multi-way hybrid retrieval method of vector retrieval, full-text retrieval, and knowledge graph retrieval, and classify the intent of the questions entered by the user, build rules to filter the context based on the classification results, and accurately find relevant context information, providing reliable reference information for the generative large model to answer professional questions. This method not only improves the interactive experience of the medical question-answering system, but also significantly improves the accuracy and professionalism of the answers generated by the system, thus providing a guarantee for the application of large language models in medical scenarios.

[0012] 2. Reduce manual maintenance costs: No need to frequently update and maintain rules or templates, reducing manual intervention. Improve Q&A coverage: Able to handle more types of medical questions to meet the diverse needs of users. Improve user experience: The answer results are more natural and fluent, in line with the user's language habits. Enhance the reliability of answers: Answers with reference sources are more authoritative, which improves user trust.

[0013] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 A schematic diagram of a method flow chart provided by an embodiment of the present invention; Figure 2 A schematic diagram of a medical knowledge base management method flow chart provided by an embodiment of the present invention; Figure 3 A schematic diagram of the medical AI question-answering system flow provided by an embodiment of the present invention; Figure 4 A schematic diagram of the article structure of the medical knowledge base provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] like Figure 1-Figure 4 As shown, the present invention provides a medical AI question answering method based on retrieval enhancement, comprising the following steps: 1. Obtain a medical professional knowledge base, annotate the entities and relationships of the medical professional knowledge base, and use the annotated medical professional knowledge base to build an entity recognition model and a medical knowledge graph. Including: 1.1 Define the schema of the medical knowledge graph, including entity types such as disease, clinical manifestations, symptoms, signs, sites, tests (test results), examinations (examination results), genes (gene results), pathogens, clinical stages, clinical classifications, populations, surgeries or operations, drugs, drug classes, treatment plans, grading scales, etc., and relationship types such as disease clinical manifestations, disease subclasses, disease sites, disease-related tests, disease-related examinations, disease genes, disease pathogens, disease stages, disease classifications, disease populations, surgical treatments, drug treatments, treatment plans, and evaluation scales.

[0019] 1.2 Manually annotate 20% of the content in advance to obtain partial annotated content, and use the partial annotated content to train the selected BERT model to obtain an entity recognition fine-tuning model.

[0020] 1.3 Using the entity recognition fine-tuning model, pre-identify and manually review the remaining unlabeled parts in the medical professional knowledge database.

[0021] Repeat the step of “using the entity recognition fine-tuning model to pre-recognize and manually review the remaining unlabeled parts in the medical professional knowledge database” until the accuracy of the entity recognition fine-tuning model is more than 98%, thereby obtaining an entity recognition model; 1.4 Export the entity and relationship annotations of the medical professional knowledge base to obtain an initial knowledge graph, and then use entity name similarity calculation and manual verification to standardize entity names with the same entity type and consistent meaning to perform entity fusion, obtain a medical knowledge graph and a standard terminology library, and create a knowledge graph and term set index; wherein, in the medical knowledge graph, different weights are assigned according to different entity-relationship types, and the standard terminology library includes standard names and term aliases with mapping relationships.

[0022] The following table shows an example of the weight value of each article relationship and entity type: Table 1 Corresponding weight values ​​of relationship and entity types

[0023] The standard terminology library includes not only the standard name of each term, but also the term aliases in the annotated data. The term aliases and standard names suggest a mapping relationship for the term conversion of keywords identified in user questions in AI Q&A. An example of the standard terminology library is shown in Table 2 below: Table 2 Standard terminology database

[0024] 2. Semantically split the medical professional knowledge base according to the paragraphs to obtain text blocks, store the text blocks in the vector database, create vector indexes, and then pre-process the text blocks to create full-text search inverted indexes. Including: 2.1 According to the paragraph titles, the medical professional knowledge base is segmented to obtain multiple paragraphs, and a hierarchical title is set on each paragraph to obtain multiple text blocks.

[0025] Among them, the hierarchical titles include article title / first-level title / second-level title / third-level title / fourth-level title, and so on. The level of the semantic title is determined by the level of the current paragraph title. Then, the paragraphs are further segmented according to the text length limit of the vector model. During the segmentation process, if there is table content, the integrity of the table content is ensured according to the table HTML tags, and then unnecessary tags and symbols are removed for text cleaning.

[0026] An example of paragraph splitting is: the text block after the sign of "abdominal hypertension" is split into: abdominal hypertension / abdominal compartment syndrome / diagnosis / clinical manifestations / signs. Common clinical signs of ACS are closely related to the number and degree of affected organs. The main manifestations are: abdominal distension, high abdominal distension, increased anteroposterior diameter of the abdominal wall (i.e. "round abdomen sign"), tense abdominal wall and increased abdominal muscle tension during palpation, weakened or absent bowel sounds, decreased blood pressure, and distended superficial veins.

[0027] 2.2 Apply the open source vector model gte-Qwen2 to the text block, and vectorize each article in the medical professional database as an independent unit and store it in the vector database to complete the vectorized storage of the text block and create a vector index at the same time; after the user enters the question, the relevant articles are associated according to the retrieved text block.

[0028] 2.3 Preprocess irrelevant information in the text block (such as HTML tags, stop words, punctuation marks, numbers, etc.), and use the Jieba word segmentation tool to segment the text, record the frequency and position of each keyword, and create a full-text search inverted index.

[0029] 3. Use the entity recognition model, the medical knowledge graph, the vector index and the full-text search inverted index to identify the input user question, and then use the open source generative model to classify the user question intent based on the preset first prompt word, obtain the user question intent category, and complete the initial processing. Including: 3.1 Use the entity recognition model to identify entity keywords in user questions, and convert the entity keywords into standard term names through the standard term library.

[0030] For example, user question 1: "How to diagnose achalasia?", the JSON string of the entity recognition result is: [{"begin":1, "end": 5, "entity": "achalasia", "type": "dis"}], where the entity name is "achalasia" and the entity type is "disease". Then the entity name field of the standard term library is matched with "achalasia" to obtain the standard term name: "achalasia".

[0031] 3.2 Introduce the open source vector model gte-Qwen2 into the user question to vectorize the user question, and then use the word segmentation tool to segment the user question. For example, the word segmentation result of "How to diagnose achalasia?" is ['cardia', 'achalasia', 'how', 'diagnosis'].

[0032] 3.3 Based on the preset first prompt word, use the open source generative large model to classify the user's question intent, obtain the user's question intent category, and complete the initial processing.

[0033] The first prompt word example is as follows: "xml <instruction> According to the questions raised by the user, they are classified into one of the following categories: 1-Definition: 2-Cause or risk factor; 3-Diagnosis: 4-Clinical manifestations: 5-Tests: 6-Examination; 7-Treatment: 8-Prevention, prognosis or follow-up: 9-Epidemiology: 10-Differential diagnosis: 11-None of the above categories: 12-Non-medical. When the user's question only contains a separate disease name, clinical manifestation, symptom, test, or examination name, it is classified as 11-Non-medical. When the user's question is not related to medicine, it is directly classified as 12-Non-medical. The classification results are directly output and returned in JSON array format. It must comply with JSON syntax, such as strings should be quoted and do not contain any XML tags.

[0034] < / instruction> <example> User question: What is thoracic outlet syndrome? Output: 1-Definition < / example> <example> What is the preferred test for diagnosing aortic aneurysm? Output: 6-Check < / example> In the prompt words, the intent type of medical user questions is set to 1-definition, 2-cause or risk factor, 3-diagnosis, 4-clinical manifestation, 5-test, 6-examination, 7-treatment, 8-prevention, prognosis or follow-up, 9-epidemiology, 10-differential diagnosis, 11-not belonging to the above categories, and 12-non-medical.

[0035] Types 1-10 are clear intents. For example, the user question is: "What are the drug treatments for Crohn's disease?", intent category = "7-Treatment". Types 11-12 are ambiguous intents. When the user question only contains a separate disease name, clinical manifestations, symptoms, test, or examination name, it is unclear what information the user needs to query for these keywords, and they are all classified as 11-not belonging to the above categories. For example, the user inputs: "hypertension", intent category = "11-not belonging to the above categories". When the user question is not related to medicine, it is directly classified as 12-non-medical. For example, the user inputs: "Today's weather forecast", intent category = "12-non-medical".

[0036] 4. Based on the results of the initial processing, the medical professional knowledge database is searched in a multi-way mixed manner by mixing, rearranging and taking intersections to obtain text blocks related to the user's question. Including: 4.1 Knowledge Graph Retrieval According to the standard term name in the user's question, the relationship between the standard term name and the medical professional knowledge base and the term weight are found by using the knowledge graph and term set index to complete the knowledge graph retrieval.

[0037] If multiple keywords are identified in a user question, the weight value of the search result is the sum of the weights of the multiple keywords. Finally, the top ka (ka refers to the articles related to the first ka questions, and ka is determined according to the weight threshold) is taken as the knowledge graph retrieval result, thereby narrowing the scope of the knowledge base during question and answering and reducing other irrelevant interference.

[0038] 4.2 Vector Retrieval According to the vectorization result of the user's question, the cosine similarity between the query vector (i.e., the vector representation of the user's question) and the vector representation of the text block (the vector representation of the split text block) is calculated, and the medical professional knowledge base is searched for vectors in reverse order of similarity values ​​to find the text block related to the query vector.

[0039] 4.3 Full-text search According to the word segmentation results of the user's question, combined with the BM25 algorithm, the full-text search inverted index is used to perform a full-text search on the medical professional knowledge base.

[0040] The full-text search results are sorted according to the BM25 algorithm. The BM25 algorithm is the mainstream text matching algorithm in the current information retrieval field, which mainly calculates the similarity score between the query and the document collection. The formula of the BM25 algorithm is as follows: in, Q express Query , q i express Q A morpheme after parsing (for Chinese, Query The participles of the word are analyzed as morphemes, and each word is considered as a morpheme. q i ), d Represents a search result document. W i Expressing morphemes q i The weight of R ( q i ,d ) indicates a morpheme q i With Documentation d The relevance score of .

[0041] 4.4 Combine the results of vector retrieval and full-text retrieval, and use the rearrangement model to re-rank the combined results to get the top kb and obtain the hybrid rearrangement results.

[0042] The candidate results of vector search and full-text search are rearranged using the rearrangement model bce-ranker-base_v1. The vector search weight is set to 0.7, and the full-text search weight is set to 0.3. The search results are reordered and the top kb are taken (kb refers to the first kb related text blocks. In order to fully cover the search results, kb is taken according to the similarity threshold).

[0043] 4.5 Intersection of the results of multiple retrievals According to the article titles of the medical professional knowledge base, the intersection of the knowledge graph index result and the mixed rearrangement result is taken to obtain the retrieval result of the multi-way mixed retrieval.

[0044] For example, the knowledge graph retrieval result is ka articles. The vector retrieval and full-text retrieval take the top kb text blocks after sorting through the rearrangement model. These text blocks correspond to kx articles. The intersection of ka and kx is taken through the same article title, that is, only the text blocks with the same title as ka are taken from the kb text blocks, so as to obtain the text blocks related to the question that are recalled by multi-way retrieval.

[0045] 5. Preset filtering rules to filter the user question-related text blocks according to the mapping relationship between the intent category and the semantic title keywords of the user question-related text blocks.

[0046] The semantic title structure is article title / first-level title / second-level title / third-level title / fourth-level title, such as "Intra-abdominal hypertension / abdominal compartment syndrome / diagnosis / clinical manifestations / signs". Question: "What are the drug treatments for Crohn's disease?", intent category = "7-treatment". Among the text blocks retrieved by this question, the text blocks containing the keyword "treatment" in the semantic title "article title / first-level title / second-level title / third-level title" are filtered out according to the mapping relationship, and other text blocks that do not meet the conditions are filtered out. The mapping relationship between the intent category and the semantic title keywords of the text block is shown in Table 3: Table 3 Mapping relationship between intent types and keywords

[0047] The filtered text blocks are then ranked top kc based on the similarity value. The top kc is determined according to the text input length limit of the generative large model (for example, kc=15). Finally, the top 15 text blocks are passed to the large model through the interface as the context for the large model to answer the question.

[0048] 6. Obtain the context of the filtered user question, answer the user question according to the preset second prompt word, and when the user question exceeds the scope of the medical professional knowledge base or the multi-channel mixed search has no results, answer the user question according to the preset third prompt word. Including: 6.1 Obtain the context of the filtered user question, input the preset second prompt word and the text block into the generative large model to answer the question and attach the original reference link; each text block has an article title, and the article title is displayed as a link, and the user can view the original text by clicking the link.

[0049] The second prompt word example is as follows: "xml <instruction> Your role is that of a clinical expert. When answering user questions, follow these steps: 1. Carefully read the user questions and provided <context>.

[0050] 2. Understand the user's query intent from the perspective of medical professionals. <context>Conduct logical analysis to ensure accuracy and relevance of responses.

[0051] 3. If <context>Include relevant information to construct an accurate and comprehensive answer. The clinical manifestations need to describe all clinical manifestations mentioned in the text, the treatment plan needs to describe in detail the usage and dosage of the therapeutic drugs, the diagnosis of the disease needs to describe in detail the diagnostic process, and the diagnostic criteria need to fully describe the diagnostic conditions.

[0052] 4. Answer in Chinese according to the description of clinical professionals.

[0053] 5. Do not include any XML tags in the output.

[0054] < / context> < / context> < / context> < / instruction> <example> User question: How to diagnose gallstones? <context> The diagnosis of gallstones requires a combination of medical history, symptoms, signs, and laboratory and imaging tests, especially ultrasound. Patients with symptomatic gallstones should undergo abdominal ultrasound and blood tests. Gallstones can be clearly diagnosed in patients with fever, right upper quadrant pain or tenderness, vomiting, and abdominal ultrasound that suggests gallstones and cholecystitis: If ultrasound examination shows poor or uncertain gallbladder imaging, suspected cholangitis / bile duct stones, Mirizzi syndrome, confluence stones, or combined gallbladder cancer, abdominal CT, MRI / MRCP, and / or endoscopic ultrasound are recommended for further diagnosis.

[0055] < / context> Output: The diagnosis of gallstones requires a combination of medical history, symptoms, signs, and laboratory and imaging tests, especially ultrasonography.

[0056] Patients with symptomatic gallstones should have abdominal ultrasonography and blood studies.

[0057] Gallstones can be diagnosed in patients with fever, right upper quadrant abdominal pain or tenderness, vomiting, and abdominal ultrasound examinations that suggest gallstones and cholecystitis: If ultrasound examination shows poor or uncertain gallbladder imaging, suspected cholangitis / bile duct stones, Mirizzi syndrome, confluence stones, or concurrent gallbladder cancer, abdominal CT, MRI / MRCP, and / or endoscopic ultrasound are recommended for further diagnosis.

[0058] < / example> 6.2 When the user's question is classified as non-medical or the multi-way mixed search has no results, answer the user's question according to the preset third prompt word. Beyond the definition of the knowledge base scope: (1) Intent classification = non-medical; (2) The multi-way search in step 5 has no results, and the final recalled context has no content. At this time, the big model answers the user: "This question cannot be answered based on the medical professional knowledge base", avoiding irrelevant expansion or reducing the big model illusion.

[0059] The following are examples of the third prompt word: "xml <instruction> When answering user questions, please follow these steps and requirements: 1. First, classify the user's questions into: 1-medical, 2-non-medical. If the user's question is classified as 2-non-medical, just answer "This question cannot be answered based on the medical professional knowledge base": If the user's question is 1-medical, go to step 2.

[0060] 2. Carefully read the user questions and provided <context>If you cannot <context>Get the answer or <context>There is no content in it, only the answer: "This question cannot be answered based on the medical professional knowledge base."

[0061] < / context> < / context> < / context> < / instruction> Therefore, the present invention provides a medical AI question-answering method based on retrieval enhancement, which can accurately search for relevant contextual information and provide reliable reference information for the generative large model to answer professional questions. It not only improves the interactive experience of the medical question-answering system, but also significantly improves the accuracy and professionalism of the answers generated by the system.

[0062] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0063] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A medical AI question answering method based on retrieval enhancement, characterized in that: The following steps are involved: Acquire a professional medical knowledge base, annotate entities and relationships of the professional medical knowledge base, and construct an entity recognition model and a medical knowledge graph using the annotated professional medical knowledge base; Semantically splitting the medical professional knowledge base according to paragraphs to obtain text blocks, storing the text blocks in a vector database, creating a vector index, and then preprocessing the text blocks to create a full-text search inverted index; The input user question is identified using the entity recognition model, the medical knowledge graph, the vector index and the full-text search inverted index, and then the user question is classified according to the preset first prompt word using the open source generative large model to obtain the intent category of the user question and complete the initial processing; Based on the results of the initial processing, a multi-way mixed search is performed on the medical professional knowledge base in a mixed rearrangement and intersection manner to obtain text blocks related to the user's question; Preset filtering rules to filter the text blocks related to the user questions according to the mapping relationship between the intention categories and the semantic title keywords of the text blocks related to the user questions; The context of the filtered user question is obtained, and the user question is answered according to the preset second prompt word. When the user question exceeds the scope of the medical professional knowledge base or there is no result in the multi-channel mixed search, the user question is answered according to the preset third prompt word.

2. According to the medical AI question-answering method based on retrieval enhancement according to claim 1, it is characterized in that: Obtaining a medical professional knowledge base, annotating entities and relationships of the medical professional knowledge base, and using the annotated medical professional knowledge base to construct an entity recognition model and a medical knowledge graph, including: Obtain a medical professional knowledge base, manually annotate 20% of the content in advance, obtain partial annotated content, and use the partial annotated content to train a selected BERT model to obtain an entity recognition fine-tuning model; Using the entity recognition fine-tuning model, pre-identify and manually review the remaining unlabeled parts of the medical professional knowledge database; Repeat the step of "using the entity recognition fine-tuning model to pre-recognize and manually review the remaining unlabeled parts in the medical professional knowledge database" until the accuracy of the entity recognition fine-tuning model is more than 98%, thereby obtaining an entity recognition model; The entity and relationship annotations of the medical professional knowledge base are exported to obtain an initial knowledge graph, and then the entity names with the same entity type and consistent meaning are standardized by using entity name similarity calculation and manual verification to perform entity fusion, obtain a medical knowledge graph and a standard terminology library, and create a knowledge graph and a term set index; wherein, in the medical knowledge graph, different weights are assigned according to different entity-relationship types, and the standard terminology library includes standard names and term aliases with mapping relationships.

3. According to the medical AI question-answering method based on retrieval enhancement according to claim 2, it is characterized in that: Semantically splitting the medical professional knowledge base according to paragraphs to obtain text blocks, storing the text blocks in a vector database, creating a vector index, and then preprocessing the text blocks to create a full-text search inverted index, including: According to the paragraph titles, the medical professional knowledge base is segmented to obtain a plurality of paragraphs, and a hierarchical title is set on each paragraph to obtain a plurality of text blocks; Applying the open source vector model to the text block, and vectorizing each article in the medical professional database as an independent unit, and then storing it in the vector database, completing the vectorized storage of the text block, and creating a vector index at the same time; Preprocess irrelevant information in the text block, use the Jieba word segmentation tool to segment the text, record the frequency and position of each keyword, and create a full-text search inverted index.

4. According to the medical AI question-answering method based on retrieval enhancement according to claim 3, it is characterized in that: The input user question is identified by using the entity recognition model, the medical knowledge graph, the vector index and the full-text search inverted index, and then the user question is classified according to the preset first prompt word by using the open source generative large model to obtain the intent category of the user question and complete the initial processing, including: Using the entity recognition model to identify entity keywords in user questions, and converting the entity keywords into standard term names through the standard term library; Introduce open source vector models into user questions to vectorize user questions, and then use word segmentation tools to segment user questions; According to the preset first prompt word, the open source generative large model is used to classify the intent of the user question, obtain the intent category of the user question, and complete the initial processing.

5. According to the medical AI question-answering method based on retrieval enhancement according to claim 4, it is characterized in that: Based on the results of the initial processing, a multi-way mixed search is performed on the medical professional knowledge base in a mixed rearrangement and intersection manner to obtain text blocks related to the user's question, including: According to the standard term name in the user's question, the relationship between the standard term name and the medical professional knowledge base and the term weight are found by using the knowledge graph and term set index to complete the knowledge graph search; According to the vectorization result of the user question, the cosine similarity between the query vector and the vector representation of the text block is calculated, and the vector is searched in the medical professional knowledge base in a manner of sorting in reverse order of similarity values ​​to find the text block related to the query vector; According to the word segmentation results of the user's question, combined with the BM25 algorithm, the full-text search inverted index is used to perform a full-text search on the medical professional knowledge base; Combine the results of vector search and full-text search, and use the re-ranking model to re-rank the combined results to obtain a hybrid re-ranking result; the weight of vector search is set to 0.7, and the weight of full-text search is set to 0.3; According to the article titles of the medical professional knowledge base, the intersection of the knowledge graph index result and the mixed rearrangement result is taken to obtain the retrieval result of the multi-way mixed retrieval.

6. A medical AI question-answering method based on retrieval enhancement according to claim 5, characterized in that: Obtaining the context of the filtered user question, answering the user question according to the preset second prompt word, and when the user question exceeds the scope of the medical professional knowledge base or the multi-channel mixed search has no results, answering the user question according to the preset third prompt word, including: Obtain the context of the filtered user question, input the preset second prompt word and the text block into the generative large model to answer the question and attach a reference link to the original text; When the user's question is classified as non-medical or the multi-channel mixed search has no results, the user's question is answered according to the preset third prompt word.

Citation Information

Patent Citations

  • Medical auxiliary question and answer method and system based on knowledge calibration and retrieval enhancement

    CN117573843A

  • Traditional Chinese medicine question-answering system construction method based on large language model and knowledge graph

    CN118838996A

  • Online medical inquiry method and system based on large language model language reasoning analysis

    CN119274774A

Cited By

  • Large language model and multi-modal model retrieval method, electronic equipment and medium

    CN120353945A

  • Method and system for completing searching according to fuzzy significance label by using AI large model

    CN120386810A

  • A method and system for completing a search according to a fuzzy meaning label using an AI large model

    CN120386810B

  • Intelligent agent knowledge retrieval method and device based on multi-knowledge mixed recall and medium

    CN120470100A

  • A method, apparatus, and medium for intelligent agent knowledge retrieval based on multi-knowledge hybrid recall.

    CN120470100B