Low-resource multi-scene cooperative medical intelligent question-answering method, electronic equipment and medium

By dynamically identifying the medical stage in medical intelligent Q&A and switching the fine-tuning sub-model, the contradiction between multi-task adaptation and general capability protection in the medical field is solved, the efficiency and accuracy of Q&A is improved, and the problem of degradation of model capabilities and forgetting is avoided.

CN120067277AActive Publication Date: 2025-05-30国家超级计算天津中心

Patent Information

Application Number
CN202510551840.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-05-30
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

The application of existing large models in the medical field is difficult to meet the professional needs of multi-tasking in the medical field while ensuring the ability of general models, which can easily lead to the decline of the model's capabilities in other fields and even catastrophic forgetting problems.

Method used

By dynamically identifying the medical stage and performing flexible switching of the fine-tuning sub-model, the pre-trained base model and reference information related to the target problem are used to determine the target medical stage and its corresponding fine-tuning sub-model, and then determine the intermediate answer and intermediate thinking chain, and determine whether the termination conditions are met until the answer to the target problem is completed.

Benefits of technology

It improves the efficiency and accuracy of medical intelligent Q&A, avoids the decline in the model's capabilities and catastrophic forgetting problems in multi-task scenarios, and achieves effective adaptation to multi-tasks in the medical field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067277A_ABST
    Figure CN120067277A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence, and discloses a low-resource multi-scene cooperative medical intelligent question answering method, electronic equipment and a medium, and the method comprises the steps: determining each target medical stage and a fine tuning sub-model corresponding to each target medical stage according to a pre-trained base model, a target question and reference information; determining an intermediate answer and an intermediate thinking chain according to the target question, the reference information, the base model and a fine tuning sub-model corresponding to each target medical stage; according to the base model, the target question, the historical session abstract, the intermediate answer and the intermediate thinking chain, judging whether the intermediate answer meets a termination condition or not; in response to the satisfaction, determining target output information according to the intermediate answer and the intermediate thinking chain; if the condition is not met, the reference information is updated, and the next round of cyclic analysis for the target question is executed, so that flexible switching of the fine-tuning sub-models in the dynamic recognition medical stage is realized, and the efficiency and accuracy of medical intelligent question answering 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 artificial intelligence, and particularly to a medical intelligent question-answering method, an electronic device and a medium for low-resource multi-scenario collaboration. Background Art

[0002] Large models in the field of medical Q&A have extensive applications. For the application of large models in the medical field, task performance is usually improved through full model fine-tuning or medical field adaptation. However, medical data has a high degree of professionalism and complexity, containing a large number of professional terms and complex logical relationships. Existing large models are difficult to meet the professional needs of multi-tasks in the medical field while ensuring the capabilities of general models, lacking protection for the performance of general models, and easily leading to a decline in the capabilities of models in other fields, and even the problem of catastrophic forgetting.

[0003] In the medical field, the types of tasks involved are diverse. It is difficult to efficiently adapt to multi-task scenarios with a single model, and the resource consumption is relatively large. Moreover, in medical scenarios, there may be cross or dependency relationships between tasks, and a single model is also difficult to solve this problem.

[0004] In view of this, the present invention is specifically proposed. Summary of the Invention

[0005] To solve the above technical problems, the present invention provides a medical intelligent question-answering method, an electronic device and a medium for low-resource multi-scenario collaboration, which realizes the flexible switching of fine-tuning sub-models for dynamic identification of medical stages, and improves the efficiency and accuracy of medical intelligent question-answering.

[0006] An embodiment of the present invention provides a medical intelligent question-answering method for low-resource multi-scenario collaboration, the method comprising:

[0007] Determine at least one target medical stage and the corresponding fine-tuning sub-model for each target medical stage according to a pre-trained base model, a target question, and reference information corresponding to the target question;

[0008] Determine an intermediate answer and an intermediate thought chain corresponding to the intermediate answer according to the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to the target medical stages;

[0009] Judge whether the intermediate answer meets a termination condition according to the base model, the target question, a historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thought chain;

[0010] In response to meeting the termination condition, determine target output information corresponding to the target question according to the intermediate answer and the intermediate thought chain;

[0011] In response to the termination condition not being met, update the reference information corresponding to the target question according to the intermediate answer and the intermediate thought chain, and return to execute the step of determining at least one target medical stage and the fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question;

[0012] Among them, the base model and each fine-tuning sub-model are trained based on a pre-constructed medical Q&A thought chain and a general Q&A thought chain.

[0013] An embodiment of the present invention provides an electronic device, and the electronic device includes:

[0014] A processor and a memory;

[0015] The processor is used to execute the steps of the medical intelligent Q&A method for low-resource multi-scenario collaboration according to any one of the embodiments by calling the program or instruction stored in the memory.

[0016] An embodiment of the present invention provides a computer-readable storage medium, and the computer-readable storage medium stores a program or instruction, and the program or instruction causes a computer to execute the steps of the medical intelligent Q&A method for low-resource multi-scenario collaboration according to any one of the embodiments.

[0017] The embodiments of the present invention have the following technical effects:

[0018] By determining at least one target medical stage and the fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question, analyze the medical stage of the target question in the current loop analysis, and call the corresponding fine-tuning sub-module. Furthermore, according to the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage, determine the intermediate answer and the intermediate thought chain corresponding to the intermediate answer to perform the current loop analysis to answer the target question. According to the base model, the target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thought chain, judge whether the intermediate answer meets the termination condition to determine whether the answer to the target question can be completed. In response to meeting the termination condition, determine the target output information corresponding to the target question according to the intermediate answer and the intermediate thought chain. In response to not meeting the termination condition, update the reference information corresponding to the target question according to the intermediate answer and the intermediate thought chain, and perform the next round of loop analysis, realizing the flexible switching of the fine-tuning sub-model by dynamically identifying the medical stage, and improving the efficiency and accuracy of medical intelligent Q&A. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0020] Figure 1 It is a flowchart of a medical intelligent question - answering method for low - resource multi - scenario collaboration provided by an embodiment of the present invention;

