Medical knowledge base question and answer method and system, electronic equipment and storage medium

By employing a hybrid retrieval and source verification approach, and combining sparse and dense vectors in a medical knowledge base question-answering system, the problem of insufficient knowledge retrieval accuracy and answer credibility in existing technologies is solved, achieving higher retrieval accuracy and answer transparency.

CN121543728APending Publication Date: 2026-02-17TONGFANG KNOWLEDGE DIGITAL PUBLISHING TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511731448.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing medical knowledge base question-answering systems suffer from insufficient accuracy in knowledge retrieval and low credibility of answers in medical professional question answering, especially in terms of accurate matching of medical entity terms and lack of source verification mechanisms.

Method used

A hybrid retrieval strategy is adopted, combining sparse and dense vectors to represent user questions. A preliminary answer is generated through a large language model, and source verification and tracing are performed to generate the final answer, including sentence-level and block-level relevance judgment and the addition of source tags.

Benefits of technology

It improves the accuracy and recall of knowledge retrieval, enhances the credibility and verifiability of answers, ensures that each answer point has definite literature support, and improves the reliability of the question-answering system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543728A_ABST
    Figure CN121543728A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a medical knowledge base question answering method and system, electronic equipment and a storage medium. Performing mixed retrieval on the medical problem based on a medical knowledge base to obtain a set number of text blocks as retrieval results, constructing cue words based on the medical problem and the retrieval results, and generating a preliminary answer containing a preliminary source identifier through a large language model; source verification and source tracing processing is carried out on the preliminary answer to generate a final answer, and the source verification and source tracing processing comprises the steps of analyzing the preliminary answer to obtain a plurality of independent claim points, carrying out sentence-level and block-level correlation judgment on text blocks pointed by the claim points and the preliminary source identifier based on a reordering model, and executing source judgment based on a threshold value; generating a corresponding source mark; according to the medical knowledge retrieval method and system, the accuracy and integrity of medical knowledge retrieval can be improved, and the fact accuracy of answer generation is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a medical knowledge base question answering method and system, an electronic device and a storage medium. BACKGROUND

[0002] With the rapid development of natural language processing technology, retrieval-augmented generation (RAG) based question answering systems gradually show application potential in the medical health field. Such systems aim to provide accurate and professional answers to medical questions by combining external knowledge bases with the reasoning capabilities of large language models, thereby assisting in improving the efficiency and quality of medical services.

[0003] In the prior art, the implementation path usually includes the following steps:

[0004] Construct a domain knowledge base. By collecting medical professional text data, the original data is processed by text segmentation, and then a general or medical corpus trained embedding model is used to convert the text paragraphs into vector representations and store them in a dedicated vector database.

[0005] Perform knowledge retrieval. The vectorized user question is matched in the knowledge base according to the similarity, and a number of text paragraphs most relevant to the question are selected according to a set threshold.

[0006] Generate and output answers. The relevant paragraphs retrieved are combined with the user question as context information to form a prompt word, which is input into a general large language model or a domain-specific model fine-tuned to generate the final answer and output directly to the user.

[0007] The existing technology still has obvious deficiencies when dealing with high-standard medical professional questions:

[0008] Knowledge retrieval accuracy needs to be improved. Existing solutions usually rely on a single dense vector for knowledge representation and retrieval. Such models are good at capturing overall semantics, but have limitations in accurately matching and distinguishing specific medical entity terms (such as precise drug names, complex disease names, and professional medical terminology). At the same time, the text segmentation strategy often uses a general and fixed length approach, which does not optimally adapt to the characteristics of structured information (such as standardized fields in drug instructions) and unstructured information (such as narrative text in medical literature and clinical guidelines) coexisting in medical data. This may result in the inability to accurately locate the most informative text segments in the retrieval results, or difficulty in distinguishing key concepts of core medical entities when the semantic context is similar, thereby affecting the accuracy and recall rate of retrieval and challenging the accuracy of subsequent answer generation.

[0009] The credibility and verifiability of the answers are insufficient. Existing solutions typically end their process after answer generation, lacking a dedicated module for independent fact-checking and source tracing of the generated content. The system's reliability largely depends on the factual accuracy of the large language model itself. However, large language models are susceptible to factual bias or "illusions," potentially generating seemingly reasonable but actually unsubstantiated content. In the healthcare field, where information accuracy is paramount, the lack of mechanisms to trace and verify the original basis of answers makes it difficult for users to assess their credibility, severely limiting the practical value and reliability of question-answering systems in real-world clinical applications.

[0010] Therefore, this application provides a medical knowledge base question-and-answer method to solve the above-mentioned technical problems. Summary of the Invention

[0011] The purpose of this invention is to provide a medical knowledge base question-and-answer method, system, electronic device, and storage medium to solve the technical problem of insufficient accuracy and completeness in medical knowledge retrieval in the prior art.

[0012] To address the aforementioned technical problems, this invention provides a medical knowledge base question-and-answer method, comprising:

[0013] Receive medical questions input by the user;

[0014] The medical question is searched using a medical knowledge base, and a set number of text blocks are obtained as search results. The medical knowledge base is constructed by associating and storing text content, sparse vectors and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain vocabulary and calculating their weights, and the dense vectors are generated based on a text embedding model.

[0015] Based on the medical question and search results, prompt words are constructed, and a preliminary answer containing preliminary source identifiers is generated through a large language model;

[0016] The preliminary answer is subjected to source verification and tracing to generate the final answer. The source verification and tracing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgment on the claims and the text blocks pointed to by the preliminary source identifier based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags.

