Medical question and answer method and system based on retrieval enhanced language model and medium

Through the medical question-and-answer method based on the retrieval enhancement language model, the problems of information outdated and memory distorted in the prior art are solved, and more accurate and practical reply text is achieved, which improves user satisfaction and trust.

CN119474305APending Publication Date: 2025-02-18SHENZHEN HUAYU MEDICAL TECH CO LTD

Patent Information

Application Number
CN202411536164.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Existing large language models encode knowledge into parameters during the training stage, resulting in problems such as outdated information and distorted memory, resulting in poor accuracy of answer text.

Method used

Using a medical question-and-answer method based on search enhancement language model, the user's query text is obtained, semantic re-edited and expanded, combined with medical knowledge paragraphs in external databases, filtered and refined according to preset filtering standards, and finally constructed an accurate reply text. .

Benefits of technology

It improves the accuracy and practicality of the answer text, enhances users' satisfaction and trust in Q&A, and solves the problems of outdated information and distorted memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474305A_ABST
    Figure CN119474305A_ABST
Patent Text Reader

Abstract

The invention relates to a medical question and answer method and system based on a retrieval enhanced language model and a medium, and the method comprises the steps: S1, obtaining a query text X of a user about a medical question, and carrying out the semantic re-editing and expansion of the query text X through medical knowledge and a language model, and obtaining an edited text Xr and an expanded text Xe of the query text X; s2, paragraphs related to the edited text Xr and the extended text Xe are obtained from an external database, and a medical paragraph set P is obtained; s3, filtering partial paragraphs in the medical paragraph set P according to a preset screening standard to obtain a refined medical knowledge paragraph set P '; and S4, constructing a reply text based on the medical knowledge paragraph set P ', and outputting the reply text to the user. Through the steps, more accurate, practical and refined reply can be provided for the user, so that the satisfaction degree and credibility of the user on questions and answers are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical big data technology, and more specifically, to a medical question-answering method, system and medium based on a retrieval enhanced language model. Background Art

[0002] In the field of artificial intelligence, especially natural language processing (NLP), large language models (LLMs) have revolutionized the way machines understand and generate human language. For example, GPT-3.5 and its successor GPT-4, by training on large amounts of text data, predict the next word in a sequence, allowing them to generate coherent and contextually relevant text. These models have been widely used in various fields, including the medical field, to help in tasks such as medical diagnosis, treatment recommendations, literature analysis, and patient interaction.

[0003] At present, traditional large language models (LLMs) encode knowledge in parameters during the training phase. This knowledge encapsulation method also brings some problems. This encapsulation method may cause information obsolescence, that is, the model training data becomes outdated; and due to bias in training data or information loss over time, the model may generate seemingly reasonable but actually incorrect information, that is, there is a problem of memory distortion. As a result, the final constructed answer text is not accurate, and it is difficult for users to find the required content from the answer text.

[0004] In view of this, it is indeed necessary to provide a technical solution to the above problems. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a medical question-answering method, system and medium based on a retrieval enhanced language model in view of the above-mentioned defects of the prior art.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A medical question answering method based on a retrieval enhanced language model is constructed, the method comprising:

[0008] S1. Obtain a query text X about a medical problem from a user, and semantically re-edit and expand the query text X using medical knowledge and a language model to obtain an edited text Xr and an expanded text Xe of the query text X;

[0009] S2, acquiring paragraphs related to the edited text Xr and the extended text Xe from an external database to obtain a medical paragraph set P;

[0010] S3, filtering some paragraphs in the medical paragraph set P according to the preset screening criteria to obtain a refined medical knowledge paragraph set P';

[0011] S4. Construct a reply text according to the medical knowledge paragraph set P', and output the reply text to the user.

[0012] As an improvement of the medical question-and-answer method, the screening criteria are the relevance and practicality between Xr and Xe. The relevance is the degree of matching between the medical paragraphs retrieved from the external database and the edited text Xr and the extended text Xe, and the matching degree includes keyword matching, semantic proximity and context consistency; the practicality is the applicability of the retrieved medical paragraphs to the user's query, and the adaptability includes the accuracy, timeliness, operability of the information and whether it meets the user's query requirements.

[0013] As an improvement of the medical question-and-answer method, the external database is an external knowledge base for storing medical knowledge; the query text is a medical inquiry text related to the medical inquiry scenario; and the reply text is a medical inquiry result.

