Medical data processing method and system, computer equipment and storage medium
By using the thinking chain template in medical data processing to process the input information and medical data information, and dynamically adjusting the template according to the initial output results, the problem of insufficient understanding of the deep meaning of data in the existing technology is solved, and more accurate output is achieved result.
Patent Information
- Application Number
- CN202411545456.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-21
AI Technical Summary
The existing medical data processing methods lack a deep understanding of the meaning of the data, resulting in inaccurate output results.
By obtaining input information and corresponding medical data information, processing based on the preset thinking chain template, the initial output result is obtained, and the thinking chain template is adjusted according to the initial output result until an output result meets the rationality requirement is obtained. Rationality requirements indicate that the output results must comply with preset medical knowledge information.
It effectively improves the model's inference ability and the accuracy of output results, and solves the problem of inaccurate output results caused by the lack of deep understanding of the data's meaning.
Smart Images

Figure CN119495441A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a medical data processing method, system, computer device and storage medium. Background Art
[0002] In the medical information system, there are problems such as lack of standardization, incompleteness, and unstructured clinical data. Although data extraction, cleaning, and application technologies are developing rapidly under the background of big data, due to the high requirements for data accuracy in clinical research work, it is necessary to further effectively analyze and apply unstructured data to meet the particularity of its data needs.
[0003] In order to solve the above problems, related technologies use natural language processing tools to extract important features in text to describe the relationship between entities, and use machine learning models to extract entity relationships and output entities associated with the target object, such as drug information, etc. However, the above methods lack a deep understanding of the meaning of the data, resulting in inaccurate output results.
[0004] There is currently no effective solution to the problem that related technologies lack an understanding of the deep meaning of the data, resulting in inaccurate output results. Summary of the invention
[0005] In this embodiment, a medical data processing method, system, computer device and storage medium are provided to solve the problem in the related art of lacking a deep understanding of the meaning of the data, resulting in inaccurate output results.
[0006] In a first aspect, a medical data processing method is provided in this embodiment, and the method includes:
[0007] Acquire input information and medical data information corresponding to the input information;
[0008] Based on a preset thinking chain template, the input information and the medical data information are processed to obtain a corresponding initial output result;
[0009] According to the initial output result, the thinking chain template is adjusted until the input information and the medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output result must comply with preset medical knowledge information.
[0010] In some embodiments, determining whether the output result meets the rationality requirement includes:
[0011] Extracting information from the output result according to the input category to which the input information belongs;
[0012] Determining whether the extracted information conforms to the preset medical knowledge information;
[0013] According to the judgment result, it is determined whether the output result meets the rationality requirement.
[0014] In some embodiments, adjusting the thought chain template according to the initial output result includes:
[0015] Generate feedback information corresponding to the initial output result; the feedback information is used to indicate the reason why the initial output result does not meet the rationality requirement;
[0016] According to the feedback information, the preset thought chain template is optimized and adjusted.
[0017] In some embodiments, the input information and the medical data information are processed based on a preset thought chain template to obtain a corresponding initial output result, including:
[0018] Fine-tune the first large language model through the training data set to obtain the corresponding target large language model;
[0019] Based on the thought chain template, the input information and the medical data information are processed by the target large language model to obtain the initial output result.
[0020] In some embodiments, the training data set includes a first data set and a second data set; and fine-tuning the first large language model using the training data set to obtain a corresponding target large language model includes:
[0021] Fine-tune the first language model using the first data set to obtain a first adaptive weight;
[0022] Merging the first adaptive weight and the first largest language model to obtain a second largest language model;
[0023] Performing instruction fine-tuning on the second language model using the second data set to obtain a second adaptive weight;
[0024] The second adaptive weight and the second large language model are combined to obtain the target large language model.
[0025] In some embodiments, obtaining medical data information corresponding to the input information includes:
[0026] Obtaining key information from the input information;
[0027] The medical data information corresponding to the key information is extracted from a medical database; the medical database includes medical record information and medical knowledge information.
[0028] In some embodiments, extracting the medical data information corresponding to the key information from the medical database includes:
[0029] Selecting an information extraction method for the input information according to the input category to which the input information belongs;
[0030] The medical data information corresponding to the key information is extracted from the medical database through the information extraction method.
[0031] In a second aspect, a medical data processing system is provided in this embodiment, the system comprising an extraction module, a processing module and an evaluation module;
[0032] The extraction module is used to obtain input information and medical data information corresponding to the input information;
[0033] The processing module is used to process the input information and the medical data information based on a preset thought chain template to obtain a corresponding initial output result;
[0034] The evaluation module is used to adjust the thinking chain template according to the initial output result, until the input information and the medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output result must comply with preset medical knowledge information.
[0035] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the medical data processing method described in the first aspect when executing the computer program.
[0036] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the medical data processing method described in the first aspect is implemented.
[0037] Compared with the related art, the medical data processing method, system, computer device and storage medium provided in this embodiment obtain input information and medical data information corresponding to the input information; process the input information and medical data information based on a preset thinking chain template to obtain an initial output result; further, according to the initial output result, adjust the thinking chain template until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirement, and the rationality requirement is used to indicate that the output result must comply with the preset medical knowledge information. Based on this, the thinking chain template is used to decompose the multi-step problem into a series of related intermediate steps for model reasoning. When the feedback reasoning result is unreasonable, the thinking chain template is dynamically adjusted to adaptively process the currently received problem, effectively improve the reasoning ability of the model and the rationality of the model reasoning, solve the problem of inaccurate output results caused by lack of understanding of the deep meaning of the data, and realize the understanding of the deep meaning of the data in the data processing process to improve the accuracy of the output results.
[0038] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0040] Figure 1 It is a hardware structure block diagram of a terminal device of a medical data processing method provided in an embodiment of the present application;
[0041] Figure 2 is a flow chart of a medical data processing method provided by an embodiment of the present application;
[0042] Figure 3 It is a flowchart of a model instruction fine-tuning process provided by an embodiment of the present application;
[0043] Figure 4 is a flow chart of a model instruction fine-tuning process provided by a preferred embodiment of the present application;
[0044] Figure 5 is a structural block diagram of a medical data processing system provided by an embodiment of the present application;
[0045] Figure 6 It is a structural block diagram of a medical data processing system provided by a preferred embodiment of the present application.
[0046] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, pre-processing module; 20, extraction module; 30, processing module; 40, evaluation module; 100, human assistant; 200, information extractor; 300, thinking chain designer; 400, critic. DETAILED DESCRIPTION
[0047] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0048] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0049] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the medical data processing method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0050] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the medical data processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0051] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0052] In this embodiment, a medical data processing method is provided. Figure 2 is a flow chart of the medical data processing method of this embodiment. Figure 2 As shown, the process includes the following steps:
[0053] Step S210, obtaining input information and medical data information corresponding to the input information.
[0054] Specifically, the user's input information is obtained, key information in the input information is extracted, and the medical data information corresponding to the key information is extracted from the medical database. Information extraction is implemented in the form of questions and answers. Generally speaking, the big model receives questions and corresponding multiple options as input, and the big model generates answers to achieve information extraction. Among them, the input information can include different contents, such as input instructions, questions to be queried, and different options corresponding to the query questions, etc. The questions to be queried include questions of various types, such as single-choice questions, multiple-choice questions, and judgment questions related to medical data, and the question categories can be mathematical arithmetic questions, logical reasoning questions, etc.
[0055] It should be noted that the above-mentioned medical database includes medical record information and medical knowledge information. The medical record information includes various examination information, medical order information, etc. of the patient, while the medical knowledge information includes but is not limited to the names, main ingredients, uses of various drugs, and the correspondence between drug information and manufacturer names.
[0056] Step S220, processing the input information and medical data information based on the preset thinking chain template to obtain the corresponding initial output result.
[0057] Among them, the Chain of Thought (CoT) can decompose multi-step problems into a series of related intermediate steps, so that problems with more reasoning steps can be allocated more computing resources. The Chain of Thought provides an interpretable window into the model behavior, prompting the reasoning path to obtain the answer, and facilitating accurate debugging of the reasoning path, thereby effectively improving the model's reasoning ability and the rationality of model reasoning.
[0058] Specifically, according to actual application requirements and historical experience, an initial thinking chain template is pre-designed, which contains multiple reasoning steps designed based on input information, medical record information, and medical knowledge information. Based on the reasoning path provided by the thinking chain template, the input information and medical data information are analyzed and processed through the target large language model to obtain the initial output result.
[0059] Among them, the output result is associated with the category of the input information. When the input information belongs to the input instruction category, the relevant content is obtained from the medical data information according to the task indicated by the input instruction. For example, the task indicated by the input instruction is to extract a certain type of medicine in the current medical data information, and the relevant content is extracted as the output result; if the input information is a question to be queried, the answer that matches the question to be queried is searched from the medical data information, and the answer content is extracted as the output result. It should be noted that when the input information and medical data information cannot be effectively processed based on the preset thinking chain template, the output result is that the information that matches the input information cannot be returned.
[0060] Step S230, according to the initial output result, the thinking chain template is adjusted until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirement; the rationality requirement is used to indicate that the output result must comply with the preset medical knowledge information.
[0061] Specifically, after obtaining the initial output result, feedback information corresponding to the initial output result is generated, and the feedback information is used to indicate the reason why the initial output result does not meet the rationality requirement, and the preset thinking chain template is optimized and adjusted according to the feedback information, until the input information and medical data information are processed by the target large language model based on the adjusted thinking chain template to obtain an output result that meets the rationality requirement. Among them, according to the input category to which the input information belongs, the output result is extracted, and the extracted information is compared with the medical knowledge information, so that it can be judged whether the output result meets the rationality requirement according to the comparison result, that is, whether the output result conforms to the preset medical knowledge information.
[0062] Furthermore, when the output result meets the rationality requirements, the answer that matches the question type of the input information is extracted from the output result, the answer is returned and it is determined whether to accept the answer. For example, when the input information is a multiple-choice question and its options, the specific option information is extracted from the output result and returned to avoid inconsistency between the output result and the option information, while ensuring the simplicity and standardization of the output content to facilitate subsequent data aggregation and analysis.
[0063] Since clinical research has high requirements for data accuracy, it is necessary to effectively analyze and apply unstructured data to meet the particularity of its data needs. Related technologies use natural language processing tools to extract important features in text to describe the relationship between entities, and use machine learning models to extract entity relationships and output entities associated with the target object, such as drug information. However, the above methods lack a deep understanding of the meaning of the data, resulting in inaccurate output results.
[0064] Compared with the prior art, the present application obtains input information and medical data information corresponding to the input information; processes the input information and medical data information based on a preset thinking chain template to obtain an initial output result; further, according to the initial output result, the thinking chain template is adjusted until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements. Based on this, the thinking chain template is used to decompose multi-step problems into a series of related intermediate steps for model reasoning, and when the feedback reasoning result is unreasonable, the thinking chain template is dynamically adjusted to adaptively process the current received problem, effectively improve the reasoning ability of the model and the rationality of the model reasoning, solve the problem of inaccurate output results caused by lack of understanding of the deep meaning of the data, and realize the understanding of the deep meaning of the data during the data processing process, and improve the accuracy of the output results.
[0065] In some of the embodiments, determining whether the output result meets the rationality requirement further includes the following steps:
[0066] Extract information from the output results according to the input category to which the input information belongs;
[0067] Determine whether the extracted information conforms to the preset medical knowledge information;
[0068] Based on the judgment result, determine whether the output result meets the rationality requirements.
[0069] In this embodiment, the input information may be different types of questions to be queried, such as single-choice questions, multiple-choice questions, and true-or-false questions related to medical data. The categories to which each question belongs include, but are not limited to, mathematical arithmetic questions and logical reasoning questions.
[0070] Specifically, determine the input category to which the input information belongs, for example, whether the input information belongs to the input instruction category, or the input information is a question to be queried, etc., extract information from the output result according to the input category, determine whether the extracted information conforms to the preset medical knowledge information, and determine whether the current output result meets the rationality requirement based on the judgment result. If the extracted information conforms to the preset medical knowledge information, it indicates that the current output result meets the rationality requirement. Among them, the medical knowledge information includes the name, main ingredients, drug use, correspondence between drug information and manufacturer name of various drugs, etc. Accordingly, keyword extraction can be performed on the information extracted from the output result, and each keyword can be matched with each noun in the medical knowledge information. If the match is successful, it indicates that the extracted information conforms to the preset medical knowledge information, or, extract the specific semantics of the preset medical knowledge information, and perform a logical check on the information extracted from the output result based on the specific semantics to determine whether the extracted information is inconsistent with the internal logic of the medical knowledge information. If there is no logical contradiction, it indicates that the extracted information conforms to the preset medical knowledge information. This embodiment does not specifically limit the judgment method.
[0071] It should be noted that by comparing the extracted information with the medical knowledge information, the drug aliases, manufacturer names, etc. associated with the extracted information are analyzed and obtained, so as to facilitate the subsequent extraction of answers from the output results that match the question type of the input information, and avoid the different expressions of the two contents, which may lead to inaccurate answers finally returned.
[0072] Through this embodiment, information extraction is performed on the output result according to the input category to which the input information belongs, and it is determined whether the extracted information conforms to the preset medical knowledge information. Based on the judgment result, it is determined whether the output result meets the rationality requirements, so as to accurately judge whether the current output result is reasonable.
[0073] In some embodiments, the step S230 of adjusting the thought chain template according to the initial output result includes the following steps:
[0074] Step S231, generating feedback information corresponding to the initial output result; the feedback information is used to indicate the reason why the initial output result does not meet the rationality requirement;
[0075] Step S232: Optimize and adjust the preset thought chain template according to the feedback information.
[0076] Specifically, feedback information is generated based on the initial output result, and the feedback information is used to indicate the reason why the initial output result does not meet the rationality requirement. For example, the reason why the output result does not meet the rationality requirement is that it is impossible to extract effective information from the medical data information, the information extracted from the output result does not meet the preset medical knowledge information, or the information extracted from the output result is not comprehensive enough, lacking key terms in the preset medical knowledge information, etc. The reason is fed back to the design stage of the thinking chain template. The reasoning path of the thinking chain template is optimized and adjusted according to the feedback information, that is, the various intermediate steps of the decomposition are adjusted to accurately obtain the effective information required to process the current input information, until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirement.
[0077] Among them, when the first output result does not meet the rationality requirement, if the output result exceeds the preset number of times and still does not meet the rationality requirement, the current dialogue is terminated.
[0078] Through this embodiment, feedback information corresponding to the initial output result is generated, and the preset thinking chain template is optimized and adjusted according to the feedback information, so as to achieve accurate optimization of the thinking chain template, so as to be able to adaptively process the currently received input information.
[0079] In some embodiments, the step S220 of processing the input information and the medical data information based on the thought chain template to obtain the corresponding initial output result includes the following steps:
[0080] Step S221, fine-tuning the first large language model using the training data set to obtain a corresponding target large language model;
[0081] Step S222, based on the thought chain template, the input information and medical data information are processed through the target large language model to obtain an initial output result.
[0082] Specifically, based on medical record information and medical knowledge information, different training data sets are constructed. The training data sets contain pairs of instructions and outputs. Instructions are specific tasks or requests provided to the model to be trained. They can be natural language descriptions that indicate the operations that the model needs to perform, and outputs are responses or results generated according to given instructions, that is, direct responses to instructions, so that the model can learn to understand different instructions and generate appropriate responses, thereby being able to learn relevant drug knowledge, learn to extract specific data information from medical record information, etc. In this embodiment, based on the medical knowledge of drugs such as chloran tablets and aspartame tablets, or extracting drugs used by patients and the main ingredients of drugs from medical order information, corresponding instruction and output pairs can be constructed. For example, the instruction is "extract all drug names from the text information", and the output corresponding to the instruction is "the drugs in the current text information include enteric-coated tablets, sustained-release tablets, and compound tablets".
[0083] Among them, for some question types that the model does not process well, such as drug questions or vascular questions, specific training data sets can be constructed for these question types to improve the model processing effect.
[0084] Furthermore, based on the constructed multiple training data sets, the first large language model is fine-tuned by using the principle of merging multiple low-rank subspaces, and the behavior of the model during training is represented by the low-rank space to obtain the target large language model. Afterwards, based on the thought chain template, the input information and medical data information are processed by the target large language model to obtain the output result.
[0085] It should be noted that the thinking chain can decompose multi-step problems into a series of related intermediate steps, so that problems with more reasoning steps are allocated more computing resources, and the thinking chain provides an interpretable window for the model behavior, suggesting the reasoning path to the answer. In this embodiment, the target large language model uses multiple intermediate steps to perform reasoning analysis on the input information and medical data information according to the reasoning path provided by the thinking chain template to obtain the output result. Exemplarily, the reasoning path provided by the thinking chain template is to execute step A, step B and step C in sequence, and step A, step B and step C are used to indicate the specific reasoning logic for outputting the corresponding result according to the input information and medical data information. The target large language model processes the input information and medical data information according to each step to obtain the final output result.
[0086] Through this embodiment, the first large language model is fine-tuned through the training data set to obtain the corresponding target large language model, and based on the thinking chain template, the input information and medical data information are processed by the target large language model to obtain the output result. In this way, the generalization ability of the model is significantly improved, data migration is effectively realized, the fine-tuning calculation cost is reduced, and the output content is guaranteed to be concise and standardized, which is convenient for subsequent data aggregation and analysis.
[0087] See also Figure 3 In some embodiments, the training data set includes a first data set and a second data set; step S221 of fine-tuning the first large language model using the training data set to obtain a corresponding target large language model includes the following steps:
[0088] Fine-tune the first language model using the first data set to obtain a first adaptive weight;
[0089] The first adaptive weight and the first largest language model are combined to obtain a second largest language model;
[0090] Fine-tune the second language model using the second data set to obtain a second adaptive weight;
[0091] The second adaptive weight and the second large language model are combined to obtain a target large language model.
[0092] It should be noted that instruction tuning (IT) fine-tunes the large language model in a supervised manner by constructing instances of the instruction format, thereby improving the large language model's responsiveness to natural language processing task instructions.
[0093] Specifically, the first large language model is fine-tuned using the principle of merging multiple low-rank subspaces to obtain a target large language model, and the corresponding low-rank matrix is introduced based on different data sets to adjust the model so that the model gradually integrates knowledge in specific fields at different stages to improve the generalization ability of the model. In the first stage, a first data set containing medical knowledge information is constructed, and the first large language model is fine-tuned using the first data set to obtain a first adaptive weight, and the first adaptive weight and the first large language model are merged to obtain a second large language model.
[0094] Furthermore, in the second stage, a corresponding second data set is constructed based on a set of related questions in the current application scenario. The second large language model is fine-tuned by the second data set to obtain a second adaptive weight, and the second adaptive weight and the second large language model are merged to obtain a target large language model. The first adaptive weight and the second adaptive weight are both low-rank adaptive weights.
[0095] In this embodiment, there is no limitation on the number and category of training data sets. On the basis of the above-mentioned target large language model, the target large language model can continue to be trained using training data sets constructed based on other medical record information or medical knowledge, without the need to retrain the initial large language model.
[0096] Through this embodiment, the first large language model is fine-tuned by using the first data set to obtain the first adaptive weight, the first adaptive weight and the first large language model are merged to obtain the second large language model, and the second large language model is fine-tuned by using the second data set to obtain the second adaptive weight, the second adaptive weight and the second large language model are merged to obtain the target large language model, thereby effectively improving the generalization ability of the model and reducing the fine-tuning calculation cost.
[0097] In some embodiments, the step S210 of obtaining medical data information corresponding to the input information includes the following steps:
[0098] Step S211, obtaining key information in the input information;
[0099] Step S212, extracting medical data information corresponding to the key information from the medical database; the medical database includes medical record information and medical knowledge information.
[0100] Specifically, key information is extracted from the input information, such as extracting keywords from the input information, and corresponding medical data information is extracted from the medical database based on the key information. The medical database includes medical record information and medical knowledge information. Medical record information includes various examination information and medical advice information of patients, while medical knowledge information includes but is not limited to the names, main ingredients, uses of various drugs, and the corresponding relationship between drug information and manufacturer names.
[0101] It should be noted that the input information may be questions to be queried of different types. When the input information includes a question and options, key information is extracted from the contents of both the question and the options.
[0102] Through this embodiment, key information in the input information is obtained, and medical data information corresponding to the key information is extracted from the medical database, so as to facilitate subsequent processing of the input information in combination with the medical data information and improve the rationality of the output result.
[0103] In some embodiments, extracting medical data information corresponding to the key information from the medical database in step S212 includes the following steps:
[0104] Selecting an information extraction method for the input information according to the input category to which the input information belongs;
[0105] Through the information extraction method, the medical data information corresponding to the key information is extracted from the medical database.
[0106] Specifically, the input information is analyzed to obtain the input category to which the input information belongs, including but not limited to the examination information category, the angiography category, the medical record text category, and the medical order information category. According to the input category obtained by the analysis, a corresponding information extraction method is selected, and the information extraction method is used to extract medical data information corresponding to the key information from the medical database.
[0107] Exemplarily, for examination information questions, the relevant medical data information contains content in a specific format or pattern, and the complexity of the information content is low, so regular matching is selected for information extraction; for angiography questions, the relevant medical data information uses relatively fixed terms, and the word vector generation model Word2vec is selected for information extraction; for medical record document questions, the relevant medical data information is the patient's admission record, discharge record, etc., which contains more professional terms and vocabulary changes, and usually there are words that did not appear in the training process, so the text classification model FastText is selected for information extraction; and for medical order information questions, the relevant medical data information focuses on the overall situation, that is, the overall relationship between each word, and the word vector model Glove is selected for information extraction.
[0108] It should be noted that when the above information extraction method cannot handle the problem or the processing effect is poor, the bidirectional language model BERT can be used to balance the requirements of processing performance and computing resources.
[0109] Through this embodiment, an information extraction method for the input information is selected according to the input category to which the input information belongs, and then the medical data information corresponding to the key information is extracted from the medical database through the information extraction method, thereby improving the flexibility and practicality of information extraction and ensuring the accuracy and efficiency of information extraction.
[0110] The present embodiment is described and illustrated by means of specific examples below.
[0111] Taking a single disease structured task as an example, its medical data includes the patient's case documents. Each case contains the patient's admission record, discharge record, percutaneous coronary intervention (PCI) angiography record, echocardiography and other examination information, and medical order information. The information to be extracted interacts with the big model in the form of questions and answers. The big model generates output answers, and several questions corresponding to each patient are used as input information. The question types of questions and answers can include single-choice questions, multiple-choice questions, and true-or-false questions. For multiple-choice questions, the options and questions are input to the big model together.
[0112] In order to uniformly summarize and analyze the above-mentioned medical data for accurate monitoring and analysis of the condition, it is necessary to predict the results of each question. First, convert the patient's case information into text format and unify it into the same document. Since the content of long-term medical orders accounts for the largest proportion in the case information, extract the case information through regular matching, screen out the long-term medical orders and remove duplicates. For example, use the regular expression "[在][^。]*长期医嘱[^。]*[。]" for screening to obtain the data information that matches the format defined by this regular expression, so that the length of the long-term medical order information after screening and deduplication meets the analysis window size of the large language model.
[0113] Furthermore, based on an adjustable thought chain template, use the large language model to predict the question, enabling the model to reason according to the established steps and obtain more reasonable reasoning results.
[0114] Take the drug question as an example to illustrate. This question requires selecting the specific drugs used by the patient under the target drug type from options A to F according to the patient's case information. According to the question content, input relevant drug prompt information, which includes each drug under the target drug type and the corresponding drug ingredients, manufacturer names, etc. Based on this, in the initial thought chain template, each step is successively to learn each drug included in the target drug type according to the drug prompt information, extract the drugs related to the target drug type from the medical knowledge base, match the drugs related to the target drug type from the patient's case information, and then match the options based on the above information to infer the final answer.
[0115] Based on the initial thought chain template, use the large language model to predict the question. The model prediction result is that no valid information can be extracted from the patient's case information and the prompt. Since no answer can be output, generate feedback information according to the problems existing in the current processing process, and optimize and adjust the thought chain template according to the feedback information, that is, adaptively adjust the content of each step, so that the model can reason reasonably according to the adjusted steps until the output result of the model meets the rationality requirements. Among them, subsequent adjustments include pre-screening the drugs used by the patient from the case information, and correctly learning the aliases and manufacturer names corresponding to the drugs while learning the drugs included in the target drug type.
[0116] In addition, the output results of the model based on the thinking chain template are rich and complex. In order to obtain concise and standardized answers and improve the generalization ability of the model, multiple training data sets are constructed, and based on each training data set, the principle of multiple low-rank subspace merging is used to fine-tune the instructions of the initial large language model. Specifically, different training data sets are constructed based on medical knowledge information and patient case information. For example, based on the medical knowledge of drugs such as losartan potassium tablets and aspirin enteric-coated tablets, or extracting the drugs used by patients and the main ingredients of the drugs from the doctor's order information, the corresponding instruction and output pairs are constructed as training data sets. For some question types where the model processing effect is not good, such as drug questions or vascular questions, specific training data sets can be constructed for this type of question to improve the model processing effect.
[0117] The present embodiment is described and illustrated below through preferred embodiments.
[0118] Figure 4 is a flow chart of the medical data processing method of this preferred embodiment, such as Figure 4 As shown, the medical data processing method includes the following steps:
[0119] Step S410, obtaining input information and key information in the input information;
[0120] Step S420, extracting medical data information corresponding to the key information from a medical database; the medical database includes medical record information and medical knowledge information;
[0121] Step S430, fine-tuning the first large language model using the training data set to obtain a corresponding target large language model;
[0122] Step S440, based on the thought chain template, the input information and medical data information are processed by the target large language model to obtain an initial output result;
[0123] Step S450, generating feedback information corresponding to the initial output result; wherein the feedback information is used to indicate the reason why the output result does not meet the rationality requirement;
[0124] Step S460, based on the feedback information, the preset thinking chain template is optimized and adjusted until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output results must comply with the preset medical knowledge information.
[0125] Through this embodiment, input information and key information in the input information are obtained, medical data information corresponding to the key information is extracted from the medical database, and the first large language model is fine-tuned through the training data set to obtain the corresponding target large language model, thereby improving the generalization ability of the model and ensuring the simplicity and standardization of the output content.
[0126] Furthermore, based on the thought chain template, the input information and medical data information are processed through the target large language model to obtain the initial output result. Feedback information corresponding to the initial output result is generated, and the preset thought chain template is optimized and adjusted according to the feedback information, until the input information and medical data information are processed based on the adjusted thought chain template to obtain an output result that meets the rationality requirements, solving the problem of inaccurate output results due to lack of understanding of the deep meaning of the data, realizing the understanding of the deep meaning of the data during the data processing process, and improving the accuracy of the output results.
[0127] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0128] In this embodiment, a medical data processing system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the systems described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0129] Figure 5 is a structural block diagram of the medical data processing system of this embodiment, such as Figure 5 As shown, the system includes an extraction module 20, a processing module 30 and an evaluation module 40;
[0130] An extraction module 20, used to obtain input information and medical data information corresponding to the input information;
[0131] The processing module 30 is used to process the input information and medical data information based on the preset thinking chain template to obtain the corresponding initial output result;
[0132] The evaluation module 40 is used to adjust the thinking chain template according to the initial output result, until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output results must comply with the preset medical knowledge information.
[0133] Through the system provided in this embodiment, input information and medical data information corresponding to the input information are obtained; the input information and medical data information are processed based on a preset thinking chain template to obtain an initial output result; further, according to the initial output result, the thinking chain template is adjusted until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements, wherein the rationality requirements are used to indicate that the processed output results must comply with the preset medical knowledge information, thereby solving the problem of inaccurate output results caused by a lack of understanding of the deep meaning of the data, and realizing the understanding of the deep meaning of the data during the data processing process, thereby improving the accuracy of the output results.
[0134] In some of these embodiments, Figure 5 On the basis of, the system also includes a preprocessing module 10, which is used to extract information from the output result according to the input category to which the input information belongs; determine whether the extracted information conforms to the preset medical knowledge information; and determine whether the output result meets the rationality requirement based on the judgment result.
[0135] In some of the embodiments, the evaluation module 40 is also used to generate feedback information corresponding to the initial output result; the feedback information is used to indicate the reason why the initial output result does not meet the rationality requirement; and the preset thinking chain template is optimized and adjusted according to the feedback information.
[0136] In some of the embodiments, the processing module 30 is also used to fine-tune the first large language model through the training data set to obtain the corresponding target large language model; based on the thinking chain template, the input information and medical data information are processed through the target large language model to obtain the initial output result.
[0137] In some of the embodiments, the processing module 30 is further used to perform instruction fine-tuning on the first large language model through the first data set to obtain a first adaptive weight; merge the first adaptive weight and the first large language model to obtain a second large language model; perform instruction fine-tuning on the second large language model through the second data set to obtain a second adaptive weight; merge the second adaptive weight and the second large language model to obtain a target large language model.
[0138] In some of the embodiments, the extraction module 20 is also used to obtain key information in the input information; extract medical data information corresponding to the key information from a medical database; the medical database includes medical record information and medical knowledge information.
[0139] In some of the embodiments, the extraction module 20 is further used to select an information extraction method for the input information according to the input category to which the input information belongs; and extract medical data information corresponding to the key information from the medical database through the information extraction method.
[0140] The present embodiment is described and illustrated below through preferred embodiments.
[0141] Figure 6 1 is a block diagram of the structure of the medical data processing system of the preferred embodiment. The system is used to implement the above method embodiment. The descriptions that have been made will not be repeated. Figure 6 As shown, multiple agents are created in advance, namely a human assistant 100, an information extractor 200, a thought chain designer 300 and a critic 400. The medical data processing flow is realized through the collaborative cooperation of various agents.
[0142] Specifically, the human assistant 100 is used to receive input information, extract key information from the input information, transmit the key information to the information extractor 200, and transmit the input information to the thinking chain designer 300 and the critic 400. The information extractor 200 plays a role in knowledge extraction in the whole process, and can obtain the patient's medical record information and the medical knowledge information in the medical knowledge base. When the information extractor 200 receives the key information, it extracts the medical data information corresponding to the key information according to the key information, including the medical record information and medical knowledge information related to the current input information, and transmits the extracted medical data information to the thinking chain designer 300.
[0143] It should be noted that the thinking chain template includes multiple reasoning steps designed based on input information, medical record information and medical knowledge information. The thinking chain designer 300 uses the initial thinking chain template to process the input information and the corresponding medical data information, obtains the output result, and transmits the output result to the critic 400.
[0144] Furthermore, the critic 400 extracts information from the output result according to the input category to which the input information belongs, and determines whether the output result conforms to the preset medical knowledge information. Based on the judgment result, it determines whether the output result is reasonable. If the output result conforms to the preset medical knowledge information, it indicates that the output result is reasonable. Otherwise, it indicates that the output result is unreasonable. When the critic 400 determines that the output result is unreasonable, it generates corresponding feedback information and returns it to the thinking chain designer 300. The feedback information is used to indicate the reason why the output result does not meet the rationality requirement. The thinking chain template is optimized and adjusted according to the feedback information. At the same time, based on the optimization of the thinking chain template, the knowledge extraction work of the information extractor 200 can be adjusted until the input information and medical data information are processed based on the adjusted thinking chain template to obtain a reasonable output result.
[0145] Afterwards, when the output result is judged to be reasonable, the critic 400 extracts the answer from the output result and returns the answer to the human assistant 100, and the human assistant 100 determines whether to accept the answer, thereby automatically realizing the medical data processing process.
[0146] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0147] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0148] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0149] S1, obtaining input information and medical data information corresponding to the input information;
[0150] S2, based on the preset thinking chain template, processes the input information and medical data information to obtain the corresponding initial output results;
[0151] S3, according to the initial output result, the thinking chain template is adjusted until the input information and medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output results must comply with the preset medical knowledge information.
[0152] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0153] In addition, in combination with the medical data processing method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any medical data processing method in the above embodiments is implemented.
[0154] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0155] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0156] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0157] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that the concept of this patent protection is to realize the extraction of information in a large-model question-and-answer manner, which involves fine-tuning of parameters of the large model, prompt word design based on the thinking chain and other technologies. For ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the attached claims.
Claims
1. A medical data processing method, characterized in that: The method comprises: Acquire input information and medical data information corresponding to the input information; Based on a preset thinking chain template, the input information and the medical data information are processed to obtain a corresponding initial output result; According to the initial output result, the thinking chain template is adjusted until the input information and the medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output result must comply with preset medical knowledge information.
2. The medical data processing method according to claim 1, characterized in that: Determining whether the output result meets the rationality requirement includes: Extracting information from the output result according to the input category to which the input information belongs; Determining whether the extracted information conforms to the preset medical knowledge information; According to the judgment result, it is determined whether the output result meets the rationality requirement.
3. The medical data processing method according to claim 1, characterized in that: The step of adjusting the thought chain template according to the initial output result includes: Generate feedback information corresponding to the initial output result; the feedback information is used to indicate the reason why the initial output result does not meet the rationality requirement; According to the feedback information, the preset thought chain template is optimized and adjusted.
4. The medical data processing method according to claim 1, characterized in that: The input information and the medical data information are processed based on the preset thinking chain template to obtain the corresponding initial output result, including: Fine-tune the first large language model through the training data set to obtain the corresponding target large language model; Based on the thought chain template, the input information and the medical data information are processed by the target large language model to obtain the initial output result.
5. The medical data processing method according to claim 4, characterized in that: The training data set includes a first data set and a second data set; the step of fine-tuning the first large language model through the training data set to obtain a corresponding target large language model includes: Fine-tune the first language model using the first data set to obtain a first adaptive weight; Merging the first adaptive weight and the first largest language model to obtain a second largest language model; Performing instruction fine-tuning on the second language model using the second data set to obtain a second adaptive weight; The second adaptive weight and the second large language model are combined to obtain the target large language model.
6. The medical data processing method according to claim 1, characterized in that: Obtaining medical data information corresponding to the input information, including: Obtaining key information from the input information; The medical data information corresponding to the key information is extracted from a medical database; the medical database includes medical record information and medical knowledge information.
7. The medical data processing method according to claim 6, characterized in that: The step of extracting the medical data information corresponding to the key information from the medical database includes: Selecting an information extraction method for the input information according to the input category to which the input information belongs; The medical data information corresponding to the key information is extracted from the medical database through the information extraction method.
8. A medical data processing system, characterized in that: The system includes an extraction module, a processing module and an evaluation module; The extraction module is used to obtain input information and medical data information corresponding to the input information; The processing module is used to process the input information and the medical data information based on a preset thought chain template to obtain a corresponding initial output result; The evaluation module is used to adjust the thinking chain template according to the initial output result, until the input information and the medical data information are processed based on the adjusted thinking chain template to obtain an output result that meets the rationality requirements; the rationality requirements are used to indicate that the output result must comply with preset medical knowledge information.
9. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps of the medical data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the medical data processing method according to any one of claims 1 to 7 are implemented.