[0017] Output the final answer with source tags.

[0018] In some specific embodiments, receiving medical questions input by the user further includes:

[0019] Receive medical questions in natural language through a user interface;

[0020] The input medical questions undergo text preprocessing, including removing irrelevant characters, standardizing text encoding formats, and standardizing medical terminology.

[0021] The medical issues were analyzed for domain relevance based on a predefined medical terminology database.

[0022] The validated medical questions are converted into a standardized text data format used in the processing.

[0023] In some specific embodiments, a hybrid retrieval of the medical question is performed based on a medical knowledge base to obtain a set number of text blocks as retrieval results. The medical knowledge base is constructed by associating and storing text content, sparse vectors, and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain thesaurus and calculating their weights. The dense vectors are generated based on a text embedding model, and further include:

[0024] Convert user-inputted medical questions into sparse and dense vector representations;

[0025] Keyword matching retrieval based on sparse vectors and semantic similarity retrieval based on dense vectors are performed in parallel in the medical knowledge base. The similarity scores obtained from the retrieval are weighted and fused according to the set weight ratio to generate a comprehensive score.

[0026] All search results are sorted based on the comprehensive score, and a set number of text blocks are selected in descending order of score to form a preliminary search result set.

[0027] The re-ranking model based on the cross-attention mechanism re-ranks the text blocks in the initial retrieval result set, and selects the highest-ranked text blocks of a set number as the final retrieval result.

[0028] In some specific embodiments, based on the medical question and search results, prompt words are constructed, and a preliminary answer containing preliminary source identification is generated through a large language model, further including:

[0029] The retrieved text blocks are organized in a structured manner according to a preset structured data template;

[0030] Define the rules and requirements for system role settings and answer generation in the prompt words, and set the answer format specifications, including text organization structure, chapter title setting requirements and citation annotation methods;

[0031] When generating answers using a large language model, the source identifiers of the referenced document blocks are marked.

[0032] The constructed prompt words are input into a large language model for inference calculation and text generation;

[0033] The text output by the large language model is subjected to structured parsing, and the content of each independent claim and its corresponding preliminary source identifier are extracted from the parsing results.

[0034] In some specific embodiments, the preliminary answer is subjected to source verification and tracing processing to generate a final answer. The source verification and tracing processing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgments on the claims and the text blocks pointed to by the preliminary source identifiers based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags. Further, it includes:

[0035] The preliminary answer was broken down into multiple semantically independent claims using text analysis methods;

[0036] For each claim, obtain the text block content pointed to by the corresponding preliminary source identifier, and segment the text block content into independent sentences;

[0037] The relevance score between each claim and each sentence is calculated based on the re-ranking model;

[0038] Sentence-level source determination is performed based on a preset first relevance threshold. When there is no sentence-level source that meets the conditions, the relevance score between the claim and the entire text block is calculated.

[0039] Perform block-level source determination based on the preset second relevance threshold, record the source information that passes the determination, and establish a correspondence with the claim.

[0040] In some specific embodiments, the method further includes:

[0041] When the verification of the claim and the initial source identifier fails, the corresponding source identifier is removed from the source information of the answer;

[0042] To verify the claims that failed, the relevance score with all search result text blocks is calculated, and the text block with the highest relevance score is selected as the candidate matching source for the corresponding claim.

[0043] When the relevance score of a candidate matching source exceeds the set second relevance threshold, the corresponding text block is identified as the source of the claim.

[0044] Establish a correspondence between claims and verified sources, add corresponding source tags to each claim in the final answer, and construct structured final answer data containing source verification information.

[0045] In some specific embodiments, the output of the final answer with source tags further includes:

[0046] The final answer content is formatted and organized according to the preset display template;

[0047] Insert corresponding source tags for each claim in the answer body, list detailed information of all reference sources in a designated area of ​​the answer, and output the final answer content with source tags through the user interface;

[0048] The source tag is set to have interactive functionality, enabling interactive operations on the source tag, responding to user actions, and displaying the source content.

[0049] When displaying source content, highlight text snippets related to the claims made;

[0050] Record information about the question-and-answer process, including user questions, search results, generated answers, and verification results, and store the data in the log.

[0051] Based on the same concept, the present invention also provides a medical knowledge base question-and-answer system, comprising:

[0052] The problem response and reception module is configured to receive medical problems input by the user;

[0053] The hybrid retrieval and result output module is configured to perform a hybrid retrieval of the medical question based on a medical knowledge base, and obtain a set number of text blocks as retrieval results. The medical knowledge base is constructed by associating and storing text content, sparse vectors and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain thesaurus and calculating their weights, and the dense vectors are generated based on a text embedding model.

[0054] The prompt word construction and preliminary answer output module is configured to construct prompt words based on the medical question and search results, and generate a preliminary answer containing preliminary source identifiers through a large language model;

[0055] The source verification and tracing module is configured to perform source verification and tracing on the preliminary answer to generate the final answer. The source verification and tracing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgment on the claims and the text blocks pointed to by the preliminary source identifier based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags.

[0056] The final answer output module is configured to output the final answer with source tags.

[0057] Based on the same concept, the present invention also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a medical knowledge base question-and-answer method.

[0058] Based on the same concept, the present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a medical knowledge base question-and-answer method.

[0059] Compared with existing technologies, its advantages are as follows:

[0060] This invention discloses a medical knowledge base question-answering method, system, electronic device, and storage medium, which improves the accuracy and comprehensiveness of knowledge retrieval. By employing a hybrid representation and retrieval strategy combining sparse and dense vectors, it fully utilizes the advantages of sparse vectors in precise matching of key medical terms while retaining the strengths of dense vectors in deep semantic understanding. This improves the recall and accuracy of the retrieval.