[0014] As an improvement of the medical question-and-answer method, in step S1, the colloquial or non-standardized expression of the query text X is converted into corresponding standardized medical terms according to semantics, and the converted query text X is re-edited to form an edited text Xr.

[0015] As an improvement of the medical question-answering method, in step S1, the query text X is parsed and inferred by a large language model using a thinking chain method, and medical terms related to the query text X but not explicitly mentioned in the query text X are identified and introduced; after the medical terms are introduced into the query text X and integrated, an extended version xe is formed.

[0016] As an improvement of the medical question-and-answer method, in step S2, the medical paragraph set P is obtained by combining the edit text Xr and the extended text Xe to form query content, retrieving relevant paragraphs from the external database, and marking the relevant paragraphs.

[0017] As an improvement of the medical question-and-answer method, the retrieval method includes sparse retrieval, dense retrieval and rearrangement. The sparse retrieval is to encode the edited text Xr, the extended text Xe and the documents of the external database separately, and represent the text through maximum aggregation; the dense retrieval is to perform k-NN search using the dense representation of the edited text Xr, the extended text Xe and the documents of the external database; the rearrangement is to use a BERT-based cross encoder to connect the query and the retrieved related paragraphs to calculate the relevance score.

[0018] As an improvement of the medical question-answering method, in step S3, after obtaining the medical paragraph set P, binary classification is performed on each paragraph to determine its relevance, and the relevant subset Pr is obtained after filtering; and according to the heuristic rules, each paragraph of the relevant subset Pr is segmented at the sentence boundary according to the heuristic rules to form multiple fragments; the length of each fragment is checked, and the fragments that do not reach the minimum length threshold will be merged with the adjacent fragments; then each fragment is binary classified to determine its practicality, and the fragments are screened according to the set practicality standards to obtain a refined medical knowledge paragraph set P'.

[0019] A medical question answering system based on a retrieval enhanced language model, comprising:

[0020] A query enhancement module, used to obtain a query text X input by a user, and re-edit and expand the query text X to obtain an edited text Xr and an expanded text Xe;

[0021] A retrieval module, used to obtain paragraphs related to the edited text Xr and the extended text Xe from an external database to obtain a medical paragraph set P;

[0022] A refining module, which filters some paragraphs in the medical paragraph set P according to a preset screening criterion to obtain a refined medical knowledge paragraph set P';

[0023] A generation module constructs a reply text according to the medical knowledge paragraph set P', and outputs the reply text to the user.

[0024] A computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the medical question-and-answer method as described above.

[0025] The beneficial effect of the present invention is that: in the above technical solution, by obtaining the query text X input by the user, and then re-editing and expanding it according to the semantics of the query text X to obtain the edited text Xr and the extended text Xe, in this step, the colloquial or non-standardized expression of the query text X will be converted into standardized medical terms, and the large language model is used for reasoning and expansion, and relevant but not explicitly mentioned medical terms are introduced; then the obtained edited text Xr and the extended text Xe are combined to form a more comprehensive query to ensure the accuracy and extensiveness of the query; relevant paragraphs are retrieved from an external database storing professional medical knowledge to form a medical paragraph set P; according to the preset screening criteria, the medical paragraph set P is filtered and refined to obtain a refined medical knowledge paragraph set P', and finally, the reply text is constructed according to the refined medical knowledge paragraph set P' and output to the user. Through the above steps, more accurate, practical and refined replies can be provided to users, thereby improving user satisfaction and trust in questions and answers. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. 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 creative work:

[0027] Figure 1 It is a flow chart of a medical question answering method based on a retrieval enhanced language model provided by the present invention;

[0028] Figure 2 It is a schematic diagram of a medical question-answering method system based on a retrieval enhanced language model provided by the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the following will be described clearly and completely in combination with the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are partial embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.

[0030] A medical question answering method based on a retrieval enhanced language model in a preferred embodiment of the present invention is as follows: Figure 1 As shown, the method includes:

[0031] S1. Obtain the user's query text X about medical problems, and use medical knowledge and language models to semantically re-edit and expand the query text X to obtain the edited text Xr and expanded text Xe of the query text X;

[0032] S2, obtaining paragraphs related to the edited text Xr and the extended text Xe from an external database to obtain a medical paragraph set P;