[0021] Figure 2 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Specific Embodiments

[0022] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by the present invention.

[0023] The medical intelligent question - answering method for low - resource multi - scenario collaboration provided by the embodiments of the present invention is mainly applicable to the situation of analyzing and answering medical problems in staged scenarios to improve the effectiveness of question - answering. The medical intelligent question - answering method for low - resource multi - scenario collaboration provided by the embodiments of the present invention can be executed by an electronic device.

[0024] Embodiment 1

[0025] Figure 1 It is a flowchart of a medical intelligent question - answering method for low - resource multi - scenario collaboration provided by an embodiment of the present invention. Refer to Figure 1 and the medical intelligent question - answering method for low - resource multi - scenario collaboration specifically includes:

[0026] S110. Determine at least one target medical stage and the corresponding fine - tuning sub - models for each target medical stage according to a pre - trained base model, a target question, and the reference information corresponding to the target question.

[0027] Among them, the base model is a general analysis and recognition model, which is a large language model trained based on a pre-constructed general question-and-answer thought chain. It can be LoRA (Low-Rank Adaptation of Large Language Models). The general question-and-answer thought chain includes questions in general fields, corresponding answers, and corresponding thinking processes. The target question is a medical-related question to be answered. The reference information is other information related to answering the target question, which can include information on historical questions and answers, and can also include information on intermediate results in the analysis process, etc. The target medical stage is the medical stage involved in the target question. For example, the medical stage can include preliminary diagnosis, subsequent diagnosis, recommended examinations, recommended medications, treatment plans, etc. The fine-tuning sub-model is a low-rank matrix in LoRA trained based on a pre-constructed medical question-and-answer thought chain and a pre-trained base model, and can be used as an incremental sub-model of the base model. The medical question-and-answer thought chain is a question, corresponding answer, and corresponding thinking process in the medical field.

[0028] Specifically, by combining the target question and the reference information corresponding to the target question with a pre-set medical stage analysis instruction, at least one target medical stage can be obtained through the pre-trained base model, and according to each target medical stage, the fine-tuning sub-models corresponding to each target medical stage are determined from the pre-trained fine-tuning sub-models. Among them, the medical stage analysis instruction can be guiding information for guiding the base model to analyze the medical stage currently involved in the target question and the reference information corresponding to the target question.

[0029] Based on the above example, the base model and each fine-tuning sub-model are trained based on the following method:

[0030] According to the pre-constructed general question-and-answer thought chain, perform low-rank fine-tuning training on the large language model to obtain the base model;

[0031] For each candidate medical stage, perform low-rank fine-tuning training on the incremental model according to the medical question-and-answer thought chain, general question-and-answer thought chain, preset mixing ratio, and base model corresponding to the candidate medical stage to obtain the fine-tuning sub-model corresponding to the candidate medical stage.

[0032] Among them, the preset mixing ratio is the usage ratio of the pre-set medical question-and-answer thought chain and the general question-and-answer thought chain, for example, it can be 1:1, etc. The candidate medical stage is different fine-tuning stages divided according to different medical tasks. The incremental model is a model composed of a low-rank matrix connected to the base model, serving as an increment of the base model.

[0033] Specifically, open-source general-domain Q&A data can be used to pre-construct a general Q&A thought chain. Then, the general Q&A thought chain is used to perform low-rank fine-tuning training on the large language model, that is, full-parameter training, so as to activate its complex reasoning and structured output capabilities and obtain the base model. For each candidate medical stage, a corresponding fine-tuning sub-model is trained for each candidate medical stage, that is, stage-based small models are trained separately. Taking one of the candidate medical stages as an example, the medical Q&A thought chain corresponding to the candidate medical stage and the general Q&A thought chain are mixed according to a preset mixing ratio to prevent the model from having stage-based forgetting. Then, using the mixed data, on the basis of the base model, the parameters of the base model are frozen, and low-rank fine-tuning training is performed on the incremental model to obtain the fine-tuning sub-model corresponding to the candidate medical stage.

[0034] It can be understood that in a multi-task scenario, for different medical tasks (such as disease diagnosis, drug recommendation, etc.), lightweight fine-tuning is achieved through the LoRA technology to generate independent fine-tuning sub-models. The base model serves as the center, retaining its extensive knowledge and capabilities for daily interaction and basic task processing. In a specific task scenario, highly specialized services are provided by dynamically loading professional LoRA modules (fine-tuning sub-modules). Through the balance mechanism of general-domain data and professional-domain data, it is ensured that while the fine-tuning sub-model is adapted to professional tasks, overfitting and catastrophic forgetting problems are avoided, achieving a dynamic balance between professionalism and generality and enhancing its long-term stability and generalization ability.

[0035] Based on the above example, it is also necessary to pre-generate the medical Q&A thought chains corresponding to each candidate medical stage. Specifically, it can be:

[0036] Obtain the initial Q&A data and medical non-Q&A data for each candidate medical stage, and determine the auxiliary medical information for each candidate medical stage according to the medical non-Q&A data.

[0037] For each candidate medical stage, according to the medical non-Q&A data of the candidate medical stage, the auxiliary medical information corresponding to the medical non-Q&A data, and the Q&A generation instruction template of the candidate medical stage, determine the converted Q&A data of the candidate medical stage, and determine the medical Q&A data of the candidate medical stage according to the converted Q&A data and the initial Q&A data of the candidate medical stage.

[0038] For each candidate medical stage, according to the medical Q&A data of the candidate medical stage, the auxiliary medical information corresponding to the medical Q&A data, and the thought chain Q&A instruction template of the candidate medical stage, determine the medical Q&A thought chain corresponding to the candidate medical stage.

