Drug recommendation method based on multi-dimensional clinical information fusion of large language model
By integrating multidimensional clinical information through a large language model and a multi-label classification framework, the problem of insufficient personalization and accuracy in existing drug recommendation methods is solved, and more accurate drug recommendations are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-07
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies struggle to effectively utilize semi-structured or unstructured information in electronic medical records, particularly laboratory test results. Furthermore, deep learning models have limited capabilities in processing complex semantic relationships within clinical texts, resulting in a lack of personalization and accuracy in traditional drug recommendation methods.
A large language model is used to fuse multidimensional clinical information. Through preprocessing and efficient parameter fine-tuning techniques, multidimensional clinical information in electronic medical records is transformed into text descriptions. The model parameters are then optimized using a multi-label classification framework and the LoRA algorithm to achieve drug recommendation.
This improves the personalization and accuracy of drug recommendations, enabling better utilization of multidimensional clinical information in electronic medical records, especially laboratory test results, thus enhancing the precision and efficiency of drug recommendations.
Smart Images

Figure CN121862299A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information processing technology, and in particular to a drug recommendation method based on the fusion of multidimensional clinical information using a large language model. Background Technology
[0002] With the widespread adoption of electronic medical records, how to utilize the massive amounts of clinical data within them to provide patients with accurate and personalized medication recommendations has become a research hotspot in the field of intelligent healthcare. Accurate medication recommendations can not only assist doctors in decision-making but also effectively reduce potential medication risks. Current technologies mainly suffer from the following shortcomings:
[0003] Limitations of traditional recommendation methods: Traditional recommendation systems based on collaborative filtering or content filtering often face data sparsity and "cold start" problems when dealing with high-dimensional and sparse medical data, making it difficult to provide truly personalized recommendation solutions.
[0004] Limitations of Existing Deep Learning Models: In recent years, deep learning models based on recurrent neural networks and graph neural networks have been widely used. However, most of these models rely on structured clinical codes (such as diagnostic codes and surgical codes) as input, failing to effectively utilize the richer semi-structured or unstructured information in electronic medical records, such as laboratory test reports. Laboratory test results directly reflect the patient's real-time physiological state and are a key basis for doctors' clinical decisions, but existing models struggle to directly process and understand this type of data. Furthermore, these models have limited ability to capture the complex deep semantic relationships within medical record text.
[0005] Preliminary Applications of Large Language Models: Large language models have demonstrated powerful capabilities in natural language understanding and generation, offering new possibilities for processing complex clinical text data. However, research on applying large language models to drug recommendation is still in its early exploratory stages. Existing work either fails to systematically integrate key heterogeneous information such as laboratory tests into the model or fails to design an optimal model framework for the specific task of drug recommendation. Therefore, developing a novel drug recommendation method that can deeply understand and effectively integrate multi-dimensional clinical information such as patient diagnosis, surgery, and laboratory tests, and leverage the powerful capabilities of large language models, has significant clinical value and is technically urgent. Summary of the Invention
[0006] Based on this, it is necessary to propose a drug recommendation method, device, computer equipment, and storage medium based on the fusion of multidimensional clinical information using a large language model to address the above problems.
[0007] A drug recommendation method based on multidimensional clinical information fusion using a large language model, the method comprising:
[0008] S1: Obtain the patient's electronic medical record dataset, which includes a multidimensional clinical information set of the patient and a corresponding set of actual clinical medication information; and perform textual preprocessing on the multidimensional clinical information set to obtain a clinical status description text;
[0009] S2: Inject each clinical status description text and the set of actual clinical medication information from the electronic medical record set into a preset prompt word template to form an instruction input text and an output text that include background settings, task requirements, and boundary restrictions; the instruction input text and the output text constitute an instruction fine-tuning dataset;
[0010] S3: Select pre-trained large language models, adopt efficient parameter fine-tuning technology, and use the instruction fine-tuning dataset to perform supervised fine-tuning on the pre-trained large language models to obtain the optimized parameters after the pre-trained large language models are updated, thereby obtaining the adapted model after the pre-trained large language models are updated.
[0011] S4: Input the clinical status description text of the patient to be recommended into the fine-tuned adaptation model, and output the corresponding drug combination recommendation results.
[0012] In one embodiment, the multidimensional clinical information set includes diagnostic coding information, surgical coding information, and laboratory test information;
[0013]
[0014]
[0015] in, For electronic medical record datasets; This is the set of multidimensional clinical information for the i-th patient; This is the set of actual clinical medication information for the i-th patient; For diagnostic coding information; For surgical coding information; For laboratory inspection information The text after outlier template.
[0016] In one embodiment, the step of performing textual preprocessing on the multidimensional clinical information set to obtain the clinical state description text includes:
[0017] The structured diagnostic coding information, surgical coding information, and laboratory test information are transformed into a unified format of clinical status description text; that is, the multidimensional clinical information set is mapped by function to transform it into a unified format of clinical status description text.
[0018]
[0019] in, For describing clinical conditions; For diagnostic coding information; For surgical coding information; For laboratory inspection information The text after outlier template.
[0020] In one embodiment, the instruction input text, output text, and instruction fine-tuning dataset expression are as follows:
[0021]
[0022]
[0023]
[0024] in, Enter text for the instruction; To output text; Fine-tune the dataset for the instructions; For prompt word templates; For describing clinical conditions; This is the set of actual clinical medication information for the i-th patient; It is a collection that includes background settings, task requirements, and boundary constraints.
[0025] In one embodiment, the process of obtaining the templated text of the outlier values from the laboratory test information is as follows:
[0026] Extract laboratory indicators from the MIMIC database, including blood test indicators, urine analysis results, and biochemical indicators;
[0027] Laboratory indicators with abnormal test values are screened and categorized according to the measured substance and measurement type; an anomaly judgment function is defined, which determines if the measured value of the laboratory indicator is abnormal. Then determine , indicates an anomaly; The table indicates normal; among which... and These represent the lower and upper limits of the normal reference value for this indicator, respectively; all those that meet the criteria... Abnormal laboratory indicators are classified according to the type of substance being measured. Clustering is performed to obtain a set of abnormal indicators:
[0028]
[0029] in, A set of abnormal indicators; To measure the type of substance; These are the measured values of laboratory indicators; This is the exception detection function; For clustering operations;
[0030] Abnormal laboratory indicators are analyzed according to pre-defined semantic description rules. Convert to natural language text:
[0031]
[0032] in, For laboratory inspection information The text after outlier template.
[0033] In one embodiment, the adaptation model employs a multi-label classification fine-tuning framework, the construction steps of which include:
[0034] S31: For the instruction fine-tuning dataset Each instruction input text in the process is fused with the pre-trained large language model through text segmentation, word embedding layer mapping, and positional encoding to obtain input features;
[0035] S32: The efficient parameter fine-tuning technique uses the LoRA algorithm, specifically implemented in the following way:
[0036] Freeze all original weight parameters of the pre-trained large language model ,in The feature dimension of the input vector. The dimension of the output vector;
[0037] Insert trainable low-rank matrix pairs into the bypass of the linear mapping layer of a pre-trained large language model. and , where rank For input features Its hidden state vector through the linear mapping layer The calculation formula is:
[0038]
[0039] in, For the hidden state vector, Input features; Both B and B are low-rank matrix pairs; These are the original weight parameters;
[0040] S33: Replace the original output layer of the pre-trained large language model with the weight matrix of a fully connected classification layer targeting the entire set of target drugs. ,in The target drug set is the total number of drugs; the complete target drug set is a collection of actual clinical medication information corresponding to multiple patients. The set that constitutes;
[0041] S34: Use the Sigmoid activation function to transform the hidden state vector Converted into predicted probabilities for each candidate drug:
[0042]
[0043] in, The predicted probability of each drug in the target drug set; For the hidden state vector, It is the weight matrix of the fully connected layer for classification. The corresponding number in the middle A column vector of parameters for a drug; Use the Sigmoid activation function;
[0044] S35: Utilizing predicted probabilities With real labels The binary cross-entropy loss function is calculated to optimize the parameters of the pre-trained large language model. The formula for calculating the binary cross-entropy loss function is as follows:
[0045]
[0046] in, The binary cross-entropy loss function; To predict probabilities; This is the true label; if the drug but Otherwise, it is 0;
[0047] S36: By minimizing the binary cross-entropy loss function To iteratively update the parameters of the pre-trained large language model Obtain optimization parameters Thus, an adapted model is obtained. .
[0048] In one embodiment, the pre-trained large language model is screened in the following way:
[0049] Three strategies are applied to each candidate large model: zero-shot hint (0-Shot), few-shot hint (1-Shot), and CoT (CoT) hint. Each candidate large model corresponds to two parameters for each strategy: Jaccard coefficient and F1-score. The candidate large model with the lowest Jaccard coefficient and F1-score is removed.
[0050] For the remaining candidate large models, calculate the Jaccard coefficient, F1-score, and PRAUC index respectively; the candidate large model with the highest Jaccard coefficient, F1-score, or PRAUC index is the pre-trained large language model.
[0051] The three strategies are as follows:
[0052] Zero-Shot prompt: Direct input of text commands, requiring a pre-trained large language model to output a medication plan based on its inherent knowledge;
[0053] Few-shot hint 1-Shot: Add a real doctor-patient case to the input as an example to guide the model to imitate medication logic; the doctor-patient case is the patient's instruction input text and output text;
[0054] CoT (Conceptual Chain Tips): Before outputting drug combination recommendations, the pre-trained large language model is required to first demonstrate the reasoning process of patient condition analysis, medication need assessment, and drug selection in steps.
[0055] In one embodiment, the Jaccard coefficient is calculated as follows:
[0056] The Jaccard coefficient between the drug combination recommendation results of the pre-trained large language model and the set of actual clinical drug use information is calculated to measure the similarity of the sets.
[0057]
[0058] in, Jaccard coefficient; This is a collection of information on actual clinical drug use. Recommendation results for drug combinations
[0059] In one embodiment, the F1-score is calculated as follows:
[0060] Calculate the F1-score to comprehensively evaluate the precision and recall of the drug combination recommendation results output by the pre-trained large language model;
[0061]
[0062] in, This represents the set of actual clinical medication information for the i-th patient. This represents the drug combination recommendation result for the i-th patient predicted by the pre-trained large language model. Represents a set The number of elements in the middle, This represents the total number of patients.
[0063] This invention combines a pre-trained large language model with screening, effectively utilizing the multidimensional clinical information set of electronic medical record datasets and the semantic information in medical texts to assist in recommending suitable drugs for patients, thereby achieving the goal of personalized recommendations. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] in:
[0066] Figure 1 This is a flowchart of a drug recommendation method based on the fusion of multidimensional clinical information using a large language model, as shown in one embodiment.
[0067] Figure 2 This is a schematic diagram of the structure of a multi-label classification framework used for model fine-tuning in one embodiment.
[0068] Figure 3 This is a performance comparison chart of an embodiment on the MIMIC-IV dataset with existing methods under different training data volumes;
[0069] Figure 4 This is a structural block diagram of a computer device in one embodiment. Detailed Implementation
[0070] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0071] To address the technical problems in the background section, this application provides a drug recommendation method based on the fusion of multidimensional clinical information using a large language model. For example... Figure 1 As shown, this drug recommendation method based on the fusion of multidimensional clinical information using a large language model specifically includes the following steps:
[0072] S1: Obtain the patient's electronic medical record dataset, which includes a multidimensional clinical information set of the patient and a corresponding set of actual clinical medication information; and perform textual preprocessing on the multidimensional clinical information set to obtain a clinical status description text;
[0073] S2: Inject each clinical status description text and the set of actual clinical medication information from the electronic medical record set into a preset prompt word template to form an instruction input text and an output text that include background settings, task requirements, and boundary restrictions; the instruction input text and the output text constitute an instruction fine-tuning dataset;
[0074] S3: Select a pre-trained large language model, adopt efficient parameter fine-tuning technology, and use the instruction fine-tuning dataset to perform supervised fine-tuning on the pre-trained large language model (Qwen2.5-7B-Instruct) to obtain the optimized parameters after the pre-trained large language model is updated, and then obtain the adapted model after the pre-trained large language model is updated.
[0075] S4: Input the clinical status description text of the patient to be recommended into the fine-tuned adaptation model, and output the corresponding drug combination recommendation results. .
[0076] In one embodiment, the multidimensional clinical information set Includes diagnostic coding information Surgical coding information and laboratory test information ;
[0077]
[0078]
[0079] in, For electronic medical record datasets; This is the set of multidimensional clinical information for the i-th patient; This is the set of actual clinical medication information for the i-th patient; For diagnostic coding information; For surgical coding information; For laboratory inspection information The text after outlier template.
[0080] In one embodiment, the multidimensional clinical information set is... Textual preprocessing was performed to obtain clinical condition description text. include:
[0081] Structured diagnostic coding information Surgical coding information and laboratory test information Convert into a standardized clinical condition description text. That is, the multidimensional clinical information set Perform function mapping This will be converted into a standardized clinical condition description text.
[0082]
[0083] in, For describing clinical conditions; For diagnostic coding information; For surgical coding information; For laboratory inspection information The text after outlier template.
[0084] In one embodiment, the instruction input text and output text and the instruction to fine-tune the dataset The expression is as follows:
[0085]
[0086]
[0087]
[0088] in, Enter text for the instruction; To output text; Fine-tune the dataset for the instructions; For prompt word templates; For describing clinical conditions; This is the set of actual clinical medication information for the i-th patient; It is a collection that includes background settings, task requirements, and boundary constraints.
[0089] In one embodiment, the laboratory test information Outlier templated text The acquisition process is as follows:
[0090] Extract laboratory indicators from the MIMIC database, including blood test indicators, urine analysis results, and biochemical indicators;
[0091] Screen laboratory indicators with abnormal test values and categorize them according to the measured substance and measurement type; define anomaly judgment function. If the measured value of the laboratory index Then determine , indicates an anomaly; The table indicates normal; among which... and These represent the lower and upper limits of the normal reference value for this indicator, respectively; all those that meet the criteria... Abnormal laboratory indicators are classified according to the type of substance being measured. Clustering is performed to obtain a set of abnormal indicators:
[0092]
[0093] in, A set of abnormal indicators; To measure the type of substance; These are the measured values of laboratory indicators; This is the exception detection function; For clustering operations;
[0094] Abnormal laboratory indicators are analyzed according to pre-defined semantic description rules. Convert to natural language text:
[0095]
[0096] in, For laboratory inspection information The text after outlier template.
[0097] In one embodiment, the adaptation model The construction steps of the multi-label classification fine-tuning framework include:
[0098] S31: For the instruction fine-tuning dataset Each instruction input text The input features are obtained by fusing text segmentation, word embedding layer mapping, and positional encoding through a pre-trained large language model (Qwen2.5-7B-Instruct). ;
[0099] S32: The efficient parameter fine-tuning technique adopts the LoRA (Low-Rank Adaptation) algorithm, which is implemented in the following way:
[0100] Freeze all original weight parameters of the pre-trained large language model ,in The feature dimension of the input vector. The dimension of the output vector;
[0101] Insert trainable low-rank matrix pairs into the bypass of the linear mapping layer of a pre-trained large language model. and , where rank For input features Its hidden state vector through the linear mapping layer The calculation formula is:
[0102]
[0103] in, For the hidden state vector, Input features; Both B and B are low-rank matrix pairs; These are the original weight parameters;
[0104] S33: Replace the original output layer of the pre-trained large language model with the weight matrix of a fully connected classification layer targeting the entire set of target drugs. ,in The target drug set is the total number of drugs; the complete target drug set is a collection of actual clinical medication information corresponding to multiple patients. The set that constitutes;
[0105] S34: Use the Sigmoid activation function to transform the hidden state vector Converted into predicted probabilities for each candidate drug:
[0106]
[0107] in, The predicted probability of each drug in the target drug set; For the hidden state vector, It is the weight matrix of the fully connected layer for classification. The corresponding number in the middle A column vector of parameters for a drug; Use the Sigmoid activation function;
[0108] S35: Utilizing predicted probabilities With real labels The binary cross-entropy loss function is calculated to optimize the parameters of the pre-trained large language model. The formula for calculating the binary cross-entropy loss function is as follows:
[0109]
[0110] in, The binary cross-entropy loss function; To predict probabilities; This is the true label; if the drug but Otherwise, it is 0;
[0111] S36: By minimizing the binary cross-entropy loss function To iteratively update the parameters of the pre-trained large language model Obtain optimization parameters Thus, an adapted model is obtained. .
[0112] In one embodiment, the pre-trained large language model is implemented in the following manner. Filtering:
[0113] Three strategies are applied to each candidate large model: zero-shot hint (0-Shot), few-shot hint (1-Shot), and CoT (CoT) hint. Each candidate large model corresponds to two parameters for each strategy: Jaccard coefficient and F1-score. The candidate large model with the lowest Jaccard coefficient and F1-score is removed.
[0114] For the remaining candidate large models, calculate the Jaccard coefficient, F1-score, and PRAUC index respectively; the candidate large model with the highest Jaccard coefficient, F1-score, or PRAUC index is the pre-trained large language model.
[0115] The three strategies are as follows:
[0116] Zero-Shot prompt: Direct input of text commands, requiring a pre-trained large language model to output a medication plan based on its inherent knowledge;
[0117] Few-shot hint 1-Shot: Add a real doctor-patient case to the input as an example to guide the model to imitate medication logic; the doctor-patient case is the patient's instruction input text. and output text ;
[0118] CoT (Coding of Thoughts) requires pre-trained large language models to output drug combination recommendations. First, the reasoning process of analyzing the patient's condition, assessing medication needs, and selecting drugs will be presented step by step.
[0119] In one embodiment, the Jaccard coefficient is calculated as follows:
[0120] Calculate drug combination recommendation results from pre-trained large language models Collection of clinical medication information The Jaccard coefficient between sets is used to measure set similarity.
[0121]
[0122] in, Jaccard coefficient; This is a collection of information on actual clinical drug use. Recommendation results for drug combinations
[0123] In one embodiment, the F1-score is calculated as follows:
[0124] Calculate the F1-score to comprehensively evaluate the drug combination recommendation results output by the pre-trained large language model. Precision and recall rates;
[0125]
[0126] in, This represents the set of actual clinical medication information for the i-th patient. This represents the drug combination recommendation result for the i-th patient predicted by the pre-trained large language model. Represents a set The number of elements in the middle, This represents the total number of patients.
[0127] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. A complete embodiment of this invention includes the following steps:
[0128] Step 1: Data Acquisition and Preprocessing This embodiment uses the publicly available intensive care medical databases MIMIC-III and MIMIC-IV as the data source. These two datasets contain a large number of de-identified patient hospitalization records. First, the data is preprocessed to extract the diagnostic codes, surgical codes, laboratory test results, and final medication records related to each hospitalization, resulting in the final patient electronic medical record dataset. .in, A collection of multidimensional clinical information representing the patient. Each corresponds to a diagnostic code. Surgical code and laboratory test information ; This corresponds to the actual clinical drug use set. Subsequently, the entire dataset is randomly divided into training, validation, and test sets in an 8:1:1 ratio for model training, parameter tuning, and final performance evaluation.
[0129] Step Two: The heterogeneous information extracted from electronic medical records is uniformly converted into natural language text. Specifically, the patient's diagnosis and surgical information (usually ICD-coded) is converted into its textual description, i.e.,... Perform function mapping This will be converted into a standardized clinical condition description text. For laboratory test information, recorded laboratory measurements are grouped according to their liquid type (e.g., "BLOOD") and category (e.g., "ABG"), and abnormal indicators and their values within the same group are combined into a descriptive text. Anomaly detection functions are defined. If the measured value Then determine (Abnormal), otherwise .in and These are the upper and lower limits of the normal reference value for this indicator. (All) Abnormal indicators are categorized by the type of substance being measured. Clustering is performed to obtain a set of abnormal indicators:
[0130]
[0131] The filtered abnormal indicators are then processed according to preset semantic description rules. The text is converted into natural language text and then concatenated with the text stream containing diagnostic and surgical information to obtain the following text stream:
[0132]
[0133] The text fragments of the processed diagnostic, surgical, and laboratory test information are mapped using a function. Obtain clinical information text .
[0134] Will Inject preset prompt template This forms the instruction input text. , where variables It includes background settings, task requirements, and boundary constraints. The prompt template supports three strategies: zero-sample prompts (directly outputting the solution), few-sample prompts (adding doctor-patient case examples), and thought chain prompts (showing the reasoning process step by step). It also includes drug labels. Generate output text Finally, a fine-tuning dataset of instructions is constructed. .for Each input text in The input features are obtained through text segmentation, word embedding layer mapping, and positional encoding fusion by the model. .
[0135] Step 3: Model Framework Design and Construction (Reference) Figure 2 This embodiment adopts Figure 2 The multi-label classification framework shown. A pre-trained open-source large language model (e.g., Qwen2.5-7B) is selected as the base model. To reduce the computational and storage costs of model training, this embodiment employs an efficient parameter fine-tuning technique: Low-Rank Adaptive Ratio (LoRA). The principle behind this is that during the fine-tuning process, most of the original parameters of the pre-trained large language model are frozen. Only two low-rank matrices are inserted and trained next to the linear layer. and ,in The feature dimension of the input vector. The dimension of the output vector (where the rank) During training, only the parameters of these low-rank matrices are updated, thus greatly reducing the number of parameters that need to be trained, making it possible to fine-tune large models with limited computational resources. The formula for calculating the forward propagation process is:
[0136]
[0137] It removes the original language model output header and adds a fully connected layer at the top as a new classification header. ,in The output dimension of this classification layer is equal to the total number of drug types in the dataset, representing the total number of target drugs. A sigmoid activation function is then applied after this classification layer to calculate the predicted probability of each drug.
[0138]
[0139] in This represents the hidden state vector of the last layer of the model. It is the weight matrix of the fully connected layer. The corresponding number in the middle A column vector of parameters for a drug.
[0140] The value of each output neuron is mapped to the (0, 1) interval, representing the probability of recommending the corresponding drug. During training, the binary cross-entropy loss function is minimized. Iterative parameter update:
[0141]
[0142] in To predict probabilities, For true labeling (if drug) but Otherwise, it is 0). By minimizing the loss function To iteratively update model parameters Thus, an adapted model is obtained. .
[0143] Step Four: Model Inference and Drug Recommendation After fine-tuning, the model can be used for drug recommendation. For a new patient, first perform Step Two to convert their clinical information into a text description. Then, the text is input into the fine-tuned model. The model then performs forward propagation. The multi-label classification head of the model outputs a probability vector. Each element in the vector corresponds to a recommendation probability for a particular drug. A probability threshold is set... If the probability vector The probability of a certain drug being greater than If the drug is selected, then the final recommended drug combination can be obtained.
[0144] In this embodiment, the effectiveness of the constructed model was verified. In a specific dataset embodiment, the performance of direct prompts from different series of open-source large language models using different prompt word templates was compared.
[0145] The adaptation model The evaluation process includes:
[0146] Computational adaptation model Recommended drug combination results The Jaccard coefficient between the actual prescription and the actual prescription is used to measure set similarity.
[0147]
[0148] in, To adapt the model Recommended drug combination results The Jaccard coefficient between the actual prescription and the actual prescription; This represents the set of actual prescriptions for the i-th patient. Represents the adaptation model The set of recommended prescriptions for the i-th patient as predicted. Represents a set The number of elements in the middle, This represents the total number of patients.
[0149] Calculate the F1-score to comprehensively evaluate the fit of the model. Output of drug combination recommendations Precision and recall;
[0150]
[0151] in, This refers to the F1 score. This represents the set of actual prescriptions for the i-th patient. Represents the adaptation model The set of recommended prescriptions for the i-th patient as predicted. Represents a set The number of elements in the middle, This represents the total number of patients.
[0152] Computational adaptation model The PRAUC metric is used to evaluate overall performance at different recall levels.
[0153]
[0154]
[0155] in, For the total number of patients, The total number of target drugs, This represents the precision when the ranked list of the i-th patient reaches the k-th drug. This represents the recall rate when the ranked list of the i-th patient reaches the k-th drug. It is the change in recall rate from drug k-1 to drug k in the ordered drug list of patient i.
[0156] Table 1 details the performance of four mainstream large language models—GLM4-9B, Qwen2.5-7B, Llama3.1-8B, and DS-R1-Qwen-7B—in the drug recommendation task, and compares the impact of three different prompting strategies: 0-Shot, 1-Shot, and CoT. Experimental results show that the Qwen2.5-7B model achieves the best performance under the 1-Shot strategy, with its Jaccard coefficient and F1-score significantly higher than the other comparative models, demonstrating the strongest task understanding and recommendation capabilities. Regarding the effectiveness of the prompting strategies, except for Llama3.1-8B, the other models all show better performance improvement after introducing fewer sample examples compared to zero sample examples, validating the effectiveness of context learning in drug recommendation scenarios. However, the CoT strategy exhibits significant heterogeneity across models: Llama3.1-8B achieved the best performance metrics under CoT, while GLM4-9B, Qwen2.5-7B, and DS-R1-Qwen-7B experienced varying degrees of performance decline after applying CoT. This may indicate that complex thought chains do not always generate positive gains in the reasoning logic of this specific task. Furthermore, DS-R1-Qwen-7B (Deepseek-R1-Qwen-7B) performed relatively poorly overall in this task, with all metrics significantly lower than other models, reflecting considerable room for optimization in handling current medical drug recommendation logic.
[0157] Table 1. Model results for learning with different prompts
[0158]
[0159] In a specific dataset example, the performance of models employing a multi-label classification framework was compared.
[0160] Table 2 Results of Large Language Models with Different Multi-Label Classification Frameworks
[0161]
[0162] As shown in Table 2, when using the Qwen2.5-7B model, the F1 value obtained by adopting the multi-label classification framework of the present invention is 0.7042, indicating that the Qwen series classification framework in the present invention can achieve higher recommendation accuracy.
[0163] To demonstrate the technical effectiveness of the method in this embodiment, its performance was compared with that of various existing technical methods on the same dataset.
[0164] As shown in Table 3, the method in this embodiment outperforms various baseline models, including StratMed and COGNet, in terms of Jaccard, PRAUC, and F1-score on the MIMIC-III and MIMIC-IV datasets, demonstrating its technical advantages.
[0165] Table 3 Comparison results with existing methods
[0166]
[0167] * indicates data from the corresponding paper; all others represent reproduced results. (See reference...) Figure 3 To verify the robustness of the method in this embodiment, tests were conducted on the MIMIC-IV dataset using training data of different sizes. The results show that the method of this invention maintains its performance advantage over other methods across all data scales, especially exhibiting stronger robustness with smaller performance degradation when the training samples are limited. Furthermore, by incorporating laboratory test information into the input, the accuracy of the model's drug recommendations improved, intuitively demonstrating the application value of this invention in real-world clinical scenarios.
[0168] Figure 4 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 4 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a drug recommendation method based on the fusion of multidimensional clinical information using a large language model. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement a drug recommendation method based on the fusion of multidimensional clinical information using a large language model. Those skilled in the art will understand that... Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0169] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0170] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0171] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A drug recommendation method based on multidimensional clinical information fusion using a large language model, characterized in that, The method includes: S1: Obtain the patient's electronic medical record dataset, which includes a multidimensional clinical information set of the patient and a corresponding set of actual clinical medication information; and perform textual preprocessing on the multidimensional clinical information set to obtain a clinical status description text; S2: Inject each clinical status description text and the set of actual clinical medication information from the electronic medical record set into a preset prompt word template to form an instruction input text and an output text that include background settings, task requirements, and boundary restrictions; the instruction input text and the output text constitute an instruction fine-tuning dataset; S3: Select pre-trained large language models, adopt efficient parameter fine-tuning technology, and use the instruction fine-tuning dataset to perform supervised fine-tuning on the pre-trained large language models to obtain the optimized parameters after the pre-trained large language models are updated, thereby obtaining the adapted model after the pre-trained large language models are updated. S4: Input the clinical status description text of the patient to be recommended into the fine-tuned adaptation model, and output the corresponding drug combination recommendation results.
2. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 1, characterized in that, The multidimensional clinical information set includes diagnostic coding information, surgical coding information, and laboratory test information; in, For electronic medical record datasets; This is the set of multidimensional clinical information for the i-th patient; This is the set of actual clinical medication information for the i-th patient; For diagnostic coding information; For surgical coding information; For laboratory inspection information The text after outlier template.
3. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 2, characterized in that, The process of preprocessing the multidimensional clinical information set to obtain the clinical state description text includes: The structured diagnostic coding information, surgical coding information, and laboratory test information are transformed into a unified format of clinical status description text; that is, the multidimensional clinical information set is mapped by function to transform it into a unified format of clinical status description text. in, For describing clinical conditions; For diagnostic coding information; For surgical coding information; For laboratory inspection information The text after outlier template.
4. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 1, characterized in that, The instruction input text, output text, and instruction fine-tuning dataset expression are as follows: in, Enter text for the instruction; To output text; Fine-tune the dataset for the instructions; For prompt word templates; For describing clinical conditions; This is the set of actual clinical medication information for the i-th patient; It is a collection that includes background settings, task requirements, and boundary constraints.
5. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 1, characterized in that, The process of obtaining the templated text of outlier values from the laboratory test information is as follows: Extract laboratory indicators from the MIMIC database, including blood test indicators, urine analysis results, and biochemical indicators; Laboratory indicators with abnormal test values are screened and categorized according to the measured substance and measurement type; an anomaly judgment function is defined, which determines if the measured value of the laboratory indicator is abnormal. Then determine , indicates an anomaly; The table indicates normal; among which... and These represent the lower and upper limits of the normal reference value for this indicator, respectively; all those that meet the criteria... Abnormal laboratory indicators are classified according to the type of substance being measured. Clustering is performed to obtain a set of abnormal indicators: in, A set of abnormal indicators; To measure the type of substance; These are the measured values of laboratory indicators; This is the exception detection function; For clustering operations; Abnormal laboratory indicators are analyzed according to pre-defined semantic description rules. Convert to natural language text: in, For laboratory inspection information The text after outlier template.
6. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 1, characterized in that, The adaptation model employs a multi-label classification fine-tuning framework, and its construction steps include: S31: For the instruction fine-tuning dataset Each instruction input text in the process is fused with the pre-trained large language model through text segmentation, word embedding layer mapping, and positional encoding to obtain input features; S32: The efficient parameter fine-tuning technique uses the LoRA algorithm, specifically implemented in the following way: Freeze all original weight parameters of the pre-trained large language model ,in The feature dimension of the input vector. The dimension of the output vector; Insert trainable low-rank matrix pairs into the bypass of the linear mapping layer of a pre-trained large language model. and , where rank For input features Its hidden state vector through the linear mapping layer The calculation formula is: in, For the hidden state vector, For input features; Both B and B are low-rank matrix pairs; These are the original weight parameters; S33: Replace the original output layer of the pre-trained large language model with the weight matrix of a fully connected classification layer targeting the entire set of target drugs. ,in The target drug set is the total number of drugs; the complete target drug set is a collection of actual clinical medication information corresponding to multiple patients. The set that constitutes; S34: Use the Sigmoid activation function to transform the hidden state vector Converted into predicted probabilities for each candidate drug: in, The predicted probability of each drug in the target drug set; For the hidden state vector, It is the weight matrix of the fully connected layer for classification. The corresponding number in the middle A column vector of parameters for a drug; Use the Sigmoid activation function; S35: Utilizing predicted probabilities With real labels The binary cross-entropy loss function is calculated to optimize the parameters of the pre-trained large language model. The formula for calculating the binary cross-entropy loss function is as follows: in, The binary cross-entropy loss function; To predict probabilities; This is the true label; if the drug but Otherwise, it is 0; S36: By minimizing the binary cross-entropy loss function To iteratively update the parameters of the pre-trained large language model Obtain optimization parameters Thus, an adapted model is obtained. .
7. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 1, characterized in that, The pre-trained large language model is selected using the following method: Three strategies are implemented for each candidate large model: zero-shot hint 0-Shot, few-shot hint 1-Shot, and CoT (Co-T) hint. Each candidate large model corresponds to two parameters for each strategy: Jaccard coefficient and F1-score. Remove the candidate large models corresponding to the lowest Jaccard coefficient and F1-score; For the remaining candidate large models, calculate the Jaccard coefficient, F1-score, and PRAUC index respectively; the candidate large model with the highest Jaccard coefficient, F1-score, or PRAUC index is the pre-trained large language model. The three strategies are as follows: Zero-shot hint: Directly input text as a command, requiring the pre-trained large language model to output a medication plan based on its inherent knowledge; Few-shot suggestion: Add a real doctor-patient case to the input as an example to guide the model to imitate medication logic; the doctor-patient case is the patient's instruction input text and output text. Mindset hint: Before outputting drug combination recommendations, the pre-trained large language model should first demonstrate the reasoning process of patient condition analysis, medication need assessment, and drug selection in steps.
8. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 7, characterized in that, The Jaccard coefficient is calculated as follows: The Jaccard coefficient between the drug combination recommendation results of the pre-trained large language model and the set of actual clinical drug use information is calculated to measure the similarity of the sets. in, Jaccard coefficient; This is a collection of information on actual clinical drug use. Recommendation results for drug combinations 9. The drug recommendation method based on multidimensional clinical information fusion using a large language model according to claim 7, characterized in that, The F1 score is calculated as follows: Calculate the F1-score to comprehensively evaluate the precision and recall of the drug combination recommendation results output by the pre-trained large language model; in, This represents the set of actual clinical medication information for the i-th patient. This represents the drug combination recommendation result for the i-th patient predicted by the pre-trained large language model. Represents a set The number of elements in the middle, This represents the total number of patients.