[0033] S3, filtering some paragraphs in the medical paragraph set P according to the preset screening criteria to obtain a refined medical knowledge paragraph set P';

[0034] S4. Construct a reply text based on the medical knowledge paragraph set P', and output the reply text to the user.

[0035] In the technical solution of this embodiment, the query text X input by the user is obtained, and then re-edited and expanded according to the semantics of the query text X to obtain the edited text Xr and the extended text Xe. In this step, the colloquial or non-standardized expression of the query text X will be converted into standardized medical terms, and reasoned and expanded through a large language model to introduce relevant but not explicitly mentioned medical terms; then the obtained edited text Xr and extended text Xe are combined to form a more comprehensive query to ensure the accuracy and breadth of the query; relevant paragraphs are retrieved from an external database storing professional medical knowledge to form a medical paragraph set P; according to preset screening criteria, the medical paragraph set P is filtered and refined to obtain a refined medical knowledge paragraph set P'; finally, a reply text is constructed based on the refined medical knowledge paragraph set P' and output to the user.

[0036] The external database uses medical textbooks as an authoritative and professional source of information, excludes irrelevant information such as diagrams and references, ensures that the corpus is text-centric, and subdivides textbook paragraphs for easy retrieval and use, transforming the medical textbooks into an effective retrieval database.

[0037] It should be noted that the paragraphs of the medical paragraph set P are marked as P1, P2, P3, ..., Pk, respectively, where K is a positive number. The external database is a dynamically updateable database.

[0038] In this embodiment, the screening criteria of step S3 are the relevance and practicality with Xr and Xe. The relevance refers to the degree of match between the medical paragraphs retrieved from the external database and the edited text Xr and the extended text Xe, and the degree of match includes keyword matching, semantic proximity, and context consistency. The practicality refers to the applicability of the retrieved medical paragraphs to the user's query, and the adaptability includes the accuracy, timeliness, operability of the information, and whether it meets the user's query requirements.

[0039] Keyword matching: The retrieved medical passages should contain words that are the same or similar to the keywords in the query text.

[0040] Semantic proximity: Even if the words in the medical passage are not exactly the same as the query text, their meanings should be similar and be able to express similar medical concepts or information.

[0041] Contextual consistency: The content of the medical paragraph should be consistent with the context of the query text to ensure the coherence and accuracy of the information.

[0042] Accuracy: Information in medical sections should be accurate and based on authoritative medical knowledge and data.

[0043] Timeliness: Medical information should be published on time to reflect the latest developments and research results in the current medical field.

[0044] Actionability: The medical advice or treatment plans provided should be actionable, and users should be able to follow the instructions or seek further professional help.

[0045] Satisfy user query needs: Medical paragraphs should directly answer user queries and provide the specific information or solutions that users need.

[0046] Specifically, the relevance of each paragraph retrieved from the external database is judged in order to filter out paragraphs that are irrelevant to the edited text Xr and the extended text Xe, and only retain paragraphs that are closely related to the query content to complete the initial screening; then, according to the set practicality standards, the fragments that are actually helpful in answering the user's query are screened out to form a refined medical knowledge paragraph set P', ensuring that the content of the final reply text is both relevant, practical and accurate.

[0047] Through relevance screening, we can ensure that the content in the reply text is closely related to the user's query and avoid interference from irrelevant information. Practicality screening ensures that the content in the reply text is actually helpful to the user and can answer the user's questions or provide useful information. Through the above steps, we can provide users with more accurate, practical and concise replies, thereby improving user satisfaction and trust in the Q&A.

[0048] The relevance criteria include, but are not limited to, keywords, semantic similarity or sentence structure. The retrieved medical paragraph set P is divided into two categories, "relevant" and "irrelevant", by the set relevance criteria, and the paragraphs in the irrelevant category are filtered to improve the accuracy of the search results.

[0049] Practicality standard: The medical paragraph set P contains paragraphs that are practical and impractical for user queries. Impractical paragraphs in the medical paragraph set P are filtered out by the practicality standard; the practicality standard includes whether the source of the paragraph is from a similar medical field, the completeness and clarity of the paragraph content, and the degree of match between the paragraph and the query text X. The medical paragraph set P is divided into two categories, practical and impractical, based on these indicators. Practical paragraphs will be included in the refined medical knowledge paragraph set P' to construct the reply text. Impractical paragraphs will be filtered out to ensure the refinement and practicality of the reply.