[0039] Among them, the initial Q&A data can be the Q&A data obtained between doctors and patients. For example, an online retrieval and data crawling tool can be developed to obtain the Q&A data between doctors and patients from open-source Internet medical Q&As such as online doctors. The medical non-Q&A data is the medical-related information obtained, but it is non-Q&A type data, which can include electronic medical record data, medical atlas data, medical guidelines and literature data. The electronic medical record data can be obtained by developing an information system call interface to extract patient visit records, examination reports, doctor's order data, etc. from the hospital's HIS (Hospital Information System), EMR (Electronic Medical Record), PACS (Picture Archiving And Communication System), etc. The medical atlas data can be obtained by developing a data crawling and structured parsing tool to crawl structured medical data from medical encyclopedias, including diseases, departments, clinical manifestations, differential examinations, differential diagnoses, treatment medications, and treatment plans, etc. An entity node is obtained through a medical entity extraction module, and triples such as disease-symptom, disease-department, disease-examination, disease-medication, disease-differential diagnosis (other diseases) are constructed to build a disease knowledge graph. The medical guidelines and literature data can be obtained by developing a multi-format document parsing and OCR (Optical Character Recognition) tool to parse a large number of scanned medical literature and document guidelines into txt (text documents) with a regular and unified format and no duplicate redundancy. The auxiliary medical information is the reference information for each candidate medical stage obtained by splicing and integrating the medical non-Q&A data according to preset rules. The Q&A generation instruction template is a pre-set instruction template used to guide the generation of Q&A data for the corresponding candidate medical stage. The converted Q&A data is the Q&A data obtained by extracting Q&A pairs from the auxiliary medical information through an existing large language model. The thought chain Q&A instruction template is a pre-set instruction template used to guide the thinking process of generating Q&A data for the corresponding candidate medical stage.

[0040] Specifically, the initial Q&A data and non-Q&A medical data for each candidate medical stage can be obtained from open-source information on the Internet and authorized medical system information. For the non-Q&A medical data, splicing and integration are performed to obtain the auxiliary medical information for each candidate medical stage. For example, for medical atlas data, mutually related entity nodes can be extracted to construct triples such as disease-symptom, disease-department, disease-examination, disease-medication, disease-related diseases (differential diagnosis), etc., and they are spliced and integrated into auxiliary medical information; for electronic medical record data, condition information such as patient chief complaints and examination and test results is spliced and integrated into auxiliary medical information. For each candidate medical stage, the auxiliary medical information for that candidate medical stage is substituted into the Q&A generation instruction template for that candidate medical stage, and using existing large language models for analysis, the converted Q&A data for that candidate medical stage can be obtained. Furthermore, the converted Q&A data for that candidate medical stage and the initial Q&A data are combined to construct the medical Q&A data for that candidate medical stage. For each candidate medical stage, the medical Q&A data for that candidate medical stage and the auxiliary medical information corresponding to the medical Q&A data are substituted into the thinking chain Q&A instruction template for that candidate medical stage, and using existing large language models for analysis, the medical Q&A thinking chain corresponding to that candidate medical stage can be obtained.

[0041] Exemplarily, Q&A generation instruction templates for different candidate medical stages can be pre-constructed, and their task is to generate Q&A pairs for different medical stage scenarios based on auxiliary medical information. Subsequently, the auxiliary medical information is loaded into the Q&A generation instruction templates for different candidate medical stages (including preliminary diagnosis, follow-up diagnosis, recommended examinations, recommended medications, treatment plans, etc.) in sequence. With the help of instruction generation, the extraction of the converted Q&A data for each candidate medical stage is completed, and combined with the initial Q&A data for each candidate medical stage, the medical Q&A data for each candidate medical stage is constructed.

[0042] For the obtained initial Q&A data and non-Q&A medical data for each candidate medical stage, a missing value processing tool can be used to process the missing value data, an outlier filtering tool can be used to filter out special data such as data related to safety and sensitive information, an English character ratio filtering tool can be used to screen the instruction data with a relatively high English character ratio, and a functional sentence duplication removal tool can be used to screen the instruction data containing a large number of repeated sentences. After obtaining the medical Q&A thinking chains corresponding to each candidate medical stage, the missing value processing tool, outlier filtering tool, and English character ratio filtering tool can also be used to process the medical Q&A thinking chains. Through the above data cleaning and denoising, the quality of the data structure can be improved.

[0043] Based on the above examples, the medical Q&A thought chain corresponding to the to-be-selected medical stage can be determined in the following manner according to the medical Q&A data of the to-be-selected medical stage, the auxiliary medical information corresponding to the medical Q&A data, and the thought chain Q&A instruction template of the to-be-selected medical stage:

[0044] For each group of medical Q&A data of the to-be-selected medical stage, determine the key attention features corresponding to the medical Q&A data according to the question data in the medical Q&A data, the auxiliary medical information corresponding to the medical Q&A data, and the key attention feature instruction template in the thought chain Q&A instruction template;

[0045] Construct a combination of attention features based on the key attention features;

[0046] For each combination of attention features, determine the candidate thought process and candidate answer corresponding to the combination of attention features according to the combination of attention features, the question data, and the thought process result instruction template in the thought chain Q&A instruction template;

[0047] In response to the answer data in the medical Q&A data containing the candidate answer, use the candidate thought process corresponding to the candidate answer as the to-be-combined thought chain;

[0048] Determine the medical Q&A thought chain of the medical Q&A data according to the to-be-combined thought chains corresponding to the medical Q&A data and the answer data;

[0049] Use the medical Q&A thought chains of the medical Q&A data corresponding to the to-be-selected medical stage as the medical Q&A thought chain corresponding to the to-be-selected medical stage.

[0050] Among them, the key attention feature instruction template is a kind of instruction template in the thought chain Q&A instruction template, which is a pre-set instruction template for guiding the generation of the key attention features (such as positive features, etc.) corresponding to the corresponding question data. The key attention features are various data related to disease analysis, such as positive examination and test values, positive symptoms, test symptoms, etc. The combination of attention features is a combination of one or more key attention features, which is used to establish the association between the key attention features. The thought process result instruction template is a kind of instruction template in the thought chain Q&A instruction template, which is a pre-set instruction template for guiding the generation of the thought process and result of using the combination of attention features to answer the question data. The candidate thought process and candidate answer are the answer and the corresponding thought process obtained by analyzing the question data using the combination of attention features. The to-be-combined thought chain is the thought chain composed of the candidate answer and the corresponding candidate thought process when the candidate answer belongs to part or all of the original answer data.