[0061] The credibility and verifiability of the answers are enhanced: By introducing a secondary verification and precise source tracing mechanism, the initial answers generated by large language models undergo automated fact-checking. This mechanism can identify and filter out claims lacking reliable source support, ensuring that every answer point in the final output has definite documentary evidence. Users can directly trace back to the original text through source tags, enhancing the transparency and credibility of the answers.

[0062] The quality of the medical knowledge base construction has been optimized: By adopting differentiated segmentation strategies based on the characteristics of structured and unstructured medical data, and combining medical thesaurus for keyword extraction and weight optimization, the constructed knowledge base is more in line with the professional characteristics of the medical field. Attached Figure Description

[0063] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0064] Figure 1 This is a flowchart illustrating some specific embodiments of the medical knowledge base question-and-answer method of the present invention;

[0065] Figure 2 This is one of the flowcharts of another embodiment of the medical knowledge base question-and-answer method of the present invention;

[0066] Figure 3This is a second flowchart illustrating another embodiment of the medical knowledge base question-and-answer method of the present invention;

[0067] Figure 4 This is the third flowchart of another embodiment of the medical knowledge base question-and-answer method of the present invention;

[0068] Figure 5 This is the fourth flowchart of another embodiment of the medical knowledge base question-and-answer method of the present invention;

[0069] Figure 6 This is a schematic diagram of the structure of a medical knowledge base question-and-answer system according to some specific embodiments of the present invention;

[0070] Figure 7 This is a schematic diagram of the structure of an electronic device according to some specific embodiments of the present invention;

[0071] In the diagram, 710 is the processor; 720 is the memory; 730 is the input device; and 740 is the output device. Detailed Implementation

[0072] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0073] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0074] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0075] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.

[0076] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0077] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0078] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.

[0079] Reference Figure 1 A medical knowledge base question-answering method, including:

[0080] S101 receives medical questions input by the user;

[0081] S102, perform a mixed search on the medical question based on the medical knowledge base to obtain a set number of text blocks as search results. The medical knowledge base is constructed by associating and storing text content, sparse vectors and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain vocabulary and calculating their weights. The dense vectors are generated based on a text embedding model.

[0082] S103, Based on the medical question and search results, construct prompt words, and generate a preliminary answer containing preliminary source identifiers through a large language model;

[0083] S104, perform source verification and tracing processing on the preliminary answer to generate the final answer. The source verification and tracing processing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgment on the claims and the text blocks pointed to by the preliminary source identifier based on the reordering model, performing source judgment based on the threshold, and generating corresponding source tags.

[0084] S105, output the final answer with source markers.

[0085] Specifically, in this embodiment of the invention, the system receives medical question text input by the user through an interactive interface, preprocesses the input text, and then transmits it to the retrieval module. A hybrid retrieval is performed based on a pre-built medical knowledge base, which is constructed as follows: Structured and unstructured data in the medical field are acquired; for structured data, a field-level segmentation strategy is used to generate text blocks containing entity names and field content; for unstructured data, a semantically based sliding window segmentation strategy is used to generate text blocks containing document titles; sparse and dense vectors are generated for each text block, wherein the sparse vector generation process... This includes identifying core keywords based on a medical domain thesaurus, expanding the thesaurus using a synonym thesaurus, calculating keyword weights using an improved weight calculation model and performing normalization processing, and performing weight scaling processing on unstructured data blocks. The dense vector generation process includes using a text embedding model to semantically encode text blocks to obtain fixed-dimensional vector representations; associating text block content with corresponding sparse vectors, dense vectors, and metadata and storing them in a vector database; during hybrid retrieval, converting user questions into sparse vectors and dense vectors respectively, and performing keyword matching retrieval based on sparse vectors and dense vectors in parallel in the knowledge base. The semantic similarity retrieval using dense vectors involves fusing scores from two retrieval methods to obtain a preliminary result set. A re-ranking model then refines the preliminary results to obtain a predetermined number of most relevant text blocks. The user question and the retrieved text blocks are used to construct structured prompts according to a pre-defined template, which are then input into a large language model to generate a preliminary answer containing preliminary source identifiers. The preliminary answer undergoes source verification and tracing, including parsing it into multiple independent claims, obtaining the text block pointed to by the preliminary source identifier for each claim, segmenting the text block into individual sentences using sentence segmentation technology, and calculating the relevance score between the claim and each sentence using a re-ranking model. If a sentence score exceeds a first threshold, it is considered a valid source; otherwise, the relevance score between the claim and the entire text block is calculated, and if the block-level score exceeds a second threshold, the entire text block is considered a valid source. For claims that fail verification, a source re-matching operation is performed to find the most relevant alternative sources from the retrieval results. Finally, a final answer with source tags is generated, where the source tags are generated based on verified valid sources and output to the user through the user interface. Interactive functionality for the source tags is also provided, allowing users to view detailed source content.

[0086] In some of these applications, the process involves receiving medical questions input by the user, including receiving medical question input in natural language form through a user interface; performing text preprocessing operations on the input medical questions, including removing irrelevant characters, standardizing text encoding formats, and standardizing medical terminology; performing domain relevance verification analysis on the medical questions based on a predefined medical domain terminology database; and converting the verified medical questions into a standardized text data format used in the processing.