[0050] In addition, if the detection has processed semantically similar query text X before, the historical feedback of users on these paragraphs can also serve as an indicator of practicality.

[0051] In some embodiments of the present application, the external database is an external knowledge base for storing medical knowledge; the query text is a medical inquiry text related to the medical inquiry scenario; and the reply text is the medical inquiry result. The most relevant medical knowledge is retrieved from the external database, thereby improving the accuracy of the reply. Since the external database stores medical knowledge, the system can provide users with professional and authoritative question-and-answer services to meet users' needs for medical knowledge.

[0052] In some embodiments of the present application, in step S1, the colloquial or non-standardized expression of the query text X is converted into corresponding standardized medical terms according to semantics, and the converted query text X is re-edited to form an edited text Xr.

[0053] By converting colloquial or non-standardized expressions into standardized medical terms, it is possible to ensure that the query text is more accurate and professional, thereby improving the accuracy of subsequent knowledge retrieval and answer construction. The re-edited query text Xr is more refined and clear, which is convenient for users to understand, and also provides a better foundation for subsequent system processing. Standardized medical terminology helps the system to more accurately retrieve relevant knowledge from external databases and improve the efficiency and accuracy of retrieval. Step S1 provides a more accurate and professional query text for the subsequent processing of the medical question-and-answer method through semantic conversion and re-editing, thereby improving the accuracy and efficiency of the entire method.

[0054] In some embodiments of the present application, in step S1, a large language model is used to parse and reason about the query text X using a thought chain approach, and medical terms related to the query text X but not explicitly mentioned in the query text X are identified and introduced; after the medical terms are introduced into the query text X and integrated, an extended version xe is formed.

[0055] Specifically, in step S1, the query text X is parsed and reasoned through the large language model using a thought chain approach. This process deeply mines the potential information in the query text, understands its medical background and context, and thus identifies medical terms that are related to the query text X but not explicitly mentioned in the text. The large language model uses its language processing capabilities and in-depth understanding of medical field knowledge to capture the medical concepts implicit in the query text and explicitly introduce these concepts in the form of medical terms. After the relevant medical terms are introduced, these terms are integrated into the query text X to form an extended version Xe. The extended version Xe not only contains the intent of the user's original query, but also enriches the medical knowledge related to the query, providing a more comprehensive information basis for subsequent retrieval and reply construction.

[0056] By introducing medical terms related to the query, the scope of the query is expanded, allowing the system to retrieve more medical knowledge related to the user's query, thereby improving the comprehensiveness of the response. Since the extended version Xe contains richer medical information, the system can more accurately understand the user's query intent and construct a more accurate and professional response text. By providing comprehensive and accurate responses, the user's demand for medical knowledge is met and the user experience is improved.

[0057] In some embodiments of the present application, in step S2, the medical paragraph set P is obtained by combining the edit text Xr and the extended text Xe to form a query content, retrieving relevant paragraphs from an external database, and marking the relevant paragraphs.

[0058] In step S2, the edited text Xr and the extended text Xe processed in step S1 are combined to form a more complete and accurate query content, which not only contains the original query intention of the user, but also incorporates the relevant medical terms obtained through large language model parsing and reasoning, so as to more comprehensively reflect the user's query needs. Then, the query content is used to retrieve relevant paragraphs from an external database, which is a resource library that stores a large amount of professional medical knowledge and information. The system can quickly find paragraphs related to the query by matching the query content with the entries in the database. The retrieved paragraphs will be marked by the system for subsequent processing and analysis.

[0059] By combining the edited text Xr and the extended text Xe to form the query content, the system can more accurately understand the user's query intent and retrieve the most relevant medical knowledge paragraphs from the external database, reducing false detection and missed detection. The retrieved relevant paragraphs cover multiple aspects of the user's query, providing rich materials for the system to construct the reply text, making the reply content more comprehensive and detailed. By marking the paragraphs in the external database, the system can more conveniently perform subsequent processing and analysis on these paragraphs, such as filtering and refining, thereby improving the processing efficiency of the entire medical question-and-answer method.

[0060] In some embodiments of the present application, the retrieval method includes sparse retrieval, dense retrieval and rearrangement. Sparse retrieval is to encode the edited text Xr, extended text Xe and documents in the external database separately, and represent the text through maximum aggregation; dense retrieval is to perform k-NN search using dense representations of the edited text Xr, extended text Xe and documents in the external database; rearrangement is to use a BERT-based cross encoder to connect the query and the retrieved related paragraphs, and calculate the relevance score.