[0051] Specifically, for each candidate medical stage, the corresponding medical Q&A thought chain can be independently extracted. Taking one of the candidate medical stages as an example, for each group of medical Q&A data in this candidate medical stage, obtain the question data in the medical Q&A data and the auxiliary medical information corresponding to the medical Q&A data, and substitute them into the key attention feature instruction template in the thought chain Q&A instruction template. Using the existing large language model for analysis, the key attention features corresponding to the medical Q&A data can be obtained. Randomly combine the key attention features to construct multiple combinations of attention features. It can be understood that each combination of attention features contains at least one combination of attention features. Furthermore, for each combination of attention features, substitute the combination of attention features and the question data into the thinking process result instruction template in the thought chain Q&A instruction template, and use the existing large language model for analysis to obtain the candidate thinking process and candidate answer corresponding to the combination of attention features. If the answer data in the medical Q&A data contains the candidate answer, it means that the analysis is correct, and the candidate thinking process corresponding to the candidate answer can be used as the thought chain to be combined. Otherwise, it can be directly eliminated. Integrate the thought chains to be combined and the answer data corresponding to the medical Q&A data to obtain the complete medical Q&A thought chain for this group of medical Q&A data. Finally, the medical Q&A thought chains of each medical Q&A data corresponding to the candidate medical stage can be integrated as the medical Q&A thought chain corresponding to the candidate medical stage.

[0052] Exemplarily, the thought chain Q&A instruction templates for different candidate medical stages can be pre-constructed, and its task is to generate a reasoning and thinking process based on the input and output. That is, input the medical Q&A data and the corresponding auxiliary medical information C into the thought chain Q&A instruction template to construct an instruction. Its overall process is as follows: First, obtain the information related to the question data Q from the auxiliary medical information C, and analyze the list of its key attention features (such as positive examination and test values / positive symptoms / combinations of test symptoms), that is, the list composed of key attention features. Secondly, according to the list of key attention features, perform random combinations to sequentially construct the thinking process and results (candidate thinking process and candidate answer). Compare whether the generated results are consistent with the information in the answer data (answer data). If they are consistent, retain them; if not, discard them. Merge and splice the retained thinking processes (thought chains to be combined) into the overall thinking process (medical Q&A thought chain), and it can be placed in the corresponding label, such as <think>Inside the tag, together with the corresponding answer data A, construct the final output, which is the medical Q&A thought chain corresponding to the candidate medical stage. Repeat the above process to complete the construction of the medical Q&A thought chains for different candidate medical stages.

[0053] Based on the above example, after determining the medical Q&A thought chain corresponding to the candidate medical stage, it is also possible to evaluate and screen the data quality of the medical Q&A thought chain. Specifically, it can be:

[0054] For each medical Q&A thought chain of the candidate medical stage, determine at least one corresponding quality evaluation indicator;

[0055] Based on the quality evaluation indicators of each medical Q&A thought chain, determine the valid status of each medical Q&A thought chain;

[0056] Based on each valid status, update the medical Q&A thought chain corresponding to the candidate medical stage.

[0057] Among them, the quality evaluation indicators are the evaluation indicators of each quality dimension of the medical Q&A thought chain, including the length evaluation value, the diversity evaluation value, and the instruction following difficulty evaluation value. The length evaluation value is used to evaluate the text length of the medical Q&A thought chain. The diversity evaluation value is used to evaluate the semantic diversity covered by the data, such as covering multiple scenarios, task types, and semantic features. The instruction following difficulty evaluation value is used to evaluate the learning value to ensure the effectiveness of the medical Q&A thought chain. The valid status includes valid and invalid. The valid status of the medical Q&A thought chain that meets the preset requirements of the quality evaluation indicators can be set to valid, otherwise, it is set to invalid.

[0058] Specifically, for each medical question and answer thinking chain in the selected medical stage, the length evaluation value, diversity evaluation value and instruction following difficulty evaluation value are calculated respectively, and one of the medical question and answer thinking chains is used as an example for explanation. It is determined whether the data length of the medical question and answer thinking chain is within the preset length range. If not, the length evaluation value can be directly determined to be 0. Among them, the preset length range is a predetermined reasonable text length range. Each sentence in the medical question and answer thinking chain is embedded and represented respectively, and the embedding vector corresponding to each sentence can be obtained. Furthermore, the cosine similarity between the embedding vectors of any two sentences is calculated, a similarity matrix is ​​constructed, and each cosine similarity in the similarity matrix is ​​processed in a preset manner to obtain the diversity evaluation value of the medical question and answer thinking chain. The medical question and answer thinking chain is input into the preset instruction following model, and the instruction confusion and the non-instruction confusion can be calculated, and the ratio of the instruction confusion to the non-instruction confusion is used as the instruction following difficulty evaluation value. The effective status of the medical question and answer thinking chain with a medium length evaluation value of 0 in each medical question and answer thinking chain is set to invalid, and the diversity evaluation value and the instruction following difficulty evaluation value are comprehensively screened, and the effective status of each medical question and answer thinking chain that does not meet the preset requirements is set to invalid, and the remaining effective status remains valid. The medical question and answer thinking chains with valid effective status are retained, and the medical question and answer thinking chains with invalid effective status are eliminated to update the medical question and answer thinking chain corresponding to the selected medical stage.

[0059] For example, regarding the diversity evaluation value: its core goal is to ensure that the data covers a variety of scenarios, task types, and semantic features, thereby enhancing the generalization ability of the model. First, a pre-trained language model is used to generate a sentence-level embedding representation, i.e., an embedding vector, for each medical question-and-answer thinking chain. The embedding is represented as a vector of fixed dimension that can capture the semantic features of the sentence. For each sentence's embedding vector, the cosine similarity is used for calculation:

[0060]

[0061] Among them, v 1 and v 2 are the embedding vectors of the two sentences respectively, ‖v 1 ‖ and ‖v 2 ‖ represents the Euclidean norm of the vector.