[0087] Understandably, the process involves receiving medical questions in natural language via a user interface, performing multi-level preprocessing on the input text, including uniform cleaning to remove special symbols, emoticons, and other non-text characters, uniform conversion of text encoding formats to ensure encoding consistency, and standardizing the expression of medical terms in the questions based on a standardized medical terminology dictionary, including standardizing the correspondence between generic and brand names of drugs and standardizing the professional expressions of disease names and symptom descriptions. Based on a predefined medical terminology database, the preprocessed question text undergoes domain relevance verification analysis. Domain determination is achieved by calculating the matching degree between the question text and professional terms in the medical terminology database; when the matching degree reaches a preset threshold, the question is determined to belong to the medical field. Finally, the verified medical questions are converted into a standardized text data format used in the processing. This format uniformly specifies the text encoding method, field separation rules, and metadata structure to ensure that subsequent processing stages can correctly parse and use the question text data.

[0088] In some applications, a hybrid retrieval of the medical question is performed based on a medical knowledge base, yielding a set number of text blocks as search results. The medical knowledge base is constructed by associating and storing text content, sparse vectors, and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain lexicon and calculating their weights. The dense vectors are generated based on a text embedding model, including converting the user-input medical question into sparse and dense vector representations. Keyword matching retrieval based on sparse vectors and semantic similarity retrieval based on dense vectors are performed in parallel within the medical knowledge base. The similarity scores obtained from the retrieval are weighted and fused according to a set weight ratio to generate a comprehensive score. All search results are sorted based on the comprehensive score, and a set number of text blocks are selected in descending order of score to form a preliminary search result set. A re-ranking model based on a cross-attention mechanism re-ranks the text blocks in the preliminary search result set, and the set number of text blocks with the highest ranking are selected as the final search results.

[0089] Understandably, the process involves converting user-inputted medical questions into sparse and dense vector representations. The sparse vector conversion process includes identifying core medical terms based on a medical vocabulary and calculating term weights. A term expansion mechanism then expands the identified core terms into a set of synonyms. A weight calculation model is used to assign weights to the expanded term set and perform normalization to generate a sparse vector representation. The dense vector conversion process involves using a text embedding model to semantically encode the question text, generating a fixed-dimensional vector representation. Parallel execution of keyword matching retrieval based on sparse vectors and semantic similarity retrieval based on dense vectors is performed within a pre-built medical knowledge base. Keyword matching retrieval calculates the similarity between the question's sparse vector and the sparse vectors of text blocks in the knowledge base. The semantic similarity retrieval is achieved by calculating the cosine similarity between the dense vector of the question and the dense vector of text blocks in the knowledge base. The similarity scores obtained from the two retrieval methods are weighted and fused according to a set weight ratio to generate a comprehensive score for each text block. Based on the comprehensive score, all retrieval results are sorted, and a set number of text blocks are selected in descending order of score to form a preliminary retrieval result set. A re-ranking model based on a cross-attention mechanism is used to re-rank the text blocks in the preliminary retrieval result set. This re-ranking model evaluates the fine-grained relevance between the question and the text block by calculating the cross-attention weight between them, generating a more accurate relevance score. Based on the re-ranking results, the set number of text blocks with the highest ranking are selected as the final retrieval results and output to subsequent processing stages.

[0090] In some applications, prompts are constructed based on the medical question and search results. A preliminary answer containing preliminary source identifiers is generated through a large language model. This includes organizing the retrieved text blocks in a structured manner according to a preset structured data template; defining system role settings and answer generation rules in the prompts; setting answer format specifications, including text organization structure, chapter title requirements, and citation annotation methods; annotating the referenced document blocks with source identifiers when the large language model generates the answer; inputting the constructed prompts into the large language model for inference calculation and text generation; and performing structured parsing on the text results output by the large language model to extract the content of each independent claim and its corresponding preliminary source identifier from the parsing results.

[0091] Understandably, the retrieved text blocks are organized according to a pre-defined structured data template. This template defines the arrangement order, content format, and metadata field presentation of the text blocks. System role settings are defined in the prompts, clarifying the professional role of the large language model in the medical question-and-answer scenario. Specific rules for answer generation are also set, including requirements for the professional accuracy of the answer content, limitations on the scope of the answer, and stylistic guidelines. Answer format specifications are set, detailing the hierarchical structure of the text, the rules for setting chapter titles, and the specific format requirements for citations. When the large language model generates answers, it requires the annotation of the referenced document blocks' source identifiers, specifying the insertion position and annotation format. The completed prompts, containing system role settings, answer generation rules, format specifications, and retrieved text block content, are input into the large language model for inference calculation and text generation. The text results output by the large language model undergo structured parsing. Text segmentation technology is used to decompose the answer content into independent claim units. Pattern matching methods are used to extract preliminary source identifier information from the text, establishing a mapping relationship between claim content and corresponding source identifiers, thus completing the preliminary answer generation and parsing process.

[0092] In some applications, the preliminary answer undergoes source verification and tracing to generate a final answer. This source verification and tracing includes parsing the preliminary answer to obtain multiple independent claims; performing sentence-level and block-level relevance judgments on the text blocks pointed to by the claims and preliminary source identifiers based on a reordering model; performing source judgments based on thresholds to generate corresponding source tags. This includes using text analysis methods to decompose the preliminary answer content into multiple semantically independent claims; for each claim, obtaining the text block content pointed to by the corresponding preliminary source identifier and segmenting the text block content into independent sentences; calculating the relevance score between each claim and each sentence based on a reordering model; performing sentence-level source judgments according to a preset first relevance threshold; when no matching sentence-level source exists, calculating the relevance score between the claim and the entire text block; and performing block-level source judgments according to a preset second relevance threshold, recording the source information that passes the judgment, and establishing a correspondence between the block and the claim.