[0061] Specifically, sparse retrieval is performed by encoding the edited text Xr, the extended text Xe, and the documents of the external database by BERT respectively; the text is converted into a vector representation, where each vector reflects the occurrence of a word in the text; then, the entire text is represented by maximum aggregation (for example, taking the average or maximum value) to obtain a vector of fixed dimension (dimension is 30k). In the retrieval stage, the similarity between the query vector and the document vector in the database is calculated (such as cosine similarity), and the results are sorted according to the similarity to find the paragraphs most relevant to the query. Sparse retrieval can process large-scale databases quickly because it relies on the similarity calculation between vectors of fixed dimension.

[0062] Dense retrieval uses deep learning models (such as BERT, RoBERTa, etc.) to convert edited text Xr, extended text Xe, and documents of external databases into dense vector representations in high-dimensional space (dimension is 768). These vectors can capture the semantic information of the text, including the contextual relationship between words; then, the k-NN (k-nearest neighbor) search algorithm is used to find multiple documents or paragraphs in the database that are most similar to the query vector. Dense retrieval takes into account the semantic information of the text and can more finely distinguish the similarities between different texts.

[0063] The re-ranking stage uses a BERT-based cross encoder to further optimize the retrieval results. The cross encoder connects the combined text of the edited text Xr and the extended text Xe with the retrieved relevant paragraphs and calculates the relevance score between them. The paragraphs are then re-ranked based on this score to ensure that the most relevant and useful paragraphs are at the top. Through re-ranking, the most relevant and valuable paragraphs can be presented to users, thereby improving user satisfaction and retrieval efficiency.

[0064] It should be noted that BERT is a pre-trained model that can be adapted to various natural language processing tasks through fine-tuning; it adopts the Transformer network structure and trains large-scale text in an unsupervised manner to learn the semantic representation of text.

[0065] In some embodiments of the present application, in step S3, after obtaining the medical paragraph set P, binary classification is performed on each paragraph to determine its relevance, and a relevant subset Pr is obtained after filtering; and according to the heuristic rules, each paragraph of the relevant subset Pr is segmented at the sentence boundary according to the heuristic rules to form multiple fragments; the length of each fragment is checked, and the fragments that do not reach the minimum length threshold will be merged with the adjacent fragments; then, each fragment is binary classified to determine its practicality, and the fragments are screened according to the set practicality standards to obtain a refined medical knowledge paragraph set P'.

[0066] The first classification model is trained based on key indicators such as input keywords, semantic similarity, and sentence structure; the second classification model is trained based on practical standards such as whether the source of the paragraph is from a similar medical field, the completeness and clarity of the paragraph content, and the degree of matching between the paragraph and the query text X.

[0067] The first classification model learns classification rules based on the features of paragraphs and query text (including edited text Xr and extended text Xe), and applies the classification rules to classify new paragraphs into two categories: "relevant" and "irrelevant". After obtaining the medical paragraph set P, the first classification model performs binary classification on each paragraph in the medical paragraph set P to determine its relevance to the query text X. Through the first classification model, the paragraphs in the medical paragraph set P are divided into two categories: relevant and irrelevant, thereby filtering out irrelevant paragraphs and obtaining the relevant subset Pr.

[0068] Furthermore, for each paragraph in the relevant subset Pr, it is segmented at the sentence boundary according to the heuristic rules to form multiple segments. The heuristic rules are based on factors such as the grammatical structure and semantic coherence of the sentence to ensure that the segmented segments have complete meaning. In addition, the length of each segment is checked, and for segments that do not reach the minimum length threshold, they are merged with adjacent segments; ensuring that the segment is long enough to contain complete information and context, and the length of the combined single segment does not exceed 80 words. And the combined multiple segments are marked as segment1, segment2,..., segmentn, where n is a positive number.

[0069] Each merged fragment is binary classified to determine its practicality. The second classification model will classify the fragments into two categories: practical and impractical according to the set practicality criteria. According to the results of binary classification, practical fragments are screened out to form a refined medical knowledge paragraph set P'. Ensure that the information provided to users is relevant, useful and refined.