[0062] By analyzing the semantic distribution of sentences, we can avoid data information being too low, thereby improving the generalization ability of the model. The similarity matrix is ​​constructed by cosine similarity, which is convenient for calculating the sparsity of the semantic distribution of the entire data and measuring the diversity of the data. Among them, the diagonal of the similarity matrix represents the self-similarity, and the value is 1; the off-diagonal elements of the similarity matrix are averaged to obtain the overall semantic similarity, that is, the mean s. The diversity evaluation value can be calculated by the following formula:

[0063]

[0064] Among them, is the diversity evaluation value of the medical Q&A thought chain, and s is the semantic similarity.

[0065] Among them, the higher the s, the higher the semantic repetition rate, and the lower the S d ; on the contrary, the lower the s, the higher the semantic diversity, and the higher the S d is.

[0066] Exemplarily, regarding the instruction following difficulty evaluation value: The instruction following difficulty quantifies the impact of the instruction on the model generation behavior, evaluates the learning value of the instruction, and ensures the effectiveness of the medical Q&A thought chain. Its core is to calculate the effect of the instruction context on the model output based on perplexity. Calculate the perplexity of the medical Q&A thought chain when generating responses with and without the given instruction respectively. Evaluate the instruction following difficulty of the data through the calculated perplexity, and filter out noisy data or low-quality data.

[0067]

[0068] Among them, w i is the i-th word in the medical Q&A thought chain, P(w i ) is the probability that the model predicts this word, N is the total number of words in the medical Q&A thought chain, and PPL is the perplexity.

[0069] When calculating the instruction following difficulty evaluation value, calculate two kinds of perplexities for each medical Q&A thought chain respectively: the perplexity PPL with (with-instruction perplexity) with the instruction context and the perplexity PPL without (without-instruction perplexity) without the instruction context. The ratio of the two is defined as the instruction following difficulty evaluation value S i :

[0070]

[0071] If S i is greater than 0 and less than 1, the higher the value, the greater the role of the instruction in the generation process, the higher the difficulty of following the instruction, then the instruction has a significant effect on the generation, and the model needs to learn this instruction more preferentially. Those below 0 and above 1 will be judged as outliers, which indicates that this instruction does not have a positive effect on fine-tuning and should be filtered. Use a unified evaluation model to calculate the perplexity, and eliminate the influence of different models on the scoring through the perplexity ratio. Therefore, this method allows using a model with a smaller number of parameters to achieve high-quality data screening and reduce computational consumption.

[0072] Exemplarily, by comprehensively analyzing the diversity evaluation value and the instruction following difficulty evaluation value, corresponding thresholds (available ranges) can be set for the diversity evaluation value and the instruction following difficulty evaluation value respectively. According to the threshold comparison, if any one does not meet the threshold requirements, the effective state is determined to be invalid; if both meet the threshold requirements, the effective state is determined to be valid. It can also be that after normalizing the diversity evaluation value and the instruction following difficulty evaluation value, corresponding preset weights are weighted to obtain a comprehensive evaluation value, and the comprehensive evaluation value is compared with a preset evaluation value threshold. If the threshold requirements are met, the effective state is determined to be valid; otherwise, the effective state is determined to be invalid. Of course, there can also be other ways to determine the effective state, which are not limited here.

[0073] Based on the above example, if the reference information corresponding to the target question includes the historical conversation summary, the historical conversation summary can be obtained through the following method:

[0074] Obtain the historical message record corresponding to the target question;

[0075] Determine the historical summary information according to the historical message record, the preset summary extraction instruction template, and the base model.

[0076] Among them, the historical message record is the conversation record before the current inquiry of the target question. The preset summary extraction instruction template is an instruction template preset for extracting information related to the medical record in the conversation record.

[0077] Specifically, the conversation content before the target question is used as the historical message record corresponding to the target question. The historical message record is substituted into the set summary extraction instruction template, and through the instruction analysis of the base model, the historical summary information corresponding to the target question is output.

[0078] Exemplarily, after receiving the user's target question, first parse and obtain the user's historical message record, and the existing summary medical record information analyzed before (determined through the previous n rounds of analysis) can be combined to extract or update the corresponding core electronic medical record information, which can include past medical history, allergy history, examination results, etc., and input the updated core electronic medical record information into the preset summary extraction instruction template, and use the base model to automatically generate the historical conversation summary. This historical conversation summary can be used as context-known information for subsequent reference by the LoRA module (fine-tuning sub-module) during answering to improve the coherence of the question and answer.

[0079] Based on the above example, in order to facilitate the use of the fine-tuning sub-model, after determining at least one target medical stage and the corresponding fine-tuning sub-model for each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question, it is necessary to load the fine-tuning sub-models corresponding to each target medical stage for easy calling:

[0080] Load the fine-tuning sub-models corresponding to each target medical stage from the graphics processing unit into the central processing unit.

[0081] Specifically, the base model can be kept loaded in the central processing unit, and the unused fine-tuning sub-models can be saved in the graphics processing unit. When needed, that is, when each target medical stage is involved, the corresponding fine-tuning sub-models are loaded from the graphics processing unit into the central processing unit for easy use of the fine-tuning sub-models.

[0082] Alternatively, only when the task requires it, load the corresponding LoRA components (fine-tuning sub-models) from storage and combine them with the GPU (Graphics Processing Unit) memory optimization strategy to achieve efficient LoRA switching. Frequently used LoRAs are resident in video memory, and those used less frequently are stored in the CPU (Central Processing Unit) or host memory, reducing waiting time through asynchronous loading.

[0083] S120. Determine the intermediate answer and the intermediate thought chain corresponding to the intermediate answer based on the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage.

[0084] Among them, the reference information is the information required to answer the target question, which can be the historical summary information corresponding to the target question, or the historical summary information corresponding to the target question and the intermediate information generated when the target question is not fully answered, that is, the intermediate answer and the intermediate thought chain corresponding to the intermediate answer in the previous analysis cycle. The intermediate answer and the intermediate thought chain corresponding to the intermediate answer are the output results of analyzing the target question by the base model and the fine-tuning sub-models corresponding to the corresponding target medical stage based on the reference information.