[0093] Understandably, the initial answer content is decomposed into multiple semantically independent claims using text analysis methods. The boundaries of each claim are determined by identifying sentence boundaries and semantic integrity. For each claim, the text block content pointed to by its corresponding initial source identifier is obtained, and sentence segmentation technology is used to divide the text block content into independent sentence units according to punctuation and semantic boundaries. A re-ranking model is used to calculate the relevance score between each claim and each sentence. This re-ranking model generates relevance scores by analyzing the semantic association strength between claim points and sentences. Sentence-level source judgment is performed according to a preset first relevance threshold. When a sentence's relevance score exceeds the first threshold, the sentence is determined to be a valid source. When no sentence-level source meets the criteria, the relevance score between the claim and the entire text block is calculated. This calculation process is achieved by semantically matching the claim with the entire text block. Block-level source judgment is performed according to a preset second relevance threshold. When the block-level relevance score exceeds the second threshold, the entire text block is determined to be a valid source. The source information that passes the judgment is recorded, and a correspondence is established with the claim points to generate the final answer data containing verification source information.

[0094] In some applications, the process includes removing the corresponding source identifier from the source information of the answer when the verification of the claim and the initial source identifier fails; calculating the relevance score of the text blocks in all search results for the failed claim and selecting the text block with the highest relevance score as the candidate matching source for the corresponding claim; determining the corresponding text block as the source of the claim when the relevance score of the candidate matching source exceeds a set second relevance threshold; establishing the correspondence between the claim and the verified source, adding the corresponding source tag to each claim in the final answer, and constructing structured final answer data containing source verification information.

[0095] Understandably, the process involves removing the corresponding source identifier from the source information of the answer when the verification of the claim point and the initial source identifier fails; calculating the relevance score of the claim point with all search result text blocks for the failed verification, which is achieved by performing semantic relevance analysis between the claim point and each text block through a re-ranking model; selecting the text block with the highest relevance score from all search results as the candidate matching source for the corresponding claim point, which is automatically completed based on the score ranking algorithm; determining the corresponding text block as the valid source of the claim point when the relevance score of the candidate matching source exceeds the set second relevance threshold, which is performed by comparing the score with the preset threshold; establishing the correspondence between the claim point and the verified source, which records the association information between the claim point and its confirmed source in the form of a data mapping table; adding a corresponding source tag to each claim point in the final answer, which inserts the source identifier into the answer text according to a preset annotation format; and constructing structured final answer data containing source verification information, which includes fields such as claim point content, verified source identifier, source type, and confidence level, forming a complete and verifiable answer output.

[0096] In some applications, the final answer with source tags is output, including formatting the final answer content according to a preset display template; inserting corresponding source tags for each claim in the answer text; listing detailed information of all reference sources in a designated area of ​​the answer; outputting the final answer content with source tags through a user interface; setting source tags to have interactive functions, enabling interactive operations of source tags, responding to user operations and displaying source content, and identifying text fragments related to the claim when displaying source content; recording information about the question-and-answer process, including user questions, search results, generated answers and verification results, and storing the data in the log.

[0097] Understandably, the final answer content is formatted and organized according to a preset display template, which defines the overall structure, font style, paragraph spacing, and other display parameters. For each claim, a corresponding source tag is inserted into the answer body. This insertion process adds standardized source identifiers at appropriate locations based on the mapping relationship between the claim and the verification source. Detailed information on all reference sources is listed in a designated area of ​​the answer, independently placed after the answer body, displaying the complete content and metadata of each source according to a preset format. The final answer content with source tags is output through a user interface, which employs a responsive design to ensure display quality on different devices. Source tagging is then configured. The system includes interactive features, enabling clickable source tags through front-end technology; implementing interactive operations for source tags, including defining the processing logic for mouse click events and touch operations; responding to user actions and displaying source content, with a pop-up window or redirection to a details page when the user triggers the source tag; identifying text fragments related to the claim during source content display, highlighting corresponding sentences or paragraphs through highlighting or special marking; recording question-and-answer processing information, including the user's original question text, search result set, generated preliminary answer, and verification result data; and storing processing data in a log file, which uses a structured format to record key information such as timestamps, session identifiers, and processing stages.

[0098] The following is combined with Figures 2-5 Another embodiment of the medical knowledge base question-and-answer method of the present invention is described below:

[0099] like Figure 2 , Figure 3 , Figure 4 and Figure 5 As shown, this embodiment includes a construction phase of a dedicated medical knowledge base and a question-and-answer phase based on hybrid retrieval and source verification:

[0100] Methods for constructing a medical knowledge base include:

[0101] Obtain raw text data from the medical field and preprocess it to obtain text blocks:

[0102] The acquired medical data typically includes structured data (such as standardized records in drug databases and disease databases) and unstructured data (such as plain text from medical textbooks and clinical guidelines). To improve the targeting of subsequent searches, this embodiment employs a differentiated segmentation strategy for the two types of data:

[0103] For structured data: a field-level chunking strategy is employed. Different fields in each record are split into independent text chunks. Each text chunk can be formatted as "entity name + field name: + field content". For example, for the drug "Aspirin Enteric-coated Tablets", the following text chunk can be generated:

[0104] Block 1: Aspirin enteric-coated tablets are indicated for the prevention and treatment of myocardial infarction, angina pectoris, etc.