[0070] Through the application of binary classification and heuristic rules, the most practical information can be accurately extracted from relevant paragraphs, ensuring that the information obtained by users is truly useful and meets user needs. By splitting paragraphs, checking the length of fragments and merging them, and filtering practical fragments, redundant and irrelevant information can be removed, making the information finally presented to users more refined and easy to understand. The refined medical knowledge paragraph set P' is more in line with the user's query needs and information preferences, which helps to improve user satisfaction and experience, and enables users to find the information they need more quickly.

[0071] It should be noted that the paragraphs of the relevant subset Pr are marked as Pr1, Pr2, Pr3, ..., Pra respectively; where a is a positive number.

[0072] like Figure 2 As shown, a medical question answering system based on a retrieval enhanced language model includes:

[0073] The query enhancement module is used to obtain the query text X input by the user, and re-edit and expand the query text X to obtain the edited text Xr and the expanded text Xe;

[0074] The query enhancement module obtains the query text X input by the user and re-edits and expands the query text by using the text generation and understanding capabilities of the large language model. This process may involve semantic analysis of the original query, keyword extraction, and context-based text generation. By combining the original query and the output of the preliminary generation, a richer and more informative new query is generated, including the edited text Xr and the expanded text Xe.

[0075] A retrieval module is used to obtain paragraphs related to the edited text Xr and the extended text Xe from an external database to obtain a medical paragraph set P;

[0076] By using the enhanced query text X (including the edited text Xr and the extended text Xe), the retrieval module can locate the paragraphs related to the user's needs more quickly, thereby improving the retrieval efficiency.

[0077] A refining module, which filters some paragraphs in the medical paragraph set P according to a preset screening criterion to obtain a refined medical knowledge paragraph set P';

[0078] The refining module filters and refines the medical paragraph set P according to the preset screening criteria. Specifically, it involves semantic analysis, quality assessment, and relevance and practicality judgment of the paragraph content. By filtering out paragraphs that are irrelevant to user needs or of low quality, the refining module can obtain a refined medical knowledge paragraph set P'.

[0079] The generation module constructs a reply text based on the medical knowledge paragraph set P' and outputs the reply text to the user.

[0080] The generation module constructs a reply text based on the refined medical knowledge paragraph set P' and the text generation capability of the large language model. Specifically, it involves the integration and reorganization of paragraph content and the generation of text based on context. In this way, a smooth, coherent reply text that meets user needs is generated and output to the user.

[0081] It should be noted that in Figure 2In the example, the user inputs the question "A 61-year-old male patient developed purple discoloration on his feet two weeks after heart stent implantation. Laboratory: WBC 16,400; Eosinophils 11%; Creatinine 4.2... Biopsy; Intravascular cavitation. What is the most likely cause of these symptoms?" That is, the query text X. After the query enhancement module of the system obtains the query text X, it re-edits and expands the query text by leveraging the text generation and understanding capabilities of the large language model to obtain the edited text Xr and the expanded text Xe. The retrieval module of the system connects multiple retrieval channels and, through sparse retrieval and dense retrieval, collects medical records related to the patient's symptoms in the query text X. Medical information data is collected, and the search results are sorted using a re-ranking model. The most relevant TOP-K channels are selected to ensure the accuracy of subsequent analysis, and a medical paragraph set P is obtained. The system's refining module further refines the medical paragraph set P by performing a correlation analysis on the medical paragraph set P, eliminating information that is not directly related to the question. The remaining medical paragraphs are evaluated for practicality, recombined and screened to ensure the practicality and value of the final answer, and a refined medical knowledge paragraph set P' is obtained. Finally, the generation module combines the query text X (including the edited text Xr and the extended text Xe) with the medical knowledge paragraph set P' to generate the final reply text. According to Figure 2 The most likely cause of this patient's symptoms is cholesterol embolism syndrome (also called atheroembolic kidney disease or blue toe syndrome), which is caused by atherosclerotic plaques in larger arteries rupturing and embolizing to smaller vessels, causing occlusion and tissue damage.

[0082] For the system embodiment, it basically corresponds to the method embodiment, so the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the technical solution of the present application.

[0083] A computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the above medical question-and-answer method.

[0084] Computer-readable media include permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0085] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.

Claims