[0085] Specifically, for each target medical stage, use the base model and the fine-tuning sub-model corresponding to that target medical stage to analyze the target question and the reference information corresponding to the target question, and give the thought process of the analysis. Integrating the output results corresponding to each target medical stage can obtain the intermediate answer and the intermediate thought chain corresponding to the intermediate answer.

[0086] Based on the above example, the intermediate answer and the intermediate thought chain corresponding to the intermediate answer can be determined according to the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage in the following way:

[0087] For the fine-tuning sub-model corresponding to each target medical stage, connect the base model and the fine-tuning sub-model corresponding to the target medical stage in series to form a target analysis model;

[0088] Input the target problem, the reference information corresponding to the target problem, and the preset Q&A instruction template corresponding to the target medical stage into the target analysis model to obtain the stage answer corresponding to the target medical stage and the stage thought chain corresponding to the stage answer.

[0089] Construct an intermediate answer and the intermediate thought chain corresponding to the intermediate answer based on the stage answers and stage thought chains corresponding to each target medical stage.

[0090] Among them, the target analysis model is a model formed by connecting a fine-tuning sub-model after a base model. The preset Q&A instruction template is a pre-set instruction template used to guide the generation of an answer and a thinking process based on the target problem and the corresponding reference information. The stage answer and the stage thought chain corresponding to the stage answer are the output results after analysis using a fine-tuning sub-model corresponding to a target medical stage.

[0091] Specifically, for the fine-tuning sub-model corresponding to each target medical stage, connect the base model and the fine-tuning sub-model corresponding to this target medical stage in series to form the target analysis model for this target medical stage. Substitute the target problem and the reference information corresponding to the target problem into the preset Q&A instruction template corresponding to this target medical stage, and use the target analysis model to analyze the instruction to obtain the stage answer corresponding to this target medical stage and the stage thought chain corresponding to the stage answer. Further, combine the stage answers and stage thought chains corresponding to each target medical stage in this analysis loop to construct an intermediate answer and the intermediate thought chain corresponding to the intermediate answer.

[0092] Based on the above example, if the fine-tuning sub-models corresponding to each target medical stage are loaded from the graphics processing unit to the central processing unit, then after the target problem, the historical message record corresponding to the target problem, the base model, the fine-tuning sub-models corresponding to each target medical stage, the intermediate answer, and the intermediate thought chain corresponding to the intermediate answer, these fine-tuning sub-models can be released. Specifically:

[0093] Release the fine-tuning sub-models corresponding to each target medical stage from the central processing unit.

[0094] Specifically, after using the fine-tuning sub-models corresponding to each target medical stage, they can be released and kept in the graphics processing unit to reduce the load on the central processing unit.

[0095] S130. According to the base model, the target problem, the historical conversation summary corresponding to the target problem, the intermediate answer, and the intermediate thought chain, determine whether the intermediate answer meets the termination condition. If it meets, execute S140; if it does not meet, execute S150.

[0096] Among them, the termination condition is used to determine whether the intermediate answer is accurately associated with the target question and the historical conversation summary, and whether it can completely answer the target question, which may include integrity (for parallel requests) and validity (for serial requests).

[0097] Specifically, substitute the target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thought chain into the preset termination analysis instruction template, and use the base model to analyze whether the termination condition is met. For example, the answer progress can be given, and when the answer progress reaches 100%, it is determined that the termination condition is met; otherwise, the termination condition is not met, and the loop analysis still needs to continue. Among them, the preset termination analysis instruction template can be an instruction template preset for guiding the analysis of whether the intermediate answer and the intermediate thought chain correspond to the target question and the historical conversation summary, and whether the answer to the target question is accurate.

[0098] S140. Determine the target output information corresponding to the target question according to the intermediate answer and the intermediate thought chain.

[0099] Among them, the target output information is the answer and the thinking process that can accurately and completely answer the target question.

[0100] Specifically, if the intermediate answer meets the termination condition, it means that the intermediate answer and the intermediate thought chain can already accurately and completely answer the target question, and there is no need to continue the analysis. Therefore, the intermediate answer and the intermediate thought chain can be used as the target output information corresponding to the target question. And the target output information can be provided to the user corresponding to the target question.

[0101] S150. Update the reference information corresponding to the target question according to the intermediate answer and the intermediate thought chain, and return to execute the step of determining at least one target medical stage and the corresponding fine-tuning sub-model for each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question.

[0102] Specifically, if the intermediate answer does not meet the termination condition, it means that the intermediate answer and the intermediate thought chain obtained from the current loop analysis cannot completely answer the target question. Therefore, further analysis is required, that is, to enter the next round of loop analysis. Specifically, the intermediate answer and the intermediate thought chain are updated into the reference information corresponding to the target question, so that the results of the current loop analysis are considered in the subsequent loop analysis. Furthermore, return to execute the step of determining at least one target medical stage and the corresponding fine-tuning sub-model for each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question, in order to obtain new intermediate answers and intermediate thought chains, so as to re-judge whether the intermediate answer meets the termination condition until the termination condition is met to obtain the target output information.

[0103] Exemplarily, inputting the historical conversation summary and the user's target question into the base model can identify the most suitable LoRA sub-model (fine-tuning sub-model) to ensure that the request is scheduled to the most appropriate one or more fine-tuning sub-models, improving the answer accuracy. When a single LoRA sub-model is scheduled, the inference result of this LoRA sub-model is directly returned as the preliminary inference output (intermediate answer and intermediate thought chain). When the scheduling involves multiple LoRA sub-models, the complex task is split into multiple parallel or serial sub-tasks to ensure a more reasonable call of the LoRA sub-models.

[0104] It can be understood that if the target question can be solved in parallel, multiple LoRA sub-models will be called in parallel for inference, and the intermediate answer and intermediate thought chain will be finally integrated. If the target question involves multiple steps, it will be executed serially according to the task logic, and after each step of execution decision, the fine-tuning sub-model to be called in the next step will be analyzed and decided in a loop. Based on the disassembled intent recognition result (target medical stage), serial / parallel scheduling and iterative solution of the LoRA sub-model are carried out.