[0105] Block 2: Aspirin Enteric-coated Tablets Contraindications: This product is contraindicated in patients with known hypersensitivity to it or those with active ulcers.

[0106] For unstructured data: a semantically based sliding window chunking strategy is employed. A fixed window size (e.g., 512 tokens) and overlap area (e.g., 128 tokens) can be set. For text with clear, natural paragraphs, paragraph integrity is prioritized. Furthermore, the heading information of the document to which each text block belongs can be appended at the beginning to provide context.

[0107] For each text block, keywords are extracted based on a predefined medical domain thesaurus and their weights are calculated to generate a sparse vector:

[0108] A model trained on sparse representations (e.g., a model based on the SPLADE architecture) can be used as the basis.

[0109] To improve the ability to recognize medical terms, a predefined medical terminology list (which can be integrated from UMLS, OMAHA, or a self-built standard medical terminology database) can be used to extend or fine-tune the basic model to obtain a domain-adapted sparse vector generation model.

[0110] The model is used to process text blocks, yielding a preliminary sparse vector representation. For further optimization, the weights of words related to medical entities in the vector can be increased. For example, different weight increase factors can be set based on the type of word (e.g., entity name, field name, medical entity terminology, non-entity medical terminology, etc.). For normalizing all weight values ​​within a text block, all weight values ​​can be divided by the maximum value, ensuring that the highest normalized weight is 1.0.

[0111] To further differentiate the importance of different data blocks, the normalized weights of text blocks generated from unstructured data can be multiplied by a scaling factor less than 1.0. This gives structured data blocks with well-defined topics a higher initial weight in retrieval.

[0112] For each text block, a dense vector representing its semantic information is generated using a text embedding model:

[0113] A dense vector (e.g., 768-dimensional) can be generated for each text block using a general text embedding model (e.g., a Transformer-based model). For long texts that exceed the model's single-pass processing capacity, a strategy of segmenting the text before vector pooling (e.g., average pooling) can be used to generate its overall vector representation.

[0114] The text content of each text block, its corresponding sparse vector, and dense vector are associated and stored to construct the medical knowledge base.

[0115] The original text content, optimized sparse vector, dense vector, and necessary metadata (such as unique block ID, source document ID, document title, etc.) of each text block are associated. These associated data are then stored in a dedicated vector database (such as Milvus, Chroma, etc.), thereby completing the construction of a high-quality medical knowledge base.

[0116] The question-and-answer method in this embodiment is applied to the medical knowledge base constructed above, including:

[0117] Receive medical questions input by the user:

[0118] The interface receives medical questions from users in natural language, such as: "What are the contraindications for taking aspirin?".

[0119] Based on the medical knowledge base, a hybrid search is performed on the medical question to obtain the Top-K most relevant text blocks as search results. This step includes two sub-processes: hybrid search and re-ranking.

[0120] Vectorization: The user-input question is transformed into sparse and dense vectors, respectively. The model used for vectorization should be consistent with or compatible with the model used in the construction of the knowledge base.

[0121] Hybrid retrieval: In the vector database, retrieval based on sparse question vectors (focusing on keyword matching) and retrieval based on dense question vectors (focusing on semantic similarity) are performed in parallel. The result lists obtained from the two retrieval methods are then fused by scores (e.g., different weights are assigned to the sparse and dense retrieval scores, such as 0.6 and 0.4, which are adjustable), resulting in a preliminary set of retrieval results containing N text blocks (N>K).

[0122] Re-ranking: A re-ranking model (e.g., a cross-attention model based on a dual-encoder architecture) is used to perform a more refined relevance score on the N text blocks in the initial result set to the user question. The Top-K most relevant text blocks are selected from high to low based on the re-ranking scores as the final retrieval results.

[0123] The user question and the search results are used to construct prompt words, which are then input into a large language model to generate a preliminary answer.

[0124] The user's question and the top-K retrieved text blocks are used to construct prompts according to a pre-defined template. This template typically includes system role settings, JSON-formatted content of the document blocks (containing fields such as content and source), and specific answer rules (e.g., requiring the model to annotate the source document block ID it references in the answer). These prompts are then input into a large language model (such as Qwen, DeepSeek, etc.) to generate text containing a preliminary answer and preliminary source identifiers annotated by the model itself. An example is shown below:

[0125]

【---Role---

[0126] You are an assistant who can respond to user questions about document blocks provided in JSON format.

[0127] Target:

[0128] The system generates concise responses based on the knowledge base, adhering to response rules and considering both dialogue history and the current query. It integrates all information from the provided knowledge base with relevant general knowledge. It may also include general knowledge not provided in the knowledge base.

[0129] When dealing with matters related to sources:

[0130] 1. Each relationship and document block has a "source", indicating that the record comes from a certain document.

[0131] 2. “Source” merely indicates the origin and has no actual meaning. Do not overanalyze, extrapolate, or extrapolate its meaning.

[0132] 3. Except in the references section, do not include "source" in any of your replies.

[0133] Document Block (DC):

[0134] json

[0135] [{"content":"","full_doc_id":"","serial_number":1,"title":"","source":""},{"content":"","full_doc_id":"","serial_number":11,"title":"","source":""}]