1. A medical question answering method based on a retrieval-enhanced language model, characterized in that , the method comprises: S1. Obtain a query text X about a medical problem from a user, and semantically re-edit and expand the query text X using medical knowledge and a language model to obtain an edited text Xr and an expanded text Xe of the query text X; S2, acquiring medical paragraphs related to the edited text Xr and the extended text Xe from an external database to obtain a medical paragraph set P; S3, filtering some paragraphs in the medical paragraph set P according to a preset screening criterion to obtain a refined medical knowledge paragraph set P'; S4. Construct a reply text based on the medical knowledge paragraph set P', and output the reply text to the user.

2. The medical question answering method based on retrieval enhanced language model according to claim 1, characterized in that: The screening criteria are the relevance and practicality with the Xr and Xe. The relevance is the degree of matching between the medical paragraphs retrieved from the external database and the edited text Xr and the extended text Xe, and the matching degree includes keyword matching, semantic proximity and context consistency; the practicality is the applicability of the retrieved medical paragraphs to user queries, and the adaptability includes the accuracy, timeliness, operability of the information and whether it meets the user's query requirements.

3. The medical question answering method based on retrieval enhanced language model according to claim 2, characterized in that: The external database is an external knowledge base for storing medical knowledge; the query text is a medical inquiry text related to a medical inquiry scenario; and the reply text is a medical inquiry result.

4. The medical question answering method based on retrieval enhanced language model according to claim 3, characterized in that: In the step S1, the colloquial or non-standardized expression of the query text X is converted into corresponding standardized medical terms according to semantics, and the converted query text X is re-edited to form an edited text Xr.

5. The medical question answering method based on retrieval enhanced language model according to claim 4, characterized in that: In step S1, the query text X is parsed and inferred by a large language model using a thought chain approach, and medical terms related to the query text X but not explicitly mentioned in the query text X are identified and introduced; after the medical terms are introduced into the query text X and integrated, an extended version xe is formed.

6. The medical question answering method based on retrieval enhanced language model according to claim 3, characterized in that: In the step S2, the medical paragraph set P is obtained by combining the edit text Xr and the extended text Xe to form a query content, retrieving relevant paragraphs from the external database, and marking the relevant paragraphs.

7. The medical question answering method based on retrieval enhanced language model according to claim 6, characterized in that: The retrieval method includes sparse retrieval, dense retrieval and rearrangement. The sparse retrieval is to encode the edited text Xr, the extended text Xe and the documents of the external database respectively, and represent the text through maximum aggregation; the dense retrieval is to use the dense representation of the edited text Xr, the extended text Xe and the documents of the external database to perform k-NN search; the rearrangement is to use a cross encoder to connect the query and the retrieved related paragraphs to calculate the relevance score.

8. The medical question answering method based on retrieval enhanced language model according to claim 3, characterized in that: In the step S3, after obtaining the medical paragraph set P, binary classification is performed on each paragraph to determine its relevance, and a relevant subset Pr is obtained after filtering; And according to the heuristic rules, each paragraph of the relevant subset Pr is segmented at the sentence boundary according to the heuristic rules to form multiple fragments; the length of each fragment is checked, and the fragments that do not reach the minimum length threshold will be merged with the adjacent fragments; then each fragment is binary classified to determine its practicality, and the fragments are screened according to the set practicality standards to obtain a refined medical knowledge paragraph set P'.

9. A medical question-answering system based on a retrieval-enhanced language model, characterized in that: include: A query enhancement module, used to obtain a query text X input by a user, and re-edit and expand the query text X to obtain an edited text Xr and an expanded text Xe; A retrieval module, used to obtain paragraphs related to the edited text Xr and the extended text Xe from an external database to obtain a medical paragraph set P; A refining module, which filters some paragraphs in the medical paragraph set P according to a preset screening criterion to obtain a refined medical knowledge paragraph set P'; A generation module constructs a reply text according to the medical knowledge paragraph set P', and outputs the reply text to the user.

10. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the medical question-and-answer method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Traditional Chinese medicine question and answer method and device based on long document retrieval enhancement generation and medium

    CN117828050A

  • Knowledge retrieval enhancement-based large language model question and answer method and device

    CN118113836A

  • Multi-modal multi-scale multi-recall large language model retrieval enhancement generation method

    CN118296120A

Cited By

  • Evidence-based medical question and answer method and device, electronic equipment and storage medium

    CN121144469A

  • Rheumatism immunology department intelligent question and answer method based on multi-model cooperation

    CN121880517A