[0105] Exemplarily, it can specifically include three parts: Intent analysis: Based on the analysis of the base model, determine the tool (LoRA sub-model) and parameters required to execute the current loop. The input of LoRA can also be adaptively adjusted according to the structured parameters of different tasks (target medical stages), for example: adjusting diagnostic keywords, key information in medical record summaries, etc.; Reflection mechanism: When executing each step of the task (each round of loop analysis), the thinking process (intermediate thought chain) will be recorded and adaptively optimized in combination with the current environmental state (reference information); Judgment termination: Based on the parsed output, judge whether it is necessary to continue to iterate the LoRA call, which can improve the coherence and accuracy of task execution.

[0106] The above method supports the collaborative work between multiple LoRA sub-modules, and can solve the problems of task intersection or dependence in the medical scenario. Through the context information sharing and task scheduling mechanism, the coherence and consistency of task processing are ensured. It can cooperate seamlessly between tasks, improving the task processing efficiency and accuracy in complex scenarios. Moreover, it supports the general model (base model) to independently select and load the corresponding LoRA module (fine-tuning sub-model) according to the task requirements, realizing dynamic adaptation. Through task recognition and priority scheduling (analyzing each target medical stage) and using dynamic loading, the LoRA module required for the current task can be quickly switched to ensure the real-time and flexibility of analysis, significantly improving the adaptability of the model in multi-task scenarios and meeting the dynamic requirements of complex tasks.

[0107] LoRA dynamic management is a technical extension for efficiently fine-tuning large models. Its core objective is to enhance the model's adaptability in different task or data scenarios by dynamically adjusting the structure and weight allocation of low-rank adapters.

[0108] Optionally, an efficient module management mechanism is designed to support the base model to autonomously select and load the corresponding LoRA weights according to task requirements, achieve dynamic adaptation, and perform the next inference work.

[0109] The above content realizes the dynamic adaptation of medical tasks in different stages through LoRA technology. Multiple fine-tuned sub-models can be flexibly switched according to task requirements, improving the generalization ability of the model. Moreover, it can dynamically adapt and schedule the fine-tuned sub-models of multiple target medical stages, enhancing efficiency and accuracy in complex medical tasks. Through multi-LoRA two-stage fine-tuning, the balance between the base model and various professional medical stage tasks is ensured, avoiding overfitting and catastrophic forgetting problems, and realizing the long-term stability and professional performance of each stage. Also, it can generate a medical record summary (historical conversation summary) by combining historical conversation information (historical message records), providing complete context information for the task of answering the target question later, and enhancing the coherence and accuracy of the question and answer. It can also reasonably disassemble the task of answering the target question into parts of different target medical stages, realizing the parallel or serial scheduling of each fine-tuned sub-model, and ensuring the efficiency and flexibility of task execution. The dynamic management of Lora can reduce system resource consumption and optimize the time and computational efficiency of the inference process through efficient resource management and dynamic loading mechanisms.

[0110] The present invention has the following technical effects: By determining at least one target medical stage and the corresponding fine-tuned sub-models for each target medical stage according to a pre-trained base model, a target question, and the reference information corresponding to the target question, to analyze the medical stage of the target question within the current loop analysis and call the corresponding fine-tuned sub-module. Furthermore, according to the target question, the reference information corresponding to the target question, the base model, and the fine-tuned sub-models corresponding to each target medical stage, determine the intermediate answer and the intermediate thought chain corresponding to the intermediate answer to perform the current loop analysis and answer the target question. According to the base model, the target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thought chain, judge whether the intermediate answer meets the termination condition to determine whether the answer to the target question can be completed. In response to meeting the termination condition, determine the target output information corresponding to the target question according to the intermediate answer and the intermediate thought chain. In response to not meeting the termination condition, update the reference information corresponding to the target question according to the intermediate answer and the intermediate thought chain, and perform the next round of loop analysis, realizing the flexible switching of fine-tuned sub-models by dynamically identifying medical stages, and improving the efficiency and accuracy of medical intelligent question answering.

[0111] Example Two

[0112] Figure 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 2 shown, the electronic device 200 includes one or more processors 201 and a memory 202.

[0113] The processor 201 can be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device 200 to perform desired functions.

[0114] The memory 202 can include one or more computer program products, and the computer program products can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory can include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory can include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions can be stored on the computer-readable storage medium, and the processor 201 can run the program instructions to implement the low-resource multi-scenario collaborative medical intelligent question-answering method of any embodiment of the present invention described above and / or other desired functions. Various contents such as initial external parameters, thresholds, etc. can also be stored in the computer-readable storage medium.

[0115] In one example, the electronic device 200 can further include: an input device 203 and an output device 204, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown). The input device 203 can include, for example, a keyboard, a mouse, etc. The output device 204 can output various information to the outside, including warning prompt information, braking force, etc. The output device 204 can include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0116] Of course, for simplicity, Figure 2 only some of the components related to the present invention in the electronic device 200 are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device 200 can further include any other appropriate components.

[0117] Example Three

[0118] In addition to the above methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions that, when run by a processor, cause the processor to execute the steps of the medical intelligent question-answering method for low-resource multi-scenario collaboration provided by any embodiment of the present invention.

[0119] The computer program product can be written in any combination of one or more programming languages for the program code to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as an independent software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0120] In addition, an embodiment of the present invention may also be a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are run by a processor, the processor is caused to execute the steps of the medical intelligent question-answering method for low-resource multi-scenario collaboration provided by any embodiment of the present invention.

[0121] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0122] It should be noted that the terms used in the present invention are only for describing specific embodiments and do not limit the scope of the present application. As shown in the specification of the present invention, unless the context clearly indicates otherwise, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include plural. The term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method or device comprising the element.

[0123] It should also be noted that the orientation or positional relationship indicated by terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Unless otherwise clearly specified and defined, terms such as "mounted", "connected", "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention.< / think>

Claims