[0136] ```

[0137] Reply Rules:

[0138] Target format and length: Multiple Paragraphs

[0139] Use Markdown formatting and set appropriate chapter headings.

[0140] At the end of the "References" section, list and number the sources that referenced the given knowledge base. Clearly indicate each source document block (DC), and if a source is provided, indicate it in the following format: [DC]source.

[0141] For Chinese text, if you reference content from the "References" section, please cite the source as [DC source] in the relevant location.

[0142] If the knowledge you are referencing is not from the knowledge base provided above, please do not list it in the "References" section.

[0143] Prioritize knowledge from the knowledge base; responses can be expanded upon to some extent.

[0144] Formatting requirements:

[0145] When marking the source in the text, strictly follow the format: `[DC source]`

[0146] The references section should be listed separately and strictly follow the format: `number.[DC] source`

[0147] Additional user prompt:

[0148] {Questions asked by users} 】

[0150] The preliminary answer undergoes source verification and precise tracing to generate the final answer, including:

[0151] Claim Analysis: The preliminary answer is analyzed to identify the individual claims (i.e., the stated facts) and the preliminary source identifiers (i.e., the document block source IDs it claims to reference) marked by the large language model for each claim are extracted.

[0152] Source verification. Two levels of verification are performed for each claim and its initial source identifier:

[0153] Sentence-level verification: The text block pointed to by the initial source identifier is segmented into sentences. A reordering model is used to calculate the relevance score between the claim and each sentence. If the score of a sentence exceeds a first preset threshold (e.g., 1.2), the claim is determined to be traceable to that sentence, and the text block containing that sentence is identified as a valid source.

[0154] Block-level verification: If sentence-level verification fails, the relevance score of the claim to the entire initial source text block is calculated. If this score exceeds a second preset threshold (which may be the same as or different from the first threshold), the claim is determined to be traceable to the entire text block.

[0155] Invalid source removal: If both of the above two levels of verification fail, the initial source identifier is determined to be invalid and removed from the source information of the answer.

[0156] Source rematch (optional). For claims with invalid sources removed, their relevance scores to all other text blocks in the Top-K search results can be further calculated. If a text block's score exceeds a threshold, it can be identified as the correct source for that claim.

[0157] Generate the final answer: Associate the validated claims with their corresponding valid sources. In the final answer, each claim should have a verifiable source tag.

[0158] Output the final answer.

[0159] The final answer, marked with a verified source, is output to the user. This source mark can be represented as an interactive element (such as a hyperlink icon) on the user interface. Clicking on it allows the user to locate and highlight a specific sentence within the source text block or view the entire text block, thus achieving precise source tracing and transparency of the answer.

[0160] For the purpose of simplicity, the method steps disclosed in the above embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0161] like Figure 6 As shown, the present invention also provides a medical knowledge base question-and-answer system, comprising:

[0162] Problem response and reception module 201 is configured to receive medical problems input by the user;

[0163] The hybrid retrieval and result output module 202 is configured to perform a hybrid retrieval of the medical question based on a medical knowledge base, and obtain a set number of text blocks as retrieval results. The medical knowledge base is constructed by associating and storing text content, sparse vectors and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain thesaurus and calculating weights, and the dense vectors are generated based on a text embedding model.

[0164] The prompt word construction and preliminary answer output module 203 is configured to construct prompt words based on the medical question and search results, and generate a preliminary answer containing preliminary source identifiers through a large language model;

[0165] The source verification and tracing module 204 is configured to perform source verification and tracing on the preliminary answer to generate a final answer. The source verification and tracing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgment on the claims and the text blocks pointed to by the preliminary source identifier based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags.

[0166] The final answer output module 205 is configured to output the final answer with source tags.

[0167] It is worth noting that although only some basic functional modules are disclosed in the embodiments of this invention, it does not mean that the composition of this system is limited to the above-mentioned basic functional modules. On the contrary, what this embodiment intends to express is that, based on the above-mentioned basic functional modules, those skilled in the art can arbitrarily add one or more functional modules in combination with existing technology to form an infinite number of embodiments or technical solutions. That is to say, this system is open rather than closed. The fact that this embodiment only discloses a few basic functional modules should not be considered as the scope of protection of the claims of this invention being limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above device is described separately according to its functions as various units and modules. Of course, in implementing this invention, the functions of each unit and module can be implemented in one or more software and / or hardware.

[0168] like Figure 7 As shown, the present invention also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a medical knowledge base question-and-answer method.

[0169] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. For example... Figure 7 The structure shown in this embodiment of the invention includes an electronic device comprising one or more processors 710 and a memory 720; the processors 710 in this electronic device may be one or more. Figure 7Taking a processor 710 as an example; a memory 720 is used to store one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement a medical knowledge base question-and-answer method as described in any one of the embodiments of the present invention.

[0170] The electronic device may also include an input device 730 and an output device 740.

[0171] The processor 710, memory 720, input device 730, and output device 740 in this electronic device can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0172] The memory 720 in this electronic device serves as a computer-readable storage medium, capable of storing one or more programs. These programs can be software programs, computer-executable programs, or modules, such as the program instructions / modules corresponding to the medical knowledge base question-and-answer method provided in this embodiment of the invention. The processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 720, thereby implementing the medical knowledge base question-and-answer method described in the above embodiment.

[0173] The memory 720 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 720 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 720 may further include memory remotely located relative to the processor 710, which can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0174] Input device 730 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 740 may include display devices such as a display screen.

[0175] The present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a medical knowledge base question-and-answer method.

[0176] Specifically, the computer storage medium in this embodiment of the invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A question-and-answer method for a medical knowledge base, characterized in that, include: Receive medical questions input by the user; The medical question is searched using a medical knowledge base, and a set number of text blocks are obtained as search results. The medical knowledge base is constructed by associating and storing text content, sparse vectors and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain vocabulary and calculating their weights, and the dense vectors are generated based on a text embedding model. Based on the medical question and search results, prompt words are constructed, and a preliminary answer containing preliminary source identifiers is generated through a large language model; The preliminary answer is subjected to source verification and tracing to generate the final answer. The source verification and tracing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgment on the claims and the text blocks pointed to by the preliminary source identifier based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags. Output the final answer with source tags.

2. The medical knowledge base question-and-answer method according to claim 1, characterized in that, Receiving medical questions input by the user, further including: Receive medical questions in natural language through a user interface; The input medical questions undergo text preprocessing, including removing irrelevant characters, standardizing text encoding formats, and standardizing medical terminology. The medical issues were analyzed for domain relevance based on a predefined medical terminology database. The validated medical questions are converted into a standardized text data format used in the processing.

3. The medical knowledge base question-and-answer method according to claim 1, characterized in that, A hybrid retrieval of the medical question is performed based on a medical knowledge base, yielding a set number of text blocks as search results. The medical knowledge base is constructed by associating and storing text content, sparse vectors, and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain lexicon and calculating their weights. The dense vectors are generated based on a text embedding model. Further, it includes: Convert user-inputted medical questions into sparse and dense vector representations; Keyword matching retrieval based on sparse vectors and semantic similarity retrieval based on dense vectors are performed in parallel in the medical knowledge base. The similarity scores obtained from the retrieval are weighted and fused according to the set weight ratio to generate a comprehensive score. All search results are sorted based on the comprehensive score, and a set number of text blocks are selected in descending order of score to form a preliminary search result set. The re-ranking model based on the cross-attention mechanism re-ranks the text blocks in the initial retrieval result set, and selects the highest-ranked text blocks of a set number as the final retrieval result.

4. The medical knowledge base question-and-answer method according to claim 1, characterized in that, Based on the medical question and search results, prompt words are constructed, and a preliminary answer containing preliminary source identifiers is generated using a large language model, further including: The retrieved text blocks are organized in a structured manner according to a preset structured data template; Define the rules and requirements for system role settings and answer generation in the prompt words, and set the answer format specifications, including text organization structure, chapter title setting requirements and citation annotation methods; When generating answers using a large language model, the source identifiers of the referenced document blocks are marked. The constructed prompt words are input into a large language model for inference calculation and text generation; The text output by the large language model is subjected to structured parsing, and the content of each independent claim and its corresponding preliminary source identifier are extracted from the parsing results.

5. The medical knowledge base question-and-answer method according to claim 1, characterized in that, The preliminary answer is subjected to source verification and tracing processing to generate a final answer. The source verification and tracing processing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgments on the claims and the text blocks pointed to by the preliminary source identifiers based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags. Further, it includes: The preliminary answer was broken down into multiple semantically independent claims using text analysis methods; For each claim, obtain the text block content pointed to by the corresponding preliminary source identifier, and segment the text block content into independent sentences; The relevance score between each claim and each sentence is calculated based on the re-ranking model; Sentence-level source determination is performed based on a preset first relevance threshold. When there is no sentence-level source that meets the conditions, the relevance score between the claim and the entire text block is calculated. Perform block-level source determination based on the preset second relevance threshold, record the source information that passes the determination, and establish a correspondence with the claim.

6. The medical knowledge base question-and-answer method according to claim 5, characterized in that, The method further includes: When the verification of the claim and the initial source identifier fails, the corresponding source identifier is removed from the source information of the answer; To verify the claims that failed, the relevance score with all search result text blocks is calculated, and the text block with the highest relevance score is selected as the candidate matching source for the corresponding claim. When the relevance score of a candidate matching source exceeds the set second relevance threshold, the corresponding text block is identified as the source of the claim. Establish a correspondence between claims and verified sources, add corresponding source tags to each claim in the final answer, and construct structured final answer data containing source verification information.

7. The medical knowledge base question-and-answer method according to claim 1, characterized in that, Output the final answer with source tags, further including: The final answer content is formatted and organized according to the preset display template; Insert corresponding source tags for each claim in the answer body, list detailed information of all reference sources in a designated area of ​​the answer, and output the final answer content with source tags through the user interface; The source tag is set to have interactive functionality, enabling interactive operations on the source tag, responding to user actions, and displaying the source content. When displaying source content, highlight text snippets related to the claims made; Record information about the question-and-answer process, including user questions, search results, generated answers, and verification results, and store the data in the log.

8. A medical knowledge base question-and-answer system, characterized in that, include: The problem response and reception module is configured to receive medical problems input by the user; The hybrid retrieval and result output module is configured to perform a hybrid retrieval of the medical question based on a medical knowledge base, and obtain a set number of text blocks as retrieval results. The medical knowledge base is constructed by associating and storing text content, sparse vectors and dense vectors. The sparse vectors are generated by extracting keywords from a medical domain thesaurus and calculating their weights, and the dense vectors are generated based on a text embedding model. The prompt word construction and preliminary answer output module is configured to construct prompt words based on the medical question and search results, and generate a preliminary answer containing preliminary source identifiers through a large language model; The source verification and tracing module is configured to perform source verification and tracing on the preliminary answer to generate the final answer. The source verification and tracing includes parsing the preliminary answer to obtain multiple independent claims, performing sentence-level and block-level relevance judgment on the claims and the text blocks pointed to by the preliminary source identifier based on a reordering model, performing source judgment based on a threshold, and generating corresponding source tags. The final answer output module is configured to output the final answer with source tags.

9. An electronic device, characterized in that, include: The system includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Patient information processing method based on knowledge enhancement inference chain verification

    CN121983217A