1. A low-resource, multi-scenario collaborative medical intelligent question-answering method, characterized in that: include: Determine at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage according to a pre-trained base model, a target problem, and reference information corresponding to the target problem; Determine an intermediate answer and an intermediate thinking chain corresponding to the intermediate answer according to the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage; According to the base model, the target question, the historical conversation summary corresponding to the target question, the intermediate answer and the intermediate thinking chain, determining whether the intermediate answer meets the termination condition; In response to satisfying the termination condition, determining target output information corresponding to the target question according to the intermediate answer and the intermediate thinking chain; In response to the termination condition not being met, updating the reference information corresponding to the target question according to the intermediate answer and the intermediate thinking chain, and returning to execute the step of determining at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question; Among them, the base model and each fine-tuning sub-model are trained based on a pre-constructed medical question-and-answer thinking chain and a general question-and-answer thinking chain.

2. The method according to claim 1, characterized in that The base model and each fine-tuning sub-model are trained based on the following method: According to the pre-built general question-answering thinking chain, the large language model is trained with low-rank fine-tuning to obtain the base model; For each medical stage to be selected, the incremental model is low-rank fine-tuned according to the medical question-and-answer thinking chain corresponding to the medical stage to be selected, the general question-and-answer thinking chain, the preset mixing ratio and the base model to obtain the fine-tuning sub-model corresponding to the medical stage to be selected.

3. The method according to claim 2, characterized in that Also includes: Acquire initial question-and-answer data and medical non-question-and-answer data for each medical stage to be selected, and determine auxiliary medical information for each medical stage to be selected based on the medical non-question-and-answer data; For each medical stage to be selected, determining the conversion question and answer data of the medical stage to be selected according to the auxiliary medical information of the medical stage to be selected and the question and answer generation instruction template of the medical stage to be selected, and determining the medical question and answer data of the medical stage to be selected according to the conversion question and answer data of the medical stage to be selected and the initial question and answer data; For each medical stage to be selected, the medical question and answer thinking chain corresponding to the medical stage to be selected is determined based on the medical question and answer data of the medical stage to be selected, the auxiliary medical information corresponding to the medical question and answer data, and the thinking chain question and answer instruction template of the medical stage to be selected.

4. The method according to claim 3, characterized in that The determining of the medical question and answer thinking chain corresponding to the medical stage to be selected according to the medical question and answer data of the medical stage to be selected, the auxiliary medical information corresponding to the medical question and answer data, and the thinking chain question and answer instruction template of the medical stage to be selected includes: For each group of medical question and answer data in the to-be-selected medical stage, determining the key focus features corresponding to the medical question and answer data according to the question data in the medical question and answer data, the auxiliary medical information corresponding to the medical question and answer data, and the key focus feature instruction template in the thinking chain question and answer instruction template; Constructing a focus feature combination according to the focus features; For each focus feature combination, determine the candidate thinking process and candidate answer corresponding to the focus feature combination according to the focus feature combination, the question data and the thinking process result instruction template in the thinking chain question and answer instruction template; In response to the answer data in the medical question and answer data including the candidate answer, taking the candidate thinking process corresponding to the candidate answer as the thinking chain to be combined; Determine a medical question and answer thinking chain of the medical question and answer data according to each to-be-combined thinking chain corresponding to the medical question and answer data and the answer data; The medical question and answer thinking chain of each medical question and answer data corresponding to the medical stage to be selected is used as the medical question and answer thinking chain corresponding to the medical stage to be selected.

5. The method according to claim 3, characterized in that: After determining the medical question-and-answer thinking chain corresponding to the selected medical stage, the method further includes: Determine at least one corresponding quality assessment indicator for each medical question-and-answer thinking chain of the selected medical stage; Determine the effective status of each medical question and answer thinking chain according to each quality assessment indicator of each medical question and answer thinking chain; According to each valid state, the medical question and answer thinking chain corresponding to the medical stage to be selected is updated; The quality evaluation indicators include a length evaluation value, a diversity evaluation value, and an instruction following difficulty evaluation value.

6. The method according to claim 1, characterized in that The reference information corresponding to the target question includes a historical conversation summary, and the method further includes: Obtaining historical message records corresponding to the target issue; A historical conversation summary is determined according to the historical message record, a preset summary extraction instruction template and the base model.

7. The method according to claim 1, characterized in that Determining an intermediate answer and an intermediate thinking chain corresponding to the intermediate answer according to the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage includes: For each fine-tuning sub-model corresponding to the target medical stage, the base model and the fine-tuning sub-model corresponding to the target medical stage are connected in series to form a target analysis model; Inputting the target question, the reference information corresponding to the target question, and the preset question-answer instruction template corresponding to the target medical stage into the target analysis model, and obtaining the stage answer corresponding to the target medical stage and the stage thinking chain corresponding to the stage answer; According to the stage answers and stage thinking chains corresponding to each target medical stage, intermediate answers and intermediate thinking chains corresponding to the intermediate answers are constructed.

8. The method according to claim 1, characterized in that After determining at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target problem, and the reference information corresponding to the target problem, the method further includes: Loading the fine-tuned sub-models corresponding to each target medical stage from the graphics processor to the central processor; Accordingly, after determining the intermediate answer and the intermediate thinking chain corresponding to the intermediate answer according to the target question, the reference information corresponding to the target question, the base model and the fine-tuning sub-models corresponding to each target medical stage, the method further includes: The fine-tuned sub-model corresponding to each target medical stage is released from the central processing unit.

9. An electronic device, characterized in that: The electronic device comprises: Processor and memory; The processor is used to execute the steps of the low-resource, multi-scenario collaborative medical intelligent question and answer method as described in any one of claims 1 to 8 by calling the program or instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores programs or instructions, which enable a computer to execute the steps of the low-resource, multi-scenario collaborative medical intelligent question-answering method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Medical reply generation method and device, equipment and storage medium

    CN117743522A

  • Method and device for determining answer to question based on thinking chain, and electronic equipment

    CN117787421A

  • Question and answer method and device, equipment and medium

    CN118585619A

  • Medical question and answer method and device, electronic equipment and storage medium

    CN118692704A

  • Information processing method and device, electronic equipment and storage medium

    CN119338001A

Cited By

  • Pancreatic cancer prediction method and system based on local and global confusion weighted pruning

    CN121839088A